From 4047a44b682e9f84eec63fb3b66ad3288e18b26a Mon Sep 17 00:00:00 2001 From: Keith Hui Date: Tue, 21 Oct 2025 21:39:21 -0400 Subject: [PATCH] sio/nuvoton/common/nuvoton.h: Add common Nuvoton SIO LDNs Put the most commonly shared Nuvoton SIO logical device numbers into one central header. It will be handy when they start sharing per-LDN setup code. Block iasl from seeing anything other than the LDNs. Rename the re-inclusion guard symbol as its use is no longer limited to pre-RAM stages. It references NCT677x because that reference is hidden in every single Nuvoton SIO chip datasheet in my possession. Change-Id: Ibf01c0e0ffdecbedc34df62b582e3be0c5c0a852 Signed-off-by: Keith Hui Reviewed-on: https://review.coreboot.org/c/coreboot/+/89739 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Angel Pons --- src/superio/nuvoton/common/nuvoton.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/superio/nuvoton/common/nuvoton.h b/src/superio/nuvoton/common/nuvoton.h index eb5bc759f3..0243c69b3e 100644 --- a/src/superio/nuvoton/common/nuvoton.h +++ b/src/superio/nuvoton/common/nuvoton.h @@ -1,13 +1,28 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ -#ifndef SUPERIO_NUVOTON_COMMON_PRE_RAM_H -#define SUPERIO_NUVOTON_COMMON_PRE_RAM_H +#ifndef SUPERIO_NUVOTON_COMMON_H +#define SUPERIO_NUVOTON_COMMON_H +#ifndef __ACPI__ #include #include void nuvoton_pnp_enter_conf_state(pnp_devfn_t dev); void nuvoton_pnp_exit_conf_state(pnp_devfn_t dev); void nuvoton_enable_serial(pnp_devfn_t dev, u16 iobase); +#endif -#endif /* SUPERIO_NUVOTON_COMMON_PRE_RAM_H */ +/* + * Logical Device Numbers (LDN) common to all Nuvoton SIOs. + * Because they will be incorporated into ACPI device IDs, + * they must be written as decimal. + */ +#define NCT677X_PP 1 /* Parallel port */ +#define NCT677X_SP1 2 /* COM1 */ +#define NCT677X_SP2 3 /* COM2 & IR */ +#define NCT677X_KBC 5 /* PS/2 keyboard and mouse */ +#define NCT677X_ACPI 10 /* ACPI */ +#define NCT677X_HWM_FPLED 11 /* Hardware monitor & front LED */ +#define NCT677X_MAXLDN 22 /* The highest known LDN of these chips (0x16) */ + +#endif /* SUPERIO_NUVOTON_COMMON_H */