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/pci_ops.h
>
5
#include <
southbridge/intel/i82801gx/i82801gx.h
>
6
#include <
northbridge/intel/pineview/pineview.h
>
7
#include <
superio/winbond/w83627thg/w83627thg.h
>
8
#include <
superio/winbond/common/winbond.h
>
9
10
#define SERIAL_DEV PNP_DEV(0x4e, W83627THG_SP1)
11
12
void
bootblock_mainboard_early_init
(
void
)
13
{
14
/* Disable Serial IRQ */
15
pci_write_config8
(
PCI_DEV
(0, 0x1f, 0),
SERIRQ_CNTL
, 0x00);
16
/* Decode range */
17
pci_or_config16
(
PCI_DEV
(0, 0x1f, 0),
LPC_IO_DEC
, 0x0010);
18
pci_write_config16
(
PCI_DEV
(0, 0x1f, 0),
LPC_EN
,
CNF1_LPC_EN
19
|
CNF2_LPC_EN
|
KBC_LPC_EN
|
COMA_LPC_EN
20
|
COMB_LPC_EN
);
21
22
pci_write_config32
(
PCI_DEV
(0, 0x1f, 0),
GEN2_DEC
, 0x7c0291);
23
24
winbond_enable_serial
(
SERIAL_DEV
, CONFIG_TTYS0_BASE);
25
}
26
27
void
mb_pirq_setup
(
void
)
28
{
29
/* dev irq route register */
30
RCBA16
(
D31IR
) = 0x0132;
31
RCBA16
(
D30IR
) = 0x0146;
32
RCBA16
(
D29IR
) = 0x0237;
33
RCBA16
(
D28IR
) = 0x3201;
34
RCBA16
(
D27IR
) = 0x0146;
35
36
/* Does not belong here, but is it needed? */
37
RCBA32
(
FD
) |=
FD_INTLAN
;
38
}
39
40
void
get_mb_spd_addrmap
(
u8
*spd_addrmap)
41
{
42
spd_addrmap[0] = 0x50;
43
spd_addrmap[1] = 0x51;
44
}
bootblock_common.h
i82801gx.h
GEN2_DEC
#define GEN2_DEC
Definition:
i82801gx.h:89
FD_INTLAN
#define FD_INTLAN
Definition:
i82801gx.h:248
pci_ops.h
pci_write_config32
static __always_inline void pci_write_config32(const struct device *dev, u16 reg, u32 val)
Definition:
pci_ops.h:76
pci_or_config16
static __always_inline void pci_or_config16(const struct device *dev, u16 reg, u16 ormask)
Definition:
pci_ops.h:180
pci_write_config16
static __always_inline void pci_write_config16(const struct device *dev, u16 reg, u16 val)
Definition:
pci_ops.h:70
pci_write_config8
static __always_inline void pci_write_config8(const struct device *dev, u16 reg, u8 val)
Definition:
pci_ops.h:64
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
SERIAL_DEV
#define SERIAL_DEV
Definition:
early_init.c:10
mb_pirq_setup
void mb_pirq_setup(void)
Definition:
early_init.c:27
PCI_DEV
#define PCI_DEV(SEGBUS, DEV, FN)
Definition:
pci_type.h:14
pineview.h
SERIRQ_CNTL
#define SERIRQ_CNTL
Definition:
espi.h:21
COMB_LPC_EN
#define COMB_LPC_EN
Definition:
lpc.h:45
KBC_LPC_EN
#define KBC_LPC_EN
Definition:
lpc.h:40
COMA_LPC_EN
#define COMA_LPC_EN
Definition:
lpc.h:46
CNF2_LPC_EN
#define CNF2_LPC_EN
Definition:
lpc.h:37
CNF1_LPC_EN
#define CNF1_LPC_EN
Definition:
lpc.h:38
LPC_IO_DEC
#define LPC_IO_DEC
Definition:
lpc.h:35
LPC_EN
#define LPC_EN
Definition:
lpc.h:36
D31IR
#define D31IR
Definition:
rcba.h:87
D30IR
#define D30IR
Definition:
rcba.h:88
D28IR
#define D28IR
Definition:
rcba.h:90
D29IR
#define D29IR
Definition:
rcba.h:89
FD
#define FD
Definition:
rcba.h:125
D27IR
#define D27IR
Definition:
rcba.h:91
RCBA16
#define RCBA16(x)
Definition:
rcba.h:13
RCBA32
#define RCBA32(x)
Definition:
rcba.h:14
u8
uint8_t u8
Definition:
stdint.h:45
winbond_enable_serial
void winbond_enable_serial(pnp_devfn_t dev, u16 iobase)
Definition:
early_init.c:47
w83627thg.h
winbond.h
src
mainboard
intel
d510mo
early_init.c
Generated by
1.9.1