[Skiboot] [PATCH] external/mambo: 4 byte align chained CPIOs

Michael Neuling mikey at neuling.org
Thu Nov 26 13:01:51 AEDT 2020


Linux requires chained CPIOs to be 4 byte aligned otherwise they are
ignored. This aligns them.

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

diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl
index 76d29f6e9080..3a8e19406f29 100644
--- a/external/mambo/skiboot.tcl
+++ b/external/mambo/skiboot.tcl
@@ -274,13 +274,14 @@ if { [info exists env(SKIBOOT_INITRD)] } {
 	    set cpio_size [file size $cpio_file]
 	    mysim mcm 0 memory fread $cpio_end $cpio_size $cpio_file
 	    set cpio_end [expr $cpio_end + $cpio_size]
+	    # Linux requires cpios are 4 byte aligned
+	    set cpio_end [expr $cpio_end + 3 & 0xfffffffffffffffc]
     }
 
     mysim of addprop $chosen_node int "linux,initrd-start" $cpio_start
     mysim of addprop $chosen_node int "linux,initrd-end"   $cpio_end
 }
 
-
 # Map persistent memory disks
 proc pmem_node_add { root start size } {
     set start_hex [format %x $start]
-- 
2.28.0



More information about the Skiboot mailing list