Add serial# for SPL SDP download

After update this, uuu(>1.6) can use below command to filter out devices
when multi boards connected.

uuu -ms <serial#> ...
[sudo] uuu -lsusb can list known devices with serial# informaiton.

Serial number is retrieved via get_board_serial() and passed to
g_dnl_set_serialnumber(). This part is conditionally compiled for i.MX94
only now.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
This commit is contained in:
Frank Li
2025-11-04 12:39:46 -03:00
committed by Fabio Estevam
parent 28a38ab542
commit 53d98faad7
+12
View File
@@ -21,6 +21,8 @@
#include <g_dnl.h>
#include <linux/libfdt.h>
#include <memalign.h>
#include <asm/setup.h>
#include <asm/bootm.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -184,6 +186,16 @@ u32 spl_boot_device(void)
#ifdef CONFIG_SPL_USB_GADGET
int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
{
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
#ifdef CONFIG_IMX94
struct tag_serialnr serialnr;
char serial_string[0x21] = {0};
get_board_serial(&serialnr);
snprintf(serial_string, sizeof(serial_string), "%08x%08x", serialnr.high, serialnr.low);
g_dnl_set_serialnumber(serial_string);
#endif
#endif
put_unaligned(CONFIG_USB_GADGET_PRODUCT_NUM + 0xfff, &dev->idProduct);
return 0;