u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v9 01/14] sandbox: Build a device tree file for sandbox
Date: Wed, 26 Feb 2014 15:59:14 -0700	[thread overview]
Message-ID: <1393455567-13378-2-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1393455567-13378-1-git-send-email-sjg@chromium.org>

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>
---

Changes in v9:
- Move sandbox device tree file into arch/sandbox/dts

Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3:
- Add new patch to build a device tree file for sandbox

Changes in v2: None

 Makefile                     |  1 +
 arch/sandbox/config.mk       |  2 ++
 arch/sandbox/dts/Makefile    | 11 +++++++++++
 arch/sandbox/dts/sandbox.dts | 20 ++++++++++++++++++++
 include/configs/sandbox.h    |  1 +
 5 files changed, 35 insertions(+)
 create mode 100644 arch/sandbox/dts/Makefile
 create mode 100644 arch/sandbox/dts/sandbox.dts

diff --git a/Makefile b/Makefile
index 0281171..4ff3ef6 100644
--- a/Makefile
+++ b/Makefile
@@ -712,6 +712,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
diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk
index 23b057e..668aa71 100644
--- a/arch/sandbox/config.mk
+++ b/arch/sandbox/config.mk
@@ -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
index 0000000..a4c980b
--- /dev/null
+++ b/arch/sandbox/dts/Makefile
@@ -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
index 0000000..96a4438
--- /dev/null
+++ b/arch/sandbox/dts/sandbox.dts
@@ -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>;
+	};
+};
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index e77d06b..fbb9791 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -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
-- 
1.9.0.rc1.175.g0b1dcb5

  reply	other threads:[~2014-02-26 22:59 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26 22:59 [U-Boot] [PATCH v9 0/14] Driver model implementation, tests, demo and GPIO Simon Glass
2014-02-26 22:59 ` Simon Glass [this message]
2014-03-04 19:16   ` [U-Boot] [U-Boot, v9, 01/14] sandbox: Build a device tree file for sandbox Tom Rini
2014-02-26 22:59 ` [U-Boot] [PATCH v9 02/14] Add cmd_process_error() to report and process errors Simon Glass
2014-03-04 19:16   ` [U-Boot] [U-Boot, v9, " Tom Rini
2014-02-26 22:59 ` [U-Boot] [PATCH v9 03/14] yaffs: Remove private list implementation Simon Glass
2014-03-04 19:16   ` [U-Boot] [U-Boot, v9, " Tom Rini
2014-02-26 22:59 ` [U-Boot] [PATCH v9 04/14] dm: Add README for driver model Simon Glass
2014-03-04 19:16   ` [U-Boot] [U-Boot,v9,04/14] " Tom Rini
2014-02-26 22:59 ` [U-Boot] [PATCH v9 05/14] dm: Add base driver model support Simon Glass
2014-03-04 19:16   ` [U-Boot] [U-Boot,v9,05/14] " Tom Rini
2014-02-26 22:59 ` [U-Boot] [PATCH v9 06/14] sandbox: config: Enable driver model Simon Glass
2014-03-04 19:17   ` [U-Boot] [U-Boot, v9, " Tom Rini
2014-02-26 22:59 ` [U-Boot] [PATCH v9 07/14] dm: Set up driver model after relocation Simon Glass
2014-03-04 19:17   ` [U-Boot] [U-Boot, v9, " Tom Rini
2014-02-26 22:59 ` [U-Boot] [PATCH v9 08/14] dm: Add basic tests Simon Glass
2014-03-04 19:17   ` [U-Boot] [U-Boot,v9,08/14] " Tom Rini
2014-02-26 22:59 ` [U-Boot] [PATCH v9 09/14] dm: Add a 'dm' command for testing Simon Glass
2014-03-04 19:17   ` [U-Boot] [U-Boot,v9,09/14] " Tom Rini
2014-02-26 22:59 ` [U-Boot] [PATCH v9 10/14] dm: Add a demonstration/example driver Simon Glass
2014-03-04 19:17   ` [U-Boot] [U-Boot, v9, " Tom Rini
2014-02-26 22:59 ` [U-Boot] [PATCH v9 11/14] dm: Add GPIO support and tests Simon Glass
2014-03-04 19:17   ` [U-Boot] [U-Boot,v9,11/14] " Tom Rini
2014-02-26 22:59 ` [U-Boot] [PATCH v9 12/14] sandbox: Convert GPIOs to use driver model Simon Glass
2014-03-04 19:17   ` [U-Boot] [U-Boot, v9, " Tom Rini
2014-02-26 22:59 ` [U-Boot] [PATCH v9 13/14] dm: Enable gpio command to support " Simon Glass
2014-03-04 19:17   ` [U-Boot] [U-Boot, v9, " Tom Rini
2014-02-26 22:59 ` [U-Boot] [PATCH v9 14/14] dm: Remove old driver model documentation Simon Glass
2014-03-04 19:17   ` [U-Boot] [U-Boot, v9, " Tom Rini
2014-02-26 23:01 ` [U-Boot] [PATCH v9 0/14] Driver model implementation, tests, demo and GPIO Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393455567-13378-2-git-send-email-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).