| 1 |
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-clause |
| 2 |
# Copyright 2021 Google LLC |
| 3 |
# |
| 4 |
|
| 5 |
%YAML 1.2 |
| 6 |
--- |
| 7 |
$id: http://devicetree.org/schemas/options.yaml# |
| 8 |
$schema: http://devicetree.org/meta-schemas/core.yaml# |
| 9 |
|
| 10 |
title: /options Node |
| 11 |
|
| 12 |
maintainers: |
| 13 |
- Simon Glass <[email protected]> |
| 14 |
|
| 15 |
description: | |
| 16 |
The '/options' node does not represent a real device, but serves as a place |
| 17 |
for passing data into and between firmware components, such as memory |
| 18 |
mappings. Data in the '/options' node does not represent the hardware. It is |
| 19 |
ignored by operating systems. |
| 20 |
|
| 21 |
Properties in this node should be common to (and used by) at least two |
| 22 |
firmware projects, such as U-Boot and TF-A. Project-specific subnodes can be |
| 23 |
used for properties which are specific to a single project. |
| 24 |
|
| 25 |
This is based on the precedent set by IEEE 1275-1994 IEEE Standard for Boot |
| 26 |
(Initialization Configuration) Firmware: Core Requirements and Practices |
| 27 |
at https://www.openfirmware.info/data/docs/of1275.pdf |
| 28 |
|
| 29 |
Purpose of '/options' node |
| 30 |
-------------------------- |
| 31 |
|
| 32 |
A common problem with firmware is that many builds are needed to deal with the |
| 33 |
slight variations between different, related models of the same hardware. For |
| 34 |
example, one model may have a TPM and another may not. Devicetree provides an |
| 35 |
excellent solution to this problem, in that the devicetree to actually use on |
| 36 |
a platform can be injected in the factory based on which model is being |
| 37 |
manufactured at the time. |
| 38 |
|
| 39 |
A related problem causing build proliferation is dealing with the differences |
| 40 |
between development firmware, developer-friendly firmware (e.g. with all |
| 41 |
security features present but with the ability to access the command line), |
| 42 |
test firmware (which runs tests used in the factory), final production |
| 43 |
firmware (before signing), signed firmware (where the signatures have been |
| 44 |
inserted) and the like. Ideally all or most of these should use the same |
| 45 |
firmware build, with just some options to determine the features available. |
| 46 |
For example, being able to control whether the UART console or JTAG are |
| 47 |
available, on any image, is a great debugging aid. |
| 48 |
|
| 49 |
When the firmware consists of multiple parts (various U-Boot phases, TF-A, |
| 50 |
OP-TEE), it is helpful that all operate the same way at runtime, regardless of |
| 51 |
how they were built. This can be achieved by passing the runtime configuration |
| 52 |
(e.g. 'enable UART console', 'here are your public keys') along the chain |
| 53 |
through each firmware stage. It is frustrating to have to replicate a bug on |
| 54 |
production firmware which does not happen on developer firmware, because they |
| 55 |
are completely different builds. |
| 56 |
|
| 57 |
The '/options' node provides useful functionality for this. It allows the |
| 58 |
different controls to be 'factored out' of the firmware binaries, so they can |
| 59 |
be controlled separately from the initial source-code build. The node can be |
| 60 |
easily updated by a build or factory tool and can control various features in |
| 61 |
the firmware binaries. It is similar in concept to a Kconfig option, except |
| 62 |
that it can be changed after firmware binaries are built. |
| 63 |
|
| 64 |
The '/options' node is similar in concept to /chosen (see chosen.yaml) except |
| 65 |
that it is for passing information *into* and *between*) firmware components, |
| 66 |
instead of from firmware to the operating system. Also, while operating |
| 67 |
systems typically have a (sometimes extremely long) command line, firmware |
| 68 |
binaries typically do not support this. The devicetree provides a more |
| 69 |
structured approach in any case. |
| 70 |
|
| 71 |
properties: |
| 72 |
$nodename: |
| 73 |
const: options |
| 74 |
|
| 75 |
"#address-cells": true |
| 76 |
"#size-cells": true |
| 77 |
|
| 78 |
additionalProperties: |
| 79 |
type: object |