summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJimmy Zhang <jimmzhang@nvidia.com>2014-08-08 18:11:10 -0700
committerPatrick Georgi <pgeorgi@google.com>2015-03-26 00:26:51 +0100
commit6d7c9acc179a072fd2c19516339f90751402bc74 (patch)
tree83790df88862d712b4022c8b9ca2b0d73759d676 /src
parent573e21132fbe6ac3c750b59a3744766ddd750687 (diff)
downloadcoreboot-6d7c9acc179a072fd2c19516339f90751402bc74.tar.xz
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 <pgeorgi@chromium.org> Original-Commit-Id: 2eb0cae0e3396da1eaeaa72411c4b74300138a7b Original-Change-Id: Ia2a4309d3b63b0a94d79465dd727b01fae01e1b9 Original-Signed-off-by: Jimmy Zhang <jimmzhang@nvidia.com> Original-Reviewed-on: https://chromium-review.googlesource.com/211753 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/8920 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/rush_ryu/Kconfig1
-rw-r--r--src/mainboard/google/rush_ryu/boardid.c12
2 files changed, 7 insertions, 6 deletions
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 <console/console.h>
#include <soc/nvidia/tegra132/gpio.h>
+#include <stdlib.h>
#include <boardid.h>
@@ -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;
}