@@ -6,3 +6,4 @@ include arm-softmmu.mak
CONFIG_XLNX_ZYNQMP_ARM=y
CONFIG_XLNX_VERSAL=y
CONFIG_SBSA_REF=y
+CONFIG_CPUFREQ=y
@@ -38,3 +38,7 @@ config ACPI_VMGENID
depends on PC
config ACPI_HW_REDUCED
+
+config CPUFREQ
+ bool
+ default y
@@ -764,6 +764,17 @@ static void create_uart(const VirtMachineState *vms, int uart,
g_free(nodename);
}
+static void create_cpufreq(const VirtMachineState *vms, MemoryRegion *mem)
+{
+ hwaddr base = vms->memmap[VIRT_CPUFREQ].base;
+ DeviceState *dev = qdev_create(NULL, "cpufreq");
+ SysBusDevice *s = SYS_BUS_DEVICE(dev);
+
+ qdev_init_nofail(dev);
+ memory_region_add_subregion(mem, base, sysbus_mmio_get_region(s, 0));
+}
+
+
static void create_rtc(const VirtMachineState *vms)
{
char *nodename;
@@ -1723,6 +1734,8 @@ static void machvirt_init(MachineState *machine)
create_uart(vms, VIRT_UART, sysmem, serial_hd(0));
+ create_cpufreq(vms, sysmem);
+
if (vms->secure) {
create_secure_ram(vms, secure_sysmem);
create_uart(vms, VIRT_SECURE_UART, secure_sysmem, serial_hd(1));