u-boot/doc/device-tree-bindings
Simon Glass 7703efbc99 schemas: Add schema for U-Boot driver model 'phase tags'
U-Boot has some particular challenges with device tree and devices:

- U-Boot has multiple build phases, such as a Secondary Program Loader
  (SPL) phase which typically runs in a pre-SDRAM environment where code
  and data space are limited. In particular, there may not be enough
  space for the full device tree blob. U-Boot uses various automated
  techniques to reduce the size from perhaps 40KB to 3KB. It is not
  always possible to handle these tags entirely at build time, since
  U-Boot proper must have the full device tree, even though we do not
  want it to process all nodes until after relocation.
- Some U-Boot phases needs to run before the clocks are properly set up,
  where the CPU may be running very slowly. Therefore it is important to
  bind only those devices which are actually needed in that phase
- U-Boot uses lazy initialisation for its devices, with 'bind' and
  'probe' being separate steps. Even if a device is bound, it is not
  actually probed until it is used. This is necessary to keep the boot
  time reasonable, e.g. to under a second

The phases of U-Boot in order are: TPL, VPL, SPL, U-Boot (first
pre-relocation, then post-relocation). ALl but the last two are optional.

For the above reasons, U-Boot only includes the full device tree in the
final 'U-Boot proper' build. Even then, before relocation U-Boot only
processes nodes which are marked as being needed.

For this to work, U-Boot's driver model[1] provides a way to mark device
tree nodes as applicable for a particular phase. This works by adding a
tag to the node, e.g.:

   cru: clock-controller@ff760000 {
      bootph-all;
      compatible = "rockchip,rk3399-cru";
      reg = <0x0 0xff760000 0x0 0x1000>;
      rockchip,grf = <&grf>;
      #clock-cells = <1>;
      #reset-cells = <1>;
      ...
   };

Here the "bootph-all" tag indicates that the node must be present in all
phases, since the clock driver is required.

There has been discussion over the years about whether this could be done
in a property instead, e.g.

   options {
      bootph-all = <&cru> <&gpio_a> ...;
      ...
   };

Some problems with this:

- we need to be able to merge several such tags from different .dtsi files
  since many boards have their own specific requirements
- it is hard to find and cross-reference the affected nodes
- it is more error-prone
- it requires significant tool rework in U-Boot, including fdtgrep and
  the build system
- is harder (slower, more code) to process since it involves scanning
  another node/property to find out what to do with a particular node
- we don't want to add phandle arguments to the above since we are
  referring, e.g., to the clock device as a whole, not a paricular clock
- the of-platdata feature[2], which converts device tree to C for even
  more constrained environments, would need to become aware of the
  /options node

There is also the question about whether this needs to be U-Boot-specific,
or whether the tags could be generic. From what I can tell, U-Boot is the
only bootloader which seriously attempts to use a runtime device tree in
all cases. For this version, an attempt is made to name the phases in a
generic manner.

It should also be noted that the approach provided here has stood the test
of time, used in U-Boot for 8 years so far.

So add the schema for this. This will allow a major class of schema
exceptions to be dropped from the U-Boot source tree.

This has been applied upstream[3]

[1] https://u-boot.readthedocs.io/en/latest/develop/driver-model/index.html
[2] https://u-boot.readthedocs.io/en/latest/develop/driver-model/of-plat.html
[3] https://github.com/devicetree-org/dt-schema/commit/63bd847

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-14 09:42:14 -07:00
..
adc doc: stm32mp1: add page for device tree bindings 2021-08-14 20:54:41 +02:00
arm doc: binding: scmi: link to latest Linux kernel binding 2022-03-02 17:42:06 -05:00
ata x86: ivybridge: Add SATA init 2014-11-25 06:34:01 -07:00
axi doc: Remove duplicated documentation directory 2019-06-20 10:57:08 -04:00
bus dm: Add support for simple-pm-bus 2020-07-01 15:01:21 +08:00
clock doc: stm32mp1: add page for device tree bindings 2021-08-14 20:54:41 +02:00
cpu doc: Remove duplicated documentation directory 2019-06-20 10:57:08 -04:00
exynos s5p: cpu_info: print "cpu-model" if exists in dts 2015-11-02 10:37:59 +09:00
firmware dt/bindings: Add bindings for GPT based FWU Metadata storage device 2022-10-31 14:47:32 -04:00
fpga ARM: socfpga: Description on FPGA bitstream type and file name for Arria 10 2019-05-10 22:48:10 +02:00
fsp/fsp2/apollolake dt-bindings: fsp: Fix Apollo Lake FSP-S devicetree bindings 2021-04-15 10:43:17 +08:00
gpio drivers/gpio: add support for MAX7320 i2c i/o expander 2021-10-19 11:25:24 -04:00
gpu tegra124: dts: Add host1x node to provide display information 2015-05-13 09:24:08 -07:00
i2c dt-bindings: i2c: i2c-cdns.txt: Add description for an optional parameter, fifo-depth 2023-02-13 09:58:15 +01:00
input dt-bindings: input: adc-keys bindings documentation 2021-02-18 11:37:26 +01:00
interrupt-controller tpm: cr50: Use the correct GPIO binding 2020-04-16 14:36:28 +08:00
iommu iommu: Add IOMMU uclass 2021-10-31 08:46:44 -04:00
leds led: led_pwm: Add a driver for LEDs connected to PWM 2022-04-11 11:39:19 -04:00
mailbox WS cleanup: remove SPACE(s) followed by TAB 2021-09-30 09:08:16 -04:00
memory dt/bindings: memory: Add bindings for TI GPMC driver 2022-10-26 15:21:11 -04:00
memory-controller ram: k3-ddrss: Allow use of dt provided initial frequency 2022-04-20 11:14:39 -04:00
memory-controllers ram: stm32mp1: add support of STM32MP13x 2022-06-17 10:41:16 +02:00
mfd k210: use the board vendor name rather than the marketing name 2022-03-15 17:43:11 +08:00
misc doc: Add device-tree-bindings for atsha204 and atsha204a 2022-05-10 06:47:38 +02:00
mmc sandbox: mmc: Support a backing file 2021-11-28 16:51:51 -07:00
mtd dt-bindings: mtd: Add ti, elm DT binding documentation 2023-01-08 10:38:50 +01:00
nand tegra: fdt: Add NAND controller binding and definitions 2012-09-07 13:54:30 -07:00
net phy: adin: add driver for Analog Devices ADIN1300 PHY 2022-04-10 08:44:13 +03:00
pci x86: pci: Allow binding of some devices before relocation 2021-07-15 19:49:50 +08:00
pci_endpoint pci_ep: add Cadence PCIe endpoint driver 2019-07-11 10:05:15 -04:00
phy doc: stm32mp1: add page for device tree bindings 2021-08-14 20:54:41 +02:00
pinctrl k210: use the board vendor name rather than the marketing name 2022-03-15 17:43:11 +08:00
pmic pmic: Convert pm8916 driver to a generic Qcom PMIC driver 2022-08-26 10:55:45 -04:00
power dt-bindings: ti_sci_pm_domains: Add support for exclusive and shared access 2019-07-26 21:49:23 -04:00
pwm dt-bindings: pwm: pwm-at91: Add PWM bindings for A5D2 2021-10-12 15:18:39 +03:00
ram doc: Remove duplicated documentation directory 2019-06-20 10:57:08 -04:00
reboot-mode reboot-mode: read the boot mode from RTC memory 2021-07-23 10:16:39 -04:00
regulator doc: regulator: Add regulator-force-boot-off binding 2022-06-06 17:47:16 -04:00
remoteproc remoteproc: k3_system_controller: Support optional boot_notification channel 2022-02-08 09:41:26 -05:00
reserved-memory doc: Remove duplicated documentation directory 2019-06-20 10:57:08 -04:00
reset doc: stm32mp1: add page for device tree bindings 2021-08-14 20:54:41 +02:00
rtc doc: device-tree-bindings: rtc: Abracon AB x80x i2c rtc 2021-01-27 17:07:48 -05:00
serial serial: qcom: add support for GENI serial driver 2021-10-31 08:46:44 -04:00
soc/fsl/cpm_qe/qe net, qe: add DM support for QE UEC ethernet 2020-09-17 06:09:53 +02:00
sound sound: Add an ACPI driver for Maxim MAX98357ac 2020-07-17 14:32:24 +08:00
spi dt-bindings: spi: Add hpe gxp spi 2022-06-22 21:30:05 -04:00
spmi drivers: spmi: Add support for Qualcomm SPMI bus driver 2016-04-01 17:18:12 -04:00
sysinfo sysinfo: Add gpio-sysinfo driver 2021-05-04 07:57:18 -04:00
sysreset sysreset: Add TI System Control Interface (TI SCI) sysreset driver 2018-09-11 08:32:55 -04:00
thermal thermal: ti-bandgap: Add support for temperature sensor 2017-11-21 08:03:38 -05:00
timer doc: Remove duplicated documentation directory 2019-06-20 10:57:08 -04:00
tpm2 WS cleanup: remove SPACE(s) followed by TAB 2021-09-30 09:08:16 -04:00
usb dt-bindings: usb: mtk-xhci: add optional properies to disable ports 2021-02-10 22:23:24 +01:00
video global: Move remaining CONFIG_SYS_* to CFG_SYS_* 2022-12-05 16:06:08 -05:00
w1 WS cleanup: remove trailing empty lines 2021-09-30 08:08:56 -04:00
w1-eeprom WS cleanup: remove trailing empty lines 2021-09-30 08:08:56 -04:00
watchdog watchdog: introduce a u-boot,autostart property 2022-10-24 11:09:19 +02:00
bootcount-syscon.txt bootcount: add a new driver with syscon as backend 2021-08-22 11:04:52 +02:00
bootdev.txt bootstd: doc: Add documentation 2022-04-25 10:00:04 -04:00
bootmeth.txt bootstd: doc: Add documentation 2022-04-25 10:00:04 -04:00
bootph.yaml schemas: Add schema for U-Boot driver model 'phase tags' 2023-02-14 09:42:14 -07:00
bootstd.txt bootstd: doc: Add documentation 2022-04-25 10:00:04 -04:00
chosen.txt x86: Add a way to add to the e820 memory table 2020-09-25 11:27:25 +08:00
config.txt treewide: fdt: Move fdt_get_config_... to ofnode_conf_read... 2021-09-25 09:46:15 -06:00
device.txt x86: Add wake sources for the acpi_gpe driver 2020-09-25 11:27:15 +08:00
README fdt: Add staging area for device tree binding documentation 2012-03-29 08:12:47 +02:00
root.txt fdt: Pass the device serial number through devicetree 2015-06-05 08:32:07 -06:00

Device Tree Bindings Staging Area
=================================

This directory contains device tree bindings for U-Boot.

These follow along with Linux kernel bindings, with a few additions. By
adding the files here, U-Boot patches can clearly show thees additions.
This makes it easier for device tree people to review these additions in
patches sent to the U-Boot mailing list.

The intent IS to commit these files to U-Boot. Hopefully at some point
the files will be stored in another repo (shared with Linux) which is
brought in as needed. Changes here are intended to mirror changes in the
Linux Documentation/devicetree/bindings/ directory.

sjg@chromium.org
17-Jan-12