aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Bellows <greg.bellows@linaro.org>2014-09-24 09:31:53 -0500
committerGreg Bellows <greg.bellows@linaro.org>2014-12-17 13:35:05 -0600
commitf7f1669200582bcec949e2c364c0bd189f8e015f (patch)
treea132a0f5c79c888b8fa3417336ff9a327b45c75a
parenta1a9a9a667cefd1da5fb9640dcbe711b8aca3031 (diff)
downloadqemu-tz-qemutz.virt_uart.tar.gz
target-arm: add second UART to virtqemutz.virt_uart
Added UART1 to virt to enable separate UARTs for secure/nonsecure worlds. Signed-off-by: Greg Bellows <greg.bellows@linaro.org>
-rw-r--r--hw/arm/virt.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 19d6174..1455cd9 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -65,7 +65,8 @@ enum {
VIRT_CPUPERIPHS,
VIRT_GIC_DIST,
VIRT_GIC_CPU,
- VIRT_UART,
+ VIRT_UART0,
+ VIRT_UART1,
VIRT_MMIO,
VIRT_RTC,
};
@@ -123,8 +124,9 @@ static const MemMapEntry a15memmap[] = {
/* GIC distributor and CPU interfaces sit inside the CPU peripheral space */
[VIRT_GIC_DIST] = { 0x08000000, 0x00010000 },
[VIRT_GIC_CPU] = { 0x08010000, 0x00010000 },
- [VIRT_UART] = { 0x09000000, 0x00001000 },
- [VIRT_RTC] = { 0x09010000, 0x00001000 },
+ [VIRT_UART0] = { 0x09000000, 0x00001000 },
+ [VIRT_UART1] = { 0x09010000, 0x00001000 },
+ [VIRT_RTC] = { 0x09020000, 0x00001000 },
[VIRT_MMIO] = { 0x0a000000, 0x00000200 },
/* ...repeating for a total of NUM_VIRTIO_TRANSPORTS, each of that size */
/* 0x10000000 .. 0x40000000 reserved for PCI */
@@ -132,8 +134,9 @@ static const MemMapEntry a15memmap[] = {
};
static const int a15irqmap[] = {
- [VIRT_UART] = 1,
- [VIRT_RTC] = 2,
+ [VIRT_UART0] = 1,
+ [VIRT_UART1] = 2,
+ [VIRT_RTC] = 3,
[VIRT_MMIO] = 16, /* ...to 16 + NUM_VIRTIO_TRANSPORTS - 1 */
};
@@ -381,12 +384,12 @@ static void create_gic(const VirtBoardInfo *vbi, qemu_irq *pic)
fdt_add_gic_node(vbi);
}
-static void create_uart(const VirtBoardInfo *vbi, qemu_irq *pic)
+static void create_uart(const VirtBoardInfo *vbi, qemu_irq *pic, int uart)
{
char *nodename;
- hwaddr base = vbi->memmap[VIRT_UART].base;
- hwaddr size = vbi->memmap[VIRT_UART].size;
- int irq = vbi->irqmap[VIRT_UART];
+ hwaddr base = vbi->memmap[uart].base;
+ hwaddr size = vbi->memmap[uart].size;
+ int irq = vbi->irqmap[uart];
const char compat[] = "arm,pl011\0arm,primecell";
const char clocknames[] = "uartclk\0apb_pclk";
@@ -623,7 +626,8 @@ static void machvirt_init(MachineState *machine)
create_gic(vbi, pic);
- create_uart(vbi, pic);
+ create_uart(vbi, pic, VIRT_UART0);
+ create_uart(vbi, pic, VIRT_UART1);
create_rtc(vbi, pic);