arm64: dts: qcom: Add support for Xperia 1 III / 5 III
authorKonrad Dybcio <konrad.dybcio@somainline.org>
Sun, 14 Nov 2021 01:27:52 +0000 (02:27 +0100)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Sat, 20 Nov 2021 22:24:58 +0000 (16:24 -0600)
commitc2721b0c23d975c73bce68d40435d66fbab19047
tree850bbf8b665583a90ce49ae37f087849bc01990f
parent9bc2c8fea55c12d3720a80a59f99fdf68b8de773
arm64: dts: qcom: Add support for Xperia 1 III / 5 III

Add support for SONY Xperia 1 III (PDX215) and 5 III (PDX214) smartphones.
Both are based on the SM8350 Sagami platform and feature some really high-end
specs, such as:

- 4K (1 III / PRO-I) / 1080p (5 III), 120Hz HDR OLED 10-bit panels
- USB-C 3.1 with HDMI in (yes, phone as display!) and DP out
- 5G
- 8 or 12 gigs of ram, 128/256/512 gigs of storage
- A 3.5mm headphone jack, a RGB notification LED and a uSD card slot :)
- IP65/68 dust/water resistance
- Dual front-firing speakers and a lot of microphones
- Crazy complex camera hardware (especially on the PRO-I), which includes
4 cameras, an RGBIR sensor and a 3D iToF

The aforementioned PRO-I (PDX217) is not supported in this patch, because
even though it shares most of the code with 1 III, nobody really has it (yet?)

This only adds basic support for booting to a USB shell with a
bootloader-enabled display, support for all the awesome hardware listed above
will (hopefully) come (hopefully) soon.

In order to get a working boot image, you need to run (e.g. for 1 III):

cat arch/arm64/boot/Image.gz arch/arm64/boot/dts/qcom/sm8350-sony-xperia-\
sagami-pdx215.dtb > .Image.gz-dtb

mkbootimg \
--kernel .Image.gz-dtb \
--ramdisk some_initrd.img \
--pagesize 4096 \
--base 0x0 \
--kernel_offset 0x8000 \
--ramdisk_offset 0x1000000 \
--tags_offset 0x100 \
--cmdline "SOME_CMDLINE" \
--dtb_offset 0x1f00000 \
--header_version 1 \
--os_version 11 \
--os_patch_level 2021-10 \ # or newer
-o boot.img-sony-xperia-pdx215

Then, you need to flash it on the device and get rid of all the
vendor_boot/dtbo mess:

fastboot flash boot boot.img-sony-xperia-pdx215
fastboot erase vendor_boot
fastboot flash dtbo emptydtbo.img
fastboot reboot

Where emptydtbo.img is a tiny file that consists of 2 bytes (all zeroes), doing
a "fastboot erase" won't cut it, the bootloader will go crazy and things will
fall apart when it tries to overlay random bytes from an empty partition onto a
perfectly good appended DTB.

Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211114012755.112226-13-konrad.dybcio@somainline.org
arch/arm64/boot/dts/qcom/Makefile
arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami-pdx214.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami-pdx215.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi [new file with mode: 0644]