[PATCH v2 00/11] Linux compat improvements and CCF prep

Casey Connolly casey.connolly at linaro.org
Wed Apr 1 16:15:16 CEST 2026


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.

---
Changes since v1:
    * No changes
    * V1: https://lore.kernel.org/u-boot/20260319-casey-ccf-upstream-v1-0-4df2ee2226da@linaro.org

To: u-boot at lists.denx.de
Cc: Tom Rini <trini at konsulko.com>
Cc: Casey Connolly <casey.connolly at linaro.org>
Cc: Ilias Apalodimas <ilias.apalodimas at linaro.org>
Cc: Simon Glass <sjg at chromium.org>
Cc: Raphael Gallais-Pou <raphael.gallais-pou at foss.st.com>
Cc: Romain Gantois <romain.gantois at bootlin.com>
Cc: Andrew Goodbody <andrew.goodbody at linaro.org>
Cc: Patrice Chotard <patrice.chotard at foss.st.com>
Cc: Raymond Mao <raymondmaoca at gmail.com>
Cc: Peng Fan <peng.fan at nxp.com>

---
Casey Connolly (11):
      vsprintf: add %pOF
      common: add an option to skip DM pre-relocation
      string: add strdup_const and kstrdup_const
      ofnode: add read_u64_array and count_elems_of_size
      compat: add PTR_ERR_OR_ZERO
      compat: add kref implementation
      compat: add dev_name()
      compat: add linux/regmap.h symlink
      regmap: add regmap_assign_bits
      compat: regulator: add enable/disable macros
      compat: math64: add abs_diff()

 Kconfig                        |  12 ++++
 common/board_f.c               |  11 +++-
 drivers/core/of_access.c       |  52 +++++++++++++++++
 drivers/core/ofnode.c          |  48 ++++++++++++++++
 include/asm-generic/sections.h |  19 +++++++
 include/dm/of_access.h         |  20 +++++++
 include/dm/ofnode.h            |  50 +++++++++++++++++
 include/fdtdec.h               |  16 ++++++
 include/linux/compat.h         |  13 +++++
 include/linux/device.h         |  29 ++++++++++
 include/linux/err.h            |  25 +++++++++
 include/linux/kref.h           | 124 +++++++++++++++++++++++++++++++++++++++++
 include/linux/math64.h         |  19 +++++++
 include/linux/regmap.h         |   1 +
 include/linux/string.h         |   2 +
 include/power/regulator.h      |   3 +
 include/regmap.h               |   9 +++
 lib/fdtdec.c                   |  18 ++++++
 lib/string.c                   |  31 +++++++++++
 lib/vsprintf.c                 |  37 ++++++++++++
 20 files changed, 538 insertions(+), 1 deletion(-)
---
base-commit: c704af3c8b0f37929bce8c2a4bba27d6e89919c7

// Casey (she/they)



More information about the U-Boot mailing list