Jump to content

Google Pixel 3 (google-blueline): Difference between revisions

From postmarketOS Wiki
Hreikin (talk | contribs)
m See also: Update links to latest versions
8osm3rka (talk | contribs)
Update feature status. Audio output fixed by https://gitlab.com/postmarketOS/pmaports/-/merge_requests/5686
 
(20 intermediate revisions by 12 users not shown)
Line 6: Line 6:
| imagecaption = Google Pixel 3
| imagecaption = Google Pixel 3
| releaseyear = 2018
| releaseyear = 2018
| originalsoftware = Android 9.0
| originalsoftware = Android
| chipset = Qualcomm SDM845 Snapdragon 845 (10 nm)
| originalversion = 9.0
| chipset = Qualcomm Snapdragon 845 (SDM845)
| cpu = Octa-core (4x2.5 GHz Kryo 385 Gold & 4x1.6 GHz Kryo 385 Silver)
| cpu = Octa-core (4x2.5 GHz Kryo 385 Gold & 4x1.6 GHz Kryo 385 Silver)
| gpu = Adreno 630
| gpu = Adreno 630
| storage = 64GB/128GB
| storage = 64GB/128GB
| display = 1080 x 2160 P-OLED, HDR
| display = 1080 x 2160 P-OLED, HDR
| memory = 4GB
| memory = 4 GB
| architecture = aarch64
| architecture = aarch64
| type = handset
<!-- the following status_* questions should be answered with Y - yes, P - partial, N - no, or left blank (for untested or unknown) -->
<!-- the following status_* questions should be answered with Y - yes, P - partial, N - no, or left blank (for untested or unknown) -->
| status_usbnet = <!-- USB networking does work? then put Y here and delete this comment -->
| status_usbnet = Y
| status_flashing = Y <!-- Flashing with "pmbootstrap flasher" works? Put Y here. It works the same for everything coming below. -->
| status_flashing = Y <!-- Flashing with "pmbootstrap flasher" works? Put Y here. It works the same for everything coming below. -->
| status_touch = <!-- Touch screen is working? You can also answer these questions with P for partially. -->
| status_emmc = Y
| status_screen = <!-- The display is working? -->
| status_touch = Y <!-- Touch screen is working? You can also answer these questions with P for partially. -->
| status_wifi = <!-- Wireless network works? -->
| status_screen = Y <!-- The display is working? -->
| status_xwayland = <!-- Showing X11 applications in a Wayland compositor (Weston, KWin, ...) works? -->
| status_wifi = Y <!-- Wireless network works? -->
| status_fde = <!-- When installing with full disk encryption, can you type in the password with the on screen keyboard? -->
| status_xwayland = Y <!-- Showing X11 applications in a Wayland compositor (Weston, KWin, ...) works? -->
| status_fde = Y <!-- When installing with full disk encryption, can you type in the password with the on screen keyboard? -->
| status_mainline = P <!-- Instead of a Linux kernel fork, it is possible to run mainline. -->
| status_mainline = P <!-- Instead of a Linux kernel fork, it is possible to run mainline. -->
| status_battery = <!-- Charging the battery with charging-sdl is possible -->
| status_battery = Y <!-- Charging the battery with charging-sdl is possible -->
| status_3d = <!-- Hardware accelerated 3D graphics (e.g. with freedreno) -->
| status_3d = Y <!-- Hardware accelerated 3D graphics (e.g. with freedreno) -->
| status_accel = <!-- The sensor that measures proper acceleration works -->
| status_accel = N<!-- The sensor that measures proper acceleration works -->
| status_audio = <!-- Using the device's speakers/headphone jack works -->
| status_audio = P <!-- Using the device's speakers/headphone jack works -->
| status_bluetooth = <!-- It's possible to pair and use other devices via the bluetooth protocol -->
| status_bluetooth = Y <!-- It's possible to pair and use other devices via the bluetooth protocol -->
| status_camera = <!-- Taking photos and videos works. -->
| status_camera = N <!-- Taking photos and videos works. -->
| status_gps = <!-- The Global Positioning System sensor works.  -->
| status_gps = P <!-- The Global Positioning System sensor works.  -->
| status_mobiledata = <!-- Connecting to the Internet via cellular network. -->
| status_mobiledata = <!-- Connecting to the Internet via cellular network. -->
| status_sms = <!-- Sending and receiving short messages works as intended. -->
| status_sms = <!-- Sending and receiving short messages works as intended. -->
| status_calls = <!-- Talking to other people over the cellular network. -->
| status_calls = <!-- Talking to other people over the cellular network. -->
| status = Work is ongoing, flashing works and telnet can be accessed during boot. <!-- Text displayed in the "not booting" table on the Devices page , e.g "kernel compiles, doesn't boot" -->
| status = <!-- Text displayed in the "not booting" table on the Devices page , e.g "kernel compiles, doesn't boot" -->
| status_otg = <!-- USB-OTG adapters work, e.g. to connect an USB flash drive to the device -->
| status_otg = N <!-- USB-OTG adapters work, e.g. to connect an USB flash drive to the device -->
| status_nfc = <!-- Near-Field Communication (NFC) works -->
| status_nfc = <!-- Near-Field Communication (NFC) works -->
| booting = Y <!-- The device is booting at all, can be yes/no *IMPORTANT* -->
| booting = Y <!-- The device is booting at all, can be yes/no *IMPORTANT* -->
 
| packaged = Y
<!-- you can also use these lines if you need to:
<!-- you can also use these lines if you need to:
if the device haven't originally ran Android OS, e.g. Nokia N900
if the device haven't originally ran Android OS, e.g. Nokia N900
| n-android =  ✔
Version of the kernel that pmos is running
Version of the kernel that pmos is running
| pmoskernel = 3.x.x
| pmoskernel = 3.x.x
Line 50: Line 52:
== Contributors ==
== Contributors ==
* hreikin
* hreikin
* [[User:Caleb|Caleb]]
* drakulix


== Users owning this device ==
== Users owning this device ==
Line 59: Line 63:


== How to enter flash mode ==
== How to enter flash mode ==
The Pixel 3, like all Google Pixel/Nexus devices, uses Fastboot as the flashing protocol.


To enter Fastboot mode, hold Volume Down while powering on the device. Let go of Volume Down when "Fastboot mode" displays on the screen.
Unplug from USB and hold {{Button|Power}} and {{Button|Volume Down}} until you see a screen with a red triangle titled "fastboot mode".


Alternatively, if connected to a pc then you can also use <code>adb reboot bootloader</code>.
== Installation ==


== Installation ==
=== Prerequisites ===
<!-- add more sections below as necessary, e.g. WiFi, photos, ... -->
 
The steps below should allow you to flash postmarketOS to a Pixel 3 and boot to a point that telnet can be accessed.
==== Upgrade ====
 
Before installing postmarketOS, it is recommended that you update your device to the last release available. This can be done easily by visiting http://flash.android.com/ from a Chromium based browser and following the instructions.
 
==== Unlock the bootloader ====
 
1. Open setting, go to "About" and tap on the "Build number" box ~10 times until the "You are now a developer" toast message appears.
 
2. Go back to the main settings page, go to "System" and then "Developer options" (it might be hiding behind a dropdown menu). Toggle the switch to "Enable OEM unlocking"
 
3. Refer to "How to enter flash mode" above to get into fastboot mode, then re-attach your USB cable. Run the following command on your host:
 
<syntaxhighlight lang="shell-session">
$ fastboot flashing unlock
</syntaxhighlight>
 
Use the volume buttons to navigate the confirmation screen on the device and confirm.
 
=== Building and flashing ===
 
The vendor is google, the codename is "blueline".
 
Follow the [[pmbootstrap]] article, until you have done the install action (note that <code>--fde</code> stands for full-disk-encryption - this can also be left out).
<syntaxhighlight lang="shell-session">
$ pmbootstrap install --fde --password 147147
</syntaxhighlight>
 
Reboot back into flash mode as explained above. (If you encounter weird behaviour like the command getting stuck before the flashing starts, reboot into flash mode or select "restart bootloader" on the phone itself and run the command again while the device reboots).
 
<syntaxhighlight lang="shell-session">
$ pmbootstrap flasher flash_dtbo
$ pmbootstrap flasher flash_rootfs
$ pmbootstrap flasher flash_boot
</syntaxhighlight>
 
Then choose "start" on the device to reboot into your new installation.


* Run <code>pbootstrap init</code> and then delete the generated linux-google-blueline folder
== UART ==
* Edit the APKBUILD in the device-google-blueline folder to remove the <code>linux-google-blueline</code> and <code>mesa-dri-gallium</code> dependencies and insert the <code>linux-postmarketos-qcom-sdm845</code> and <code>soc-qcom-sdm845</code> dependencies
*Clone the sdm845 mainline kernel and create a new branch for your changes, copy the DTS file available in the [https://git.linaro.org/people/vinod.koul/kernel.git/?h=pixel/dsc_v2 Linaro kernel] to the sdm845 mainline kernel and edit the Makefile to include it, comment out the following nodes to ensure the kernel compiles successfully: <code>&sde_te_active</code>, <code>&sde_te_suspend</code>, <code>&dsi0</code> and <code>&dsi0_phy</code>
*Add the following kernel configuration options to the sdm845.config file:
<pre>
# Pixel 3
CONFIG_EXT4_FS=y
CONFIG_KERNEL_GZIP=y
CONFIG_CGROUPS=y
CONFIG_ANDROID_PARANOID_NETWORK=n
CONFIG_PFT=n
CONFIG_USE_VFB=n
CONFIG_KINETO_GAN=n
CONFIG_SAMSUNG_TUI=n
CONFIG_SEC_RESTRICT_ROOTING=n
CONFIG_TZDEV=n
</pre>
*Source <code>envkernel.sh</code> and run <code>make defconfig sdm845.config</code> and <code>make -j`nproc`</code> to compile the kernel, run <code>pmbootstrap build --envkernel linux-postmarketos-qcom-sdm845</code>, <code>pmbootstrap checksum device-google-blueline</code> and <code>pmbootstrap build device-google-blueline</code>
*Run <code>pmbootstrap install --split</code>, <code>pmbootstrap initfs hook_add debug-shell</code> and <code>pmbootstrap export</code>
*Clone this [https://gitlab.com/zhuowei/dtbo-google-crosshatch-mainline DTBO repository] from the crosshatch port
*Edit the dtboimg.cfg file with the following changes:
<pre>
sdm845-c1-dvt1.1.dtbo
id=0x215
rev=0x2
</pre>
*Edit the sdm845-c1-dvt1.1.dts file with the following changes before running build.sh to create the dtbo.img:
<pre>
/dts-v1/;


/ {
See also: https://github.com/Peter-Easton/android-debug-cable-howto, [[ Serial_debugging:Cable_schematics#Google_Pixel_.22Android_Debug_Cable.22 ]]
model = "Google Inc. MSM sdm845 C1 DVT1.1";
compatible = "google,b1c1-sdm845", "qcom,sdm845";
qcom,board-id = <0x00021505 0>;
};
</pre>
*Run the following commands to flash everything to the phone, You have to flash the dtbo.img and then the kernel normally for the telnet shell and then use fastboot to flash the boot and root images created with <code>pmbootstrap install --split</code> otherwise nothing shows up in telnet when running <code>blkid</code>:
<pre>
fastboot set_active b
fastboot flash dtbo_b /path/to/dtbo.img
pmbootstrap flasher flash_kernel
fastboot flash vendor /path/to/exported/google-blueline-boot.img
fastboot flash userdata /path/to/exported/google-blueline-root.img
</pre>
*The phone boots and you should get the white screen with Google logo, sometimes it has a graphical glitch and others it doesn't. The SSH isn't working, it should have an IP and you can ping it but you can't connect by SSH. You can however connect to a shell with the telnet command; <code>$ telnet 172.16.42.1</code>
*Run <code>blkid</code>, the vendor and userdata partitions should show up with the <code>pmOS_boot</code> and <code>pmOS_root</code> labels
*Source <code>/etc/deviceinfo</code> and <code>init_functions.sh</code> before running <code>mount_subpartitions</code> which seems to complete with no errors reported in the shell or via dmesg but could be unsuccessful as nothing new is mounted when looking with <code>mount</code> or <code>blkid</code>
*Running <code>mount_boot_partition</code> shows an error in telnet but not in dmesg however if you run <code>mount -o ro -t ext2 /dev/sda10 /boot</code> you should get the following errors output to the shell and dmesg:
<pre>
/ # mount_subpartitions
/ # mount_boot_partition
Mount boot partition (/dev/sda10) to  (read-only)
mount: mounting /dev/sda10 on  failed: No such file or directory
/ # mount -o ro -t ext2 /dev/sda10 /boot
mount: mounting /dev/sda10 on /boot failed: Invalid argument
</pre>
<pre>
[  118.355939] EXT4-fs (sda10): mounting ext2 file system using the ext4 subsystem
[  118.363336] EXT4-fs (sda10): bad block size 1024
</pre>
*You can successfully mount the root partition with <code>mount_root_partition</code> and it is viewable in <code>/sysroot</code>.


Here are some links to the config files and logs, scroll down for multiple files:
Baud rate is 115200. Voltage is 3.3V, although 1.8V seems to work as well.
*[https://gitlab.com/-/snippets/2189490 dmesg and pmOS_init.log]
*[https://gitlab.com/-/snippets/2189510 defconfig, sdm845.config and generated .config files from kernel compilation]


== Status ==
# Obtain a USB-C breakout board and a UART adapter
Work is ongoing, flashing works and telnet can be accessed during boot.
# Connect pins <code>board pin (USB-C pinout) - UART adapter pin</code> as following:
## A1 (GND) - GND
## A8 (SBU1) - RXD
## B8 (SBU2) - TXD
# Connect breakout board and phone using a USB-C cable that has working SBU1/2 (I had to use a thicker TB3/USB 3.0 capable cable). Make sure the cable is in "top" orientation (in my case Thunderbolt logos were facing same side as phone's screen and the <code>A</code> side of breakout board), it won't work if the plug is reversed on one side.
# Boot phone into fastboot, then execute <code>fastboot oem uart enable</code> and poweroff.


== See also ==
== See also ==
* {{issue|1229|pmaports}} Pixel 3 (google-blueline) porting: progress and questions
* {{MR|5514|pmaports}} MR adding device support
* [https://gitlab.com/-/snippets/2189490 dmesg and pmOS_init.log]
* {{issue|1229|pmaports}} Old Pixel 3 (google-blueline) porting: progress and questions
* [https://gitlab.com/-/snippets/2177610 Device Map]
* {{MR|3932|pmaports}} Old Draft MR


<!--
<!--

Latest revision as of 20:09, 5 October 2024

Google Pixel 3
Google Pixel 3
Google Pixel 3
Manufacturer Google
Name Pixel 3
Codename google-blueline
Released 2018
Type handset
Hardware
Chipset Qualcomm Snapdragon 845 (SDM845)
CPU Octa-core (4x2.5 GHz Kryo 385 Gold & 4x1.6 GHz Kryo 385 Silver)
GPU Adreno 630
Display 1080 x 2160 P-OLED, HDR
Storage 64GB/128GB
Memory 4 GB
Architecture aarch64
Software
Original software Android
Original version 9.0
postmarketOS
Category testing
Pre-built images no
Mainline partial
Features
Flashing
Works
USB Networking
Works
Internal storage
Works
SD card
No data
Battery
Works
Screen
Works
Touchscreen
Works
Multimedia
3D Acceleration
Works
Audio
Partial
Camera
Broken
Camera Flash
No data
Connectivity
WiFi
Works
Bluetooth
Works
GPS
Partial
NFC
No data
Modem
Calls
No data
SMS
No data
Mobile data
No data
Miscellaneous
FDE
Works
USB OTG
Broken
HDMI/DP
No data
Sensors
Accelerometer
Broken
Magnetometer
No data
Ambient Light
No data
Proximity
No data
Hall Effect
No data
Haptics
No data
Barometer
No data


Contributors

Users owning this device


How to enter flash mode

Unplug from USB and hold Power and Volume Down until you see a screen with a red triangle titled "fastboot mode".

Installation

Prerequisites

Upgrade

Before installing postmarketOS, it is recommended that you update your device to the last release available. This can be done easily by visiting http://flash.android.com/ from a Chromium based browser and following the instructions.

Unlock the bootloader

1. Open setting, go to "About" and tap on the "Build number" box ~10 times until the "You are now a developer" toast message appears.

2. Go back to the main settings page, go to "System" and then "Developer options" (it might be hiding behind a dropdown menu). Toggle the switch to "Enable OEM unlocking"

3. Refer to "How to enter flash mode" above to get into fastboot mode, then re-attach your USB cable. Run the following command on your host:

$ fastboot flashing unlock

Use the volume buttons to navigate the confirmation screen on the device and confirm.

Building and flashing

The vendor is google, the codename is "blueline".

Follow the pmbootstrap article, until you have done the install action (note that --fde stands for full-disk-encryption - this can also be left out).

$ pmbootstrap install --fde --password 147147

Reboot back into flash mode as explained above. (If you encounter weird behaviour like the command getting stuck before the flashing starts, reboot into flash mode or select "restart bootloader" on the phone itself and run the command again while the device reboots).

$ pmbootstrap flasher flash_dtbo
$ pmbootstrap flasher flash_rootfs
$ pmbootstrap flasher flash_boot

Then choose "start" on the device to reboot into your new installation.

UART

See also: https://github.com/Peter-Easton/android-debug-cable-howto, Serial_debugging:Cable_schematics#Google_Pixel_.22Android_Debug_Cable.22

Baud rate is 115200. Voltage is 3.3V, although 1.8V seems to work as well.

  1. Obtain a USB-C breakout board and a UART adapter
  2. Connect pins board pin (USB-C pinout) - UART adapter pin as following:
    1. A1 (GND) - GND
    2. A8 (SBU1) - RXD
    3. B8 (SBU2) - TXD
  3. Connect breakout board and phone using a USB-C cable that has working SBU1/2 (I had to use a thicker TB3/USB 3.0 capable cable). Make sure the cable is in "top" orientation (in my case Thunderbolt logos were facing same side as phone's screen and the A side of breakout board), it won't work if the plug is reversed on one side.
  4. Boot phone into fastboot, then execute fastboot oem uart enable and poweroff.

See also