coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
early_serial.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include <arch/io.h>
4 #include <device/pnp_ops.h>
5 #include <device/pnp.h>
6 #include <stdint.h>
7 #include "lpc47m10x.h"
8 
10 {
11  u16 port = dev >> 8;
12  outb(0x55, port);
13 }
14 
16 {
17  u16 port = dev >> 8;
18  outb(0xaa, port);
19 }
20 
21 /**
22  * Configure the base I/O port of the specified serial device and enable the
23  * serial device.
24  *
25  * @param dev High 8 bits = Super I/O port, low 8 bits = logical device number.
26  * @param iobase Processor I/O port address to assign to this serial device.
27  */
29 {
32  pnp_set_enable(dev, 0);
33  pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
34  pnp_set_enable(dev, 1);
36 }
void pnp_exit_conf_state(pnp_devfn_t dev)
Definition: early_serial.c:38
void pnp_enter_conf_state(pnp_devfn_t dev)
Definition: early_serial.c:30
void outb(u8 val, u16 port)
port
Definition: i915.h:29
#define PNP_IDX_IO0
Definition: pnp_def.h:5
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
u32 pnp_devfn_t
Definition: pnp_type.h:8
void lpc47m10x_enable_serial(pnp_devfn_t dev, u16 iobase)
Configure the base I/O port of the specified serial device and enable the serial device.
Definition: early_serial.c:28
uint16_t u16
Definition: stdint.h:48