[PATCH RFC] bootm: ARM64 EL1 direct jump to kernel start

2025-04-07 Thread George Chan via B4 Relay
From: George Chan It was EL3->EL2 or EL2->EL1 when boot. But in many case such chain loading from bootloader is already run in EL1. There is no practically way to raise EL1 to EL2. Thus theonly way to start kernel is direct jump. This apporach is similar to KEXEC purgatory idea but do not need t

[PATCH RFC] fdt.c: fdt chosen cmd had off-by-one issue

2025-04-07 Thread George Chan via B4 Relay
From: George Chan The kernel searching bootconfig will be off-by-1 and never match thus always not found in this case. Signed-off-by: George Chan --- The searching will shift-by-1 and never match the bootconfig thus always not found bootconfig this case. Kernel: data = (char *)init

[PATCH 3/3] mach-snapdragon: Add support to append string to kernel cmdline

2025-04-27 Thread George Chan via B4 Relay
From: George Chan Add support for blindly appending string to bootargs env_param and let boot process take care of it. Signed-off-by: George Chan --- arch/arm/mach-snapdragon/Kconfig | 11 + arch/arm/mach-snapdragon/board.c | 97 2 files changed, 10

[PATCH 1/3] boot/image-android.c: Workaround androidboot kernel/ramdisk addr

2025-04-27 Thread George Chan via B4 Relay
From: George Chan Some vendor bootloader ignored kernel/ramdisk addr and use their own addr. Even those addr are pointing to out-of-reach memory block at 0, and available address start at 0x8000. So we also need to use our own available addr for loadaddr. Signed-off-by: George Chan --- bo

[PATCH 0/3] u-boot chain-loading LineageOS bootimg

2025-04-27 Thread George Chan via B4 Relay
This is a series of patches to enable chainloading LineageOS on qcom SOC. First patch is to workaround kernel/ramdisk invalid addr by identify its physical memory address out-of-range. Since qcom SOC usually have 0x8000 as start/base/real memory address but androidboot img specified to around

[PATCH 2/3] boot/bootmeth-android.c: Reuse fastboot memory block for unzip kernel

2025-04-27 Thread George Chan via B4 Relay
From: George Chan Some androidboot images have gzipped kernel so we need to reuse extra mem block for holding gzipped boot.img, and let loadaddr to hold unzipped kernel data. Here we choose fastboot memory for reuse and avoid dramatically increase memory footprint. Signed-off-by: George Chan --

[PATCH v2 3/5] fdt_support: Add support for extra var for bootargs

2025-05-05 Thread George Chan via B4 Relay
From: George Chan Introduce a new env var 'legacy_os_boot_param' to hold legacy OS dependent boot param. Signed-off-by: George Chan --- boot/Kconfig | 9 + boot/fdt_support.c | 20 +++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/boot/Kconfig b

[PATCH v2 4/5] qcom-phone.env: Example of new env var legacy_os_boot_param

2025-05-05 Thread George Chan via B4 Relay
From: George Chan This is an example for newly introduced env_var legacy_os_boot_param that will append 'console=ramoops' to fdt bootargs. Signed-off-by: George Chan --- board/qualcomm/qcom-phone.env | 4 1 file changed, 4 insertions(+) diff --git a/board/qualcomm/qcom-phone.env b/board/

[PATCH v2 2/5] mach-snapdragon: Enhance android image handling memory footprint

2025-05-05 Thread George Chan via B4 Relay
From: George Chan In order to unzipped kernel from androidboot img, extra memory for loadaddr is needed. So once fastboot is enabled fastboot memory also share with loadaddr. That can balance with memory constrain soc and android usecase. Signed-off-by: George Chan --- arch/arm/mach-snapdrago

[PATCH v2 0/5] u-boot chain-loading LineageOS bootimg

2025-05-05 Thread George Chan via B4 Relay
This is a series of patches to enable chainloading LineageOS on qcom SOC. Patch #1 introduce kconfig to ignore those default value and use loadaddr instead. That workaround some androidboot image have invalid kernel/ramdisk loadaddr. Patch #2 override qcom soc loadaddr with fastboot_addr_r as a b

[PATCH v2 1/5] boot/image-android: Workaround kernel/ramdisk invalid addr

2025-05-05 Thread George Chan via B4 Relay
From: George Chan Some androidboot image have invalid kernel/ramdisk load addr, force to ignore those value and use loadaddr instead. Suggested-by: Casey Connolly Signed-off-by: George Chan --- boot/Kconfig | 6 ++ boot/image-android.c | 9 ++--- 2 files changed, 12 insertions

[PATCH v2 5/5] mach-snapdragon: Enable workaround of ignoring androidboot addr

2025-05-05 Thread George Chan via B4 Relay
From: George Chan Enable the workaround for whole snapdragon family. Suggested-by: Casey Connolly Signed-off-by: George Chan --- arch/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index df373d38a55..249bd4b5bf3 100644 --- a/arch/arm/Kconfi

[PATCH 4/4] usb: gadget: Introduce usb gadget vendor/product default id for ARCH_QCOM

2025-05-20 Thread George Chan via B4 Relay
From: George Chan Currently vendor/product id are both 0, and that might not as we want. Set to some arbitary known value that we can make it work more smoothly. Signed-off-by: George Chan --- drivers/usb/gadget/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/K

[PATCH 0/4] A series of patch for enable sc7180 android boot

2025-05-20 Thread George Chan via B4 Relay
Since attempt[1] to embed android specific boot param into fdt bootargs, a new idea is formed as to make use of env file to contain default param value. Current code logic is already working fine, unless the priority of param at begining is higher than at tail. From env file, bootargs is treated im

[PATCH 1/4] image-android: Prepend/postpend default bootargs value with given bootcmd

2025-05-20 Thread George Chan via B4 Relay
From: George Chan Control how default bootargs is prepended or postpended to boot param found from androidboot img. Signed-off-by: George Chan --- boot/Kconfig | 8 boot/image-android.c | 10 -- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/boot/Kcon

[PATCH 3/4] boot: bootmeth_android: Conditionally dependent on abootimg

2025-05-20 Thread George Chan via B4 Relay
From: George Chan If target u-boot img do not support androidboot v3 or greater, abootimg might not be necessary. aarch64-linux-gnu-ld.bfd: boot/bootmeth_android.o: in function `boot_android_normal': /home/user/sources/u-boot-next/boot/bootmeth_android.c:541:(.text.boot_android_normal+0xd0): u

[PATCH 2/4] iommu: qcom-smmu: Introduce sc7180 compatible string

2025-05-20 Thread George Chan via B4 Relay
From: George Chan Add basic compatible string for sc7180 family soc. Signed-off-by: Vitalii Skorkin Co-developed-by: George Chan Signed-off-by: George Chan --- drivers/iommu/qcom-hyp-smmu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/qcom-hyp-smmu.c b/drivers/iommu/qcom

[PATCH v3 2/3] mach-snapdragon: Enable workaround of ignoring androidboot addr

2025-05-18 Thread George Chan via B4 Relay
From: George Chan Enable the workaround for whole snapdragon family. Suggested-by: Casey Connolly Reviewed-by: Neil Armstrong Signed-off-by: George Chan --- arch/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index fedfdb21457..f6d903b4f1e

[PATCH v3 1/3] boot/image-android: Workaround kernel/ramdisk invalid addr

2025-05-18 Thread George Chan via B4 Relay
From: George Chan Some androidboot image have invalid kernel/ramdisk load addr, force to ignore those value and use loadaddr instead. There is a concern on exposing the whole memory to image loading is dangerous. Also, since it's not always possible to change the load addr by repacking the boot.

[PATCH v3 0/3] u-boot chain-loading LineageOS bootimg

2025-05-18 Thread George Chan via B4 Relay
This is a series of patches to enable chainloading LineageOS on qcom SOC. Patch #1 introduce kconfig to ignore those default value and use loadaddr instead. That workaround some androidboot image have invalid kernel/ramdisk loadaddr. Patch #2 enable #1 for snapdragon machine. Patch #3 override q

[PATCH v3 3/3] mach-snapdragon: Enhance android image handling memory footprint

2025-05-18 Thread George Chan via B4 Relay
From: George Chan In order to unzipped kernel from androidboot img, extra memory for loadaddr is needed. So once fastboot is enabled fastboot memory also share with loadaddr. That can balance with memory constrain soc and android usecase. Reviewed-by: Neil Armstrong Signed-off-by: George Chan

[PATCH v2 1/5] image-android: Prepend/postpend default bootargs value with given bootcmd

2025-06-07 Thread George Chan via B4 Relay
From: George Chan Control how default bootargs is prepended or postpended to boot param found from androidboot img. Signed-off-by: George Chan --- boot/Kconfig | 7 +++ boot/image-android.c | 10 -- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/boot/Kconf

[PATCH v2 3/5] boot: bootmeth_android: Conditionally dependent on abootimg

2025-06-07 Thread George Chan via B4 Relay
From: George Chan If target u-boot img do not support androidboot v3 or greater, abootimg might not be necessary. aarch64-linux-gnu-ld.bfd: boot/bootmeth_android.o: in function `boot_android_normal': /home/user/sources/u-boot-next/boot/bootmeth_android.c:541:(.text.boot_android_normal+0xd0): u

[PATCH v2 0/5] A series of patch for enable sc7180 android boot

2025-06-07 Thread George Chan via B4 Relay
Since attempt[1] to embed android specific boot param into fdt bootargs, a new idea is formed as to make use of env file to contain default param value. Current code logic is already working fine, unless the priority of param at begining is higher than at tail. From env file, bootargs is treated im

[PATCH v2 2/5] bootm: Append bootargs value when bootmeth_android provide cmdline

2025-06-07 Thread George Chan via B4 Relay
From: George Chan Old logic wipe bootargs env with cmdline, new logic maintain the value by prepending cmdline value to bootargs. Signed-off-by: George Chan --- boot/bootm.c | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/boot/bootm.c b/boot/bo

[PATCH v2 5/5] usb: gadget: Introduce usb gadget vendor/product default id for ARCH_QCOM

2025-06-07 Thread George Chan via B4 Relay
From: George Chan Currently vendor/product id are both 0, and that might not as we want. Set to some arbitary known value that we can make it work more smoothly. Signed-off-by: George Chan Reviewed-by: Neil Armstrong --- drivers/usb/gadget/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff

[PATCH v2 4/5] iommu: qcom-smmu: Introduce sc7180 compatible string

2025-06-07 Thread George Chan via B4 Relay
From: George Chan Add basic compatible string for sc7180 family soc. Signed-off-by: Vitalii Skorkin Co-developed-by: George Chan Signed-off-by: George Chan Reviewed-by: Casey Connolly --- drivers/iommu/qcom-hyp-smmu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/qcom-hy

[PATCH v4 2/6] boot/image-android.c: Split android_image_get_kernel into two functions

2025-06-30 Thread George Chan via B4 Relay
From: George Chan Since fastboot->bootm glue layer also need to cater with bootargs environment, so move common logic from android_image_get_kernel into a new function to avoid some degree of code duplication. This new function is android_image_modify_bootargs_env to specially cater bootargs env

[PATCH v4 1/6] image-android: Prepend/postpend default bootargs value with given bootcmd

2025-06-30 Thread George Chan via B4 Relay
From: George Chan By default, the boot.img's cmdline are appended to the bootargs environment. If we take a cmdline example of: * androidboot.hardware=warm (in U-Boot environment) * androidboot.hardware=chilly (in boot.img's cmdline) The resulting commandline will be: androidboot.hardware=warm [

[PATCH v4 6/6] usb: gadget: Introduce usb gadget vendor/product default id for ARCH_QCOM

2025-06-30 Thread George Chan via B4 Relay
From: George Chan Currently vendor/product id are both 0, and that might not as we want. Set to some arbitary known value that we can make it work more smoothly. Reviewed-by: Mattijs Korpershoek Acked-by: Mattijs Korpershoek Reviewed-by: Neil Armstrong Signed-off-by: George Chan --- drivers

[PATCH v4 3/6] bootm: Append bootargs value when bootmeth_android provide cmdline

2025-06-30 Thread George Chan via B4 Relay
From: George Chan Old logic wipe bootargs env with cmdline, new logic cater the value by prepending cmdline value to bootargs. Signed-off-by: George Chan --- boot/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/bootm.c b/boot/bootm.c index 4bdca22ea8c..d8e0c352

[PATCH v4 0/6] A series of patch for enable sc7180 android boot

2025-06-30 Thread George Chan via B4 Relay
Since attempt[1] to embed android specific boot param into fdt bootargs, a new idea is formed as to make use of env file to contain default param value. Current code logic is already working fine, unless the priority of param at begining is higher than at tail. From env file, bootargs is treated im

[PATCH v4 4/6] boot: bootmeth_android: Conditionally dependent on abootimg

2025-06-30 Thread George Chan via B4 Relay
From: George Chan If target u-boot img do not support androidboot v3 or greater, abootimg might not be necessary. aarch64-linux-gnu-ld.bfd: boot/bootmeth_android.o: in function `boot_android_normal': /home/user/sources/u-boot-next/boot/bootmeth_android.c:541:(.text.boot_android_normal+0xd0): u

[PATCH v4 5/6] iommu: qcom-smmu: Introduce sc7180 compatible string

2025-06-30 Thread George Chan via B4 Relay
From: George Chan Add basic compatible string for sc7180 family soc. Signed-off-by: Vitalii Skorkin Co-developed-by: George Chan Signed-off-by: George Chan Reviewed-by: Casey Connolly --- drivers/iommu/qcom-hyp-smmu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/qcom-hy

[PATCH v3 2/7] boot/image-android.c: Split android_image_get_kernel into two functions

2025-06-28 Thread George Chan via B4 Relay
From: George Chan Since fastboot->bootm glue layer also need to cater with bootargs environment, so move common logic from android_image_get_kernel into a new function to avoid some degree of code duplication. This new function is android_image_modify_bootargs_env to specially cater bootargs env

[PATCH v3 3/7] image-android.c: Add null check to bootargs and cmdline

2025-06-28 Thread George Chan via B4 Relay
From: George Chan With some manual testing, when bootargs and/or cmdline from android boot image is absent there will be some unhandled behavior happened. So add null check to all these const char values. Signed-off-by: George Chan --- boot/image-android.c | 27 +-- 1

[PATCH v3 6/7] iommu: qcom-smmu: Introduce sc7180 compatible string

2025-06-28 Thread George Chan via B4 Relay
From: George Chan Add basic compatible string for sc7180 family soc. Signed-off-by: Vitalii Skorkin Co-developed-by: George Chan Signed-off-by: George Chan Reviewed-by: Casey Connolly --- drivers/iommu/qcom-hyp-smmu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/qcom-hy

[PATCH v3 1/7] image-android: Prepend/postpend default bootargs value with given bootcmd

2025-06-28 Thread George Chan via B4 Relay
From: George Chan By default, the boot.img's cmdline are appended to the bootargs environment. If we take a cmdline example of: * androidboot.hardware=warm (in U-Boot environment) * androidboot.hardware=chilly (in boot.img's cmdline) The resulting commandline will be: androidboot.hardware=warm [

[PATCH v3 7/7] usb: gadget: Introduce usb gadget vendor/product default id for ARCH_QCOM

2025-06-28 Thread George Chan via B4 Relay
From: George Chan Currently vendor/product id are both 0, and that might not as we want. Set to some arbitary known value that we can make it work more smoothly. Reviewed-by: Mattijs Korpershoek Acked-by: Mattijs Korpershoek Reviewed-by: Neil Armstrong Signed-off-by: George Chan --- drivers

[PATCH v3 5/7] boot: bootmeth_android: Conditionally dependent on abootimg

2025-06-28 Thread George Chan via B4 Relay
From: George Chan If target u-boot img do not support androidboot v3 or greater, abootimg might not be necessary. aarch64-linux-gnu-ld.bfd: boot/bootmeth_android.o: in function `boot_android_normal': /home/user/sources/u-boot-next/boot/bootmeth_android.c:541:(.text.boot_android_normal+0xd0): u

[PATCH v3 4/7] bootm: Append bootargs value when bootmeth_android provide cmdline

2025-06-28 Thread George Chan via B4 Relay
From: George Chan Old logic wipe bootargs env with cmdline, new logic cater the value by prepending cmdline value to bootargs. Signed-off-by: George Chan --- boot/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/bootm.c b/boot/bootm.c index 4bdca22ea8c..d8e0c352

[PATCH v3 0/7] A series of patch for enable sc7180 android boot

2025-06-28 Thread George Chan via B4 Relay
Since attempt[1] to embed android specific boot param into fdt bootargs, a new idea is formed as to make use of env file to contain default param value. Current code logic is already working fine, unless the priority of param at begining is higher than at tail. From env file, bootargs is treated im