1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-29 06:21:15 +02:00

tiny-printf: Handle %pM format when CONFIG_SPL_NET_SUPPORT is enabled

%pM format string is used to print MAC-address and this is required while SPL
network boot.

This patch fixes the SPL boot issues like the following:

    Trying to boot from USB eth
    ## Error: flags type check failure for "ethaddr" <= "40309614M" (type: m)
    ## Error inserting "ethaddr" variable, errno=1
    eth0: eth_cpsw## Error: flags type check failure for "eth1addr" <=
    "81f01114M" (type: m)
    ## Error inserting "eth1addr" variable, errno=1
    , eth1: usb_ether
    eth_cpsw Waiting for PHY auto negotiation to complete......... TIMEOUT !
    Problem booting with BOOTP
    SPL: failed to boot from all boot devices
    ### ERROR ### Please RESET the board ###

Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Matwey V. Kornilov
2021-08-05 22:06:05 +03:00
committed by Tom Rini
parent 55a202f64b
commit c091f65234

View File

@@ -9,8 +9,9 @@
*/ */
#include <common.h> #include <common.h>
#include <stdarg.h> #include <log.h>
#include <serial.h> #include <serial.h>
#include <stdarg.h>
#include <linux/ctype.h> #include <linux/ctype.h>
struct printf_info { struct printf_info {
@@ -269,7 +270,7 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va)
} }
break; break;
case 'p': case 'p':
#ifdef DEBUG if (CONFIG_IS_ENABLED(NET_SUPPORT) || _DEBUG) {
pointer(info, fmt, va_arg(va, void *)); pointer(info, fmt, va_arg(va, void *));
/* /*
* Skip this because it pulls in _ctype which is * Skip this because it pulls in _ctype which is
@@ -279,10 +280,9 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va)
while (isalnum(fmt[0])) while (isalnum(fmt[0]))
fmt++; fmt++;
break; break;
#else }
islong = true; islong = true;
/* no break */ /* no break */
#endif
case 'x': case 'x':
if (islong) { if (islong) {
num = va_arg(va, unsigned long); num = va_arg(va, unsigned long);