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 <
console/console.h
>
5
#include <
device/pnp_ops.h
>
6
#include <
northbridge/intel/pineview/pineview.h
>
7
#include <
southbridge/intel/i82801gx/i82801gx.h
>
8
#include <
superio/ite/common/ite.h
>
9
#include <
superio/ite/it8720f/it8720f.h
>
10
11
#define SERIAL_DEV PNP_DEV(0x2e, IT8720F_SP1)
12
#define GPIO_DEV PNP_DEV(0x2e, IT8720F_GPIO)
13
#define EC_DEV PNP_DEV(0x2e, IT8720F_EC)
14
15
void
bootblock_mainboard_early_init
(
void
)
16
{
17
/* Set default GPIOs on superio */
18
pnp_enter_conf_state
(
GPIO_DEV
);
19
20
pnp_set_logical_device
(
GPIO_DEV
);
21
pnp_write_config
(
GPIO_DEV
, 0x25, 0x00);
22
pnp_write_config
(
GPIO_DEV
, 0x26, 0x0c);
23
pnp_write_config
(
GPIO_DEV
, 0x28, 0x41);
24
pnp_write_config
(
GPIO_DEV
, 0x2c, 0x01);
25
pnp_write_config
(
GPIO_DEV
, 0x62, 0x08);
26
pnp_write_config
(
GPIO_DEV
, 0x72, 0x00);
27
pnp_write_config
(
GPIO_DEV
, 0xb8, 0x00);
28
pnp_write_config
(
GPIO_DEV
, 0xc0, 0x00);
29
pnp_write_config
(
GPIO_DEV
, 0xc1, 0x0c);
30
pnp_write_config
(
GPIO_DEV
, 0xc3, 0x41);
31
pnp_write_config
(
GPIO_DEV
, 0xc8, 0x00);
32
pnp_write_config
(
GPIO_DEV
, 0xcb, 0x00);
33
pnp_write_config
(
GPIO_DEV
, 0xe9, 0x01);
34
pnp_write_config
(
GPIO_DEV
, 0xfc, 0xa4);
35
36
pnp_exit_conf_state
(
GPIO_DEV
);
37
38
ite_enable_serial
(
SERIAL_DEV
, CONFIG_TTYS0_BASE);
39
40
pnp_enter_conf_state
(
GPIO_DEV
);
41
pnp_set_logical_device
(
GPIO_DEV
);
42
43
printk
(
BIOS_DEBUG
,
"ITE register 0xef: 0x%02x "
,
pnp_read_config
(
GPIO_DEV
, 0xef));
44
45
/* Disable SIO reboot */
46
pnp_write_config
(
GPIO_DEV
, 0xef, 0x7e);
47
48
printk
(
BIOS_DEBUG
,
"=> 0x%02x\n"
,
pnp_read_config
(
GPIO_DEV
, 0xef));
49
50
pnp_set_logical_device
(
EC_DEV
);
51
pnp_write_config
(
EC_DEV
, 0x70, 0x00);
/* Don't use IRQ9 */
52
pnp_write_config
(
EC_DEV
, 0x30, 0x01);
/* Enable */
53
54
pnp_exit_conf_state
(
GPIO_DEV
);
55
}
56
57
void
get_mb_spd_addrmap
(
u8
*spd_addrmap)
58
{
59
spd_addrmap[0] = 0x50;
60
spd_addrmap[1] = 0x51;
61
}
bootblock_common.h
printk
#define printk(level,...)
Definition:
stdlib.h:16
console.h
i82801gx.h
it8720f.h
ite_enable_serial
void ite_enable_serial(pnp_devfn_t dev, u16 iobase)
Definition:
early_serial.c:61
ite.h
BIOS_DEBUG
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition:
loglevel.h:128
bootblock_mainboard_early_init
void bootblock_mainboard_early_init(void)
Definition:
early_init.c:11
get_mb_spd_addrmap
void get_mb_spd_addrmap(u8 *spd_addrmap)
Definition:
early_init.c:16
EC_DEV
#define EC_DEV
Definition:
early_init.c:13
GPIO_DEV
#define GPIO_DEV
Definition:
early_init.c:12
SERIAL_DEV
#define SERIAL_DEV
Definition:
early_init.c:11
pineview.h
pnp_set_logical_device
void pnp_set_logical_device(struct device *dev)
Definition:
pnp_device.c:59
pnp_read_config
u8 pnp_read_config(struct device *dev, u8 reg)
Definition:
pnp_device.c:44
pnp_write_config
void pnp_write_config(struct device *dev, u8 reg, u8 value)
Definition:
pnp_device.c:38
pnp_ops.h
u8
uint8_t u8
Definition:
stdint.h:45
pnp_exit_conf_state
void pnp_exit_conf_state(pnp_devfn_t dev)
Definition:
early_init.c:40
pnp_enter_conf_state
void pnp_enter_conf_state(pnp_devfn_t dev)
Definition:
early_init.c:32
src
mainboard
gigabyte
ga-d510ud
early_init.c
Generated by
1.9.1