[PATCH v2] ARM: mx6: Add function to set serial#
Tom Rini
trini at konsulko.com
Thu Feb 4 23:55:45 CET 2021
On Thu, Feb 04, 2021 at 11:31:22PM +0100, Heinrich Schuchardt wrote:
> On 2/4/21 11:12 PM, Sean Anderson wrote:
> >
> >
> > On 2/4/21 5:03 PM, Heinrich Schuchardt wrote:
> > > On 2/4/21 10:58 PM, Tom Rini wrote:
> > >> On Thu, Feb 04, 2021 at 04:44:22PM -0500, Sean Anderson wrote:
> > >>
> > >>> The serial number OTP is similar to the imx7 version, except that the
> > >>> register names are different. This also sets serial# directly,
> > >>> instead of
> > >>> providing board_get_serial.
> > >>>
> > >>> Signed-off-by: Sean Anderson <sean.anderson at seco.com>
> > >>
> > >> Reviewed-by: Tom Rini <trini at konsulko.com>
> > >>
> > >
> > > The current patch is without effect.
> > >
> > > We need to enable CONFIG_ARCH_MISC_INIT on i.MX6 by default, e.g.
> > >
> > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > > index 95557d6ed6..ba189c404d 100644
> > > --- a/arch/arm/Kconfig
> > > +++ b/arch/arm/Kconfig
> > > @@ -901,6 +901,7 @@ config ARCH_MX6
> > > select SYS_FSL_HAS_SEC
> > > select SYS_FSL_SEC_COMPAT_4
> > > select SYS_FSL_SEC_LE
> > > + select ARCH_MISC_INIT
> > > imply MXC_GPIO
> > > imply SYS_THUMB_BUILD
> > >
> > > Best regards
> > >
> > > Heinrich
> >
> > Do any boards on i.MX6 currently set serial# themselves? arch_misc_init
> > is called before board_late_init, which is (AFACT) typically where
> > boards set serial#. Any boards which conditionally set serial# (e.g.
> > from an eeprom) will not set things up properly. I looked over things
> > quickly, and I didn't see anything. So it may be fine to enable this.
> >
> > Though by this logic, shouldn't you have implied ARCH_MISC_INIT back in
> > 90865614b4 ("ARM: mx6: make CAAM usable on the i.MX6 boards")?
>
> +1 to activate the flag.
> I was already wondering why the random number generator on my Wandboard
> was not working.
>
> The three i.MX6 boards with misc_init_r() don's set serial#:
>
> board/congatec/cgtqmx6eval/cgtqmx6eval.c:755:int misc_init_r(void)
> board/toradex/apalis_imx6/apalis_imx6.c:786:int misc_init_r(void)
> board/toradex/colibri_imx6/colibri_imx6.c:679:int misc_init_r(void)
>
> git grep -n 'serial#' | grep mx6
>
> finds nothing.
No. We have things in Kconfig so that boards can enable what they want
without having to go and change the config.h file. We only use
select/imply for things that it's between required (if you don't have
this, your platform does not function at all) and strongly encouraged
(it should be hard to opt out of distro defaults for example because
this is what makes almost any distribution turn-key to use on a given
platform). Everything else should be something easily turned on/off in
the defconfig. Is "serial#" and in turn the serial-number property in
the device tree handy? Sure is. Has i.MX6 been going fine without it
for it's long lifespan? Yup. Is there an argument that it should be
easier to opt-out of on all the other platforms? Probably so, yes (I
think there's some cases where Linux userspace expects it for some
stuff, I want to say allwinner? Maybe Pi?).
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210204/6516b4da/attachment.sig>
More information about the U-Boot
mailing list