* [U-Boot] [PATCH v2 1/1] board: am335x: Set serial# variable
@ 2018-02-27 22:26 Sam Protsenko
2018-02-27 22:31 ` Tom Rini
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Sam Protsenko @ 2018-02-27 22:26 UTC (permalink / raw)
To: u-boot
serial# variable is needed to show the device correctly in "fastboot
devices" output. It's useful when we have several devices (in fastboot
mode) connected to single host and want to choose which one to flash.
We can't use omap_die_id_serial() for this, because AM335x lacks
DIE_ID, as can be seen from AM335x TRM. Let's do next:
- reuse board_serial variable (obtained from EEPROM in
set_board_info_env() function) to set serial#
- if board_serial is "unknown", reuse ethaddr variable to set serial#
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
board/ti/am335x/board.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 1a52bffc00..6a0ff5a93e 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -767,6 +767,16 @@ int board_late_init(void)
}
#endif
+ if (!env_get("serial#")) {
+ char *board_serial = env_get("board_serial");
+ char *ethaddr = env_get("ethaddr");
+
+ if (!board_serial || !strncmp(board_serial, "unknown", 7))
+ env_set("serial#", ethaddr);
+ else
+ env_set("serial#", board_serial);
+ }
+
return 0;
}
#endif
--
2.16.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v2 1/1] board: am335x: Set serial# variable
2018-02-27 22:26 [U-Boot] [PATCH v2 1/1] board: am335x: Set serial# variable Sam Protsenko
@ 2018-02-27 22:31 ` Tom Rini
2018-03-14 19:17 ` Sam Protsenko
2018-02-28 3:44 ` Tom Rini
2018-03-16 13:50 ` [U-Boot] [U-Boot,v2,1/1] " Tom Rini
2 siblings, 1 reply; 5+ messages in thread
From: Tom Rini @ 2018-02-27 22:31 UTC (permalink / raw)
To: u-boot
On Wed, Feb 28, 2018 at 12:26:15AM +0200, Sam Protsenko wrote:
> serial# variable is needed to show the device correctly in "fastboot
> devices" output. It's useful when we have several devices (in fastboot
> mode) connected to single host and want to choose which one to flash.
>
> We can't use omap_die_id_serial() for this, because AM335x lacks
> DIE_ID, as can be seen from AM335x TRM. Let's do next:
> - reuse board_serial variable (obtained from EEPROM in
> set_board_info_env() function) to set serial#
> - if board_serial is "unknown", reuse ethaddr variable to set serial#
>
> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180227/aaea6a3e/attachment.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v2 1/1] board: am335x: Set serial# variable
2018-02-27 22:26 [U-Boot] [PATCH v2 1/1] board: am335x: Set serial# variable Sam Protsenko
2018-02-27 22:31 ` Tom Rini
@ 2018-02-28 3:44 ` Tom Rini
2018-03-16 13:50 ` [U-Boot] [U-Boot,v2,1/1] " Tom Rini
2 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2018-02-28 3:44 UTC (permalink / raw)
To: u-boot
On Wed, Feb 28, 2018 at 12:26:15AM +0200, Sam Protsenko wrote:
> serial# variable is needed to show the device correctly in "fastboot
> devices" output. It's useful when we have several devices (in fastboot
> mode) connected to single host and want to choose which one to flash.
>
> We can't use omap_die_id_serial() for this, because AM335x lacks
> DIE_ID, as can be seen from AM335x TRM. Let's do next:
> - reuse board_serial variable (obtained from EEPROM in
> set_board_info_env() function) to set serial#
> - if board_serial is "unknown", reuse ethaddr variable to set serial#
>
> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180227/be796b33/attachment.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v2 1/1] board: am335x: Set serial# variable
2018-02-27 22:31 ` Tom Rini
@ 2018-03-14 19:17 ` Sam Protsenko
0 siblings, 0 replies; 5+ messages in thread
From: Sam Protsenko @ 2018-03-14 19:17 UTC (permalink / raw)
To: u-boot
On 28 February 2018 at 00:31, Tom Rini <trini@konsulko.com> wrote:
> On Wed, Feb 28, 2018 at 12:26:15AM +0200, Sam Protsenko wrote:
>
>> serial# variable is needed to show the device correctly in "fastboot
>> devices" output. It's useful when we have several devices (in fastboot
>> mode) connected to single host and want to choose which one to flash.
>>
>> We can't use omap_die_id_serial() for this, because AM335x lacks
>> DIE_ID, as can be seen from AM335x TRM. Let's do next:
>> - reuse board_serial variable (obtained from EEPROM in
>> set_board_info_env() function) to set serial#
>> - if board_serial is "unknown", reuse ethaddr variable to set serial#
>>
>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
>
> Reviewed-by: Tom Rini <trini@konsulko.com>
>
Bump. Please merge it if it's ok.
Thanks.
> --
> Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [U-Boot,v2,1/1] board: am335x: Set serial# variable
2018-02-27 22:26 [U-Boot] [PATCH v2 1/1] board: am335x: Set serial# variable Sam Protsenko
2018-02-27 22:31 ` Tom Rini
2018-02-28 3:44 ` Tom Rini
@ 2018-03-16 13:50 ` Tom Rini
2 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2018-03-16 13:50 UTC (permalink / raw)
To: u-boot
On Wed, Feb 28, 2018 at 12:26:15AM +0200, Sam Protsenko wrote:
> serial# variable is needed to show the device correctly in "fastboot
> devices" output. It's useful when we have several devices (in fastboot
> mode) connected to single host and want to choose which one to flash.
>
> We can't use omap_die_id_serial() for this, because AM335x lacks
> DIE_ID, as can be seen from AM335x TRM. Let's do next:
> - reuse board_serial variable (obtained from EEPROM in
> set_board_info_env() function) to set serial#
> - if board_serial is "unknown", reuse ethaddr variable to set serial#
>
> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180316/713a6cfc/attachment.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-03-16 13:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-27 22:26 [U-Boot] [PATCH v2 1/1] board: am335x: Set serial# variable Sam Protsenko
2018-02-27 22:31 ` Tom Rini
2018-03-14 19:17 ` Sam Protsenko
2018-02-28 3:44 ` Tom Rini
2018-03-16 13:50 ` [U-Boot] [U-Boot,v2,1/1] " Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox