[PING][PATCH] Optionally: Set the serial# environment variable on the i.MX7.
Mark G
mark at novtech.com
Wed May 20 03:58:17 CEST 2020
On Mon, 11 May 2020, Stefano Babic wrote:
> patch was hidden in the flood of other patches and I am unsure if this
> belongs to i.MX:
No worries. To clarify the patch applies to all i.MX7 boards.
> On 19.02.20 22:01, Mark G wrote:
>> + Linux kernel will use this as the serial number of the machine.
>> +
>
> I do not see the need of *another* CONFIG_ option. To make this
> available, CONFIG_SERIAL_TAG should also be on, else you cannot call
> get_board_serial() to get the serial from OCOTP. It think SET_SERIAL_ENV
> is quite superflous.
The intent here is to pass in the serial number via the environemnt
(i.e. when not using ATAGS). My patch changes the preprocessor machinery
so that get_board_serial() is callable if this option is set.
This then lets fdt_root() put it in the FDT passed to the kernel. It also
means that it's easily changed for testing by being in the environment.
The origins of this patch were for a customer switching to the Meerkat96
board that utilized the CPU serial number in Linux for provisioning and
testing.
> If this should be done global, local solution should be moved too. I
> mean the warp board doing exactly this in board code.
Ah. To be fair I never looked at the port for the Warp7 board as I do not
have one. This really should be done globally; there isn't anything board
specific for this behavior. It should apply to all i.MX7 boards, at a
minimum.
Well - to clarify in theory there is nothing board specific. Could there
be a board out there with an EEPROM that contains a different serial
number that a customer would want to pass to the kernel? Possibly but
unlikely.
> So which is the idea of this ? To move warp code and making global, or
> what ?
I would say this behavior should be global but the Warp7 port seems to add
a board specific prefix to the CPU serial number. So I am hesitant to
remove it. If you like I can #ifdef around it.
Additionally the Warp7 code isn't quite the same as it relies on ATAGS
being enabled where as my patch does not.
Sincerely,
Mark G.
More information about the U-Boot
mailing list