coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
bootblock.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <bootblock_common.h>
4 #include <amdblocks/lpc.h>
6 #include "gpio.h"
7 
8 #define SERIAL_DEV PNP_DEV(CONFIG_SUPERIO_ADDR_BASE, SIO1036_SP1)
9 
11 {
13 
14  if (CONFIG(SUPERIO_SMSC_SIO1036)) {
15  if (CONFIG_SUPERIO_ADDR_BASE == 0x4e) {
17  } else {
18  // set up 16 byte wide I/O range window for the super IO
19  lpc_set_wideio_range(CONFIG_SUPERIO_ADDR_BASE & ~0xF, 16);
20  }
21  lpc_enable_decode(DECODE_ENABLE_SERIAL_PORT0 << CONFIG_UART_FOR_CONSOLE);
22  sio1036_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
23  }
24 }
void mainboard_program_early_gpios(void)
Definition: early_gpio.c:32
@ CONFIG
Definition: dsi_common.h:201
__weak void bootblock_mainboard_early_init(void)
Definition: bootblock.c:16
#define SERIAL_DEV
Definition: bootblock.c:8
void sio1036_enable_serial(pnp_devfn_t dev, u16 iobase)
void lpc_enable_decode(uint32_t decodes)
Definition: lpc_util.c:160
void lpc_enable_sio_decode(const bool addr)
Definition: lpc_util.c:148
#define LPC_SELECT_SIO_4E4F
Definition: lpc.h:68
#define DECODE_ENABLE_SERIAL_PORT0
Definition: lpc.h:23
int lpc_set_wideio_range(uint16_t start, uint16_t size)
Program a LPC wide IO to support an IO range.
Definition: lpc_util.c:109