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)
  • sound (dsankouski)
  • phone calls
  • charger driver(max77705)
  • fuelgauge driver(max77705)
  • muic driver(max77705), at least detect usb cable
  • assemble firmware package in aports
  • wifi (broadcom chip, needs driver)
  • bluetooth (broadcom chip, needs driver)
  • display panel driver

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