Marc Jones has uploaded a new change for review. ( https://review.coreboot.org/19837 )
Change subject: google/kahlee: Add ChromeOS SMBIOS Board ID ......................................................................
google/kahlee: Add ChromeOS SMBIOS Board ID
Kahlee uses 3 GPIO(144, 140, 135) pins to identify the board revision.
Change-Id: Ia9693db6d6506af7ff40db0b3ce4cc6c1469f6ef Signed-off-by: Marc Jones marcj303@gmail.com --- M src/mainboard/google/kahlee/Kconfig M src/mainboard/google/kahlee/Makefile.inc A src/mainboard/google/kahlee/boardid.c 3 files changed, 36 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/37/19837/1
diff --git a/src/mainboard/google/kahlee/Kconfig b/src/mainboard/google/kahlee/Kconfig index 1d49972..7f56909 100644 --- a/src/mainboard/google/kahlee/Kconfig +++ b/src/mainboard/google/kahlee/Kconfig @@ -21,6 +21,8 @@ select BOARD_ROMSIZE_KB_8192 select EC_GOOGLE_CHROMEEC select EC_GOOGLE_CHROMEEC_LPC + select GFXUMA + select GOOGLE_SMBIOS_MAINBOARD_VERSION select HAVE_OPTION_TABLE select HAVE_PIRQ_TABLE select HAVE_MP_TABLE diff --git a/src/mainboard/google/kahlee/Makefile.inc b/src/mainboard/google/kahlee/Makefile.inc index f21b0b6..7aa6e4a 100644 --- a/src/mainboard/google/kahlee/Makefile.inc +++ b/src/mainboard/google/kahlee/Makefile.inc @@ -19,10 +19,12 @@ bootblock-y += OemCustomize.c
romstage-y += BiosCallOuts.c +romstage-y += boardid.c romstage-y += chromeos.c romstage-y += OemCustomize.c
ramstage-y += BiosCallOuts.c +ramstage-y += boardid.c ramstage-y += chromeos.c ramstage-y += ec.c ramstage-y += OemCustomize.c diff --git a/src/mainboard/google/kahlee/boardid.c b/src/mainboard/google/kahlee/boardid.c new file mode 100644 index 0000000..00c092c --- /dev/null +++ b/src/mainboard/google/kahlee/boardid.c @@ -0,0 +1,32 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2017 Advanced Micro Devices, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <boardid.h> +#include <console/console.h> +#include <soc/gpio.h> + +uint8_t board_id(void) +{ + static int id = -1; + + if (id < 0) { + id = gpio_get(GPIO_135) << 0 | + gpio_get(GPIO_140) << 1 | + gpio_get(GPIO_144) << 2; + printk(BIOS_SPEW, "Board ID: %#x.\n", id); + } + + return id; +}