i386: enable rust hpet for pc when rust is enabled

Add HPET configuration in PC's Kconfig options, and select HPET device
(Rust version) if Rust is supported.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250210030051.2562726-11-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Zhao Liu 2025-02-10 11:00:51 +08:00 committed by Paolo Bonzini
parent 6e90a8f813
commit d128c341a7
6 changed files with 8 additions and 3 deletions

View file

@ -6,6 +6,7 @@
#CONFIG_APPLESMC=n #CONFIG_APPLESMC=n
#CONFIG_FDC=n #CONFIG_FDC=n
#CONFIG_HPET=n #CONFIG_HPET=n
#CONFIG_X_HPET_RUST=n
#CONFIG_HYPERV=n #CONFIG_HYPERV=n
#CONFIG_ISA_DEBUG=n #CONFIG_ISA_DEBUG=n
#CONFIG_ISA_IPMI_BT=n #CONFIG_ISA_IPMI_BT=n

View file

@ -1701,7 +1701,7 @@ static void pc_machine_initfn(Object *obj)
pcms->sata_enabled = true; pcms->sata_enabled = true;
pcms->i8042_enabled = true; pcms->i8042_enabled = true;
pcms->max_fw_size = 8 * MiB; pcms->max_fw_size = 8 * MiB;
#ifdef CONFIG_HPET #if defined(CONFIG_HPET) || defined(CONFIG_X_HPET_RUST)
pcms->hpet_enabled = true; pcms->hpet_enabled = true;
#endif #endif
pcms->fd_bootchk = true; pcms->fd_bootchk = true;

View file

@ -11,7 +11,7 @@ config A9_GTIMER
config HPET config HPET
bool bool
default y if PC default y if PC && !HAVE_RUST
config I8254 config I8254
bool bool

View file

@ -1,2 +1,3 @@
# devices Kconfig # devices Kconfig
source char/Kconfig source char/Kconfig
source timer/Kconfig

2
rust/hw/timer/Kconfig Normal file
View file

@ -0,0 +1,2 @@
config X_HPET_RUST
bool

View file

@ -103,7 +103,8 @@ qtests_i386 = \
config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \ config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \
slirp.found() ? ['virtio-net-failover'] : []) + \ slirp.found() ? ['virtio-net-failover'] : []) + \
(unpack_edk2_blobs and \ (unpack_edk2_blobs and \
config_all_devices.has_key('CONFIG_HPET') and \ (config_all_devices.has_key('CONFIG_HPET') or \
config_all_devices.has_key('CONFIG_X_HPET_RUST')) and \
config_all_devices.has_key('CONFIG_PARALLEL') ? ['bios-tables-test'] : []) + \ config_all_devices.has_key('CONFIG_PARALLEL') ? ['bios-tables-test'] : []) + \
qtests_pci + \ qtests_pci + \
qtests_cxl + \ qtests_cxl + \