coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
early_init.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include <bootblock_common.h>
4 #include <device/pnp_ops.h>
11 
12 #define SERIAL_DEV_R2 PNP_DEV(0x2e, NCT6776_SP1)
13 #define SERIAL_DEV_R1 PNP_DEV(0x2e, W83627DHG_SP1)
14 
16 {
17  /* Set GPIOs on superio, enable UART */
18  if (CONFIG(SUPERIO_NUVOTON_NCT6776)) {
21 
22  pnp_write_config(SERIAL_DEV_R2, 0x1c, 0x80);
23  pnp_write_config(SERIAL_DEV_R2, 0x27, 0x80);
24  pnp_write_config(SERIAL_DEV_R2, 0x2a, 0x60);
25 
27  nuvoton_enable_serial(SERIAL_DEV_R2, CONFIG_TTYS0_BASE);
28  } else {
29  winbond_enable_serial(SERIAL_DEV_R1, CONFIG_TTYS0_BASE);
30  }
31  /* IRQ routing */
32  RCBA16(D31IR) = 0x0132;
33  RCBA16(D29IR) = 0x0237;
34 }
35 
36 void mb_get_spd_map(u8 spd_map[4])
37 {
38  spd_map[0] = 0x50;
39  spd_map[2] = 0x52;
40 }
@ CONFIG
Definition: dsi_common.h:201
void bootblock_mainboard_early_init(void)
Definition: early_init.c:11
void mb_get_spd_map(u8 spd_map[4])
Definition: early_init.c:27
#define SERIAL_DEV_R2
Definition: early_init.c:12
#define SERIAL_DEV_R1
Definition: early_init.c:13
void nuvoton_pnp_enter_conf_state(pnp_devfn_t dev)
Definition: early_serial.c:33
void nuvoton_enable_serial(pnp_devfn_t dev, u16 iobase)
Definition: early_serial.c:48
void nuvoton_pnp_exit_conf_state(pnp_devfn_t dev)
Definition: early_serial.c:41
void pnp_set_logical_device(struct device *dev)
Definition: pnp_device.c:59
void pnp_write_config(struct device *dev, u8 reg, u8 value)
Definition: pnp_device.c:38
#define D31IR
Definition: rcba.h:87
#define D29IR
Definition: rcba.h:89
#define RCBA16(x)
Definition: rcba.h:13
uint8_t u8
Definition: stdint.h:45
void winbond_enable_serial(pnp_devfn_t dev, u16 iobase)
Definition: early_init.c:47