From 6d7c9acc179a072fd2c19516339f90751402bc74 Mon Sep 17 00:00:00 2001 From: Jimmy Zhang Date: Fri, 8 Aug 2014 18:11:10 -0700 Subject: t132: ryu: Correct how board id is retrieved Two changes: 1. A44 ID straps use different gpio pins than nyan. 2. A44 uses tristate values instead two state values. BUG=none BRANCH=none TEST=Built and tested on A44 board. Change-Id: I6a36f6da0c9f6168780606ba76595c7a0af8e8bf Signed-off-by: Patrick Georgi Original-Commit-Id: 2eb0cae0e3396da1eaeaa72411c4b74300138a7b Original-Change-Id: Ia2a4309d3b63b0a94d79465dd727b01fae01e1b9 Original-Signed-off-by: Jimmy Zhang Original-Reviewed-on: https://chromium-review.googlesource.com/211753 Original-Reviewed-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/8920 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/mainboard/google/rush_ryu/Kconfig | 1 + src/mainboard/google/rush_ryu/boardid.c | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/mainboard/google/rush_ryu') diff --git a/src/mainboard/google/rush_ryu/Kconfig b/src/mainboard/google/rush_ryu/Kconfig index 192b9faead..ec6eadb86b 100644 --- a/src/mainboard/google/rush_ryu/Kconfig +++ b/src/mainboard/google/rush_ryu/Kconfig @@ -31,6 +31,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy select MAINBOARD_HAS_BOOTBLOCK_INIT select BOARD_ROMSIZE_KB_4096 select VIRTUAL_DEV_SWITCH + select TERTIARY_BOARD_ID config MAINBOARD_DIR string diff --git a/src/mainboard/google/rush_ryu/boardid.c b/src/mainboard/google/rush_ryu/boardid.c index 67e55ba3fb..42a51bd0cf 100644 --- a/src/mainboard/google/rush_ryu/boardid.c +++ b/src/mainboard/google/rush_ryu/boardid.c @@ -19,6 +19,7 @@ #include #include +#include #include @@ -27,12 +28,11 @@ uint8_t board_id(void) static int id = -1; if (id < 0) { - id = gpio_get_in_value(GPIO(Q3)) << 0 | - gpio_get_in_value(GPIO(T1)) << 1 | - gpio_get_in_value(GPIO(X1)) << 2 | - gpio_get_in_value(GPIO(X4)) << 3; - printk(BIOS_SPEW, "Board ID: %#x.\n", id); - } + gpio_t gpio[] = {GPIO(Q3), GPIO(Q4)}; + + id = gpio_get_in_tristate_values(gpio, ARRAY_SIZE(gpio), 0); + printk(BIOS_SPEW, "Board TRISTATE ID: %#x.\n", id); + } return id; } -- cgit v1.2.3