
On Thu, Feb 04, 2021 at 03:56:23PM -0500, Sean Anderson wrote:
On 2/4/21 3:52 PM, Heinrich Schuchardt wrote:
On 2/4/21 9:29 PM, Sean Anderson wrote:
This is almost identical to the imx7 version, except that the register names are different.
Signed-off-by: Sean Anderson sean.anderson@seco.com
Hello Sean,
I tried to understand where this serial number is ending up.
See common/fdt_support.c and fdt_root(). That's the common use and way it's populated and passed on.
It seems to be used by the bootm command. But shouldn't we use it to define environment variable #serial instead?
Yes. Typically boards will use get_board_serial to set serial#. For example, the warp7 board does
int board_late_init(void) { /* ... snip ... */
#ifdef CONFIG_SERIAL_TAG /* Set serial# standard environment variable based on OTP settings */ get_board_serial(&serialnr); snprintf(serial_string, sizeof(serial_string), "WaRP7-0x%08x%08x", serialnr.low, serialnr.high); env_set("serial#", serial_string); #endif
return 0; }
I would like to do the same on an i.MX6-based board.
Please note that the WaRP7 case of mixing the serial# with some other string is not the common / best practices case. It's typically just the die-ID or similar value without other text around it, which makes for an easy generic function. The WaRP7 case makes it harder for imx7 to have a generic everyone gets it populated function like imx6 could have with your patch and a few changes, and like I want to go adjust the currently unused imx8 code to do.