From: Simon Kuenzer Date: Thu, 19 Sep 2024 15:25:15 +0000 (+0200) Subject: drivers/*: Introduce `HAVE_IBMPC` X-Git-Tag: RELEASE-0.18.0~13 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=fbc3144340562a898f6d76b6e1e448d3eec1d465;p=unikraft%2Funikraft.git drivers/*: Introduce `HAVE_IBMPC` This commit introduces the (invisible) feature option `HAVE_IBMPC`, which describes that a platform uses non-discoverable devices that can be found under an established address and operated according to the IBM PC/AT standard. At the moment this focuses on VGA compatible adapters and UART controllers. The suboptions `HAVE_IBMPC_NS16550`, `HAVE_IBMPC_VGA` can be used instead if only a subset of the devices are used by a platform. For example, `HAVE_IBMPC_NS16550` enables the port-io mode of ns16550: Serial devices are addressed under well-defined addresses: `0x3f8` (COM1), `0x2f8` (COM2). Signed-off-by: Simon Kuenzer Reviewed-by: Oleksii Moisieiev Reviewed-by: Oleksii Moisieiev Reviewed-by: Michalis Pappas Approved-by: Michalis Pappas GitHub-Closes: #1501 --- diff --git a/drivers/Config.uk b/drivers/Config.uk index 70d43a21b..0c1729b09 100644 --- a/drivers/Config.uk +++ b/drivers/Config.uk @@ -21,3 +21,9 @@ endmenu menu "Xen" source "$(shell,$(UK_BASE)/support/build/config-submenu.sh -q -o '$(KCONFIG_DIR)/drivers-xen.uk' -r '$(KCONFIG_DRIV_BASE)/xen' -l '$(KCONFIG_DRIV_BASE)/xen' -e '$(KCONFIG_EXCLUDEDIRS)')" endmenu + +# Invisible option for full IBM PC/AT compatible machines +config HAVE_IBMPC + bool + select HAVE_IBMPC_NS16550 + select HAVE_IBMPC_VGA diff --git a/drivers/ukconsole/ns16550/Config.uk b/drivers/ukconsole/ns16550/Config.uk index 20d2c8bbe..75ffca355 100644 --- a/drivers/ukconsole/ns16550/Config.uk +++ b/drivers/ukconsole/ns16550/Config.uk @@ -1,13 +1,17 @@ +# Port-IO mode for IBM PC/AT compatible machines +config HAVE_IBMPC_NS16550 + bool + depends on ARCH_X86_64 + menuconfig LIBNS16550 bool "NS16550 / 8250" - depends on (ARCH_ARM_64 || ARCH_X86_64) - depends on (!PLAT_XEN && ARCH_X86_64) + depends on (HAVE_FDT || HAVE_IBMPC_NS16550) depends on LIBUKCONSOLE select LIBUKOFW if ARCH_ARM_64 if LIBNS16550 -if ARCH_ARM_64 +if !HAVE_IBMPC_NS16550 config LIBNS16550_EARLY_CONSOLE bool "Early console" select LIBUKBOOT @@ -15,9 +19,10 @@ config LIBNS16550_EARLY_CONSOLE Uses the fdt's `/chosen/stdout-path` to derive the default console. Override by setting `ns16550.base` at the cmdline, if LIBUKLIBPARAM is enabled. -endif # ARCH_ARM_64 -if ARCH_X86_64 +endif # !HAVE_IBMPC_NS16550 + +if HAVE_IBMPC_NS16550 config LIBNS16550_COM_AVAIL bool @@ -144,6 +149,6 @@ config LIBNS16550_COM4_EARLY endchoice endif # LIBNS16550_EARLY_CONSOLE -endif # ARCH_X86_64 +endif # HAVE_IBMPC_NS16550 endif # LIBNS16550 diff --git a/drivers/ukconsole/vgacons/Config.uk b/drivers/ukconsole/vgacons/Config.uk index df6c3b4a5..45d2eff54 100644 --- a/drivers/ukconsole/vgacons/Config.uk +++ b/drivers/ukconsole/vgacons/Config.uk @@ -1,5 +1,9 @@ +config HAVE_IBMPC_VGA + bool + depends on ARCH_X86_64 + config LIBVGACONS bool "VGA console driver" - depends on ARCH_X86_64 + depends on HAVE_IBMPC_VGA depends on LIBUKCONSOLE select LIBNOLIBC if !HAVE_LIBC diff --git a/plat/kvm/Config.uk b/plat/kvm/Config.uk index bec0ef02f..c6640cef3 100644 --- a/plat/kvm/Config.uk +++ b/plat/kvm/Config.uk @@ -103,12 +103,14 @@ config KVM_VMM_QEMU imply LIBUKINTCTLR_GICV2 if ARCH_ARM_64 imply LIBUKRTC_PL031 imply LIBVGACONS if ARCH_X86_64 + select HAVE_IBMPC select HAVE_PCI select HAVE_MMIO config KVM_VMM_FIRECRACKER bool "Firecracker" select KVM_BOOT_PROTO_LXBOOT + select HAVE_IBMPC_NS16550 if ARCH_X86_64 select HAVE_MMIO select VIRTIO_MMIO_LINUX_COMPAT_CMDLINE if LIBVIRTIO_MMIO imply LIBNS16550 if LIBUKCONSOLE