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/flash.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/flash.h')
-rw-r--r-- | include/flash.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/flash.h b/include/flash.h index cceac81df1..700a663a9a 100644 --- a/include/flash.h +++ b/include/flash.h @@ -344,6 +344,25 @@ const char *flash_read_pstate_serial(void); int flash_write_pstate_serial(const char *serialno); /** + * Get the MAC address from flash. + * + * @return char * ascii MAC address string. + * Format: "01:23:45:67:89:AB" + * NULL if error. + */ +const char *flash_read_pstate_mac_addr(void); + +/** + * Set the MAC address in flash. + * + * @param mac_addr ascii MAC address string. + * Format: "01:23:45:67:89:AB" + * + * @return success status. + */ +int flash_write_pstate_mac_addr(const char *mac_addr); + +/** * Lock or unlock HW necessary for mapped storage read. * * @param lock 1 to lock, 0 to unlock. |