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-only */
2 
3 #include <bootblock_common.h>
4 #include <device/pnp_ops.h>
10 
11 #define GLOBAL_DEV PNP_DEV(0x2e, 0)
12 #define SERIAL_DEV PNP_DEV(0x2e, NCT6779D_SP1)
13 #define ACPI_DEV PNP_DEV(0x2e, NCT6779D_ACPI)
14 
16  { 1, 2, 0 },
17  { 1, 2, 0 },
18  { 1, 2, 1 },
19  { 1, 0, 1 },
20  { 1, 0, 2 },
21  { 1, 2, 2 },
22  { 1, 2, 3 },
23  { 1, 2, 3 },
24  { 1, 2, 4 },
25  { 1, 0, 4 },
26  { 1, 2, 6 },
27  { 1, 2, 5 },
28  { 1, 2, 5 },
29  { 1, 2, 6 },
30 };
31 
33 {
35 
36  /* Select SIO pin states */
37  pnp_write_config(GLOBAL_DEV, 0x1a, 0x00);
38  pnp_write_config(GLOBAL_DEV, 0x2a, 0x40);
39  pnp_write_config(GLOBAL_DEV, 0x2c, 0x00);
40 
41  /* Power RAM in S3 */
43  pnp_write_config(ACPI_DEV, 0xe4, 0x10);
44 
46 
47  /* Enable UART */
48  nuvoton_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
49 }
50 
51 void mainboard_get_spd(spd_raw_data *spd, bool id_only)
52 {
53  read_spd(&spd[0], 0x50, id_only);
54  read_spd(&spd[1], 0x51, id_only);
55  read_spd(&spd[2], 0x52, id_only);
56  read_spd(&spd[3], 0x53, id_only);
57 }
u8 spd_raw_data[256]
Definition: ddr3.h:156
void bootblock_mainboard_early_init(void)
Definition: early_init.c:11
void mainboard_get_spd(spd_raw_data *spd, bool id_only)
Definition: early_init.c:25
const struct southbridge_usb_port mainboard_usb_ports[]
Definition: early_init.c:8
#define ACPI_DEV
Definition: early_init.c:13
#define SERIAL_DEV
Definition: early_init.c:12
#define GLOBAL_DEV
Definition: early_init.c:11
void read_spd(spd_raw_data *spd, u8 addr, bool id_only)
Definition: raminit.c:138
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