diff options
| author | Heinrich Schuchardt <[email protected]> | 2023-09-30 14:01:44 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-10-16 10:22:11 -0400 |
| commit | dd1118227ea69b66bb8c0a415182caa96240b1f8 (patch) | |
| tree | 8b19c3085ccf0ef1a20b0194762606e561c73e22 /board/sifive | |
| parent | f5e921e948149bdf7c5bb6b97647bc4712d5993a (diff) | |
eeprom: SiFive Unmatched: re-implement mac command
The different implementations of the mac command have board or vendor
specific sub-commands.
Add the command definition specific to the SiFive HiFive Unmatched board.
Don't call cmd_usage() directly but return CMD_RET_USAGE instead.
Signed-off-by: Heinrich Schuchardt <[email protected]>
Diffstat (limited to 'board/sifive')
| -rw-r--r-- | board/sifive/unmatched/hifive-platform-i2c-eeprom.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/board/sifive/unmatched/hifive-platform-i2c-eeprom.c b/board/sifive/unmatched/hifive-platform-i2c-eeprom.c index 2b985b9b228..3c7ba4e0d3f 100644 --- a/board/sifive/unmatched/hifive-platform-i2c-eeprom.c +++ b/board/sifive/unmatched/hifive-platform-i2c-eeprom.c @@ -426,7 +426,7 @@ int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) } if (argc > 3) - return cmd_usage(cmdtp); + return CMD_RET_USAGE; cmd = argv[1]; @@ -443,7 +443,7 @@ int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) } if (argc != 3) - return cmd_usage(cmdtp); + return CMD_RET_USAGE; if (!is_match_magic()) { printf("Please read the EEPROM ('read_eeprom') and/or initialize the EEPROM ('initialize') first.\n"); @@ -470,7 +470,7 @@ int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return 0; } - return cmd_usage(cmdtp); + return CMD_RET_USAGE; } /** @@ -551,3 +551,27 @@ u8 get_pcb_revision_from_eeprom(void) return be.pcb_revision; } + +#ifndef CONFIG_SPL_BUILD + +#ifdef CONFIG_SYS_LONGHELP +static char booti_help_text[] = + "- displays memory copy of EEPROM\n" + "mac read_eeprom - reads EEPROM into memory\n" + "mac initialize - initializes memory copy with magic number\n" + "mac write_eeprom - writes the EEPROM from memory\n" + "mac manuf_test_status [unknown|pass|fail] - sets test status in memory\n" + "mac_address <addr> - sets MAC address in memory\n" + "mac pcb_revision <rev> - sets PCB revision in memory\n" + "mac bom_variant <var> - sets BOM variant in memory\n" + "mac bom_revision <rev> - sets BOM revision in memory\n"; +#else + ""; +#endif + +U_BOOT_CMD( + mac, 3, 1, do_mac, + "display and program the board revision and MAC address in EEPROM", + booti_help_text); + +#endif /* CONFIG_SPL_BUILD */ |
