summaryrefslogtreecommitdiff
path: root/dts
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-05-10 11:59:04 -0700
committerSimon Glass <sjg@chromium.org>2011-08-24 10:01:31 -0700
commit20d8fe039fa7732aa71f1360adadfb6753687f8d (patch)
tree0d3c689503990f113eef69603cd30d9f78736b5e /dts
parentfba3cfb94552efe566dbb2b1e595ec236c91b168 (diff)
fdt: Add support for embedded device tree (CONFIG_OF_EMBED)
This new option allows U-Boot to embed a binary device tree into its image to allow run-time control of peripherals. This device tree is for U-Boot's own use and is not necessarily the same one as is passed to the kernel. BUG=chromium-os:11623 TEST=build and boot U-Boot on Seaboard Change-Id: I024d01079a44395e122a8b53e3901ba9a007dc5a Reviewed-on: http://gerrit.chromium.org/gerrit/621 Reviewed-by: Doug Anderson <dianders@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'dts')
-rw-r--r--dts/Makefile60
-rw-r--r--dts/README39
2 files changed, 99 insertions, 0 deletions
diff --git a/dts/Makefile b/dts/Makefile
new file mode 100644
index 0000000000..986a6b3ee3
--- /dev/null
+++ b/dts/Makefile
@@ -0,0 +1,60 @@
+#
+# Copyright (c) 2011 The Chromium OS Authors.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundatio; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB = $(obj)libdts.o
+
+# Use a constant name for this so we can access it from C code.
+# objcopy doesn't seem to allow us to set the symbol name independently of
+# the filename.
+DT_BIN := dt.dtb
+
+# TODO: get arch properly for objcopy line.
+dt.o: $(TOPDIR)/board/$(BOARDDIR)/$(DEVICE_TREE).dts
+ $(DTC) -R 4 -p 0x1000 -O dtb -o $(DT_BIN) $<
+ $(OBJCOPY) -B armv5te -I binary -O elf32-littlearm $(DT_BIN) dt.o
+ rm $(DT_BIN)
+
+OBJS := dt.o
+
+OBJS := $(addprefix $(obj),$(OBJS))
+
+all: $(obj).depend $(LIB)
+
+$(LIB): $(OBJS)
+ $(call cmd_link_o_target, $(OBJS))
+
+clean:
+ rm -f $(OBJS) $(LIB)
+ rm -f $(DT_BIN)
+
+distclean: clean
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/dts/README b/dts/README
new file mode 100644
index 0000000000..ad939b9e66
--- /dev/null
+++ b/dts/README
@@ -0,0 +1,39 @@
+#
+# Copyright (c) 2011 The Chromium OS Authors.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundatio; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+Emebdded Device Tree Support in U-Boot
+======================================
+
+This directory contains a Makefile for building the device tree blob and
+embedding it in your U-Boot image. This is useful since it allows U-Boot to
+configure itself according to what it finds there. If you have a number of
+similar boards with different peripherals, you can describe the features of
+each board in the device tree file, and have a single generic source base.
+
+Put your device tree file in board/<vendor>/dts/<soc>_<board>.dts. It will be
+picked up and built into the image.
+
+
+To do
+=====
+- Provide a way for U-Boot to find a device tree somewhere in memory on startup,
+similar to how the environment works.