Skip to content

spl: dm: Make it possible for the SPL to pick its own DTB from a FIT

Jean-Jacques Hiblot u-boot 6 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest10 patches 0 repliesNew
  2. v510 patches 0 repliesSuperseded
  3. v49 patches 0 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v39 patches0 repliesSuperseded
v29 patches0 repliesSuperseded
v10 of 9 patches0 repliesSuperseded

Changes in v6 from the cover letter

- rebased on top of latest u-boot/master: updated patch #7 as support for SPL_GZIP has been recently added to u-boot/master.
- Fixed the wrong ordering of includes in lib/fdtdec.c
- changed Kconfig messages to start with an an upper-case

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10dts: renamed FIT_EMBED to MULTI_DTB_FIT and moved it to the dts KconfigMakefile board/ti/ks2_evm/board_k2e.c board/ti/ks2_evm/board_k2g.c +11 more+45 -281 reply
2/10fit: use 'const' for the input of fdt_offset() and locate_dtb_in_fit()common/boot_fit.c include/boot_fit.h+9 -41 reply
3/10fit: fixed bug in locate_dtb_in_fit()common/boot_fit.c+1 -11 reply
4/10fit: If no matching config is found in fit_find_config_node(), use the default onecommon/common_fit.c include/image.h+33 -01 reply
5/10lzo: add a function to check the validity of the headerinclude/linux/lzo.h lib/lzo/lzo1x_decompress.c+20 -41 reply
6/10gzip: add a function to parse the headerinclude/common.h lib/gunzip.c+13 -31 reply
7/10lib: allow building lzo for the SPLlib/Kconfig lib/Makefile+7 -11 reply
8/10fdtdec: sort include fileslib/fdtdec.c+5 -52 replies
8/10fdtdec: sort include files+0 -00 replies
9/10spl: dm: Make it possible for the SPL to pick its own DTB from a FITdoc/README.multi-dtb-fit dts/Kconfig lib/fdtdec.c +1 more+249 -131 reply
10/10omap: detect board before spl_early_init()arch/arm/mach-omap2/hwinit-common.c+3 -11 reply

Reviews trailers per patch

8 of 11 patches have a Reviewed-by or Acked-by.

PatchTom RiniSimon Glass
1/10R-b R-b
2/10R-b R-b
3/10R-b R-b
4/10R-b R-b
5/10R-b R-b
6/10R-b R-b
7/10R-b R-b
8/10
8/10
9/10
10/10R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [U-Boot] [PATCH v6 00/10] spl: dm: Make it possible for the SPL to pick its own DTB from a FIT

Following the RFC, here is the series implementing the mechanism in a cleaner way. The idea is that the SPL may take advantage of selecting its DTB from a pool of available DTBs. To do that several DTBs are embedded in a compressed FIT image appended at the end of the SPL. The patch is done in such way that this mechanism can easily be extended to other ways of loading the DTBs.

Here are some numbers:

                            +----------+------------+-----------+------------+
                            |  size    | size delta | SPL boot  | boot time  |
                            |  (bytes) | (bytes)    | time (s)  | delta (s)  |
+---------------------------+----------+------------+-----------+------------+
| 1 DTB                     |          |            |           |            |
+---------------------------+----------+------------+-----------+------------+
| reference                 |   125305 |          0 |     1.389 |          0 |
| LZO (dynamic allocation)  |   125391 |         86 |     1.381 |     -0.008 |
+---------------------------+----------+------------+-----------+------------+
| 4 DTBs (DRA7, DRA71,      |          |            |           |            |
| DRA72, DRA72 revC)        |          |            |           |            |
+---------------------------+----------+------------+-----------+------------+
| LZO (dynamic allocation)  |   125991 |        686 |      1.39 |      0.001 |
| LZO (user defined area)   |   125927 |        622 |     1.403 |      0.014 |
| GZIP (user defined area)  |   133880 |       8575 |     1.421 |      0.032 |
| No compression (in place) |   137472 |      12167 |     1.412 |      0.023 |
+---------------------------+----------+------------+-----------+------------+

changes since v5:
- rebased on top of latest u-boot/master: updated patch #7 as support for SPL_GZIP has been recently added to u-boot/master.
- Fixed the wrong ordering of includes in lib/fdtdec.c
- changed Kconfig messages to start with an an upper-case

changes since v4:
- Updated the documentation. Hopefully it's more intelligible.
- renamed SPL_MULTI_DTB_FIT_GZ in SPL_MULTI_DTB_FIT_GZIP
- Added a patch to sort the included headers in lib/fdtdec.c
- reduced the level of #ifdeffing of the patch

changes since v3:
- Added reviewed-by tags
- Fixed nits and spelling mistakes reported by Simon G.
- updated the help in Kconfig to take in account commit f1896c ("spl: make SPL and normal u-boot stage use independent SYS_MALLOC_F_LEN")

changes since v2:
- rebased on u-boot/master
- improved help in Kconfig for the compression options in SPL
- improved commit message for patch #1
- Added some comments to describe locate_dtb_in_fit() and fit_find_config_node()
- Added a description of the mecanism in a README

changes since v1:
- improved help in Kconfig for the SPL_MULTI_DTB_FIT option
- Added "reviewed-by" tags

changes since RFC:
- split the RFC patch in several patches.
- leverage work from Cooper Jr., Franklin (CONFIG_FIT_EMBED) as a big part of the code is similar. Rename CONFIG_FIT_EMBED as CONFIG_MULTI_DTB_FIT to prevent confusion with CONFIG_OF_EMBED.
- use the default configuration if no match is provided by board_fit_config_name_match(). note that this is generic not just for this feature.
- provide an option to not use dynamic memory allocation.
- added a patch related to board detection on omap that's required to take advantage of this feature.

Jean-Jacques Hiblot (10):
dts: renamed FIT_EMBED to MULTI_DTB_FIT and moved it to the dts
Kconfig
fit: use 'const' for the input of fdt_offset() and locate_dtb_in_fit()
fit: fixed bug in locate_dtb_in_fit()
fit: If no matching config is found in fit_find_config_node(), use the
default one
lzo: add a function to check the validity of the header
gzip: add a function to parse the header
lib: allow building lzo for the SPL
fdtdec: sort include files
spl: dm: Make it possible for the SPL to pick its own DTB from a FIT
omap: detect board before spl_early_init()

 Makefile                            |   2 +-
 arch/arm/mach-omap2/hwinit-common.c |   4 +-
 board/ti/ks2_evm/board_k2e.c        |   2 +-
 board/ti/ks2_evm/board_k2g.c        |   2 +-
 board/ti/ks2_evm/board_k2hk.c       |   2 +-
 board/ti/ks2_evm/board_k2l.c        |   2 +-
 common/Kconfig                      |  16 ------
 common/Makefile                     |   2 +-
 common/boot_fit.c                   |   6 +--
 common/common_fit.c                 |  20 +++++++
 configs/k2e_evm_defconfig           |   2 +-
 configs/k2g_evm_defconfig           |   2 +-
 configs/k2hk_evm_defconfig          |   2 +-
 configs/k2l_evm_defconfig           |   2 +-
 doc/README.multi-dtb-fit            |  65 +++++++++++++++++++++++
 dts/Kconfig                         | 103 +++++++++++++++++++++++++++++++++++-
 include/boot_fit.h                  |   9 +++-
 include/common.h                    |   1 +
 include/image.h                     |  13 +++++
 include/linux/lzo.h                 |   3 ++
 lib/Kconfig                         |   5 ++
 lib/Makefile                        |   3 +-
 lib/fdtdec.c                        |  98 +++++++++++++++++++++++++++++-----
 lib/gunzip.c                        |  15 ++++--
 lib/lzo/lzo1x_decompress.c          |  21 ++++++--
 scripts/Makefile.spl                |  35 +++++++++++-
 26 files changed, 381 insertions(+), 56 deletions(-)
 create mode 100644 doc/README.multi-dtb-fit
Signature · 1 line
1.9.1