• Konrad Dybcio's avatar
    arm64: dts: qcom: Add device tree for Sony Xperia 10 IV · 4420e604
    Konrad Dybcio authored
    Add support for Sony Xperia 10 IV, a.k.a PDX225. This device is a part
    of the SoMC SM6375 Murray platform and currently it is the only
    device based on that board, so no -common DTSI is created until (if?)
    other Murray devices appear.
    
    This commit brings support for:
    * USB (only USB2 for now)
    * Display via simplefb
    
    To create a working boot image, you need to run:
    cat arch/arm64/boot/Image.gz arch/arm64/boot/dts/qcom/sm6375-sony-xperia-\
    murray-pdx225.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 12 \
    --os_patch_level 2022-04 \ # or newer
    -o boot.img-sony-xperia-pdx225
    
    Then, you need to flash it on the device and get rid of all the
    vendor_boot/dtbo mess:
    
    First, you need to get rid of vendor_boot. However, the bootloader
    is utterly retarded and it will not let you neither flash nor erase it.
    There are a couple ways to handle this: you can either dd /dev/zero to
    it from Android (if you have root) or a custom recovery or from fastbootd
    (fastboot/adb reboot fastboot). You will not be able to boot Android
    images on your phone unless you lock the bootloader (fastboot oem lock)
    and restore the factory image with Xperia Companion
    Windows-and-macOS-only software.
    
    The best way so far is probably to use the second (_b) slot and flash
    mainline there. This will however require you to flash some partitions
    manually, as they are not populated from factory:
    
    (boot_b, dtbo_b, vendor_boot_b, vbmeta_b, vbmeta_system_b) - these we
    don't really care about as we nuke/replace them
    
    (dsp_b, imagefv_b, modem_b, oem_b, rdimage_b) - these you NEED to populate
    to get a successful boot on slot B, otherwise you will have limited / no
    functionality.
    
    To switch slots, simply run:
    
    fastboot --set-active=a //or =b
    
    The rest assumes you are on slot A.
    
    // You have to either pull vbmeta{"","_system"} from
    // /dev/block/bootdevice/by-name/ or build one as a part of AOSP
    fastboot --disable-verity --disable-verification flash vbmeta_b vbmeta.img
    fastboot --disable-verity --disable-verification flash vbmeta_system_b \
    vbmeta_system.img
    
    fastboot flash boot_b boot.img-sony-xperia-pdx225
    fastboot reboot fastboot // entering fastbootd
    fastboot flash vendor_boot_b emptything.img
    fastboot flash dtbo_b emptything.img
    fastboot reboot bootloader // entering bootloader fastboot
    fastboot --set-active=b
    fastboot reboot // mainline time!
    
    Where emptything.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.
    
    From there on you can flash new mainline builds by simply flashing
    boot.img that you create after each kernel rebuild.
    Signed-off-by: default avatarKonrad Dybcio <konrad.dybcio@somainline.org>
    Signed-off-by: default avatarKonrad Dybcio <konrad.dybcio@linaro.org>
    Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Signed-off-by: default avatarBjorn Andersson <andersson@kernel.org>
    Link: https://lore.kernel.org/r/20221107120920.12593-4-konrad.dybcio@linaro.org
    4420e604
sm6375-sony-xperia-murray-pdx225.dts 1.6 KB