Jump to content

Samsung Galaxy S9 (samsung-starqltechn)/development

From postmarketOS Wiki

Flash boot image from TWRP

adb push $BOOT_IMAGE_PATH /tmp/boot.img && adb -d shell 'dd of=/dev/block/platform/soc/1d84000.ufshc/by-name/boot if=/tmp/boot.img'


Mainline

Mainline kernel can be booted with stock bootloader or u-boot. Logs may be viewed from pstore(ramoops) or simple framebuffer.

Status

  • Green lines - works
  • Blue - in progress
  • Red - backlog

Roadmap

  • boots
  • framebuffer
  • storage, both main and sdcard
  • touchscreen driver (dsankouski)
  • display panel driver
  • sound (dsankouski)
  • phone calls
  • charger driver(max77705)
  • fuelgauge driver(max77705)
  • assemble firmware package in aports (firmware should be extracted from particular phone though)
  • wireless charge driver
  • sensor hub
  • muic driver(max77705), at least detect usb cable (dsankouski)
  • wifi (broadcom chip, needs driver) (ghatto404)
  • bluetooth (broadcom chip, needs driver) (ghatto404)

Assembling boot image

  • clone mainline sources
  • build kernel. See also Compiling_kernels_with_envkernel.sh
  • append dtb to gzipped kernel image
    • pushd .output/arch/arm64/boot
    • cat Image.gz dts/qcom/sdm845-samsung-starqltechn.dtb > Image.gz-dtb
  • generate initramfs image
  • make android bootimage mkbootimg --base 0x0 --kernel_offset 0x00008000 --ramdisk_offset 0x02000000 --tags_offset 0x01e00000 --pagesize 4096 --second_offset 0x00f00000 --ramdisk "$INITRAMFS" --kernel Image.gz-dtb -o boot.img


Notes

Uart

`/dev/ttyHS8` can be exposed on USB D+D- lines. It's configured in data mover mode by downstream kernel.

Getting logs from pstore

Boot to twrp, and check /sys/fs/pstore folder

Stock bootloader

Loads payload into ram at random physical address for security reason. Initramfs physical load address is 0xa2000000 both for boot image and recovery image

Wireless charge

Wireless charge is implemented on IDT9320 chip. It should be capable of reverse charging (because it used in Samsung S10, and S20). S20 firmware on S9 charges phone, however, there's no reverse charge (different antenna than on S20?)

Flash tool