22 May, 2017

1 commit

  • This converts the following to Kconfig:
    CONFIG_CMD_EEPROM
    CONFIG_CMD_EEPROM_LAYOUT
    CONFIG_EEPROM_LAYOUT_HELP_STRING

    Signed-off-by: Simon Glass
    Reviewed-by: Tom Rini
    [trini: Rework Kconfig logic slightly, define EEPROM location on TI eval
    platforms]
    Signed-off-by: Tom Rini

    Simon Glass
     

15 May, 2017

1 commit


21 May, 2016

5 commits

  • Merge the parsing of layout aware and layout unaware eeprom commands into
    one parsing function. With this change, layout aware commands now follow
    the eeprom read and eeprom write conventions of making i2c bus and i2c address
    parameters optional.

    Cc: Heiko Schocher
    Cc: Marek Vasut
    Cc: Simon Glass
    Cc: Igor Grinberg
    Cc: Tom Rini
    Signed-off-by: Nikita Kiryanov

    Nikita Kiryanov
     
  • Update eeprom_execute_command() and related code to accommodate both layout
    aware and layout unaware functions.

    No functional changes.

    Cc: Heiko Schocher
    Cc: Marek Vasut
    Cc: Simon Glass
    Cc: Igor Grinberg
    Cc: Tom Rini
    Signed-off-by: Nikita Kiryanov
    [trini: Make eeprom_execute_command have ulong for i2c_addr]
    Signed-off-by: Tom Rini

    Nikita Kiryanov
     
  • Introduce parse_i2c_bus_addr() to generalize the parsing of i2c bus number and
    i2c device address. This is done in preparation for merging layout aware and
    layout unaware command parsing into one function.

    No functional changes.

    Cc: Heiko Schocher
    Cc: Marek Vasut
    Cc: Simon Glass
    Cc: Igor Grinberg
    Cc: Tom Rini
    Signed-off-by: Nikita Kiryanov

    Nikita Kiryanov
     
  • Introduce the (optional) eeprom print and eeprom update commands.

    These commands are eeprom layout aware:
    * The eeprom print command prints the contents of the eeprom in a human
    readable way (eeprom layout fields, and data formatted to be fit for human
    consumption).
    * The eeprom update command 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.

    New CONFIG options:
    CONFIG_CMD_EEPROM_LAYOUT - enables commands.
    CONFIG_EEPROM_LAYOUT_HELP_STRING - tells user what layout names are supported

    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.

    Cc: Heiko Schocher
    Cc: Marek Vasut
    Cc: Simon Glass
    Cc: Igor Grinberg
    Cc: Tom Rini
    Signed-off-by: Nikita Kiryanov

    Nikita Kiryanov
     
  • The i2c_init function is always provided when CONFIG_SYS_I2C is
    defined. No need to limit ourselves to just one supported I2C driver
    (soft_i2c). Update the #ifdef conditions to support bus switching for
    all I2C drivers.

    Cc: Heiko Schocher
    Cc: Marek Vasut
    Cc: Igor Grinberg
    Cc: Tom Rini
    Signed-off-by: Nikita Kiryanov

    Nikita Kiryanov
     

03 May, 2016

1 commit

  • I2C_RXTX_LEN from include/i2c.h is not defined if CONFIG_DM_I2C is
    enabled. This leads to a compilation error on boards that enable both
    CONFIG_CMD_EEPROM and CONFIG_DM_I2C.

    To avoid this, we define I2C_RXTX_LEN in cmd/eeprom.c if it is not
    already defined.

    Signed-off-by: Mario Six

    Mario Six
     

25 Jan, 2016

1 commit

  • Now that they are in their own directory, we can remove this prefix.
    This makes it easier to find a file since the prefix does not get in the
    way.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng
    Reviewed-by: Heiko Schocher
    Acked-by: Stefan Roese
    Acked-by: Przemyslaw Marczak

    Simon Glass