]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
drivers/*: Introduce `HAVE_IBMPC`
authorSimon Kuenzer <simon@unikraft.io>
Thu, 19 Sep 2024 15:25:15 +0000 (17:25 +0200)
committerUnikraft Bot <monkey@unikraft.io>
Sat, 14 Dec 2024 10:47:46 +0000 (10:47 +0000)
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 <simon@unikraft.io>
Reviewed-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
Reviewed-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
Approved-by: Michalis Pappas <michalis@unikraft.io>
GitHub-Closes: #1501

drivers/Config.uk
drivers/ukconsole/ns16550/Config.uk
drivers/ukconsole/vgacons/Config.uk
plat/kvm/Config.uk

index 70d43a21b6ae66dc9e5c29c90671edee67310860..0c1729b09e2b0fe200d90be2da7f2508a78ebe2e 100644 (file)
@@ -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
index 20d2c8bbe1c54aa1c4726f2d04779e6173792030..75ffca3554fad3354df8e159a7c068db7b36c16b 100644 (file)
@@ -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
index df6c3b4a5f852aa6fe25cdb1da4df1de5441bcb2..45d2eff5437df823a40b7a6495aaaa8639e3dd7b 100644 (file)
@@ -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
index bec0ef02f28f9e91724126791faec676a5eb9ad2..c6640cef3fb88933dd309b6311d0eadab080e842 100644 (file)
@@ -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