sandbox: Build a device tree file for sandbox
authorSimon Glass <sjg@chromium.org>
Wed, 26 Feb 2014 22:59:14 +0000 (15:59 -0700)
committerTom Rini <trini@ti.com>
Tue, 4 Mar 2014 17:15:28 +0000 (12:15 -0500)
Add support for building a device tree for sandbox's CONFIG_OF_HOSTFILE
option to make it easier to use device tree with sandbox.

This adjusts the Makefile to build a u-boot.dtb file which can be passed
to sandbox U-Boot with:

   ./u-boot -d u-boot.dtb

Signed-off-by: Simon Glass <sjg@chromium.org>
Makefile
arch/sandbox/config.mk
arch/sandbox/dts/Makefile [new file with mode: 0644]
arch/sandbox/dts/sandbox.dts [new file with mode: 0644]
include/configs/sandbox.h

index 25af43b81218359fa6da87acfa4b5ac56d4cd00a..93741082ad14e9998f92e82262a79a857cbf8b07 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -708,6 +708,7 @@ ALL-$(CONFIG_SPL) += spl/u-boot-spl.bin
 ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.img
 ALL-$(CONFIG_TPL) += tpl/u-boot-tpl.bin
 ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb u-boot-dtb.bin
+ALL-$(CONFIG_OF_HOSTFILE) += u-boot.dtb
 ifneq ($(CONFIG_SPL_TARGET),)
 ALL-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%)
 endif
index 23b057e6c4ae88c79ac03b7cfcafe45ffe0c04da..668aa71157e8f6bb98e131606938e69db65e55a5 100644 (file)
@@ -11,3 +11,5 @@ __HAVE_ARCH_GENERIC_BOARD := y
 cmd_u-boot__ = $(CC) -o $@ -T u-boot.lds \
        -Wl,--start-group $(u-boot-main) -Wl,--end-group \
        $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map
+
+CONFIG_ARCH_DEVICE_TREE := sandbox
diff --git a/arch/sandbox/dts/Makefile b/arch/sandbox/dts/Makefile
new file mode 100644 (file)
index 0000000..a4c980b
--- /dev/null
@@ -0,0 +1,11 @@
+dtb-$(CONFIG_SANDBOX) += sandbox.dtb
+
+targets += $(dtb-y)
+
+DTC_FLAGS += -R 4 -p 0x1000
+
+PHONY += dtbs
+dtbs: $(addprefix $(obj)/, $(dtb-y))
+       @:
+
+clean-files := *.dtb
diff --git a/arch/sandbox/dts/sandbox.dts b/arch/sandbox/dts/sandbox.dts
new file mode 100644 (file)
index 0000000..96a4438
--- /dev/null
@@ -0,0 +1,20 @@
+/dts-v1/;
+
+/ {
+       triangle {
+               compatible = "demo-shape";
+               colour = "cyan";
+               sides = <3>;
+               character = <83>;
+       };
+       square {
+               compatible = "demo-shape";
+               colour = "blue";
+               sides = <4>;
+       };
+       hexagon {
+               compatible = "demo-simple";
+               colour = "white";
+               sides = <6>;
+       };
+};
index e77d06bcd3edccf79ab2f94a12545f534dcef1bd..fbb979117fc71ec8dae5697a33430b2c33b1c7f4 100644 (file)
@@ -32,6 +32,7 @@
 #define CONFIG_FIT_SIGNATURE
 #define CONFIG_RSA
 #define CONFIG_CMD_FDT
+#define CONFIG_DEFAULT_DEVICE_TREE     sandbox
 
 #define CONFIG_FS_FAT
 #define CONFIG_FS_EXT4