From 62c25351c101a3d5c7104aa6fc34e71990478dde Mon Sep 17 00:00:00 2001 From: Mate Kukri Date: Sun, 6 Jun 2021 14:00:57 +0100 Subject: superio/smsc: Add support for the SCH555x series Used by the OptiPlex 3020/7020/9020: - EMI and Runtime registers work - UART1 works (including IRQs) - PS/2 keyboard and mouse untested Signed-off-by: Mate Kukri Change-Id: I9323198f1139cd0c3dd37f977ae7693b721654f4 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64359 Tested-by: build bot (Jenkins) Reviewed-by: Martin L Roth --- src/superio/smsc/sch555x/emi.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/superio/smsc/sch555x/emi.c (limited to 'src/superio/smsc/sch555x/emi.c') diff --git a/src/superio/smsc/sch555x/emi.c b/src/superio/smsc/sch555x/emi.c new file mode 100644 index 0000000000..7b3b204181 --- /dev/null +++ b/src/superio/smsc/sch555x/emi.c @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include "sch555x.h" + +uint8_t sch555x_emi_read8(uint16_t addr) +{ + outw(addr | 0x8000, SCH555x_EMI_IOBASE + 2); + return inb(SCH555x_EMI_IOBASE + 4); +} + +uint16_t sch555x_emi_read16(uint16_t addr) +{ + outw(addr | 0x8001, SCH555x_EMI_IOBASE + 2); + return inw(SCH555x_EMI_IOBASE + 4); +} + +uint32_t sch555x_emi_read32(uint16_t addr) +{ + outw(addr | 0x8002, SCH555x_EMI_IOBASE + 2); + return inl(SCH555x_EMI_IOBASE + 4); +} + +void sch555x_emi_write8(uint16_t addr, uint8_t val) +{ + outw(addr | 0x8000, SCH555x_EMI_IOBASE + 2); + outb(val, SCH555x_EMI_IOBASE + 4); +} + +void sch555x_emi_write16(uint16_t addr, uint16_t val) +{ + outw(addr | 0x8001, SCH555x_EMI_IOBASE + 2); + outw(val, SCH555x_EMI_IOBASE + 4); +} + +void sch555x_emi_write32(uint16_t addr, uint32_t val) +{ + outw(addr | 0x8002, SCH555x_EMI_IOBASE + 2); + outl(val, SCH555x_EMI_IOBASE + 4); +} -- cgit v1.2.3