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 <arch/io.h>
4 #include <endian.h>
5 #include <device/pnp_ops.h>
6 #include <device/pnp_def.h>
7 
8 #include "bootblock.h"
9 
10 #define PNP_CFG_IDX 0x2e
11 #define PNP_LDN_SERIAL 0x0d
12 
14 {
15  outb(0x55, PNP_CFG_IDX);
16  outb(0x55, PNP_CFG_IDX);
17 }
18 
20 {
21  outb(0xaa, PNP_CFG_IDX);
22 }
23 
24 static void wilco_ec_serial_init(void)
25 {
27 
30  pnp_set_enable(dev, 1);
31  pnp_set_iobase(dev, PNP_IDX_IO1, cpu_to_be16(CONFIG_TTYS0_BASE));
34 }
35 
37 {
38  if (CONFIG(DRIVERS_UART_8250IO))
40 }
void outb(u8 val, u16 port)
@ CONFIG
Definition: dsi_common.h:201
static void pnp_enter_conf_state(pnp_devfn_t dev)
Definition: bootblock.c:13
#define PNP_LDN_SERIAL
Definition: bootblock.c:11
static void wilco_ec_serial_init(void)
Definition: bootblock.c:24
#define PNP_CFG_IDX
Definition: bootblock.c:10
static void pnp_exit_conf_state(pnp_devfn_t dev)
Definition: bootblock.c:19
void wilco_ec_early_init(void)
wilco_ec_early_init
Definition: bootblock.c:36
#define PNP_IDX_IO0
Definition: pnp_def.h:5
#define PNP_IDX_IO1
Definition: pnp_def.h:6
void pnp_set_logical_device(struct device *dev)
Definition: pnp_device.c:59
void pnp_set_enable(struct device *dev, int enable)
Definition: pnp_device.c:64
void pnp_set_iobase(struct device *dev, u8 index, u16 iobase)
Definition: pnp_device.c:93
void pnp_write_config(struct device *dev, u8 reg, u8 value)
Definition: pnp_device.c:38
#define PNP_DEV(PORT, FUNC)
Definition: pnp_type.h:10
u32 pnp_devfn_t
Definition: pnp_type.h:8