soc/mediatek/mt8196: Add PMIC MT6373 driver
[coreboot.git] / src / mainboard / intel / strago / com_init.c
blob06229ede4b9a9de1184a21d6b689928c5649f0ca
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <bootblock_common.h>
4 #include <device/mmio.h>
5 #include <device/pci_ops.h>
6 #include <soc/gpio.h>
7 #include <soc/lpc.h>
8 #include <soc/pci_devs.h>
11 * return family number and internal pad number in that community
12 * by pad number and which community it is in.
15 /* family number in high byte and inner pad number in lowest byte */
17 void bootblock_mainboard_early_init(void)
19 uint32_t reg;
20 uint32_t *pad_config_reg;
22 /* Enable the UART hardware for COM1. */
23 reg = 1;
24 pci_write_config32(PCI_DEV(0, LPC_DEV, 0), UART_CONT, reg);
27 * Set up the pads to select the UART function
28 * AD12 SW16(UART1_DATAIN/UART0_DATAIN) - Setting Mode 2 for UART0_RXD
29 * AD10 SW20(UART1_DATAOUT/UART0_DATAOUT) - Setting Mode 2 for UART0_TXD
31 pad_config_reg = gpio_pad_config_reg(GP_SOUTHWEST, UART1_RXD_PAD);
32 write32(pad_config_reg, SET_PAD_MODE_SELECTION(PAD_CONFIG0_DEFAULT0,
33 M2));
35 pad_config_reg = gpio_pad_config_reg(GP_SOUTHWEST, UART1_TXD_PAD);
36 write32(pad_config_reg, SET_PAD_MODE_SELECTION(PAD_CONFIG0_DEFAULT0,
37 M2));