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>
8 
9 #define SUPERIO_BASE 0x2e
10 #define SIO_GPIO PNP_DEV(SUPERIO_BASE, IT8728F_GPIO)
11 #define SERIAL_DEV PNP_DEV(SUPERIO_BASE, 0x01)
12 
14 {
15  /* Initialize SuperIO */
16  ite_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
17 
18  ite_reg_write(SIO_GPIO, 0xEF, 0x7E); // magic SIO disable reboot
19 
20  /* FIXME: These values could be configured in ramstage */
21  ite_reg_write(SIO_GPIO, 0x25, 0x40); // gpio pin function -> gp16
22  ite_reg_write(SIO_GPIO, 0x27, 0x10); // gpio pin function -> gp34
23  ite_reg_write(SIO_GPIO, 0x2c, 0x80); // smbus isolation on parallel port
24  ite_reg_write(SIO_GPIO, 0x62, 0x0a); // simple iobase 0xa00
25  ite_reg_write(SIO_GPIO, 0x72, 0x20); // watchdog timeout clear!
26  ite_reg_write(SIO_GPIO, 0x73, 0x00); // watchdog timeout clear!
27  ite_reg_write(SIO_GPIO, 0xcb, 0x00); // simple io set4 direction -> in
28  ite_reg_write(SIO_GPIO, 0xe9, 0x27); // bus select disable
29  ite_reg_write(SIO_GPIO, 0xf0, 0x10); // ?
30  ite_reg_write(SIO_GPIO, 0xf1, 0x42); // ?
31  ite_reg_write(SIO_GPIO, 0xf6, 0x1c); // hwmon alert beep -> gp36(pin12)
32 
33  /* EC SIO settings */
34  ite_reg_write(IT8728F_EC, 0xf1, 0xc0);
35  ite_reg_write(IT8728F_EC, 0xf6, 0xf0);
36  ite_reg_write(IT8728F_EC, 0xf9, 0x48);
37  ite_reg_write(IT8728F_EC, 0x60, 0x0a);
38  ite_reg_write(IT8728F_EC, 0x61, 0x30);
39  ite_reg_write(IT8728F_EC, 0x62, 0x0a);
40  ite_reg_write(IT8728F_EC, 0x63, 0x20);
41  ite_reg_write(IT8728F_EC, 0x30, 0x01);
42 }
43 
45  { 1, 5, 0 },
46  { 1, 5, 0 },
47  { 1, 5, 1 },
48  { 1, 5, 1 },
49  { 1, 5, 2 },
50  { 1, 5, 2 },
51  { 1, 5, 3 },
52  { 1, 5, 3 },
53  { 1, 5, 4 },
54  { 1, 5, 4 },
55  { 1, 5, 6 },
56  { 1, 5, 5 },
57  { 1, 5, 5 },
58  { 1, 5, 6 },
59 };
60 
61 /* FIXME: The GA-B75M-D3V only has two DIMM slots! */
62 void mainboard_get_spd(spd_raw_data *spd, bool id_only)
63 {
64  read_spd(&spd[0], 0x50, id_only);
65  read_spd(&spd[1], 0x51, id_only);
66  read_spd(&spd[2], 0x52, id_only);
67  read_spd(&spd[3], 0x53, id_only);
68 }
u8 spd_raw_data[256]
Definition: ddr3.h:156
#define IT8728F_EC
Definition: it8728f.h:10
void ite_enable_serial(pnp_devfn_t dev, u16 iobase)
Definition: early_serial.c:61
void ite_reg_write(pnp_devfn_t dev, u8 reg, u8 value)
Definition: early_serial.c:41
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 SIO_GPIO
Definition: early_init.c:10
#define SERIAL_DEV
Definition: early_init.c:11
void read_spd(spd_raw_data *spd, u8 addr, bool id_only)
Definition: raminit.c:138