payloads/edk2: Disable the CPU Timer Lib unless supported
[coreboot.git] / src / superio / smsc / lpc47m15x / early_serial.c
blob5921a489ce6c10b7a5785a52cd31a57e255a742a
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /* Pre-RAM driver for the SMSC LPC47M15X Super I/O chip */
5 #include <arch/io.h>
6 #include <device/pnp_ops.h>
7 #include <device/pnp.h>
8 #include <stdint.h>
10 #include "lpc47m15x.h"
12 static void pnp_enter_conf_state(pnp_devfn_t dev)
14 u16 port = dev >> 8;
15 outb(0x55, port);
18 static void pnp_exit_conf_state(pnp_devfn_t dev)
20 u16 port = dev >> 8;
21 outb(0xaa, port);
24 void lpc47m15x_enable_serial(pnp_devfn_t dev, u16 iobase)
26 pnp_enter_conf_state(dev);
27 pnp_set_logical_device(dev);
28 pnp_set_enable(dev, 0);
29 pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
30 pnp_set_enable(dev, 1);
31 pnp_exit_conf_state(dev);