coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
bootblock.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_type.h
>
5
#include <
amdblocks/acpimmio.h
>
6
#include <
stdint.h
>
7
#include <
superio/ite/common/ite.h
>
8
#include <
superio/ite/it8728f/it8728f.h
>
9
#include <
superio/nuvoton/common/nuvoton.h
>
10
#include <
superio/nuvoton/nct6779d/nct6779d.h
>
11
12
static
void
sbxxx_enable_48mhzout
(
void
)
13
{
14
/* most likely programming to 48MHz out signal */
15
u32
reg32;
16
reg32 =
misc_read32
(0x28);
17
reg32 &= 0xffc7ffff;
18
reg32 |= 0x00100000;
19
misc_write32
(0x28, reg32);
20
21
misc_write32
(0x40,
misc_read32
(0x40) & (~0x80u));
22
}
23
24
static
void
superio_init_m
(
void
)
25
{
26
const
pnp_devfn_t
uart =
PNP_DEV
(0x2e,
IT8728F_SP1
);
27
const
pnp_devfn_t
gpio
=
PNP_DEV
(0x2e,
IT8728F_GPIO
);
28
29
ite_kill_watchdog
(
gpio
);
30
ite_enable_serial
(uart, CONFIG_TTYS0_BASE);
31
ite_enable_3vsbsw
(
gpio
);
32
}
33
34
static
void
superio_init_m_pro
(
void
)
35
{
36
const
pnp_devfn_t
uart =
PNP_DEV
(0x2e,
NCT6779D_SP1
);
37
38
nuvoton_enable_serial
(uart, CONFIG_TTYS0_BASE);
39
}
40
41
void
bootblock_mainboard_early_init
(
void
)
42
{
43
/* enable SIO clock */
44
sbxxx_enable_48mhzout
();
45
46
if
(
CONFIG
(BOARD_ASUS_F2A85_M_PRO))
47
superio_init_m_pro
();
48
else
49
superio_init_m
();
50
}
acpimmio.h
misc_read32
static uint32_t misc_read32(uint8_t reg)
Definition:
acpimmio.h:266
misc_write32
static void misc_write32(uint8_t reg, uint32_t value)
Definition:
acpimmio.h:281
bootblock_common.h
CONFIG
@ CONFIG
Definition:
dsi_common.h:201
it8728f.h
IT8728F_GPIO
#define IT8728F_GPIO
Definition:
it8728f.h:13
IT8728F_SP1
#define IT8728F_SP1
Definition:
it8728f.h:7
ite_enable_serial
void ite_enable_serial(pnp_devfn_t dev, u16 iobase)
Definition:
early_serial.c:61
ite_kill_watchdog
void ite_kill_watchdog(pnp_devfn_t dev)
Definition:
early_serial.c:129
ite_enable_3vsbsw
void ite_enable_3vsbsw(pnp_devfn_t dev)
Definition:
early_serial.c:85
ite.h
bootblock_mainboard_early_init
__weak void bootblock_mainboard_early_init(void)
Definition:
bootblock.c:16
superio_init_m
static void superio_init_m(void)
Definition:
bootblock.c:24
sbxxx_enable_48mhzout
static void sbxxx_enable_48mhzout(void)
Definition:
bootblock.c:12
superio_init_m_pro
static void superio_init_m_pro(void)
Definition:
bootblock.c:34
nct6779d.h
NCT6779D_SP1
#define NCT6779D_SP1
Definition:
nct6779d.h:8
nuvoton_enable_serial
void nuvoton_enable_serial(pnp_devfn_t dev, u16 iobase)
Definition:
early_serial.c:48
nuvoton.h
pnp_type.h
PNP_DEV
#define PNP_DEV(PORT, FUNC)
Definition:
pnp_type.h:10
pnp_devfn_t
u32 pnp_devfn_t
Definition:
pnp_type.h:8
stdint.h
u32
uint32_t u32
Definition:
stdint.h:51
gpio
Definition:
pinmux.c:36
src
mainboard
asus
f2a85-m
bootblock.c
Generated by
1.9.1