diff options
author | Brian J. Nemec <bnemec@chromium.org> | 2020-02-18 13:23:56 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-21 06:21:18 +0000 |
commit | 2f4c7fb74e849f67841746877da92c584cd09dfe (patch) | |
tree | ab25bb3a8eb3f7883a8ae868f506e838aa5d9045 /include/system.h | |
parent | 05b951525aa490284085cec80094a477a69dd6a6 (diff) | |
download | chrome-ec-2f4c7fb74e849f67841746877da92c584cd09dfe.tar.gz |
Servo: Adds persistent storage of MAC address
Adds a field to the persistent storage to store the
MAC address of the device. This is enabled on ServoV4
in order to store the MAC address for the integrated
ethernet port. Added a console command to set and load
this value.
BUG=b:149506580
TEST=Verified setting and loading the MAC address using:
'macaddr set 12:34:56:78:90:ab' and 'macaddr' or 'macaddr load'
Verified that MAC addresses over 19 characters long return
an error response and not update the MAC.
Verified no set serial number will return the uninitialized string.
Verified that the MAC address can be updated independently of serialno
Verified that the persist_state fields restore during firmware updates
Change-Id: I8425ce9e13322e99a4f59df444ea0dc73821aa6b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2063330
Tested-by: Brian Nemec <bnemec@chromium.org>
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Commit-Queue: Brian Nemec <bnemec@chromium.org>
Diffstat (limited to 'include/system.h')
-rw-r--r-- | include/system.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/system.h b/include/system.h index 0d785c6899..249ab58bf4 100644 --- a/include/system.h +++ b/include/system.h @@ -328,6 +328,19 @@ __override_proto const char *board_read_serial(void); */ __override_proto int board_write_serial(const char *serial); + +/** + * Optional board-level callback functions to read a unique MAC address per + * chip. Default implementation reads from flash. + */ +__override_proto const char *board_read_mac_addr(void); + +/** + * Optional board-level callback functions to write a unique MAC address per + * chip. Default implementation reads from flash. + */ +__override_proto int board_write_mac_addr(const char *mac_addr); + /* * Common bbram entries. Chips don't necessarily need to implement * all of these, error will be returned from system_get/set_bbram if |