From: Tom Rini Date: Thu, 4 Feb 2021 16:09:13 -0500 Subject: [PATCH] ARM: mx6: Add function to read UNIQUE_ID In-Reply-To: <77d17133-8fe9-3560-6f18-91bd79c439d2@seco.com> References: <20210204202948.1609959-1-sean.anderson@seco.com> <545e1b5b-3d12-b98a-6167-c3095b96436e@gmx.de> <77d17133-8fe9-3560-6f18-91bd79c439d2@seco.com> Message-ID: <20210204210913.GJ10169@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > > > > 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. -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: