mb/google/octopus: Add two new sku IDs for foob

Declare these sku IDs:
    -SKU: 1 Foob, 1-cam, no touch, no pen.
    -SKU: 9 Foob360, 2-cam, touch, pen.

BUG=b:145837644
BRANCH=octopus
TEST=emerge-octopus coreboot

Signed-off-by: tong.lin <tong.lin@bitland.corp-partner.google.com>
Change-Id: Iffcbb3f6f945ea299ff687a383a82b88dcd11ea1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37906
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marco Chen <marcochen@google.com>
This commit is contained in:
Tommie 2019-12-23 13:33:34 +08:00 committed by Patrick Georgi
parent 086f0faf75
commit 325fd3462e
3 changed files with 80 additions and 3 deletions

View File

@ -1,3 +1,3 @@
bootblock-y += gpio.c
ramstage-y += gpio.c
ramstage-y += variant.c

View File

@ -20,6 +20,8 @@
#include <soc/gpio.h>
#include <ec/google/chromeec/ec.h>
#define SKU_UNKNOWN 0xFFFFFFFF
static const struct pad_config default_override_table[] = {
PAD_NC(GPIO_52, UP_20K),
PAD_NC(GPIO_53, UP_20K),
@ -37,8 +39,47 @@ static const struct pad_config default_override_table[] = {
PAD_NC(GPIO_214, DN_20K),
};
static const struct pad_config non_touchscreen_override_table[] = {
/* disable I2C7 SCL and SDA */
PAD_NC(GPIO_114, UP_20K), /* LPSS_I2C7_SDA */
PAD_NC(GPIO_115, UP_20K), /* LPSS_I2C7_SCL */
PAD_NC(GPIO_52, UP_20K),
PAD_NC(GPIO_53, UP_20K),
PAD_NC(GPIO_67, UP_20K),
PAD_NC(GPIO_117, UP_20K),
PAD_NC(GPIO_143, UP_20K),
/* EN_PP3300_TOUCHSCREEN */
PAD_NC(GPIO_146, UP_20K),
PAD_NC(GPIO_161, DN_20K),
PAD_NC(GPIO_213, DN_20K),
PAD_NC(GPIO_214, DN_20K),
};
bool no_touchscreen_sku(uint32_t sku_id)
{
if (sku_id != 9)
return true;
else
return false;
}
const struct pad_config *variant_override_gpio_table(size_t *num)
{
*num = ARRAY_SIZE(default_override_table);
return default_override_table;
const struct pad_config *c;
uint32_t sku_id = SKU_UNKNOWN;
sku_id = get_board_sku();
if (no_touchscreen_sku(sku_id)) {
c = non_touchscreen_override_table;
*num = ARRAY_SIZE(non_touchscreen_override_table);
} else {
c = default_override_table;
*num = ARRAY_SIZE(default_override_table);
}
return c;
}

View File

@ -0,0 +1,36 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2019 Google LLC
*
* 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 <baseboard/variants.h>
#include <soc/pci_devs.h>
#include <ec/google/chromeec/ec.h>
#define SKU_UNKNOWN 0xFFFFFFFF
void variant_update_devtree(struct device *dev)
{
uint32_t sku_id = SKU_UNKNOWN;
struct device *touchscreen_i2c_host;
touchscreen_i2c_host = pcidev_path_on_root(PCH_DEVFN_I2C7);
if (touchscreen_i2c_host == NULL)
return;
/* SKU ID 1 does not have a touchscreen device, hence disable it. */
sku_id = get_board_sku();
if (no_touchscreen_sku(sku_id))
touchscreen_i2c_host->enabled = 0;
}