[Skiboot] [PATCH 4/7] mambo: Add ability to load initrd

Michael Neuling mikey at neuling.org
Tue Oct 20 15:49:01 AEDT 2015


Add ability to load initrd using SKIBOOT_INITRD environment variable.

Signed-off-by: Michael Neuling <mikey at neuling.org>
---
 external/mambo/skiboot.tcl | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl
index 1590102..aa19485 100644
--- a/external/mambo/skiboot.tcl
+++ b/external/mambo/skiboot.tcl
@@ -162,6 +162,17 @@ lappend compat "ibm,power8-xscom"
 set compat [of::encode_compat $compat]
 mysim of addprop $xscom_node byte_array "compatible" $compat
 
+if { [info exists env(SKIBOOT_INITRD)] } {
+    set cpio_file $env(SKIBOOT_INITRD)
+    set chosen_node [mysim of find_device /chosen]
+    set cpio_size [file size $cpio_file]
+    set cpio_start 0x10000000
+    set cpio_end [expr $cpio_start + $cpio_size]
+    mysim of addprop $chosen_node int "linux,initrd-start" $cpio_start
+    mysim of addprop $chosen_node int "linux,initrd-end"   $cpio_end
+    mysim mcm 0 memory fread $cpio_start $cpio_size $cpio_file
+}
+
 # Flatten it
 
 epapr::of2dtb mysim $mconf(epapr_dt_addr) 
-- 
2.1.4



More information about the Skiboot mailing list