From 00e58c35c62dbd6c2b20980d594b2b9d1153aa45 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Sat, 17 Oct 2020 15:06:40 +0200 Subject: superio/nuvoton: Factor out equivalent Kconfig option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There's no need to have multiple Kconfig symbols which do the same thing. Introduce `SUPERIO_NUVOTON_COMMON_COM_A` and update boards to use the new symbol. To preserve alphabetical order in mainboard Kconfig, place the new symbol above the Super I/O symbol (instead of below). Change-Id: Ic0a30b3177a1a535261525638be301ae07c59c14 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/46522 Reviewed-by: Nico Huber Reviewed-by: Paul Menzel Reviewed-by: Michael Niewöhner Tested-by: build bot (Jenkins) --- src/superio/nuvoton/common/Kconfig | 7 +++++++ src/superio/nuvoton/common/early_serial.c | 4 +--- src/superio/nuvoton/nct5539d/Kconfig | 5 ----- src/superio/nuvoton/nct6776/Kconfig | 5 ----- src/superio/nuvoton/nct6791d/Kconfig | 5 ----- 5 files changed, 8 insertions(+), 18 deletions(-) (limited to 'src/superio') diff --git a/src/superio/nuvoton/common/Kconfig b/src/superio/nuvoton/common/Kconfig index 413b6a6882..78523c1b7e 100644 --- a/src/superio/nuvoton/common/Kconfig +++ b/src/superio/nuvoton/common/Kconfig @@ -5,6 +5,13 @@ config SUPERIO_NUVOTON_COMMON_PRE_RAM bool +config SUPERIO_NUVOTON_COMMON_COM_A + bool + depends on SUPERIO_NUVOTON_COMMON_PRE_RAM + help + When enabled, the 'nuvoton_enable_serial()' function will unset + global CR 0x2a bit 7 to route COM A to the GPIO8 pin group. + # Generic Nuvoton HWM driver config SUPERIO_NUVOTON_COMMON_HWM bool diff --git a/src/superio/nuvoton/common/early_serial.c b/src/superio/nuvoton/common/early_serial.c index 398678983a..f86e7a27d0 100644 --- a/src/superio/nuvoton/common/early_serial.c +++ b/src/superio/nuvoton/common/early_serial.c @@ -52,9 +52,7 @@ void nuvoton_enable_serial(pnp_devfn_t dev, u16 iobase) nuvoton_pnp_enter_conf_state(dev); - if (CONFIG(SUPERIO_NUVOTON_NCT5539D_COM_A) || - CONFIG(SUPERIO_NUVOTON_NCT6791D_COM_A) || - CONFIG(SUPERIO_NUVOTON_NCT6776_COM_A)) + if (CONFIG(SUPERIO_NUVOTON_COMMON_COM_A)) /* Route COM A to GPIO8 pin group */ pnp_unset_and_set_config(dev, 0x2a, 1 << 7, 0); diff --git a/src/superio/nuvoton/nct5539d/Kconfig b/src/superio/nuvoton/nct5539d/Kconfig index 440775f13e..dc48246668 100644 --- a/src/superio/nuvoton/nct5539d/Kconfig +++ b/src/superio/nuvoton/nct5539d/Kconfig @@ -3,8 +3,3 @@ config SUPERIO_NUVOTON_NCT5539D bool select SUPERIO_NUVOTON_COMMON_PRE_RAM - -config SUPERIO_NUVOTON_NCT5539D_COM_A - bool - depends on SUPERIO_NUVOTON_NCT5539D - default n diff --git a/src/superio/nuvoton/nct6776/Kconfig b/src/superio/nuvoton/nct6776/Kconfig index caa89b37fb..9f5e0843f5 100644 --- a/src/superio/nuvoton/nct6776/Kconfig +++ b/src/superio/nuvoton/nct6776/Kconfig @@ -3,8 +3,3 @@ config SUPERIO_NUVOTON_NCT6776 bool select SUPERIO_NUVOTON_COMMON_PRE_RAM - -config SUPERIO_NUVOTON_NCT6776_COM_A - bool - depends on SUPERIO_NUVOTON_NCT6776 - default n diff --git a/src/superio/nuvoton/nct6791d/Kconfig b/src/superio/nuvoton/nct6791d/Kconfig index b06ee31a0f..a5364916c9 100644 --- a/src/superio/nuvoton/nct6791d/Kconfig +++ b/src/superio/nuvoton/nct6791d/Kconfig @@ -3,8 +3,3 @@ config SUPERIO_NUVOTON_NCT6791D bool select SUPERIO_NUVOTON_COMMON_PRE_RAM - -config SUPERIO_NUVOTON_NCT6791D_COM_A - bool - depends on SUPERIO_NUVOTON_NCT6791D - default n -- cgit v1.2.3