summaryrefslogtreecommitdiff
path: root/board/cr50/scratch_reg1.h
diff options
context:
space:
mode:
authorScott <scollyer@chromium.org>2016-12-14 10:43:06 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-01-24 17:18:01 -0800
commit92cda018f88ffa10f3d5bf898c839da0c35d8337 (patch)
treec7f952ce1fca65aab6d4975cea6c369c428847e5 /board/cr50/scratch_reg1.h
parentf6a7f07dc95f91258b1d8d77178a2b648faa6fa8 (diff)
downloadchrome-ec-92cda018f88ffa10f3d5bf898c839da0c35d8337.tar.gz
cr50: Implement reading all strapping pins for board config
Previously only 1 pin DI0A1 was being read to distinguish between SPI/I2C configurations. This change adds code to support reading 4 strapping pins DIOA9|DIOA1 and DIOA12|DIOA6 and enabling the internal pullup/pulldown reistors to differentiate between weak and strong external pull up/dn restistors. An 8 bit strap config id is produced and then a config table is searched to match the config id with known configuraitons. The board properties to be used are read from the config table. BRANCH=none BUG=chrome-os-partner:59833 TEST=manual Modified the Cr50 dev board with 1M and 5k pullup/pulldown resistors and connected them to 4 GPIOs (defined as strapping pins). Tested the 12 possible external pullup/pulldown configurations and verified that the correct 5 bit value was produced for each configuration. Tested with both Reef and Gru. On Reef the strap config = 0x12 and on Gru it reads 0x2 as expected. Verfifed TPM was functional on both systems. Change-Id: I18c625a2b6b904bf4bcdaf2665ed9c3cbdafeb54 Signed-off-by: Scott <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/421580 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Tested-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'board/cr50/scratch_reg1.h')
-rw-r--r--board/cr50/scratch_reg1.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/board/cr50/scratch_reg1.h b/board/cr50/scratch_reg1.h
index 6fc8b798fc..2fb47601a8 100644
--- a/board/cr50/scratch_reg1.h
+++ b/board/cr50/scratch_reg1.h
@@ -34,4 +34,11 @@
#define BOARD_CONSOLE_UNLOCKED (1 << 7)
#define BOARD_WP_ASSERTED (1 << 8)
+/*
+ * Macro to capture all properties related to board strapping pins. This must be
+ * updated if additional strap related properties are added.
+ */
+#define BOARD_ALL_PROPERTIES (BOARD_SLAVE_CONFIG_SPI | BOARD_SLAVE_CONFIG_I2C \
+ | BOARD_USB_AP | BOARD_NEEDS_SYS_RST_PULL_UP | BOARD_USE_PLT_RESET)
+
#endif /* ! __EC_BOARD_CR50_SCRATCH_REG1_H */