]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
MIPS: implement device-tree handover to Linux kernel
authorDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Sun, 22 Feb 2015 15:58:30 +0000 (16:58 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 20:31:33 +0000 (22:31 +0200)
Add device-tree handover to Linux kernel conforming with MIPS UHI [1].
Register $a0 will be set to the reserved value -2. The address of
the device-tree blob will be stored as KSEG0 address in $a1. $a2 and
$a3 are set to zero.

[1] http://prplfoundation.org/wiki/MIPS_documentation

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
arch/mips/Kconfig
arch/mips/lib/bootm.c

index bc4283d2f13b551cb747d796794286eabbd83027..b0a8a4357a4bf3bdaba9df4099300b2f34b3ad53 100644 (file)
@@ -141,15 +141,12 @@ config MIPS_BOOT_ENV_LEGACY
          The address of the enviroment is stored in register $a2.
 
 config MIPS_BOOT_FDT
-       bool "Hand over a flattened device tree to Linux kernel (INCOMPLETE)"
+       bool "Hand over a flattened device tree to Linux kernel"
        default n
        help
          Enable this option if you want U-Boot to hand over a flattened
-         device tree to the kernel.
-
-         Note: the final hand over to the kernel is not yet implemented. After
-               the community agreed on the MIPS boot interface for device trees,
-               the corresponding code will be added.
+         device tree to the kernel. According to UHI register $a0 will be set
+         to -2 and the FDT address is stored in $a1.
 
 endmenu
 
index d9d8396e63b24b90838970c3256408a3c633f56b..e289799c1ee3c42247f308465494a356eb087691 100644 (file)
@@ -317,7 +317,11 @@ static void boot_jump_linux(bootm_headers_t *images)
        bootstage_report();
 #endif
 
-       kernel(linux_argc, (ulong)linux_argv, (ulong)linux_env, linux_extra);
+       if (images->ft_len)
+               kernel(-2, (ulong)images->ft_addr, 0, 0);
+       else
+               kernel(linux_argc, (ulong)linux_argv, (ulong)linux_env,
+                       linux_extra);
 }
 
 int do_bootm_linux(int flag, int argc, char * const argv[],