summaryrefslogtreecommitdiff
path: root/include/system.h
diff options
context:
space:
mode:
authorScott <scollyer@chromium.org>2016-07-21 11:08:11 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-08-03 19:40:55 -0700
commitd67f3aa1f60ff9abd4f03c58a103ab4eecf99e7f (patch)
tree3269a2071be1819469005dacd61a96bf19b7c276 /include/system.h
parent96e05799536c264b63d11604429ed760a4e019d2 (diff)
downloadchrome-ec-d67f3aa1f60ff9abd4f03c58a103ab4eecf99e7f.tar.gz
Cr50: Sample slave configuration pins at POR
There is just one version of Cr50 firmware for all boards that it's used on. However, on some boards the AP communicates to the TPM via a SPI interface (i.e. Kevin) and on others, the AP communicates via an I2C interface (i.e. Reef). In order to dynamically discover which interface to configure, there are strapping resistors added to the board which enables the Cr50 to detect which configuration to implement. This CL is a first pass and is only looking at DIOA1 which is pulled high for SPI and pulled low for I2C configurations. The strapping resistor should be read when the AP is in reset prior to it attempting to drive any of the lines used for strapping. To ensure this condition is met, Cr50 will only check the strapping options following a POR (power on reset). Once the configuration type is discovered, a 'long_life' register is used to hold the result so that the result can always be available. The long_life register contents remain unchanged until a subsequent power down event. BRANCH=none BUG=chrome-os-partner:50728 TEST=manual Tested on Kevin and Reef. Verfifed by reading the stored value that the SPI configuraiton is detected for Kevin and the I2C interface is detected on Reef. In addition, verified on Kevin that the Cr50 FW version is correctly reported to the AP which means that TPM register reads via the slave SPI are functioning. Change-Id: Ibd7624ad8e3b4126f6346dce0bc72f62a3cc6d18 Signed-off-by: Scott <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/363014 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'include/system.h')
-rw-r--r--include/system.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/system.h b/include/system.h
index 8d792123ff..60ec6b1072 100644
--- a/include/system.h
+++ b/include/system.h
@@ -466,4 +466,24 @@ int system_is_reboot_warm(void);
*/
int system_process_retry_counter(void);
+/* Board properties options */
+#define BOARD_SLAVE_CONFIG_SPI (1 << 0) /* Slave SPI interface */
+#define BOARD_SLAVE_CONFIG_I2C (1 << 1) /* Slave I2C interface */
+/**
+ * Get board properites
+ *
+ *
+ * @return uint32_t bit field where a set bit indicates option exists
+ */
+uint32_t system_get_board_properties(void);
+
+/**
+ * API for board specific version of system_get_board_properties
+ *
+ * This function must be in the board's board.c file
+ *
+ * @return uint32_t bit field where a set bit indicates option exists
+ */
+uint32_t system_board_properties_callback(void);
+
#endif /* __CROS_EC_SYSTEM_H */