Skip to content

Commit 12b1d38

Browse files
sjg20LeanSheng
authored andcommitted
Provide a way to handle board revisions and model variants
Add a means to deal with minor model changes, where devicetree tweaks may be needed. Signed-off-by: Simon Glass <[email protected]>
1 parent 1c82248 commit 12b1d38

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

Diff for: source/chapter3-usage.rst

+41
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,47 @@ second string, this isn't as good a match as ``fdt1``.
9494
In U-Boot this algorithm is handled by ``fit_conf_find_compat()`` and enabled
9595
by the ``CONFIG_FIT_BEST_MATCH`` option.
9696

97+
Sometime models have multiple PCB revisions or different minor variants, often
98+
referred to as SKUs. For this reason, bootloaders may want to select
99+
configurations in a finer-grained way. In this case, rather than using the
100+
compatible stringlist in its devicetree, if any, it constructs a single string
101+
using the base name along with any available suffixes, each beginning with a
102+
hyphen. The best match algorithm is then run using that string.
103+
104+
The following compatible-string suffixes may be used to this end. They must be
105+
provided in this order (<n> is an integer >= 0):
106+
107+
``-rev<n>``
108+
Board revision number, typically referring to a revision of the PCB to fix
109+
a problem or adjust component selection. The intention is that the board is
110+
the same design, just with some minor fixes or improvements. The first
111+
revision is typically ``rev0``.
112+
113+
``-sku<n>``
114+
Board variant, called a SKU (Stock-Keeping Unit) which is a unique code that
115+
identifies a model variant. This may encode differences in the display,
116+
WiFi and the like, but where the same PCB design (and revision) is used.
117+
The base SKU is typically ``sku0``.
118+
119+
Examples::
120+
121+
compatible = "google,kevin-rev15";
122+
compatible = "google,kevin-rev15-sku2";
123+
124+
When matching, the bootloader should build the most specific string it can using
125+
any available revision / SKU information, then try to match that. If the most
126+
specific string fails (e.g. ``"google,kevin-rev15-sku2"``), it should fall back
127+
to just ``"google,kevin-rev15"`` and then ``"google,kevin-sku2"``. If nothing
128+
matches, then it should try without any additions, i.e. ``"google,kevin"``.
129+
130+
This multi-stage process uses the same 'best match' approach as above. Each
131+
attempt finds the best match given the compatible string being searched. Where
132+
a stage does not find any match, the next stage begins. As soon as a match is
133+
found, searching stops, using the best match found in the stage.
134+
135+
Other suffixes may be added in future.
136+
137+
97138
Load the images from the selected configuration
98139
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99140

0 commit comments

Comments
 (0)