summaryrefslogtreecommitdiff
path: root/src/mainboard/google
diff options
context:
space:
mode:
authorChris Wang <chriswang@ami.corp-partner.google.com>2017-12-06 18:43:46 +0800
committerPatrick Georgi <pgeorgi@google.com>2017-12-08 10:55:06 +0000
commit97ac471a7163cda6b48c477f221d788955ec1a7c (patch)
tree9913fcf096000b7b86a89d55c162e2092d396661 /src/mainboard/google
parentec10fbb90e6b4ac2b6507a13c54d47ee1d1bdc13 (diff)
downloadcoreboot-97ac471a7163cda6b48c477f221d788955ec1a7c.tar.xz
mb/google/reef: provide override GPIO table in coral
Allow overriding specific GPIOs by SKU ID. Override two GPIO settings for nasher to save the power consumption when the system in S0ix. Change as below: AVS_DMIC_CLK_A1: IGNORE -> Tx1RXDCRx0. AVS_DMIC_CLK_B1: IGNORE -> Tx1RXDCRx0. BUG=b:69025557 BRANCH=master TEST=compile/verify the power consumption change from ~150mW to ~100mW on clamshell SKU and from ~200mW to ~100mW for convertible SKU. Change-Id: I9e0674f206426fddb3947273754774b310106334 Signed-off-by: Chris Wang <chriswang@ami.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/22752 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/mainboard/google')
-rw-r--r--src/mainboard/google/reef/mainboard.c11
-rw-r--r--src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h1
-rw-r--r--src/mainboard/google/reef/variants/coral/mainboard.c32
3 files changed, 44 insertions, 0 deletions
diff --git a/src/mainboard/google/reef/mainboard.c b/src/mainboard/google/reef/mainboard.c
index 90ffe136d3..7f5a1b3857 100644
--- a/src/mainboard/google/reef/mainboard.c
+++ b/src/mainboard/google/reef/mainboard.c
@@ -29,6 +29,14 @@
#include <variant/ec.h>
#include <variant/gpio.h>
+/* override specific gpio by sku id */
+const struct pad_config __attribute__((weak))
+*variant_sku_gpio_table(size_t *num)
+{
+ *num = 0;
+ return NULL;
+}
+
static void mainboard_init(void *chip_info)
{
int boardid;
@@ -41,6 +49,9 @@ static void mainboard_init(void *chip_info)
pads = variant_gpio_table(&num);
gpio_configure_pads(pads, num);
+ pads = variant_sku_gpio_table(&num);
+ gpio_configure_pads(pads, num);
+
mainboard_ec_init();
variant_board_ec_set_skuid();
diff --git a/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h
index 0f2c37653f..8611ecd4f3 100644
--- a/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h
@@ -29,6 +29,7 @@ uint8_t sku_strapping_value(void);
const struct pad_config *variant_gpio_table(size_t *num);
const struct pad_config *variant_early_gpio_table(size_t *num);
const struct pad_config *variant_sleep_gpio_table(u8 slp_typ, size_t *num);
+const struct pad_config *variant_sku_gpio_table(size_t *num);
/* Baseboard default swizzle. Can be reused if swizzle is same. */
extern const struct lpddr4_swizzle_cfg baseboard_lpddr4_swizzle;
diff --git a/src/mainboard/google/reef/variants/coral/mainboard.c b/src/mainboard/google/reef/variants/coral/mainboard.c
index 5daf96cabd..a45afc7070 100644
--- a/src/mainboard/google/reef/variants/coral/mainboard.c
+++ b/src/mainboard/google/reef/variants/coral/mainboard.c
@@ -19,6 +19,7 @@
#include <soc/cpu.h>
#include <soc/intel/apollolake/chip.h>
#include <soc/intel/common/vbt.h>
+#include <soc/gpio.h>
enum {
SKU_0_ASTRONAUT = 0,
@@ -122,3 +123,34 @@ const char *mainboard_vbt_filename(void)
break;
}
}
+
+static const struct pad_config nasher_gpio_tables[] = {
+ /* AVS_DMIC_CLK_A1 */
+ PAD_CFG_NF_IOSSTATE(GPIO_79, NATIVE, DEEP, NF1, Tx1RXDCRx0),
+ /* AVS_DMIC_CLK_B1 */
+ PAD_CFG_NF_IOSSTATE(GPIO_80, NATIVE, DEEP, NF1, Tx1RXDCRx0),
+};
+
+const struct pad_config *variant_sku_gpio_table(size_t *num)
+{
+ int sku_id = variant_board_sku();
+ const struct pad_config *board_gpio_tables;
+
+ switch (sku_id) {
+ case SKU_160_NASHER:
+ case SKU_161_NASHER:
+ case SKU_162_NASHER:
+ case SKU_163_NASHER360:
+ case SKU_164_NASHER360:
+ case SKU_165_NASHER360:
+ case SKU_166_NASHER360:
+ *num = ARRAY_SIZE(nasher_gpio_tables);
+ board_gpio_tables = nasher_gpio_tables;
+ break;
+ default:
+ *num = 0;
+ board_gpio_tables = NULL;
+ break;
+ }
+ return board_gpio_tables;
+}