summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell Currey <ruscur@russell.cc>2019-03-25 15:29:28 +1100
committerStewart Smith <stewart@linux.ibm.com>2019-03-28 15:24:12 +1100
commit8d8a9ca30453bc92977409966e6006f8c18f4be5 (patch)
treedf24e006fc9f4900c1578336ae31a0ec65650836
parentcccf5d79de07844cf095b8f45146b92944d15c2e (diff)
downloadblackbird-skiboot-8d8a9ca30453bc92977409966e6006f8c18f4be5.tar.gz
blackbird-skiboot-8d8a9ca30453bc92977409966e6006f8c18f4be5.zip
external/mambo: Populate kernel-base-address in the DT
skiboot.tcl defines PAYLOAD_ADDR as 0x20000000, which is the default in skiboot. This is also the default in skiboot unless kernel-base-address is set in the device tree. If you change PAYLOAD_ADDR to something else for mambo, skiboot won't see it because it doesn't set that DT property, so fix it so that it does. Signed-off-by: Russell Currey <ruscur@russell.cc> Acked-by: Michael Neuling <mikey@neuling.org> [stewart: fix up mambo hacks for STB] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r--core/init.c9
-rw-r--r--external/mambo/skiboot.tcl5
2 files changed, 13 insertions, 1 deletions
diff --git a/core/init.c b/core/init.c
index 29a6bf49..eeee2d9e 100644
--- a/core/init.c
+++ b/core/init.c
@@ -387,6 +387,15 @@ static bool load_kernel(void)
cpu_set_sreset_enable(false);
memcpy(NULL, old_vectors, EXCEPTION_VECTORS_END);
sync_icache();
+ } else {
+ /* Hack for STB in Mambo, assume at least 4kb in mem */
+ if (!kernel_size)
+ kernel_size = SECURE_BOOT_HEADERS_SIZE;
+ if (stb_is_container((void*)kernel_entry, kernel_size)) {
+ stb_container = (void*)kernel_entry;
+ kh = (struct elf_hdr *) (kernel_entry + SECURE_BOOT_HEADERS_SIZE);
+ } else
+ kh = (struct elf_hdr *) (kernel_entry);
}
} else {
if (!kernel_size) {
diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl
index 545a7cca..096f1c34 100644
--- a/external/mambo/skiboot.tcl
+++ b/external/mambo/skiboot.tcl
@@ -221,6 +221,10 @@ lappend compat "ibm,power8-xscom"
set compat [of::encode_compat $compat]
mysim of addprop $xscom_node byte_array "compatible" $compat
+set chosen_node [mysim of find_device /chosen]
+set base_addr [list $mconf(payload_addr)]
+mysim of addprop $chosen_node array64 "kernel-base-address" base_addr
+
# Load any initramfs
set cpio_start 0x80000000
set cpio_end $cpio_start
@@ -236,7 +240,6 @@ if { [info exists env(SKIBOOT_INITRD)] } {
set cpio_end [expr $cpio_end + $cpio_size]
}
- set chosen_node [mysim of find_device /chosen]
mysim of addprop $chosen_node int "linux,initrd-start" $cpio_start
mysim of addprop $chosen_node int "linux,initrd-end" $cpio_end
}
OpenPOWER on IntegriCloud