[U-Boot] [PATCH] rockchip: rk3399-puma: preserve leading zeros in serial#

Jakob Unterwurzacher jakob.unterwurzacher at theobroma-systems.com
Thu Dec 7 15:20:44 UTC 2017


Linux preserves leading zeros in /proc/cpuinfo, so we
should as well.

Otherwise we have the situation that
/sys/firmware/devicetree/base/serial-number
and /proc/cpuinfo disagree in Linux.

Signed-off-by: Jakob Unterwurzacher <jakob.unterwurzacher at theobroma-systems.com>
---

 board/theobroma-systems/puma_rk3399/puma-rk3399.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
index 26c4535f1b..737206ae0f 100644
--- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c
+++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
@@ -138,7 +138,7 @@ static void setup_serial(void)
 
 	serialno = crc32_no_comp(0, low, 8);
 	serialno |= (u64)crc32_no_comp(serialno, high, 8) << 32;
-	snprintf(serialno_str, sizeof(serialno_str), "%llx", serialno);
+	snprintf(serialno_str, sizeof(serialno_str), "%016llx", serialno);
 
 	env_set("cpuid#", cpuid_str);
 	env_set("serial#", serialno_str);
-- 
2.11.0



More information about the U-Boot mailing list