diff options
author | Simon Glass <sjg@chromium.org> | 2017-05-17 03:25:10 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-05-22 09:33:49 -0400 |
commit | a1dc980d88a5c9c2b99251c8d8299b0c8948de73 (patch) | |
tree | a869d56e760ac361f08e226b7eeba01bf01785aa /cmd | |
parent | d96e8985f60ba61150b1b67b2b1ba1a540b40ca9 (diff) | |
download | u-boot-a1dc980d88a5c9c2b99251c8d8299b0c8948de73.tar.gz |
Convert CONFIG_CMD_EEPROM et al to Kconfig
This converts the following to Kconfig:
CONFIG_CMD_EEPROM
CONFIG_CMD_EEPROM_LAYOUT
CONFIG_EEPROM_LAYOUT_HELP_STRING
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Rework Kconfig logic slightly, define EEPROM location on TI eval
platforms]
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/Kconfig | 48 | ||||
-rw-r--r-- | cmd/eeprom.c | 4 |
2 files changed, 48 insertions, 4 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig index d9f7151bac..6b9feff94c 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -338,6 +338,54 @@ config CMD_CRC32 help Compute CRC32. +config CMD_EEPROM + bool "eeprom - EEPROM subsystem" + help + (deprecated, needs conversion to driver model) + Provides commands to read and write EEPROM (Electrically Erasable + Programmable Read Only Memory) chips that are connected over an + I2C bus. + +config CMD_EEPROM_LAYOUT + bool "Enable layout-aware eeprom commands" + depends on CMD_EEPROM + help + (deprecated, needs conversion to driver model) + When enabled, additional eeprom sub-commands become available. + + eeprom print - prints the contents of the eeprom in a human-readable + way (eeprom layout fields, and data formatted to be fit for human + consumption). + + eeprom update - allows user to update eeprom fields by specifying + the field name, and providing the new data in a human readable format + (same format as displayed by the eeprom print command). + + Both commands can either auto detect the layout, or be told which + layout to use. + + Feature API: + __weak int parse_layout_version(char *str) + - override to provide your own layout name parsing + __weak void __eeprom_layout_assign(struct eeprom_layout *layout, + int layout_version); + - override to setup the layout metadata based on the version + __weak int eeprom_layout_detect(unsigned char *data) + - override to provide your own algorithm for detecting layout + version + eeprom_field.c + - contains various printing and updating functions for common + types of eeprom fields. Can be used for defining + custom layouts. + +config EEPROM_LAYOUT_HELP_STRING + string "Tells user what layout names are supported" + depends on CMD_EEPROM_LAYOUT + default "<not defined>" + help + Help printed with the LAYOUT VERSIONS part of the 'eeprom' + command's help. + config CMD_MD5SUM bool "md5sum" default n diff --git a/cmd/eeprom.c b/cmd/eeprom.c index e43566bc56..c61b396a62 100644 --- a/cmd/eeprom.c +++ b/cmd/eeprom.c @@ -265,10 +265,6 @@ __weak int eeprom_parse_layout_version(char *str) static unsigned char eeprom_buf[CONFIG_SYS_EEPROM_SIZE]; -#ifndef CONFIG_EEPROM_LAYOUT_HELP_STRING -#define CONFIG_EEPROM_LAYOUT_HELP_STRING "<not defined>" -#endif - #endif enum eeprom_action { |