From e50c0aedc74c70be1eb5347c6b276bb424b0cef3 Mon Sep 17 00:00:00 2001 From: j4nn <531585+j4nn@users.noreply.github.com> Date: Sat, 11 Oct 2025 15:23:26 +0200 Subject: [PATCH] add kernel patches included in prebuilt kernels this is just for reference to known what is in the prebuilt kernels: - patch to enable reboot to EDL with sony sdm845 tama platform kernel - patch to disable skip_initramfs kernel command line option to support 'fastboot boot' way to boot into twrp from usb - device tree overlay compatibility fix for sdm845 tama platform in order to allow 'fastboot boot' into twrp even with recent LOS releases - cherry pick 'tama: Disable AVB on /vendor' from LOS sony sdm845 kernel - cherry pick 'somc: sdm845-tama-common: fix invalid thermal trips' --- ...dm845-tama-enable-reboot-to-edl-mode.patch | 48 ++++++++++++++++ ...tramfs-option-to-allow-fastboot-boot.patch | 25 +++++++++ ...-tama-common-LOS-dtbo-compatibility-.patch | 55 +++++++++++++++++++ patches/cherry-picks.txt | 11 ++++ 4 files changed, 139 insertions(+) create mode 100644 patches/0001-arm64-sdm845-tama-enable-reboot-to-edl-mode.patch create mode 100644 patches/0002-disable-skip_initramfs-option-to-allow-fastboot-boot.patch create mode 100644 patches/0003-arm64-dts-sdm845-tama-common-LOS-dtbo-compatibility-.patch create mode 100644 patches/cherry-picks.txt diff --git a/patches/0001-arm64-sdm845-tama-enable-reboot-to-edl-mode.patch b/patches/0001-arm64-sdm845-tama-enable-reboot-to-edl-mode.patch new file mode 100644 index 0000000..9112dca --- /dev/null +++ b/patches/0001-arm64-sdm845-tama-enable-reboot-to-edl-mode.patch @@ -0,0 +1,48 @@ +Subject: [PATCH] arm64: sdm845: tama: enable reboot to edl mode + +--- + arch/arm64/boot/dts/qcom/sdm845.dtsi | 5 +++++ + drivers/power/reset/msm-poweroff.c | 4 ++-- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi +index f0a0fa24..97260006 100644 +--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi ++++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi +@@ -1935,6 +1935,11 @@ + compatible = "qcom,msm-imem-diag-dload"; + reg = <0xc8 200>; + }; ++ ++ emergency_download_mode@fe0 { ++ compatible = "qcom,msm-imem-emergency_download_mode"; ++ reg = <0xfe0 12>; ++ }; + }; + + qcom,venus@aae0000 { +diff --git a/drivers/power/reset/msm-poweroff.c b/drivers/power/reset/msm-poweroff.c +index 3e326986..4041ffd0 100644 +--- a/drivers/power/reset/msm-poweroff.c ++++ b/drivers/power/reset/msm-poweroff.c +@@ -165,7 +165,7 @@ static bool get_dload_mode(void) + return dload_mode_enabled; + } + +-#if 0 ++#if 1 + static void enable_emergency_dload_mode(void) + { + int ret; +@@ -386,7 +386,7 @@ static void msm_restart_prepare(const char *cmd) + restart_reason); + } + } +-#if 0 ++#if 1 + } else if (!strncmp(cmd, "edl", 3)) { + enable_emergency_dload_mode(); + #endif +-- +2.49.1 + diff --git a/patches/0002-disable-skip_initramfs-option-to-allow-fastboot-boot.patch b/patches/0002-disable-skip_initramfs-option-to-allow-fastboot-boot.patch new file mode 100644 index 0000000..5749b62 --- /dev/null +++ b/patches/0002-disable-skip_initramfs-option-to-allow-fastboot-boot.patch @@ -0,0 +1,25 @@ +Subject: [PATCH] disable skip_initramfs option to allow fastboot boot + +this is inspired by binary patch done by magisk in order to force +boot into initramfs even in case when bootloader tries to make +kernel boot directly from system as root partition +--- + init/initramfs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/init/initramfs.c b/init/initramfs.c +index bf3af10c..fe91420c 100644 +--- a/init/initramfs.c ++++ b/init/initramfs.c +@@ -616,7 +616,7 @@ static int __init skip_initramfs_param(char *str) + do_skip_initramfs = 1; + return 1; + } +-__setup("skip_initramfs", skip_initramfs_param); ++__setup("want_initramfs", skip_initramfs_param); + + static int __init populate_rootfs(void) + { +-- +2.49.1 + diff --git a/patches/0003-arm64-dts-sdm845-tama-common-LOS-dtbo-compatibility-.patch b/patches/0003-arm64-dts-sdm845-tama-common-LOS-dtbo-compatibility-.patch new file mode 100644 index 0000000..8b3250a --- /dev/null +++ b/patches/0003-arm64-dts-sdm845-tama-common-LOS-dtbo-compatibility-.patch @@ -0,0 +1,55 @@ +Subject: [PATCH] arm64/dts: sdm845-tama-common: LOS dtbo compatibility fixes + +this is needed in order to allow 'fastboot boot' of the kernel +in case dtbo is either from stock firmware or updated from recent +Lineage OS rom, so we can have single twrp build for both + +related commits in tama lineage os kernel repository +https://github.com/LineageOS/android_kernel_sony_sdm845 + +ad77120d734a185c3e9e84ca10dbc0d37697b779 +arm64: DT: sdm845: Add phandle to reserved-memory node + +9566e6f1b162487ec333e52890b41a8edf0adc59 +arm64: DT: Tama: Fix reserved memory override +--- + arch/arm64/boot/dts/somc/sdm845-tama-common.dtsi | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/arch/arm64/boot/dts/somc/sdm845-tama-common.dtsi b/arch/arm64/boot/dts/somc/sdm845-tama-common.dtsi +index 9cba1f27..aa5d5adf 100644 +--- a/arch/arm64/boot/dts/somc/sdm845-tama-common.dtsi ++++ b/arch/arm64/boot/dts/somc/sdm845-tama-common.dtsi +@@ -11,7 +11,7 @@ + */ + + / { +- reserved-memory { ++ reserved_mem: reserved-memory { + debug_region: debug_region@ffb00000 { + compatible = "removed-dma-pool", "qcom,debug_memory"; + no-map; +@@ -23,14 +23,14 @@ + compatible = "removed-dma-pool", "ramoops"; + no-map; + reg = <0 0xffc00000 0 0x00100000>; +- record-size = <0x1000>; +- console-size = <0x40000>; +- ftrace-size = <0x0>; +- msg-size = <0x0>; +- cc-size = <0x0>; ++ record-size = <0x10000>; ++ console-size = <0x60000>; ++ ftrace-size = <0x10000>; ++ pmsg-size = <0x20000>; ++ ecc-size = <16>; + }; + +- qseecom_region@0x8ab00000 { ++ qseecom_mem: qseecom_region@0x8ab00000 { + reg = <0 0x8ab00000 0 0x1900000>; + }; + +-- +2.49.1 + diff --git a/patches/cherry-picks.txt b/patches/cherry-picks.txt new file mode 100644 index 0000000..650b3f7 --- /dev/null +++ b/patches/cherry-picks.txt @@ -0,0 +1,11 @@ +https://github.com/LineageOS/android_kernel_sony_sdm845 + +8f4b0f98e86d48324887c1c301ce60332dd0654a +From: Olivier Karasangabo +Date: Sat, 28 Mar 2020 01:15:00 +0100 +Subject: [PATCH] tama: Disable AVB on /vendor + +651b41a3a0dcc2fc3f3176c2efaffce66c2f8694 +From: ekkusa +Date: Sun, 28 May 2023 11:05:00 +0800 +Subject: [PATCH] arm64/dts: somc: sdm845-tama-common: fix invalid thermal trips