hw/arm/virt: Rename VIRT_UART and VIRT_SECURE_UART to VIRT_UART[01]

We're going to make the second UART not always a secure-only device.
Rename the constants VIRT_UART and VIRT_SECURE_UART to VIRT_UART0
and VIRT_UART1 accordingly.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20240610162343.2131524-3-peter.maydell@linaro.org
This commit is contained in:
Peter Maydell 2024-06-10 17:23:42 +01:00
parent 9ed2fb65cc
commit fe22cba940
3 changed files with 15 additions and 15 deletions

View File

@ -440,10 +440,10 @@ spcr_setup(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
.base_addr.width = 32, .base_addr.width = 32,
.base_addr.offset = 0, .base_addr.offset = 0,
.base_addr.size = 3, .base_addr.size = 3,
.base_addr.addr = vms->memmap[VIRT_UART].base, .base_addr.addr = vms->memmap[VIRT_UART0].base,
.interrupt_type = (1 << 3),/* Bit[3] ARMH GIC interrupt*/ .interrupt_type = (1 << 3),/* Bit[3] ARMH GIC interrupt*/
.pc_interrupt = 0, /* IRQ */ .pc_interrupt = 0, /* IRQ */
.interrupt = (vms->irqmap[VIRT_UART] + ARM_SPI_BASE), .interrupt = (vms->irqmap[VIRT_UART0] + ARM_SPI_BASE),
.baud_rate = 3, /* 9600 */ .baud_rate = 3, /* 9600 */
.parity = 0, /* No Parity */ .parity = 0, /* No Parity */
.stop_bits = 1, /* 1 Stop bit */ .stop_bits = 1, /* 1 Stop bit */
@ -631,11 +631,11 @@ build_dbg2(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
/* BaseAddressRegister[] */ /* BaseAddressRegister[] */
build_append_gas(table_data, AML_AS_SYSTEM_MEMORY, 32, 0, 3, build_append_gas(table_data, AML_AS_SYSTEM_MEMORY, 32, 0, 3,
vms->memmap[VIRT_UART].base); vms->memmap[VIRT_UART0].base);
/* AddressSize[] */ /* AddressSize[] */
build_append_int_noprefix(table_data, build_append_int_noprefix(table_data,
vms->memmap[VIRT_UART].size, 4); vms->memmap[VIRT_UART0].size, 4);
/* NamespaceString[] */ /* NamespaceString[] */
g_array_append_vals(table_data, name, namespace_length); g_array_append_vals(table_data, name, namespace_length);
@ -816,8 +816,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
*/ */
scope = aml_scope("\\_SB"); scope = aml_scope("\\_SB");
acpi_dsdt_add_cpus(scope, vms); acpi_dsdt_add_cpus(scope, vms);
acpi_dsdt_add_uart(scope, &memmap[VIRT_UART], acpi_dsdt_add_uart(scope, &memmap[VIRT_UART0],
(irqmap[VIRT_UART] + ARM_SPI_BASE)); (irqmap[VIRT_UART0] + ARM_SPI_BASE));
if (vmc->acpi_expose_flash) { if (vmc->acpi_expose_flash) {
acpi_dsdt_add_flash(scope, &memmap[VIRT_FLASH]); acpi_dsdt_add_flash(scope, &memmap[VIRT_FLASH]);
} }

View File

@ -165,11 +165,11 @@ static const MemMapEntry base_memmap[] = {
[VIRT_GIC_ITS] = { 0x08080000, 0x00020000 }, [VIRT_GIC_ITS] = { 0x08080000, 0x00020000 },
/* This redistributor space allows up to 2*64kB*123 CPUs */ /* This redistributor space allows up to 2*64kB*123 CPUs */
[VIRT_GIC_REDIST] = { 0x080A0000, 0x00F60000 }, [VIRT_GIC_REDIST] = { 0x080A0000, 0x00F60000 },
[VIRT_UART] = { 0x09000000, 0x00001000 }, [VIRT_UART0] = { 0x09000000, 0x00001000 },
[VIRT_RTC] = { 0x09010000, 0x00001000 }, [VIRT_RTC] = { 0x09010000, 0x00001000 },
[VIRT_FW_CFG] = { 0x09020000, 0x00000018 }, [VIRT_FW_CFG] = { 0x09020000, 0x00000018 },
[VIRT_GPIO] = { 0x09030000, 0x00001000 }, [VIRT_GPIO] = { 0x09030000, 0x00001000 },
[VIRT_SECURE_UART] = { 0x09040000, 0x00001000 }, [VIRT_UART1] = { 0x09040000, 0x00001000 },
[VIRT_SMMU] = { 0x09050000, 0x00020000 }, [VIRT_SMMU] = { 0x09050000, 0x00020000 },
[VIRT_PCDIMM_ACPI] = { 0x09070000, MEMORY_HOTPLUG_IO_LEN }, [VIRT_PCDIMM_ACPI] = { 0x09070000, MEMORY_HOTPLUG_IO_LEN },
[VIRT_ACPI_GED] = { 0x09080000, ACPI_GED_EVT_SEL_LEN }, [VIRT_ACPI_GED] = { 0x09080000, ACPI_GED_EVT_SEL_LEN },
@ -212,11 +212,11 @@ static MemMapEntry extended_memmap[] = {
}; };
static const int a15irqmap[] = { static const int a15irqmap[] = {
[VIRT_UART] = 1, [VIRT_UART0] = 1,
[VIRT_RTC] = 2, [VIRT_RTC] = 2,
[VIRT_PCIE] = 3, /* ... to 6 */ [VIRT_PCIE] = 3, /* ... to 6 */
[VIRT_GPIO] = 7, [VIRT_GPIO] = 7,
[VIRT_SECURE_UART] = 8, [VIRT_UART1] = 8,
[VIRT_ACPI_GED] = 9, [VIRT_ACPI_GED] = 9,
[VIRT_MMIO] = 16, /* ...to 16 + NUM_VIRTIO_TRANSPORTS - 1 */ [VIRT_MMIO] = 16, /* ...to 16 + NUM_VIRTIO_TRANSPORTS - 1 */
[VIRT_GIC_V2M] = 48, /* ...to 48 + NUM_GICV2M_SPIS - 1 */ [VIRT_GIC_V2M] = 48, /* ...to 48 + NUM_GICV2M_SPIS - 1 */
@ -939,7 +939,7 @@ static void create_uart(const VirtMachineState *vms, int uart,
qemu_fdt_setprop(ms->fdt, nodename, "clock-names", qemu_fdt_setprop(ms->fdt, nodename, "clock-names",
clocknames, sizeof(clocknames)); clocknames, sizeof(clocknames));
if (uart == VIRT_UART) { if (uart == VIRT_UART0) {
qemu_fdt_setprop_string(ms->fdt, "/chosen", "stdout-path", nodename); qemu_fdt_setprop_string(ms->fdt, "/chosen", "stdout-path", nodename);
qemu_fdt_setprop_string(ms->fdt, "/aliases", "serial0", nodename); qemu_fdt_setprop_string(ms->fdt, "/aliases", "serial0", nodename);
} else { } else {
@ -2317,11 +2317,11 @@ static void machvirt_init(MachineState *machine)
fdt_add_pmu_nodes(vms); fdt_add_pmu_nodes(vms);
create_uart(vms, VIRT_UART, sysmem, serial_hd(0)); create_uart(vms, VIRT_UART0, sysmem, serial_hd(0));
if (vms->secure) { if (vms->secure) {
create_secure_ram(vms, secure_sysmem, secure_tag_sysmem); create_secure_ram(vms, secure_sysmem, secure_tag_sysmem);
create_uart(vms, VIRT_SECURE_UART, secure_sysmem, serial_hd(1)); create_uart(vms, VIRT_UART1, secure_sysmem, serial_hd(1));
} }
if (tag_sysmem) { if (tag_sysmem) {

View File

@ -59,7 +59,7 @@ enum {
VIRT_GIC_ITS, VIRT_GIC_ITS,
VIRT_GIC_REDIST, VIRT_GIC_REDIST,
VIRT_SMMU, VIRT_SMMU,
VIRT_UART, VIRT_UART0,
VIRT_MMIO, VIRT_MMIO,
VIRT_RTC, VIRT_RTC,
VIRT_FW_CFG, VIRT_FW_CFG,
@ -69,7 +69,7 @@ enum {
VIRT_PCIE_ECAM, VIRT_PCIE_ECAM,
VIRT_PLATFORM_BUS, VIRT_PLATFORM_BUS,
VIRT_GPIO, VIRT_GPIO,
VIRT_SECURE_UART, VIRT_UART1,
VIRT_SECURE_MEM, VIRT_SECURE_MEM,
VIRT_SECURE_GPIO, VIRT_SECURE_GPIO,
VIRT_PCDIMM_ACPI, VIRT_PCDIMM_ACPI,