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 <
superio/ite/it8718f/it8718f.h
>
5
#include <
superio/ite/common/ite.h
>
6
#include <
northbridge/intel/i945/i945.h
>
7
#include <
southbridge/intel/i82801gx/i82801gx.h
>
8
9
#define SERIAL_DEV PNP_DEV(0x2e, IT8718F_SP1)
10
#define GPIO_DEV PNP_DEV(0x2e, IT8718F_GPIO)
11
#define EC_DEV PNP_DEV(0x2e, IT8718F_EC)
12
13
void
bootblock_mainboard_early_init
(
void
)
14
{
15
/* Set default GPIOs on superio */
16
ite_reg_write
(
GPIO_DEV
, 0x25, 0x40);
17
ite_reg_write
(
GPIO_DEV
, 0x26, 0x3f);
18
ite_reg_write
(
GPIO_DEV
, 0x28, 0x41);
19
ite_reg_write
(
GPIO_DEV
, 0x29, 0x88);
20
ite_reg_write
(
GPIO_DEV
, 0x2c, 0x1c);
21
ite_reg_write
(
GPIO_DEV
, 0x62, 0x08);
22
ite_kill_watchdog
(
GPIO_DEV
);
23
ite_reg_write
(
GPIO_DEV
, 0xb1, 0x01);
24
ite_reg_write
(
GPIO_DEV
, 0xb8, 0x80);
25
ite_reg_write
(
GPIO_DEV
, 0xbb, 0x40);
26
ite_reg_write
(
GPIO_DEV
, 0xc0, 0x00);
27
ite_reg_write
(
GPIO_DEV
, 0xc3, 0x00);
28
ite_reg_write
(
GPIO_DEV
, 0xc8, 0x00);
29
ite_reg_write
(
GPIO_DEV
, 0xcb, 0x00);
30
ite_reg_write
(
GPIO_DEV
, 0xf6, 0x26);
31
ite_reg_write
(
GPIO_DEV
, 0xfc, 0x01);
32
33
ite_reg_write
(
EC_DEV
, 0x70, 0x00);
// Don't use IRQ9
34
ite_reg_write
(
EC_DEV
, 0x30, 0xff);
// Enable
35
36
ite_enable_serial
(
SERIAL_DEV
, CONFIG_TTYS0_BASE);
37
38
/* Disable SIO reboot */
39
ite_reg_write
(
GPIO_DEV
, 0xEF, 0x7E);
40
}
41
42
void
mainboard_late_rcba_config
(
void
)
43
{
44
/* Enable only PCIe Root Port Clock Gate */
45
RCBA32
(
CG
) = 0x00000001;
46
}
bootblock_common.h
i82801gx.h
i945.h
it8718f.h
ite_enable_serial
void ite_enable_serial(pnp_devfn_t dev, u16 iobase)
Definition:
early_serial.c:61
ite_reg_write
void ite_reg_write(pnp_devfn_t dev, u8 reg, u8 value)
Definition:
early_serial.c:41
ite_kill_watchdog
void ite_kill_watchdog(pnp_devfn_t dev)
Definition:
early_serial.c:129
ite.h
bootblock_mainboard_early_init
void bootblock_mainboard_early_init(void)
Definition:
early_init.c:11
mainboard_late_rcba_config
void mainboard_late_rcba_config(void)
Definition:
early_init.c:6
EC_DEV
#define EC_DEV
Definition:
early_init.c:11
GPIO_DEV
#define GPIO_DEV
Definition:
early_init.c:10
SERIAL_DEV
#define SERIAL_DEV
Definition:
early_init.c:9
CG
#define CG
Definition:
rcba.h:129
RCBA32
#define RCBA32(x)
Definition:
rcba.h:14
src
mainboard
gigabyte
ga-945gcm-s2l
early_init.c
Generated by
1.9.1