]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
Merge patch series "Linux compat improvements and CCF prep"
authorTom Rini <trini@konsulko.com>
Tue, 21 Apr 2026 17:21:59 +0000 (11:21 -0600)
committerTom Rini <trini@konsulko.com>
Tue, 21 Apr 2026 17:21:59 +0000 (11:21 -0600)
Casey Connolly <casey.connolly@linaro.org> says:

This series implements various improvements to Linux header
compatibility, largely in preparation for a full port of Linux CCF but
many of these changes would also be helpful when porting other drivers.

Beside the basic header/compat stuff there are a few larger patches:

Patch 1 adds the "%pOF" format specifier to vsprintf, this behaves the
same as it does in Linux printing the name of the ofnode, but notably it
expects an ofnode pointer rather than a device_node.

Patch 2 adds an option to skip doing a full DM scan pre-relocation.
Some platforms like Qualcomm don't actually need devices to be probed
prior to relocation, it is also quite slow to scan the entire FDT before
caches are up. This option gets us to main loop 30-50% faster.

Unfortunately it isn't possible to totally skip DM since U-Boot will
panic if it can't find a serial port, but the serial uclass code will
bind the serial port itself by reading /chosen/stdout-path, however any
dependencies like clocks won't be found so this should only be enabled
if the serial driver gracefully handles missing clocks.

Patch 3 adds [k]strdup_const(), this works the same as the Linux version
saving a small amount of memory by avoiding duplicating strings stored
in .rodata, this is particularly useful for CCF.

Patch 4 adds 64-bit versions of some 32-bit ofnode utilities functions,
making it possible to parse 64-bit arrays.

Patch 6 provides a simple implementation of kref, this will be used
by CCF.

Patch 9 adds devm_krealloc() support to devres, it relies on storing
allocation sizes in the devres struct which will add a small overhead.

Link: https://lore.kernel.org/r/20260401-casey-ccf-compat-v2-0-414d5b7f040b@linaro.org
1  2 
Kconfig
common/board_f.c
include/fdtdec.h
lib/fdtdec.c

diff --cc Kconfig
index 7f00e76ba78641b0eaac1e10884292535e2825f7,2f7677f47f1691f49567efac9406e98e59c1f7dc..d76db7005777f8ba7398ddaa35988914724c7854
+++ b/Kconfig
@@@ -468,29 -468,24 +468,41 @@@ config TOOLS_DEBU
          it is possible to set breakpoints on particular lines, single-step
          debug through the source code, etc.
  
 -config SKIP_RELOCATE
 -      bool "Skips relocation of U-Boot to end of RAM"
 -      help
 -        Skips relocation of U-Boot allowing for systems that have extremely
 -        limited RAM to run U-Boot.
 -
+ config SKIP_EARLY_DM
+       bool "Skips initialising device model pre-relocation"
+       help
+         Enable this option to skip scanning and probing devices prior to
+         U-Boot relocation (during board_f). Unless console support is disabled
+         a serial port is still required, however this can be found through
+         /chosen/stdout-path in FDT. If the serial port relies on other devices
+         like clocks these will also be bound and probed on demand.
+         This can speed up time to interactive console by about 50%, particularly
+         when combined with OF_LIVE.
 +config SKIP_RELOCATE
 +      bool "Skips relocation of U-Boot to end of RAM"
 +      help
 +        Skips relocation of U-Boot allowing for systems that have extremely
 +        limited RAM to run U-Boot.
 +
 +config SKIP_RELOCATE_CODE
 +      bool
 +      help
 +        Skips relocation of U-Boot code to the end of RAM, but still does
 +        relocate data to the end of RAM. This is mainly meant to relocate
 +        data to read-write portion of the RAM, while the code remains in
 +        read-only portion of the RAM from which it is allowed to execute.
 +        This split configuration is present on various secure cores.
 +
 +config SKIP_RELOCATE_CODE_DATA_OFFSET
 +      hex
 +      default 0x0
 +      depends on SKIP_RELOCATE_CODE
 +      help
 +        Offset of the read-write memory which contains data, from read-only
 +        memory which contains executable text.
 +
  endif # EXPERT
  
  config PHYS_64BIT
Simple merge
Simple merge
diff --cc lib/fdtdec.c
Simple merge