]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
Xilinx: ARM: Introduce Device Tree support.
authorBrian Hill <brian.hill@xilinx.com>
Thu, 10 Mar 2011 19:39:06 +0000 (12:39 -0700)
committerBrian Hill <brian.hill@xilinx.com>
Thu, 10 Mar 2011 19:39:06 +0000 (12:39 -0700)
Add support for fdt and bootm commands.
Use of bootm requires a proper uImage, which may be built by:
mkimage -A arm -O linux -T kernel -C none -a 0x8000 -e 0x8000 -n 'Linux' -d arch/arm/boot/Image uImage

EXAMPLE USAGE:

tftp 0x1000000 linux-2.6-xarm/arch/arm/boot/uImage
tftp 0x900000 arm-support/ramdisks/ramdisk8M-amp.image.gz
tftp 0x2000000 xilinx.dtb

fdt addr 0x2000000
fdt print

setenv bootargs console=ttyDF0,9600 root=/dev/ram rw initrd=0x900000,8M earlyprintk debug
fdt chosen

fdt list /chosen

bootm 0x1000000 - 0x2000000

The uImage CRC is verified, and it is copied to the load location.  The device
tree location is set in r2 for the kernel.

arch/arm/lib/bootm.c
include/configs/xpele.h

index 310132126cd6d2d341ff7c31d25dab9213eb1792..f9d8d1b6855b071deb330aed26d0444112cf4bc4 100644 (file)
@@ -64,6 +64,22 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
        if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
                return 1;
 
+/* HACK BHILL FIXME */
+#if defined(CONFIG_OF_LIBFDT)
+       int ret;
+       char    *of_flat_tree = NULL;
+       ulong   of_size = 0;
+
+       /* find flattened device tree */
+       ret = boot_get_fdt (flag, argc, argv, images, &of_flat_tree, &of_size);
+       if (ret) {
+               printf("Error getting device tree: 0x%x\n", ret);
+               return 1;
+       } else {
+               printf("Using device tree at: 0x%08x\n", (unsigned)of_flat_tree);
+       }
+#endif
+
        theKernel = (void (*)(int, int, uint))images->ep;
 
        s = getenv ("machid");
@@ -114,7 +130,11 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
 
        cleanup_before_linux ();
 
+#if defined(CONFIG_OF_LIBFDT)
+       theKernel (0, machid, of_flat_tree);
+#else
        theKernel (0, machid, bd->bi_boot_params);
+#endif
        /* does not return */
 
        return 1;
index 6f5b3ae7e25a1f4140b60c46a866f5f7e504c07f..004a8edbe534406ccbd60b9be79218fc292c7b3a 100644 (file)
 
 #include "../board/xilinx/dfe/xparameters.h"
 
+/*
+ * Open Firmware flat tree
+ */
+#define CONFIG_OF_LIBFDT                1
+
 /* Default environment */
 #define CONFIG_IPADDR   10.10.70.102
 #define CONFIG_ETHADDR  00:0a:35:00:01:22