]> git.baikalelectronics.ru Git - uboot.git/commit
board: turris: Initialize serial# env
authorPali Rohár <pali@kernel.org>
Sat, 27 Aug 2022 18:06:30 +0000 (20:06 +0200)
committerStefan Roese <sr@denx.de>
Tue, 13 Sep 2022 04:38:08 +0000 (06:38 +0200)
commit4cc06d12877eb9dfa8873cacbef168206628d397
treeba702d085f8ef74b4cfa869070c13580ec08a155
parentd45d2a209a840e4ea590346a4fb53417379d8207
board: turris: Initialize serial# env

Store serial number from atsha cryptochip into the serial# env variable.
U-Boot automatically puts content of this variable into the root device
tree property serial-number when booting Linux kernel. Refactor turris
atsha code and from turris_atsha_otp_get_serial_number() function returns
directly string suitable for printing or storing into device tree. Because
during different boot stages is env storage read-only, it is not possible
to always store serial number into env storage. So introduce a new function
turris_atsha_otp_init_serial_number() which is called at later stage and
which ensures that serial number is correctly stored into env.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
board/CZ.NIC/turris_atsha_otp.c
board/CZ.NIC/turris_atsha_otp.h
board/CZ.NIC/turris_omnia/turris_omnia.c