[haiku-commits] BRANCH mmu_man-github.sam460ex - src/system/boot/platform/u-boot headers/private/kernel/boot/platform/u-boot

  • From: mmu_man-github.sam460ex <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 21 Apr 2013 01:30:54 +0200 (CEST)

added 1 changeset to branch 'refs/remotes/mmu_man-github/sam460ex'
old head: 048f079571dbb5717b8f6f4096c1740b9f5423c7
new head: 247db0d169987a50b75a5ad581cf33fd1e13202b
overview: https://github.com/mmuman/haiku/compare/048f079...247db0d

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

247db0d: U-Boot: pass a copy of the FDT to the kernel

                                          [ François Revol <revol@xxxxxxx> ]

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

Commit:      247db0d169987a50b75a5ad581cf33fd1e13202b
Author:      François Revol <revol@xxxxxxx>
Date:        Sat Apr 20 23:15:43 2013 UTC

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

2 files changed, 8 insertions(+), 2 deletions(-)
.../private/kernel/boot/platform/u-boot/platform_kernel_args.h  | 4 ++--
src/system/boot/platform/u-boot/start.cpp                       | 6 ++++++

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

diff --git a/headers/private/kernel/boot/platform/u-boot/platform_kernel_args.h 
b/headers/private/kernel/boot/platform/u-boot/platform_kernel_args.h
index ae65dbc..8a78bc6 100644
--- a/headers/private/kernel/boot/platform/u-boot/platform_kernel_args.h
+++ b/headers/private/kernel/boot/platform/u-boot/platform_kernel_args.h
@@ -22,8 +22,8 @@ typedef struct {
        void    *openfirmware_entry;
        char    rtc_path[128];
 
-       // TODO: add FDT
-       char dummy;
+       // Flattened Device Tree blob
+       void    *fdt;
 } platform_kernel_args;
 
 #endif /* KERNEL_BOOT_PLATFORM_UBOOT_KERNEL_ARGS_H */
diff --git a/src/system/boot/platform/u-boot/start.cpp 
b/src/system/boot/platform/u-boot/start.cpp
index 15838eb..e1dbee6 100644
--- a/src/system/boot/platform/u-boot/start.cpp
+++ b/src/system/boot/platform/u-boot/start.cpp
@@ -105,6 +105,12 @@ platform_start_kernel(void)
        addr_t stackTop
                = gKernelArgs.cpu_kstack[0].start + 
gKernelArgs.cpu_kstack[0].size;
 
+       if (gFDT) {
+               // clone the Flattened Device Tree blob
+               gKernelArgs.platform_args.fdt = 
kernel_args_malloc(fdt_totalsize(gFDT));
+               memcpy(gKernelArgs.platform_args.fdt, gFDT, 
fdt_totalsize(gFDT));
+       }
+
 //     smp_init_other_cpus();
        serial_cleanup();
        mmu_init_for_kernel();


Other related posts:

  • » [haiku-commits] BRANCH mmu_man-github.sam460ex - src/system/boot/platform/u-boot headers/private/kernel/boot/platform/u-boot - mmu_man-github . sam460ex