summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2019-05-08 07:34:00 -0600
committerchrome-bot <chrome-bot@chromium.org>2019-05-16 09:04:34 -0700
commit45434aed20e695e08fcbb3f74c43e03f6fa19bf2 (patch)
tree598942ce75f9d28801d011d0f68a47d59b61ae97 /include
parentf88989e7518b97c83afc93497f97e33d9d4c12f4 (diff)
downloadchrome-ec-45434aed20e695e08fcbb3f74c43e03f6fa19bf2.tar.gz
i2c: add i2clookup host command
Add a new host command that will allow you to lookup a well known device on the EC. This is useful for FAFT tests that want to talk directly with i2c devices but don't know the physical address for each platform. BRANCH=octopus BUG=b:119065537 TEST=Used this with new faft test in CL:1601300 Change-Id: I82c2d5462fcb4edbc92ea60765971190fed7ae81 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1601060 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/ec_commands.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 3cdba2477b..f4ee6d1103 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -5345,6 +5345,35 @@ struct ec_response_rollback_info {
#define EC_CMD_AP_RESET 0x0125
/*****************************************************************************/
+/* I2C lookup command
+ *
+ * Return values:
+ * EC_RES_UNAVAILABLE: Lookup type is supported but not present on system.
+ * EC_RES_INVALID_PARAM: The type was unrecognized.
+ */
+
+#define EC_CMD_I2C_LOOKUP 0x0126
+
+enum i2c_device_type {
+ I2C_LOOKUP_TYPE_CBI_EEPROM = 1,
+ I2C_LOOKUP_TYPE_COUNT,
+ I2C_LOOKUP_TYPE_MAX = 0xFFFF,
+};
+
+struct ec_params_i2c_lookup {
+ uint16_t type; /* enum i2c_device_type */
+ /* Used for type specific parameters in future */
+ union {
+ uint16_t reseved;
+ };
+} __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;
+
+/*****************************************************************************/
/* The command range 0x200-0x2FF is reserved for Rotor. */
/*****************************************************************************/