Jump to content

Google Pixel 4a (google-sunfish)

From postmarketOS Wiki
Google Pixel 4a
Pixel 4a
Pixel 4a
Manufacturer Google
Name Pixel 4a
Codename google-sunfish
Released 2020
Type handset
Hardware
Chipset Qualcomm Snapdragon 730G (SM7150-AB)
CPU Kryo 470
GPU Adreno 618
Display 5.81 inch 2340x1080 AMOLED
Storage 128 GB
Memory 6 GB
Architecture aarch64
Software
Original software
The software and version the device was shipped with.
Android 10
Extended version
The most recent supported version from the manufacturer.
Android
FOSS bootloader partial
Mainline
Instead of a Linux kernel fork, it is possible to run (Close to) Mainline.
no
Features
Flashing
It is possible to flash the device with pmbootstrap flasher.
Works
USB Networking
After connecting the device with USB to your PC, you can connect to it via telnet (initramfs) or SSH (booted system).
Works
Internal storage
eMMC, SD cards, UFS, ...
Works
Battery
Charging and battery level reporting works
Partial
Screen
Display works. Ideally with sleep mode and brightness control.
Works
Touchscreen
Broken
Multimedia
3D Acceleration
Works
Audio
Audio playback, microphone, headset and buttons.
Untested
Camera
Untested
Connectivity
WiFi
Works
Bluetooth
Works
GPS
Untested
NFC
Near Field Communication
Untested
Modem
Calls
Works
SMS
Works
Mobile data
Works
Miscellaneous
FDE
Full disk encryption and unlocking with unl0kr.
Partial
USB OTG
USB On-The-Go or USB-C Role switching
Works
Sensors
Accelerometer
Auto screen rotation works in desktops e.g. Phosh or Plasma Mobile
Untested
Magnetometer
Sensor to measure magnetism
Untested
Ambient Light
Untested
Proximity
Untested
Hall Effect
Also known as flip cover sensor
Untested
Barometer
Sensor to measure air pressure
Untested
Power Sensor
Sensor to monitor current, voltage and power. Not fuel gauge!
Untested
U-Boot
Secondary Bootloader
It is possible to chainload U-Boot from stock bootloader.
Works
Mainline
Latest versions of U-Boot are not broken and it is possible to use them.
Works
Internal Storage
It is possible to boot from internal storage (e.g. eMMC or UFS).
Works
USB Host
It is possible to boot from a USB storage or connect a keyboard.
Partial
USB Peripheral
It is possible to use device as a peripheral in U-Boot, e.g. for fastboot mode.
Works
Display
Works
Buttons
It is possible to navigate in boot menu or grub with volume and power buttons.
Works


Contributors

  • JIaxyga
  • Smaybius (AceOfSpadesProduc100)

Users owning this device


How to enter flash mode

With developer mode, OEM unlocking, and USB debugging enabled, connect the phone to your PC and enter `adb reboot bootloader` in your command line and it'll enter fastboot mode.

Mainline

A work in progress mainline kernel is being developed here.

Mainline status

Feature table for SM7150
Device feature table:

Component Model Status Notes
Display Samsung sofef00 or sofef01 ?
Touchscreen fts N Connected via i2c7 @49 (0xa84000)
Charging USE PMIC ? slg51000-regulator, connected via i2c9 @75 (0xa8c000)
Accelerometer and gyroscope STMicro LSM6DSR ?
Ambient light and proximity sensor AMS TCS3701 ?
Magnetometer STMicro LIS2MDL ?
Haptics/Vibrator Texas Instruments drv2624 ? i2c9 @5a (0xa8c000)
Barometer Bosch BMP380 ?
Sound Cirrus cs35l41 ? i2c9 @40 (0xa8c000)
cs35l41 ? i2c9 @41 (0xa8c000)
rt5514 ? i2c2 @57 (@0x888000)
rt5514 ? spi0.0 (0x880000)
Camera Sony IMX355_s5 ? Front camera
Sony IMX363_s5 ? Rear camera
Qualcomm SOC connections ? qcom,a5@ac00000
NFC st21nfc ? Connected via i2c2 @08 (0x888000)
Fingerprint fp_fpc1020 ?
Other at24 ? i2c 2-0050
drv2624 ? i2c9 @5a (@0xa8c000)
dummy ? i2c 2-0051
dummy ? i2c 2-0052
dummy ? i2c 2-0053

Installation

  1. Make sure pmbootstrap is installed and your bootloader is unlocked
  2. Navigate to the installation folder containing pmbootstrap and edit ./pmb/core/config.py. Set boot_size from 256 to 64. This is to later allow flashing the flash_kernel image to a 64MB sized partition.
  3. The device uses a AB Partition layout. With the device plugged in on fastboot, keep note of what slot is currently active via fastboot getvar current-slot
  4. This device is now a part of SM7150 generic port, and requires an installed U-Boot for EFI environment (systemd-boot is used).
    So, install U-Boot as described on the generic port page. Keep track of which slot U-Boot is installed on.
  5. Run through pmbootstrap init and select qcom as the vendor and sm7150 as the device.
  6. Generate the rootfs by running pmbootstrap install
  7. Backup and erase both dtbo partition.
    To boot Linux, you'll have to erase the dtbo partition. It is recommended to back it up first if you want to boot Android again
    1. Run dd if=/dev/block/by-name/dtbo_a of=/sdcard/dtbo_a.img and dd if=/dev/block/by-name/dtbo_b of=/sdcard/dtbo_b.img from a rooted shell on your phone and pull it with adb pull /sdcard/dtbo_a.img and adb pull /sdcard/dtbo_b.img to your computer.
    2. Boot into bootloader mode
    3. Erase the dtbo partition with fastboot erase dtbo_a and fastboot erase dtbo_b
    To restore the partition flash it with fastboot flash dtbo_a dtbo_a.img and fastboot flash dtbo_b dtbo_b.img
  8. Flash the rootfs by running pmbootstrap flasher flash_rootfs
  9. To install the kernel, we need to install it on the alternate boot partition
    • If U-Boot was installed on boot_a, flash the kernal to boot_b by running pmbootstrap flasher flash_kernel --partition boot_b. Ensure U-Boot is active by running fastboot set_active a and reboot with pmbootstrap chroot fastboot reboot
    • If U-Boot was installed on boot_b, flash the kernal to boot_a by running pmbootstrap flasher flash_kernel --partition boot_a. Ensure U-Boot is active by running fastboot set_active b and reboot with pmbootstrap chroot fastboot reboot

See also