All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [RFC PATCH v2 0/6] Run-time configuration of U-Boot via a flat device tree (fdt)
@ 2011-09-12 22:04 Simon Glass
  2011-09-12 22:04 ` [U-Boot] [RFC PATCH v2 1/6] fdt: ARM: Add device tree control of U-Boot (CONFIG_OF_CONTROL) Simon Glass
                   ` (7 more replies)
  0 siblings, 8 replies; 58+ messages in thread
From: Simon Glass @ 2011-09-12 22:04 UTC (permalink / raw)
  To: u-boot

At present in U-Boot configuration is mostly done using CONFIG options in the
board file. This patch set aims to make it possible for a single U-Boot
binary to support multiple boards, with the exact configuration of each board
controlled by a flat device tree (fdt). This is the approach recently taken
by the ARM Linux kernel and has been used by PowerPC for some time.

The fdt is a convenient vehicle for implementing run-time configuration for
three reasons. Firstly it is easy to use, being a simple text file. It is
extensible since it consists of nodes and properties in a nice hierarchical
format.

Finally, there is already excellent infrastructure for the fdt: a compiler
checks the text file and converts it to a compact binary format, and a library
is already available in U-Boot (libfdt) for handling this format.

To read about fdts, take a look at the specification here:

https://www.power.org/resources/downloads/Power_ePAPR_APPROVED_v1.0.pdf

You also might find this section of the Linux kernel documentation useful:
(access this in the Linux kernel source code)

Documentation/devicetree/booting-without-of.txt

To use this patch set you will need to get the device tree compiler here:

git://jdl.com/software/dtc.git

and add some defines to your board (only ARM is currently supported):

 #define CONFIG_OF_CONTROL       (to enable run-time config control via fdt)
 #define CONFIG_OF_EMBED or CONFIG_OF_SEPARATE
 (either build the fdt blob into U-Boot, or create a separate u-boot.dtb)
 #define CONFIG_DEFAULT_DEVICE_TREE	"<your name>"
 (to specify the name of the device tree file is
  board/<vendor>/<board>/<your name>.dts)

This patch set does not include any drivers which actually use the fdt. I have
some concerns about spreading fdt code around the U-Boot code base so am
thinking of having a support file which makes this easier. I can provide a
UART driver modified to use fdt if there is interest.

It is important to understand that the fdt only selects options available in
the platform / drivers. It cannot add new drivers (yet). So you must still
have the CONFIG option to enable the driver. For example, you need to define
CONFIG_SYS_NS16550 to bring in the NS16550 driver, but can use the fdt to
specific the UART clock, peripheral address, etc. In very broad terms, the
CONFIG options in general control *what* driver files are pulled in, and the
fdt controls *how* those files work.

While only ARM is supported in this patch series, it should be easy enough to
add support for other architectures.

Changes in v2:
- Add example of i2c driver changes required to support fdt control
- Add example fdt fragments for Tegra2 I2C, just for illustration
- Add example proposed decode helper library

Simon Glass (6):
  fdt: ARM: Add device tree control of U-Boot (CONFIG_OF_CONTROL)
  fdt: Add support for embedded device tree (CONFIG_OF_EMBED)
  fdt: Add support for a separate device tree (CONFIG_OF_SEPARATE)
  fdt: ARM: Implement embedded and separate device tree
  fdt: add decode helper library
  fdt: example modification of i2c driver for fdt control

 .gitignore                                |    1 +
 Makefile                                  |    9 ++
 README                                    |   25 ++++
 arch/arm/include/asm/global_data.h        |    1 +
 arch/arm/lib/board.c                      |   22 ++++
 board/nvidia/seaboard/tegra2-seaboard.dts |   20 ++++
 board/nvidia/seaboard/tegra250.dtsi       |   42 +++++++
 common/Makefile                           |    1 +
 common/fdt_decode.c                       |  177 +++++++++++++++++++++++++++++
 config.mk                                 |    1 +
 doc/README.fdt-control                    |  168 +++++++++++++++++++++++++++
 drivers/i2c/tegra2_i2c.c                  |   91 +++++++++++++++
 dts/Makefile                              |  100 ++++++++++++++++
 include/common.h                          |    1 +
 include/fdt_decode.h                      |   90 +++++++++++++++
 include/libfdt.h                          |    5 +-
 16 files changed, 753 insertions(+), 1 deletions(-)
 create mode 100644 board/nvidia/seaboard/tegra2-seaboard.dts
 create mode 100644 board/nvidia/seaboard/tegra250.dtsi
 create mode 100644 common/fdt_decode.c
 create mode 100644 doc/README.fdt-control
 create mode 100644 dts/Makefile
 create mode 100644 include/fdt_decode.h

-- 
1.7.3.1

^ permalink raw reply	[flat|nested] 58+ messages in thread

end of thread, other threads:[~2011-10-12  0:16 UTC | newest]

Thread overview: 58+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-12 22:04 [U-Boot] [RFC PATCH v2 0/6] Run-time configuration of U-Boot via a flat device tree (fdt) Simon Glass
2011-09-12 22:04 ` [U-Boot] [RFC PATCH v2 1/6] fdt: ARM: Add device tree control of U-Boot (CONFIG_OF_CONTROL) Simon Glass
2011-09-13  3:10   ` Marek Vasut
2011-09-13  4:52     ` Simon Glass
2011-09-13  5:18       ` Marek Vasut
2011-09-13  9:47       ` Wolfgang Denk
2011-09-13 11:44         ` Simon Glass
2011-09-13 11:57           ` Wolfgang Denk
2011-09-13 12:14             ` Simon Glass
2011-09-13 13:12               ` Wolfgang Denk
2011-09-13 18:16   ` Mike Frysinger
2011-09-13 18:24     ` Simon Glass
2011-09-12 22:04 ` [U-Boot] [RFC PATCH v2 2/6] fdt: Add support for embedded device tree (CONFIG_OF_EMBED) Simon Glass
2011-09-12 23:37   ` Jason
2011-09-13  0:12     ` Simon Glass
2011-09-13 14:37       ` Jason
2011-09-13 21:06         ` Simon Glass
2011-09-14 13:47           ` Jason
2011-09-14 15:47             ` Simon Glass
2011-09-14 16:11               ` Jason
2011-09-14 17:45                 ` Simon Glass
2011-09-14 19:50                   ` Jason
2011-09-14 20:05                     ` Simon Glass
2011-09-14 20:16                       ` Jason
2011-09-14 20:24                         ` Simon Glass
2011-09-14 20:35                           ` Jason
2011-09-14 16:45   ` Grant Likely
2011-09-14 18:03     ` Simon Glass
2011-09-14 19:17       ` Grant Likely
2011-09-14 19:22         ` Simon Glass
2011-09-14 20:11     ` Wolfgang Denk
2011-09-14 20:32       ` Simon Glass
2011-09-14 21:09       ` Grant Likely
2011-09-12 22:04 ` [U-Boot] [RFC PATCH v2 3/6] fdt: Add support for a separate device tree (CONFIG_OF_SEPARATE) Simon Glass
2011-09-14 16:48   ` Grant Likely
2011-09-14 18:25     ` Simon Glass
2011-09-12 22:04 ` [U-Boot] [RFC PATCH v2 4/6] fdt: ARM: Implement embedded and separate device tree Simon Glass
2011-09-12 22:04 ` [U-Boot] [RFC PATCH v2 5/6] fdt: add decode helper library Simon Glass
2011-09-12 22:04 ` [U-Boot] [RFC PATCH v2 6/6] fdt: example modification of i2c driver for fdt control Simon Glass
2011-09-13 18:28 ` [U-Boot] [RFC PATCH v2 0/6] Run-time configuration of U-Boot via a flat device tree (fdt) Simon Glass
2011-09-15 13:54 ` [U-Boot] [RFC PATCH 0/4 v1] Use fdt to init mvrtc driver for dreamplug Jason Cooper
2011-09-15 13:54   ` [U-Boot] [RFC PATCH 1/4 v1] fdt: remove i2c example code Jason Cooper
2011-09-16  7:31     ` Kumar Gala
2011-09-16 12:00       ` Jason
2011-09-15 13:54   ` [U-Boot] [RFC PATCH 2/4 v1] fdt_decode: make more available Jason Cooper
2011-09-15 19:18     ` Simon Glass
2011-09-15 19:48       ` Jason
2011-09-15 13:54   ` [U-Boot] [RFC PATCH 3/4 v1] mvrtc: add fdt support Jason Cooper
2011-09-15 19:23     ` Simon Glass
2011-09-15 20:01       ` Jason
2011-10-06 21:31     ` Wolfgang Denk
2011-10-06 21:42       ` Simon Glass
2011-10-12  0:16         ` Simon Glass
2011-09-15 13:54   ` [U-Boot] [RFC PATCH 4/4 v1] dreamplug: enable fdt Jason Cooper
2011-09-15 19:25     ` Simon Glass
2011-09-15 19:50       ` Jason
2011-09-15 19:16   ` [U-Boot] [RFC PATCH 0/4 v1] Use fdt to init mvrtc driver for dreamplug Simon Glass
2011-09-15 19:46     ` Jason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.