Skip to content

Commit

Permalink
external/mambo: Populate kernel-base-address in the DT
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ruscur authored and stewartsmith committed Mar 28, 2019
1 parent cccf5d7 commit 8d8a9ca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions core/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion external/mambo/skiboot.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down

0 comments on commit 8d8a9ca

Please sign in to comment.