diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 5 | ||||
-rw-r--r-- | include/ec_commands.h | 47 |
2 files changed, 37 insertions, 15 deletions
diff --git a/include/config.h b/include/config.h index b0adce15d9..4dd4ef4e82 100644 --- a/include/config.h +++ b/include/config.h @@ -1903,6 +1903,11 @@ /* Command to issue AP reset */ #undef CONFIG_HOSTCMD_AP_RESET +#if !defined(TEST_BUILD) && !defined(TEST_FUZZ) +/* Enable EC_CMD_LOCATE_CHIP */ +#define CONFIG_HOSTCMD_LOCATE_CHIP +#endif + /* List of host commands whose debug output will be suppressed */ #undef CONFIG_SUPPRESSED_HOST_COMMANDS diff --git a/include/ec_commands.h b/include/ec_commands.h index 83de527fb0..ab5d193719 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -5176,33 +5176,50 @@ struct ec_response_rollback_info { #define EC_CMD_AP_RESET 0x0125 /*****************************************************************************/ -/* I2C lookup command +/* Locate peripheral chips * * Return values: - * EC_RES_UNAVAILABLE: Lookup type is supported but not present on system. - * EC_RES_INVALID_PARAM: The type was unrecognized. + * EC_RES_UNAVAILABLE: The chip type is supported but not found on system. + * EC_RES_INVALID_PARAM: The chip type was unrecognized. + * EC_RES_OVERFLOW: The index number exceeded the number of chip instances. */ +#define EC_CMD_LOCATE_CHIP 0x0126 -#define EC_CMD_I2C_LOOKUP 0x0126 +enum ec_chip_type { + EC_CHIP_TYPE_CBI_EEPROM = 0, + EC_CHIP_TYPE_TCPC = 1, + EC_CHIP_TYPE_COUNT, + EC_CHIP_TYPE_MAX = 0xFF, +}; + +enum ec_bus_type { + EC_BUS_TYPE_I2C = 0, + EC_BUS_TYPE_COUNT, + EC_BUS_TYPE_MAX = 0xFF, +}; -enum i2c_device_type { - I2C_LOOKUP_TYPE_CBI_EEPROM = 1, - I2C_LOOKUP_TYPE_COUNT, - I2C_LOOKUP_TYPE_MAX = 0xFFFF, +struct ec_i2c_info { + uint16_t port; /* Physical port for device */ + uint16_t addr; /* 7-bit (or 10-bit) address */ }; -struct ec_params_i2c_lookup { - uint16_t type; /* enum i2c_device_type */ +struct ec_params_locate_chip { + uint8_t type; /* enum ec_chip_type */ + uint8_t index; /* Specifies one instance of chip type */ /* Used for type specific parameters in future */ union { - uint16_t reseved; + uint16_t reserved; }; } __ec_align2; -struct ec_response_i2c_lookup { - uint16_t i2c_port; /* Physical port for device */ - uint16_t i2c_addr; /* 7-bit (or 10-bit) address */ -} __ec_align1; + +struct ec_response_locate_chip { + uint8_t bus_type; /* enum ec_bus_type */ + uint8_t reserved; /* Aligning the following union to 2 bytes */ + union { + struct ec_i2c_info i2c_info; + }; +} __ec_align2; /*****************************************************************************/ /* The command range 0x200-0x2FF is reserved for Rotor. */ |