From f789d41539a72d71bad97ce5e19566a05a952244 Mon Sep 17 00:00:00 2001 From: Yidi Lin Date: Wed, 3 Apr 2024 19:33:28 +0800 Subject: mb/google/rauru: Pass XHCI_INIT_DONE to the payload Configure GPIO EINT28 (XHCI_INIT_DONE) as output, so that payloads (for example depthcharge) can assert it to notify EC to enable USB VBUS. BUG=b:317009620 TEST=emerge-rauru coreboot Change-Id: I5950974435b56997626886b16d371cd8e6472e3c Signed-off-by: Yidi Lin Reviewed-on: https://review.coreboot.org/c/coreboot/+/84691 Reviewed-by: Yu-Ping Wu Tested-by: build bot (Jenkins) Reviewed-by: Yidi Lin --- src/mainboard/google/rauru/bootblock.c | 2 ++ src/mainboard/google/rauru/chromeos.c | 13 ++++++++++++- src/mainboard/google/rauru/gpio.h | 12 ++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 src/mainboard/google/rauru/gpio.h (limited to 'src/mainboard/google') diff --git a/src/mainboard/google/rauru/bootblock.c b/src/mainboard/google/rauru/bootblock.c index 578ec7558a..b1f986369e 100644 --- a/src/mainboard/google/rauru/bootblock.c +++ b/src/mainboard/google/rauru/bootblock.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include #include #include "gpio.h" @@ -14,4 +15,5 @@ void bootblock_mainboard_init(void) { mtk_snfc_init(); usb3_hub_reset(); + setup_chromeos_gpios(); } diff --git a/src/mainboard/google/rauru/chromeos.c b/src/mainboard/google/rauru/chromeos.c index 4555b90ca0..b6aaefbead 100644 --- a/src/mainboard/google/rauru/chromeos.c +++ b/src/mainboard/google/rauru/chromeos.c @@ -1,8 +1,19 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include + +#include "gpio.h" + +void setup_chromeos_gpios(void) +{ + gpio_output(GPIO_XHCI_INIT_DONE, 0); +} void fill_lb_gpios(struct lb_gpios *gpios) { - /* TODO: add ChromeOS specific gpios */ + struct lb_gpio chromeos_gpios[] = { + { GPIO_XHCI_INIT_DONE.id, ACTIVE_HIGH, -1, "XHCI init done" }, + }; + lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios)); } diff --git a/src/mainboard/google/rauru/gpio.h b/src/mainboard/google/rauru/gpio.h new file mode 100644 index 0000000000..f05a3779fe --- /dev/null +++ b/src/mainboard/google/rauru/gpio.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef __MAINBOARD_GOOGLE_RAURU_GPIO_H__ +#define __MAINBOARD_GOOGLE_RAURU_GPIO_H__ + +#include + +#define GPIO_XHCI_INIT_DONE GPIO(EINT28) + +void setup_chromeos_gpios(void); + +#endif -- cgit v1.2.3