Commit 714a5621c2df0b1cfce525b9add071fc9bfd726b

Authored by Simon Glass
Committed by Tom Rini
1 parent 1ace402239

sandbox: Build a device tree file for sandbox

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>

Showing 5 changed files with 35 additions and 0 deletions Side-by-side Diff

... ... @@ -708,6 +708,7 @@
708 708 ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.img
709 709 ALL-$(CONFIG_TPL) += tpl/u-boot-tpl.bin
710 710 ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb u-boot-dtb.bin
  711 +ALL-$(CONFIG_OF_HOSTFILE) += u-boot.dtb
711 712 ifneq ($(CONFIG_SPL_TARGET),)
712 713 ALL-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%)
713 714 endif
arch/sandbox/config.mk
... ... @@ -11,4 +11,6 @@
11 11 cmd_u-boot__ = $(CC) -o $@ -T u-boot.lds \
12 12 -Wl,--start-group $(u-boot-main) -Wl,--end-group \
13 13 $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map
  14 +
  15 +CONFIG_ARCH_DEVICE_TREE := sandbox
arch/sandbox/dts/Makefile
  1 +dtb-$(CONFIG_SANDBOX) += sandbox.dtb
  2 +
  3 +targets += $(dtb-y)
  4 +
  5 +DTC_FLAGS += -R 4 -p 0x1000
  6 +
  7 +PHONY += dtbs
  8 +dtbs: $(addprefix $(obj)/, $(dtb-y))
  9 + @:
  10 +
  11 +clean-files := *.dtb
arch/sandbox/dts/sandbox.dts
  1 +/dts-v1/;
  2 +
  3 +/ {
  4 + triangle {
  5 + compatible = "demo-shape";
  6 + colour = "cyan";
  7 + sides = <3>;
  8 + character = <83>;
  9 + };
  10 + square {
  11 + compatible = "demo-shape";
  12 + colour = "blue";
  13 + sides = <4>;
  14 + };
  15 + hexagon {
  16 + compatible = "demo-simple";
  17 + colour = "white";
  18 + sides = <6>;
  19 + };
  20 +};
include/configs/sandbox.h
... ... @@ -32,6 +32,7 @@
32 32 #define CONFIG_FIT_SIGNATURE
33 33 #define CONFIG_RSA
34 34 #define CONFIG_CMD_FDT
  35 +#define CONFIG_DEFAULT_DEVICE_TREE sandbox
35 36  
36 37 #define CONFIG_FS_FAT
37 38 #define CONFIG_FS_EXT4