summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYH Lin <yueherngl@google.com>2019-02-22 19:25:02 -0800
committerPatrick Georgi <pgeorgi@google.com>2019-02-26 11:18:40 +0000
commit967edec25463fada1634e8ccee0e847ae49141e2 (patch)
treed1fc7b7620dc4670c045f6cae366ed93c76eb981 /src
parent6220f8d8338a17b0af5dde5d99d890fba7660cfe (diff)
downloadcoreboot-967edec25463fada1634e8ccee0e847ae49141e2.tar.xz
flapjack: get sku_id from ec (cbi)
On flapjack, retrieve the board information via CBI interface. Also reserving 0x2 sku_id for the case of un-provisioned board as this is the id used prior to the readiness of cbi. BUG=b:123676982 BRANCH=kukui TEST=provisioned cbi info and verify the sku_id. Signed-off-by: YH Lin <yueherngl@google.com> Change-Id: Iad7a52df38e2045abbdded8ba0a1f1544de961fc Reviewed-on: https://review.coreboot.org/c/31586 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/kukui/boardid.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mainboard/google/kukui/boardid.c b/src/mainboard/google/kukui/boardid.c
index 2420e78f4f..2af93c8a0a 100644
--- a/src/mainboard/google/kukui/boardid.c
+++ b/src/mainboard/google/kukui/boardid.c
@@ -16,8 +16,11 @@
#include <assert.h>
#include <boardid.h>
#include <soc/auxadc.h>
+#include <ec/google/chromeec/ec.h>
#include <stddef.h>
+#define FLAPJACK_UNDEF_SKU_ID 2 /* For all un-provisioned Flapjack boards */
+
static uint32_t get_index(unsigned int channel, uint32_t *cached_id)
{
static const int voltages[] = {
@@ -64,6 +67,14 @@ uint32_t sku_id(void)
{
static uint32_t cached_sku_id = BOARD_ID_INIT;
+ /* On Flapjack, getting the SKU via CBI */
+ if (IS_ENABLED(CONFIG_BOARD_GOOGLE_FLAPJACK)) {
+ if (cached_sku_id == BOARD_ID_INIT &&
+ google_chromeec_cbi_get_sku_id(&cached_sku_id))
+ cached_sku_id = FLAPJACK_UNDEF_SKU_ID;
+ return cached_sku_id;
+ }
+
/* Quirk for KUKUI: All P1/SKU0 had incorrectly set SKU=1. */
if (IS_ENABLED(CONFIG_BOARD_GOOGLE_KUKUI)) {
if (cached_sku_id == BOARD_ID_INIT && board_id() == 1) {