projects
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b86b135
)
xilinx: board: Fix xilinx_eeprom_legacy_cleanup()
author
Michal Simek
<michal.simek@amd.com>
Tue, 24 Jan 2023 15:19:27 +0000
(16:19 +0100)
committer
Michal Simek
<michal.simek@amd.com>
Fri, 27 Jan 2023 07:48:32 +0000
(08:48 +0100)
When ethernet mac address contains 0x20 or 0xff MAC address is changed and
bytes are converted to zeros. That's why fix decoding algorithm to ignore
fields where MAC address is stored and all non printable chars (including
space) are zeroed.
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link:
https://lore.kernel.org/r/2802cf1086b14c181356810006fe886f950a36f3.1674573561.git.michal.simek@amd.com
board/xilinx/common/board.c
patch
|
blob
|
history
diff --git
a/board/xilinx/common/board.c
b/board/xilinx/common/board.c
index 6cdb0004f5c99ab43fecec3c12a75bf28240d0aa..ed393f737731b29de0f04d29f86ff51fc4078c60 100644
(file)
--- a/
board/xilinx/common/board.c
+++ b/
board/xilinx/common/board.c
@@
-102,9
+102,13
@@
static void xilinx_eeprom_legacy_cleanup(char *eeprom, int size)
for (i = 0; i < size; i++) {
byte = eeprom[i];
- /* Remove all ffs and spaces */
- if (byte == 0xff || byte == ' ')
+ /* Remove all non printable chars but ignore MAC address */
+ if ((i < offsetof(struct xilinx_legacy_format, eth_mac) ||
+ i >= offsetof(struct xilinx_legacy_format, unused1)) &&
+ (byte < '!' || byte > '~')) {
eeprom[i] = 0;
+ continue;
+ }
/* Convert strings to lower case */
if (byte >= 'A' && byte <= 'Z')