From 74e2c980305e90ff61b30b7cca37670669c3a57d Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Wed, 14 Apr 2021 14:25:49 -0600 Subject: mb/google/guybrush/var/guybrush: Add GPIO override table EN_SPKR is routed to SD pin in the ALC1019 speaker amplifier. The concerned pin has a voltage rating of 1.8V whereas the EN_SPKR GPIO has a voltage rating of 3.3 V. The schematics has been updated to bridge the gap. So enable the speaker amplifier by default and add a gpio override table to disable the speakers before board version 2. Also update the codec ACPI HID name for the kernel machine driver to probe the codec successfully. BUG=b:182960979 TEST=Build and boot to OS in guybrush. Ensure that the GPIO output state is high. Change-Id: I32b29bfae9bc94b5119b33a535d8bc825ef89445 Signed-off-by: Karthikeyan Ramasubramanian Reviewed-on: https://review.coreboot.org/c/coreboot/+/52355 Reviewed-by: Furquan Shaikh Reviewed-by: Mathew King Tested-by: build bot (Jenkins) --- .../google/guybrush/variants/baseboard/gpio.c | 2 +- .../google/guybrush/variants/guybrush/Makefile.inc | 2 ++ .../google/guybrush/variants/guybrush/gpio.c | 26 ++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/mainboard/google/guybrush/variants/guybrush/gpio.c (limited to 'src/mainboard/google/guybrush') diff --git a/src/mainboard/google/guybrush/variants/baseboard/gpio.c b/src/mainboard/google/guybrush/variants/baseboard/gpio.c index 4023b2908b..528ace1653 100644 --- a/src/mainboard/google/guybrush/variants/baseboard/gpio.c +++ b/src/mainboard/google/guybrush/variants/baseboard/gpio.c @@ -80,7 +80,7 @@ static const struct soc_amd_gpio base_gpio_table[] = { /* EN_PP3300_TCHSCR */ PAD_GPO(GPIO_68, LOW), /* EN_SPKR */ - PAD_GPO(GPIO_69, LOW), + PAD_GPO(GPIO_69, HIGH), /* SD_AUX_RESET_L */ PAD_GPO(GPIO_70, HIGH), /* GPIO_71 - GPIO_73: Not available */ diff --git a/src/mainboard/google/guybrush/variants/guybrush/Makefile.inc b/src/mainboard/google/guybrush/variants/guybrush/Makefile.inc index 88e75bde52..ba8514c4c2 100644 --- a/src/mainboard/google/guybrush/variants/guybrush/Makefile.inc +++ b/src/mainboard/google/guybrush/variants/guybrush/Makefile.inc @@ -1,3 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-or-later +ramstage-y += gpio.c + subdirs-y += ./memory diff --git a/src/mainboard/google/guybrush/variants/guybrush/gpio.c b/src/mainboard/google/guybrush/variants/guybrush/gpio.c new file mode 100644 index 0000000000..64afa60fae --- /dev/null +++ b/src/mainboard/google/guybrush/variants/guybrush/gpio.c @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include +#include +#include +#include +#include + +/* This table is used by guybrush variant with board version < 2. */ +static const struct soc_amd_gpio bid1_gpio_table[] = { + /* EN_SPKR */ + PAD_GPO(GPIO_69, LOW), +}; + +const struct soc_amd_gpio *variant_override_gpio_table(size_t *size) +{ + uint32_t board_version = board_id(); + *size = 0; + + if (board_version < 2) { + *size = ARRAY_SIZE(bid1_gpio_table); + return bid1_gpio_table; + } + + return NULL; +} -- cgit v1.2.3