summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorChristoph Niedermaier <[email protected]>2025-05-08 13:57:25 +0200
committerTom Rini <[email protected]>2025-05-22 10:57:12 -0600
commit1e24e84db41afc5beba0a0ef9dd6e0509127b1de (patch)
tree873f17ab0a1f9c4d1ac03e092f3c5cfff42c2fb4 /common
parent0a006371578a8f098c1850b0097c1af68c018165 (diff)
tiny-printf: Handle formatting of %p with an extra Kconfig
The formatting with %pa / %pap behaves like %x, which results in an incorrect value being output. To improve this, a new fine-tuning Kconfig SPL_USE_TINY_PRINTF_POINTER_SUPPORT for pointer formatting has been added. If it is enabled, the output of %pa / %pap should be correct, and if it is disabled, the pointer formatting is completely unsupported. In addition to indicate unsupported formatting, '?' will be output. This allows enabling pointer formatting only when needed. For SPL_NET it is selected by default. Then it also supports the formatting with %pm, %pM and %pI4. In summery this level of %p support for tiny printf is possible now: 1) The standard tiny printf won't have support for pointer formatting. So it doesn't print misleading values for %pa, instead '?' will be output: %p => ? %pa => ?a %pap => ?ap 2) If SPL_USE_TINY_PRINTF_POINTER_SUPPORT is enabled or DEBUG is defined tiny printf supports formatting %p and %pa / %pap. 3) If SPL_NET is enabled the support of pointers is extended for %pm, %pM and %pI4. Signed-off-by: Christoph Niedermaier <[email protected]>
Diffstat (limited to 'common')
-rw-r--r--common/spl/Kconfig1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index aa3a85eea54..a84a0f83924 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -1123,6 +1123,7 @@ config SPL_DM_SPI_FLASH
config SPL_NET
bool "Support networking"
depends on !NET_LWIP
+ select SPL_USE_TINY_PRINTF_POINTER_SUPPORT if SPL_USE_TINY_PRINTF
help
Enable support for network devices (such as Ethernet) in SPL.
This permits SPL to load U-Boot over a network link rather than