payloads/edk2: Disable the CPU Timer Lib unless supported
[coreboot.git] / src / superio / smsc / lpc47m10x / early_serial.c
blob38a13f56a7945354305b4df5028ad8cc9f5e1aa4
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <arch/io.h>
4 #include <device/pnp_ops.h>
5 #include <device/pnp.h>
6 #include <stdint.h>
7 #include "lpc47m10x.h"
9 void pnp_enter_conf_state(pnp_devfn_t dev)
11 u16 port = dev >> 8;
12 outb(0x55, port);
15 void pnp_exit_conf_state(pnp_devfn_t dev)
17 u16 port = dev >> 8;
18 outb(0xaa, port);
21 /**
22 * Configure the base I/O port of the specified serial device and enable the
23 * serial device.
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.
28 void lpc47m10x_enable_serial(pnp_devfn_t dev, u16 iobase)
30 pnp_enter_conf_state(dev);
31 pnp_set_logical_device(dev);
32 pnp_set_enable(dev, 0);
33 pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
34 pnp_set_enable(dev, 1);
35 pnp_exit_conf_state(dev);