[haiku-commits] haiku: hrev48199 - in src/system/boot/platform/u-boot: . arch/ppc arch/arm

  • From: revol@xxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 1 Nov 2014 16:39:32 +0100 (CET)

hrev48199 adds 2 changesets to branch 'master'
old head: bf685cdf2e311bc47c131369fdaf3ca4b64416fe
new head: 5de5d59d785643fc6dacf2690eadf5890bdb0307
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=5de5d59+%5Ebf685cd

----------------------------------------------------------------------------

909a14b: U-Boot: introduce a start_gen() catch-all entry
  
  So we can pass it all the optional stuff instead of playing tricks
  to initialize them outside of BSS.

5de5d59: U-Boot: move gUImage and gFDT back to BSS section
  
  No need for this trick anymore.

                                          [ François Revol <revol@xxxxxxx> ]

----------------------------------------------------------------------------

3 files changed, 20 insertions(+), 20 deletions(-)
src/system/boot/platform/u-boot/arch/arm/shell.S |  6 -----
src/system/boot/platform/u-boot/arch/ppc/shell.S |  6 -----
src/system/boot/platform/u-boot/start.cpp        | 28 ++++++++++++++------

############################################################################

Commit:      909a14bb55d37bfef602538362eee343357e089e
URL:         http://cgit.haiku-os.org/haiku/commit/?id=909a14b
Author:      François Revol <revol@xxxxxxx>
Date:        Sat Nov  1 15:29:28 2014 UTC

U-Boot: introduce a start_gen() catch-all entry

So we can pass it all the optional stuff instead of playing tricks
to initialize them outside of BSS.

----------------------------------------------------------------------------

diff --git a/src/system/boot/platform/u-boot/start.cpp 
b/src/system/boot/platform/u-boot/start.cpp
index 0bd595a..5ad940e 100644
--- a/src/system/boot/platform/u-boot/start.cpp
+++ b/src/system/boot/platform/u-boot/start.cpp
@@ -56,7 +56,8 @@ extern uint8 _end;
 
 extern "C" int main(stage2_args *args);
 extern "C" void _start(void);
-extern "C" int start_raw(int argc, const char **argv);
+extern "C" int start_gen(int argc, const char **argv,
+       struct image_header *uimage=NULL, void *fdt=NULL);
 extern "C" void dump_uimage(struct image_header *image);
 extern "C" void dump_fdt(const void *fdt);
 
@@ -134,15 +135,15 @@ start_netbsd(struct board_info *bd, struct image_header 
*image,
        // TODO: Ensure cmdline is mapped into memory by MMU before usage.
        if (cmdline && *cmdline)
                argc++;
-       gUImage = image;
-       return start_raw(argc, argv);
+       return start_gen(argc, argv, image);
 }
 
 
 extern "C" int
 start_linux(int argc, int archnum, void *atags)
 {
-       return 1;
+       // newer U-Boot pass the FDT in atags
+       return start_gen(0, NULL, NULL, atags);
 }
 
 
@@ -159,14 +160,20 @@ extern "C" int
 start_linux_ppc_fdt(void *fdt, long/*UNUSED*/, long/*UNUSED*/,
        uint32 epapr_magic, uint32 initial_mem_size)
 {
-       gFDT = fdt;     //XXX: make a copy?
-       return start_raw(0, NULL);
+       return start_gen(0, NULL, NULL, fdt);
 }
 
 
 extern "C" int
 start_raw(int argc, const char **argv)
 {
+       return start_gen(argc, argv);
+}
+
+
+extern "C" int
+start_gen(int argc, const char **argv, struct image_header *uimage, void *fdt)
+{
        stage2_args args;
 
        clear_bss();
@@ -179,6 +186,10 @@ start_raw(int argc, const char **argv)
        args.platform.fdt_data = NULL;
        args.platform.fdt_size = 0;
 
+       gUImage = uimage;
+       gFDT = fdt;     //XXX: make a copy?
+               // TODO: check for atags instead and convert them
+
        if (argv) {
                // skip the kernel name
                args.arguments = ++argv;

############################################################################

Revision:    hrev48199
Commit:      5de5d59d785643fc6dacf2690eadf5890bdb0307
URL:         http://cgit.haiku-os.org/haiku/commit/?id=5de5d59
Author:      François Revol <revol@xxxxxxx>
Date:        Sat Nov  1 15:33:09 2014 UTC

U-Boot: move gUImage and gFDT back to BSS section

No need for this trick anymore.

----------------------------------------------------------------------------

diff --git a/src/system/boot/platform/u-boot/arch/arm/shell.S 
b/src/system/boot/platform/u-boot/arch/arm/shell.S
index aad2a96..5bac957 100644
--- a/src/system/boot/platform/u-boot/arch/arm/shell.S
+++ b/src/system/boot/platform/u-boot/arch/arm/shell.S
@@ -75,16 +75,10 @@ SYMBOL_END(_start_common)
 SYMBOL(gUBootGlobalData):
        .long   0
 SYMBOL_END(gUBootGlobalData)
-SYMBOL(gUImage):
-       .long   0
-SYMBOL_END(gUImage)
 SYMBOL(gUBootOS):
 //XXX: bug? Using .byte makes the next asm symbol
 // to be at the same address
 //     .byte   0
        .long   0
 SYMBOL_END(gUBootOS)
-SYMBOL(gFDT):
-       .long   0
-SYMBOL_END(gFDT)
 
diff --git a/src/system/boot/platform/u-boot/arch/ppc/shell.S 
b/src/system/boot/platform/u-boot/arch/ppc/shell.S
index f7df586..bb99d97 100644
--- a/src/system/boot/platform/u-boot/arch/ppc/shell.S
+++ b/src/system/boot/platform/u-boot/arch/ppc/shell.S
@@ -50,16 +50,10 @@ SYMBOL_END(_start_common)
 SYMBOL(gUBootGlobalData):
        .long   0
 SYMBOL_END(gUBootGlobalData)
-SYMBOL(gUImage):
-       .long   0
-SYMBOL_END(gUImage)
 SYMBOL(gUBootOS):
 //XXX: bug? Using .byte makes the next asm symbol
 // to be at the same address
 //     .byte   0
        .long   0
 SYMBOL_END(gUBootOS)
-SYMBOL(gFDT):
-       .long   0
-SYMBOL_END(gFDT)
 
diff --git a/src/system/boot/platform/u-boot/start.cpp 
b/src/system/boot/platform/u-boot/start.cpp
index 5ad940e..1481e41 100644
--- a/src/system/boot/platform/u-boot/start.cpp
+++ b/src/system/boot/platform/u-boot/start.cpp
@@ -63,10 +63,11 @@ extern "C" void dump_fdt(const void *fdt);
 
 // declared in shell.S
 // those are initialized to NULL but not in the BSS
-extern struct image_header *gUImage;
 extern uboot_gd *gUBootGlobalData;
 extern uint32 gUBootOS;
-extern void *gFDT;
+
+struct image_header *gUImage;
+void *gFDT;
 
 static uint32 sBootOptions;
 


Other related posts:

  • » [haiku-commits] haiku: hrev48199 - in src/system/boot/platform/u-boot: . arch/ppc arch/arm - revol