From 7de7f9ab4422b0c137e73e19da9b31124074cb78 Mon Sep 17 00:00:00 2001 From: Seunghwan Kim Date: Mon, 18 Sep 2023 13:22:05 +0900 Subject: mb/google/nissa/var/pirrha: Turn off SD card power signal in s0ix Turn off GPP_H13 (EN_PP3300_SD_X) in s0ix for power saving. It reduces about 3mW of power consumption in s0ix on pirrha proto board. BUG=b:300845527 TEST=Built and verified GPP_H13 voltage was 0V in s0ix. Also verified SD card worked after s0ix for 20 times. Change-Id: I5ec53820276e50f5b8b01584595118cf2dc4c95c Signed-off-by: Seunghwan Kim Reviewed-on: https://review.coreboot.org/c/coreboot/+/77998 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Derek Huang Reviewed-by: Eric Lai --- src/mainboard/google/brya/variants/pirrha/Makefile.inc | 1 + .../google/brya/variants/pirrha/include/variant/gpio.h | 2 ++ src/mainboard/google/brya/variants/pirrha/variant.c | 16 ++++++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 src/mainboard/google/brya/variants/pirrha/variant.c (limited to 'src/mainboard') diff --git a/src/mainboard/google/brya/variants/pirrha/Makefile.inc b/src/mainboard/google/brya/variants/pirrha/Makefile.inc index bc560b8f1d..c74104c60e 100644 --- a/src/mainboard/google/brya/variants/pirrha/Makefile.inc +++ b/src/mainboard/google/brya/variants/pirrha/Makefile.inc @@ -4,4 +4,5 @@ bootblock-y += gpio.c romstage-y += memory.c ramstage-$(CONFIG_FW_CONFIG) += fw_config.c +ramstage-$(CONFIG_FW_CONFIG) += variant.c ramstage-y += gpio.c diff --git a/src/mainboard/google/brya/variants/pirrha/include/variant/gpio.h b/src/mainboard/google/brya/variants/pirrha/include/variant/gpio.h index c4fe342621..b98b09d2e2 100644 --- a/src/mainboard/google/brya/variants/pirrha/include/variant/gpio.h +++ b/src/mainboard/google/brya/variants/pirrha/include/variant/gpio.h @@ -5,4 +5,6 @@ #include +#define SD_CARD_POWER GPP_H13 + #endif diff --git a/src/mainboard/google/brya/variants/pirrha/variant.c b/src/mainboard/google/brya/variants/pirrha/variant.c new file mode 100644 index 0000000000..1b8c263bd6 --- /dev/null +++ b/src/mainboard/google/brya/variants/pirrha/variant.c @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include + +void variant_generate_s0ix_hook(enum s0ix_entry entry) +{ + return; + + if (entry == S0IX_ENTRY) + acpigen_soc_clear_tx_gpio(SD_CARD_POWER); + else if (entry == S0IX_EXIT) + acpigen_soc_set_tx_gpio(SD_CARD_POWER); +} -- cgit v1.2.3