Nikolai Vyssotski has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47545 )
Change subject: Support SIO1036 with addresses other than 0x4e/0x4d ......................................................................
Support SIO1036 with addresses other than 0x4e/0x4d
Newer LPC Mandolin debug boards hard strap SIO address to be at 0x164e/0x164d vs 0x4e/0x4d as before. Add support for configurable SIO address (SUPERIO_ADR_RANGE) to support these cards.
Change-Id: I103c61f21f13970dfa3b9a788b29964e478fb84c Signed-off-by: Nikolai Vyssotski nikolai.vyssotski@amd.corp-partner.google.com --- M src/mainboard/amd/mandolin/bootblock.c M src/superio/smsc/sio1036/Kconfig M src/superio/smsc/sio1036/sio1036_early_init.c 3 files changed, 14 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/47545/1
diff --git a/src/mainboard/amd/mandolin/bootblock.c b/src/mainboard/amd/mandolin/bootblock.c index 06da379..dc3ce34 100644 --- a/src/mainboard/amd/mandolin/bootblock.c +++ b/src/mainboard/amd/mandolin/bootblock.c @@ -5,14 +5,19 @@ #include <superio/smsc/sio1036/sio1036.h> #include "gpio.h"
-#define SERIAL_DEV PNP_DEV(0x4e, SIO1036_SP1) +#define SERIAL_DEV PNP_DEV(CONFIG_SUPERIO_ADR_RANGE, SIO1036_SP1)
void bootblock_mainboard_early_init(void) { mainboard_program_early_gpios();
if (CONFIG(SUPERIO_SMSC_SIO1036)) { - lpc_enable_sio_decode(LPC_SELECT_SIO_4E4F); + if ((CONFIG_SUPERIO_ADR_RANGE == 0x4e) || (CONFIG_SUPERIO_ADR_RANGE == 0x2e)) { + lpc_enable_sio_decode(LPC_WIDEIO0_ENABLE); + } else { + // set up 16 byte wide I/O range window for the super IO + lpc_set_wideio_range(CONFIG_SUPERIO_ADR_RANGE & ~0xF, 16); + } lpc_enable_decode(DECODE_ENABLE_SERIAL_PORT0 << CONFIG_UART_FOR_CONSOLE); sio1036_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE); } diff --git a/src/superio/smsc/sio1036/Kconfig b/src/superio/smsc/sio1036/Kconfig index 94899ff..fb13d73 100644 --- a/src/superio/smsc/sio1036/Kconfig +++ b/src/superio/smsc/sio1036/Kconfig @@ -2,3 +2,8 @@
config SUPERIO_SMSC_SIO1036 bool + +config SUPERIO_ADR_RANGE + depends on SUPERIO_SMSC_SIO1036 + hex "I/O address for SMSC1036 SIO" + default 0x4e diff --git a/src/superio/smsc/sio1036/sio1036_early_init.c b/src/superio/smsc/sio1036/sio1036_early_init.c index a65f672..c4a580a 100644 --- a/src/superio/smsc/sio1036/sio1036_early_init.c +++ b/src/superio/smsc/sio1036/sio1036_early_init.c @@ -10,13 +10,13 @@
static inline void sio1036_enter_conf_state(pnp_devfn_t dev) { - u8 port = dev >> 8; + u16 port = dev >> 8; outb(0x55, port); }
static inline void sio1036_exit_conf_state(pnp_devfn_t dev) { - u8 port = dev >> 8; + u16 port = dev >> 8; outb(0xaa, port); }