[coreboot-gerrit] New patch to review for coreboot: 350d32e Restore name of the function reading tertiary GPIO states

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Tue Mar 24 23:03:43 CET 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8979

-gerrit

commit 350d32e2d387d98a9e7d1e38e872a8875eae308b
Author: Vadim Bendebury <vbendeb at chromium.org>
Date:   Thu Aug 7 12:02:26 2014 -0700

    Restore name of the function reading tertiary GPIO states
    
    The name was changed due to review comments misunderstanding, it
    should be restored to properly convey what the function does.
    
    BUG=chrome-os-partner:30489
    TEST=verified that Storm still properly reports board ID
    
    Change-Id: Iba33cf837e137424bfac970b0c9764d26786be9c
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
    Original-Commit-Id: c0fff28c6ebf255cb9cf9dfe4c961d7a25bb13ff
    Original-Change-Id: I4bd63f29afbfaf9f3e3e78602564eb52f63cc487
    Original-Signed-off-by: Vadim Bendebury <vbendeb at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/211413
    Original-Reviewed-by: Aaron Durbin <adurbin at chromium.org>
---
 src/include/gpiolib.h                     | 2 +-
 src/lib/tristate_gpios.c                  | 2 +-
 src/mainboard/google/nyan_big/boardid.c   | 2 +-
 src/mainboard/google/nyan_blaze/boardid.c | 2 +-
 src/mainboard/google/storm/boardid.c      | 8 +++++---
 5 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/include/gpiolib.h b/src/include/gpiolib.h
index daec3b6..850a661 100644
--- a/src/include/gpiolib.h
+++ b/src/include/gpiolib.h
@@ -32,7 +32,7 @@ typedef unsigned gpio_t;
  * included multiplied by 3^gpio_num, resulting in a true tertiary value.
  *
  */
-int gpio_board_id(gpio_t gpio[], int num_gpio, int tertiary);
+int gpio_get_in_tristate_values(gpio_t gpio[], int num_gpio, int tertiary);
 
 /*
  * The following functions are not provided by the common library, but must be
diff --git a/src/lib/tristate_gpios.c b/src/lib/tristate_gpios.c
index b1ebbc0..49f060c 100644
--- a/src/lib/tristate_gpios.c
+++ b/src/lib/tristate_gpios.c
@@ -20,7 +20,7 @@
 #include <delay.h>
 #include <gpiolib.h>
 
-int gpio_board_id(gpio_t gpio[], int num_gpio, int tertiary)
+int gpio_get_in_tristate_values(gpio_t gpio[], int num_gpio, int tertiary)
 {
 	/*
 	 * GPIOs which are tied to stronger external pull up or pull down
diff --git a/src/mainboard/google/nyan_big/boardid.c b/src/mainboard/google/nyan_big/boardid.c
index c79af45..3a22ded 100644
--- a/src/mainboard/google/nyan_big/boardid.c
+++ b/src/mainboard/google/nyan_big/boardid.c
@@ -30,7 +30,7 @@ uint8_t board_id(void)
 	if (id < 0) {
 		gpio_t gpio[] = {GPIO(Q3), GPIO(T1), GPIO(X1), GPIO(X4)};
 
-		id = gpio_board_id(gpio, ARRAY_SIZE(gpio), 0);
+		id = gpio_get_in_tristate_values(gpio, ARRAY_SIZE(gpio), 0);
 
 		printk(BIOS_SPEW, "Board TRISTATE ID: %#x.\n", id);
 	}
diff --git a/src/mainboard/google/nyan_blaze/boardid.c b/src/mainboard/google/nyan_blaze/boardid.c
index c79af45..3a22ded 100644
--- a/src/mainboard/google/nyan_blaze/boardid.c
+++ b/src/mainboard/google/nyan_blaze/boardid.c
@@ -30,7 +30,7 @@ uint8_t board_id(void)
 	if (id < 0) {
 		gpio_t gpio[] = {GPIO(Q3), GPIO(T1), GPIO(X1), GPIO(X4)};
 
-		id = gpio_board_id(gpio, ARRAY_SIZE(gpio), 0);
+		id = gpio_get_in_tristate_values(gpio, ARRAY_SIZE(gpio), 0);
 
 		printk(BIOS_SPEW, "Board TRISTATE ID: %#x.\n", id);
 	}
diff --git a/src/mainboard/google/storm/boardid.c b/src/mainboard/google/storm/boardid.c
index 7cbb92a..c4a1af3 100644
--- a/src/mainboard/google/storm/boardid.c
+++ b/src/mainboard/google/storm/boardid.c
@@ -25,8 +25,9 @@
 /*
  * Storm boards dedicate to the board ID three GPIOs in tertiary mode: 29, 30
  * and 68. On proto0 GPIO68 is used and tied low, so it reads as 'zero' by
- * gpio_board_id(), whereas the other two pins are not connected and read as
- * 'two'. This results in gpio_board_id() returning 8 on proto0.
+ * gpio_get_in_tristate_values(), whereas the other two pins are not connected
+ * and read as 'two'. This results in gpio_get_in_tristate_values() returning
+ * 8 on proto0.
  *
  * Three tertitiary signals could represent 27 different values. To make
  * calculated board ID value continuous and starting at zero, offset the
@@ -42,7 +43,8 @@ uint8_t board_id(void)
 	gpio_t hw_rev_gpios[] = {68, 30, 29};
 	int offset = 19;
 
-	bid = gpio_board_id(hw_rev_gpios, ARRAY_SIZE(hw_rev_gpios), 1);
+	bid = gpio_get_in_tristate_values(hw_rev_gpios,
+					  ARRAY_SIZE(hw_rev_gpios), 1);
 	bid = (bid + offset) % 27;
 	printk(BIOS_INFO, "Board ID %d\n", bid);
 



More information about the coreboot-gerrit mailing list