summaryrefslogtreecommitdiff
path: root/src/mainboard/google/brya
diff options
context:
space:
mode:
authorMalik_Hsu <malik_hsu@wistron.corp-partner.google.com>2021-11-23 15:14:08 +0800
committerFelix Held <felix-coreboot@felixheld.de>2021-11-25 23:49:50 +0000
commit655fa5c39b34caa5fade7a3d69a2ef074ed01247 (patch)
tree3be0d16355c1032d7508acb1534480322b57f2b4 /src/mainboard/google/brya
parent7fd65a9791a7cc0d2655b282cb8a9b7e333ee121 (diff)
mb/google/brya/variants/primus: update gpios for power consumption
In different sku, some unused GPIO pins are processed by NC for power consumption. BUG=b:196790249 TEST=emerge-brya coreboot chromeos-bootimage and check power Signed-off-by: Malik_Hsu <malik_hsu@wistron.corp-partner.google.com> Change-Id: I753e41dec1825299e6cd437b5f67e2d957bc6148 Reviewed-on: https://review.coreboot.org/c/coreboot/+/59563 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/mainboard/google/brya')
-rw-r--r--src/mainboard/google/brya/variants/primus/variant.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mainboard/google/brya/variants/primus/variant.c b/src/mainboard/google/brya/variants/primus/variant.c
index e10648d6c3..4c2458acf7 100644
--- a/src/mainboard/google/brya/variants/primus/variant.c
+++ b/src/mainboard/google/brya/variants/primus/variant.c
@@ -5,6 +5,8 @@
#include <device/device.h>
#include <drivers/i2c/hid/chip.h>
#include <fw_config.h>
+#include <gpio.h>
+#include <soc/gpio.h>
static void devtree_update_emmc_rtd3(uint32_t board_ver)
{
@@ -27,9 +29,34 @@ static void devtree_update_audio_codec(uint32_t board_ver)
config->hid = "RTL5682";
}
+static const struct pad_config nvme_disable_pads[] = {
+ PAD_NC(GPP_B2, NONE), /* B2 : VRALERT# ==> M2_SSD_PLA_L */
+ PAD_NC(GPP_B4, NONE), /* B4 : PROC_GP3 ==> SSD_PERST_L */
+ PAD_NC(GPP_D3, NONE), /* D3 : ISH_GP3 ==> M2_SSD_PLN_L */
+ PAD_NC(GPP_D5, NONE), /* D5 : SRCCLKREQ0# ==> SSD_CLKREQ_ODL */
+ PAD_NC(GPP_D11, NONE), /* D11 : ISH_SPI_MISO ==> EN_PP3300_SSD */
+};
+
+static const struct pad_config emmc_disable_pads[] = {
+ PAD_NC(GPP_B3, NONE), /* B3 : PROC_GP2 ==> eMMC_PERST_L */
+ PAD_NC(GPP_E20, NONE), /* E20 : USB_C1_LSX_SOC_TX ==> EN_PP3300_eMMC */
+ PAD_NC(GPP_F19, NONE), /* F19 : SRCCLKREQ6# ==> EMMC_CLKREQ_ODL */
+};
+
+static void disable_unused_gpios(void)
+{
+ int emmc_detected = gpio_get(GPP_T2);
+
+ if (emmc_detected == 1)
+ gpio_configure_pads(nvme_disable_pads, ARRAY_SIZE(nvme_disable_pads));
+ else
+ gpio_configure_pads(emmc_disable_pads, ARRAY_SIZE(emmc_disable_pads));
+}
+
void variant_devtree_update(void)
{
uint32_t board_ver = board_id();
+ disable_unused_gpios();
devtree_update_emmc_rtd3(board_ver);
devtree_update_audio_codec(board_ver);
}