google/gale: Add more board ID variants
EVT1 has two board IDs. Use binary first mode of base3 encoding for board ID. BUG=chrome-os-partner:55320 TEST=None. BRANCH=None Change-Id: I1cac1f74207f42616111d39db5c0494b7d1a0fb2 Signed-off-by: Martin Roth <martinroth@chromium.org> Original-Commit-Id: 2b16cc74c4c147315b7db345678bbaf536ab4a7b Original-Change-Id: I6e95c7be4a6d28a0aae38b0838bd2ab71d288ba1 Original-Signed-off-by: Kan Yan <kyan@google.com> Original-Reviewed-on: https://chromium-review.googlesource.com/364623 Original-Reviewed-by: David Hendricks <dhendrix@chromium.org> Original-Reviewed-by: Suresh Rajashekara <sureshraj@chromium.org> Reviewed-on: https://review.coreboot.org/16030 Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins)
This commit is contained in:
parent
40d62f3db7
commit
d1a00515ff
|
@ -30,7 +30,8 @@ static uint8_t get_board_id(void)
|
||||||
uint8_t bid;
|
uint8_t bid;
|
||||||
gpio_t hw_rev_gpios[] = {[2] = 66, [1] = 65, [0] = 64}; /* 64 is LSB */
|
gpio_t hw_rev_gpios[] = {[2] = 66, [1] = 65, [0] = 64}; /* 64 is LSB */
|
||||||
|
|
||||||
bid = gpio_base3_value(hw_rev_gpios, ARRAY_SIZE(hw_rev_gpios));
|
bid = gpio_binary_first_base3_value(hw_rev_gpios,
|
||||||
|
ARRAY_SIZE(hw_rev_gpios));
|
||||||
printk(BIOS_INFO, "Board ID %d\n", bid);
|
printk(BIOS_INFO, "Board ID %d\n", bid);
|
||||||
|
|
||||||
return bid;
|
return bid;
|
||||||
|
|
|
@ -33,10 +33,12 @@
|
||||||
static int get_rec_sw_gpio_pin(void)
|
static int get_rec_sw_gpio_pin(void)
|
||||||
{
|
{
|
||||||
uint8_t board_rev = board_id();
|
uint8_t board_rev = board_id();
|
||||||
|
|
||||||
switch (board_rev) {
|
switch (board_rev) {
|
||||||
case BOARD_ID_GALE_PROTO:
|
case BOARD_ID_GALE_PROTO:
|
||||||
case BOARD_ID_GALE_EVT:
|
case BOARD_ID_GALE_EVT:
|
||||||
case BOARD_ID_GALE_EVT2:
|
case BOARD_ID_GALE_EVT2_0:
|
||||||
|
case BOARD_ID_GALE_EVT2_1:
|
||||||
return 7;
|
return 7;
|
||||||
case BOARD_ID_GALE_EVT3:
|
case BOARD_ID_GALE_EVT3:
|
||||||
default:
|
default:
|
||||||
|
@ -50,7 +52,8 @@ static int get_wp_status_gpio_pin(void)
|
||||||
switch (board_rev) {
|
switch (board_rev) {
|
||||||
case BOARD_ID_GALE_PROTO:
|
case BOARD_ID_GALE_PROTO:
|
||||||
case BOARD_ID_GALE_EVT:
|
case BOARD_ID_GALE_EVT:
|
||||||
case BOARD_ID_GALE_EVT2:
|
case BOARD_ID_GALE_EVT2_0:
|
||||||
|
case BOARD_ID_GALE_EVT2_1:
|
||||||
return 6;
|
return 6;
|
||||||
case BOARD_ID_GALE_EVT3:
|
case BOARD_ID_GALE_EVT3:
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -136,7 +136,8 @@ typedef struct {
|
||||||
enum gale_board_id {
|
enum gale_board_id {
|
||||||
BOARD_ID_GALE_PROTO = 0,
|
BOARD_ID_GALE_PROTO = 0,
|
||||||
BOARD_ID_GALE_EVT = 1,
|
BOARD_ID_GALE_EVT = 1,
|
||||||
BOARD_ID_GALE_EVT2 = 2,
|
BOARD_ID_GALE_EVT2_0 = 2,
|
||||||
|
BOARD_ID_GALE_EVT2_1 = 6,
|
||||||
BOARD_ID_GALE_EVT3 = 5,
|
BOARD_ID_GALE_EVT3 = 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue