summaryrefslogtreecommitdiff
path: root/src/mainboard/amd/birman_plus/early_gpio.c
diff options
context:
space:
mode:
authorAnand Vaikar <a.vaikar2021@gmail.com>2024-02-06 11:14:17 +0530
committerFelix Held <felix-coreboot@felixheld.de>2024-02-21 19:03:52 +0000
commit7ae2e2840d57060a27859086a076087389e39b77 (patch)
tree2b9ae73963b8f409abe7288d6c7b8232aaa8b450 /src/mainboard/amd/birman_plus/early_gpio.c
parent0978973d3f6665e5b6e6af49b048a8d0c5e833d5 (diff)
mb/amd/birman_plus: Add Birman+ board support for Phoenix SOC
1) Initial commit for upstreaming Birmanplus mainboard changes. 2) Add the DXIO descriptors for Birmanplus mainboard. Change-Id: I075dcf0214f8dc8b33b0e429d83d270b2f0952e1 Signed-off-by: Anand Vaikar <a.vaikar2021@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80353 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src/mainboard/amd/birman_plus/early_gpio.c')
-rw-r--r--src/mainboard/amd/birman_plus/early_gpio.c78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/mainboard/amd/birman_plus/early_gpio.c b/src/mainboard/amd/birman_plus/early_gpio.c
new file mode 100644
index 0000000000..4915996881
--- /dev/null
+++ b/src/mainboard/amd/birman_plus/early_gpio.c
@@ -0,0 +1,78 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <gpio.h>
+#include "gpio.h"
+
+/* GPIO pins used by coreboot should be initialized in bootblock */
+
+static const struct soc_amd_gpio gpio_set_stage_reset[] = {
+ /* TPM CS */
+ PAD_NF(GPIO_29, SPI_TPM_CS_L, PULL_NONE),
+ /* ESPI_CS_L */
+ PAD_NF(GPIO_30, ESPI_CS_L, PULL_NONE),
+ /* ESPI_SOC_CLK */
+ PAD_NF(GPIO_77, SPI1_CLK, PULL_NONE),
+ /* ESPI_DATA0 */
+ PAD_NF(GPIO_81, SPI1_DAT0, PULL_NONE),
+ /* ESPI_DATA1 */
+ PAD_NF(GPIO_80, SPI1_DAT1, PULL_NONE),
+ /* ESPI_DATA2 */
+ PAD_NF(GPIO_68, SPI1_DAT2, PULL_NONE),
+ /* ESPI_DATA3 */
+ PAD_NF(GPIO_69, SPI1_DAT3, PULL_NONE),
+ /* ESPI_ALERT_L */
+ PAD_NF(GPIO_22, ESPI_ALERT_D1, PULL_NONE),
+ /* TPM IRQ */
+ PAD_INT(GPIO_130, PULL_NONE, EDGE_LOW, STATUS_DELIVERY),
+ /* SPI_ROM_REQ */
+ PAD_NF(GPIO_67, SPI_ROM_REQ, PULL_NONE),
+ /* SPI_ROM_GNT */
+ PAD_NF(GPIO_76, SPI_ROM_GNT, PULL_NONE),
+ /* KBRST_L */
+ PAD_NF(GPIO_21, KBRST_L, PULL_NONE),
+
+ /* Deassert PCIe Reset lines */
+ /* PCIE_RST0_L */
+ PAD_NFO(GPIO_26, PCIE_RST0_L, HIGH),
+ /* PCIE_RST1_L */
+ PAD_NFO(GPIO_27, PCIE_RST1_L, HIGH),
+ /* M2_SSD0_RST_L */
+ PAD_GPO(GPIO_78, HIGH),
+ /* M2_SSD1_RST_L */
+ PAD_GPO(GPIO_79, HIGH),
+
+ /* Enable UART 2 */
+ /* UART2_RXD */
+ PAD_NF(GPIO_136, UART2_RXD, PULL_NONE),
+ /* UART2_TXD */
+ PAD_NF(GPIO_138, UART2_TXD, PULL_NONE),
+ /* Enable UART 0 */
+ /* UART0_RXD */
+ PAD_NF(GPIO_141, UART0_RXD, PULL_NONE),
+ /* UART0_TXD */
+ PAD_NF(GPIO_143, UART0_TXD, PULL_NONE),
+ /* FANOUT0 */
+ PAD_NF(GPIO_85, FANOUT0, PULL_NONE),
+
+ /* I2C0 SCL */
+ PAD_NF(GPIO_145, I2C0_SCL, PULL_NONE),
+ /* I2C0 SDA */
+ PAD_NF(GPIO_146, I2C0_SDA, PULL_NONE),
+ /* I2C1 SCL */
+ PAD_NF(GPIO_147, I2C1_SCL, PULL_NONE),
+ /* I2C1 SDA */
+ PAD_NF(GPIO_148, I2C1_SDA, PULL_NONE),
+ /* I2C2_SCL */
+ PAD_NF(GPIO_113, I2C2_SCL, PULL_NONE),
+ /* I2C2_SDA */
+ PAD_NF(GPIO_114, I2C2_SDA, PULL_NONE),
+ /* I2C3_SCL */
+ PAD_NF(GPIO_19, I2C3_SCL, PULL_NONE),
+ /* I2C3_SDA */
+ PAD_NF(GPIO_20, I2C3_SDA, PULL_NONE),
+};
+
+void mainboard_program_early_gpios(void)
+{
+ gpio_configure_pads(gpio_set_stage_reset, ARRAY_SIZE(gpio_set_stage_reset));
+}