Sam Lewis has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44376 )
Change subject: arch/arm: Enable booting Linux payloads ......................................................................
arch/arm: Enable booting Linux payloads
Enables booting in a Linux kernel payload with the calling convention the kernel requires. As there is no method in coreboot to check the type of payload being booted (Linux or otherwise) this assumes any payload is a Linux payload.
Change-Id: If50c834c8f434bc02dee8f84370d1dbf8f9b69e2 Signed-off-by: Sam Lewis sam.vr.lewis@gmail.com --- M src/arch/arm/boot.c 1 file changed, 16 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/44376/1
diff --git a/src/arch/arm/boot.c b/src/arch/arm/boot.c index 8c876de..fc87f2c 100644 --- a/src/arch/arm/boot.c +++ b/src/arch/arm/boot.c @@ -3,12 +3,28 @@ #include <arch/cache.h> #include <program_loading.h>
+static void run_linux_payload(struct prog *prog) +{ + void (*kernel_entry)(void *sbz, void *sbo, void *dtb); + void *fdt; + + kernel_entry = prog_entry(prog); + fdt = prog_entry_arg(prog); + kernel_entry(0, (void *)~0, fdt); +} + void arch_prog_run(struct prog *prog) { void (*doit)(void *);
cache_sync_instructions();
+ if (ENV_RAMSTAGE && prog_type(prog) == PROG_PAYLOAD) { + dcache_mmu_disable(); + run_linux_payload(prog); + return; + } + doit = prog_entry(prog); doit(prog_entry_arg(prog)); }
Sam Lewis has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44376 )
Change subject: arch/arm: Enable booting Linux payloads ......................................................................
Patch Set 1:
I'm not sure about this one - are there any payloads that have requirements for r0/r1/r2? In particular, do any payloads rely on a pointer to cbtables being in r0? If so, I think this will break those payloads. Perhaps there could be a way to detect whether the payload is a Linux/DT combo at runtime (if there isn't already a way to do this that I may have missed?) so that this calling convention can only be used for Linux payloads.
Hello build bot (Jenkins), Julius Werner,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/44376
to look at the new patch set (#2).
Change subject: arch/arm: Enable booting Linux payloads ......................................................................
arch/arm: Enable booting Linux payloads
Enables booting in a Linux kernel payload with the calling convention the kernel requires. As there is no method in coreboot to check the type of payload being booted (Linux or otherwise) this assumes any payload is a Linux payload.
Change-Id: If50c834c8f434bc02dee8f84370d1dbf8f9b69e2 Signed-off-by: Sam Lewis sam.vr.lewis@gmail.com --- M src/arch/arm/boot.c 1 file changed, 16 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/44376/2
Hello build bot (Jenkins), Patrick Rudolph, Julius Werner,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/44376
to look at the new patch set (#3).
Change subject: arch/arm: Enable booting Linux payloads ......................................................................
arch/arm: Enable booting Linux payloads
Enables booting in a Linux kernel payload with the calling convention the kernel requires. As there is no method in coreboot to check the type of payload being booted (Linux or otherwise) this assumes any payload is a Linux payload.
Change-Id: If50c834c8f434bc02dee8f84370d1dbf8f9b69e2 Signed-off-by: Sam Lewis sam.vr.lewis@gmail.com --- M src/arch/arm/boot.c 1 file changed, 16 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/44376/3
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44376 )
Change subject: arch/arm: Enable booting Linux payloads ......................................................................
Patch Set 4:
In particular, do any payloads rely on a pointer to cbtables being in r0?
Yeah, they do. See payloads/libpayload/arch/arm/head.S
We already have the distinction between a normal coreboot SELF payload and FIT kernel in the CBFS type (e.g. already used by payload_load()), so we should probably just use the same here. I think you can just use prog_cbfs_type(prog) to check that?
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44376 )
Change subject: arch/arm: Enable booting Linux payloads ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/44376/4/src/arch/arm/boot.c File src/arch/arm/boot.c:
https://review.coreboot.org/c/coreboot/+/44376/4/src/arch/arm/boot.c@13 PS4, Line 13: kernel_entry(0, (void *)~0, fdt); BTW there's more to booting a kernel than this. You need to turn off the MMU, transition back to Arm (from Thumb) mode, switch to SVC mode, etc. See https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/refs/hea... and https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/refs/hea... for inspiration.
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44376 )
Change subject: arch/arm: Enable booting Linux payloads ......................................................................
Patch Set 4:
Duplicate of https://review.coreboot.org/q/topic:%22arm_FIT%22+(status:open%20OR%20status...) ?
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44376 )
Change subject: arch/arm: Enable booting Linux payloads ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/44376/4/src/arch/arm/boot.c File src/arch/arm/boot.c:
https://review.coreboot.org/c/coreboot/+/44376/4/src/arch/arm/boot.c@23 PS4, Line 23: dcache_mmu_disable(); that breaks on qemu as the MMU isn't enabled. CB:44394 fixes that.
Sam Lewis has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44376 )
Change subject: arch/arm: Enable booting Linux payloads ......................................................................
Patch Set 5:
Patch Set 4:
Duplicate of https://review.coreboot.org/q/topic:%22arm_FIT%22+(status:open%20OR%20status...) ?
Seems so! Will abandon this in favor of that change, as it looks like that change has been reviewed and is good to be merged?
Sam Lewis has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/44376 )
Change subject: arch/arm: Enable booting Linux payloads ......................................................................
Abandoned
Duplicates https://review.coreboot.org/c/coreboot/+/35409