aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Zyngier <Marc.Zyngier@arm.com>2013-05-01 16:50:14 +0100
committerWill Deacon <will.deacon@arm.com>2015-06-01 16:39:54 +0100
commite5965f365c79c375f79bb19940a1e01848133ae3 (patch)
tree7820626d5dbc2221df534f641cf8ee9d819a8ec1
parentd28abb583a1c999a9755029e59714adcad3f518f (diff)
downloadkvmtool-e5965f365c79c375f79bb19940a1e01848133ae3.tar.gz
kvm tools: 8250: add address qualifier to uart name in fdt node
Having several uarts with the same name makes the kernel (and dtc) choke. Add the base address as a qualifier so we get unique names. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
-rw-r--r--hw/serial.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/serial.c b/hw/serial.c
index 523a7672..931067f5 100644
--- a/hw/serial.c
+++ b/hw/serial.c
@@ -374,17 +374,22 @@ static bool serial8250_in(struct ioport *ioport, struct kvm *kvm, u16 port, void
}
#ifdef CONFIG_HAS_LIBFDT
+#define DEVICE_NAME_MAX_LEN 32
static void serial8250_generate_fdt_node(struct ioport *ioport, void *fdt,
void (*generate_irq_prop)(void *fdt,
u8 irq))
{
+ char dev_name[DEVICE_NAME_MAX_LEN];
struct serial8250_device *dev = ioport->priv;
+ u64 addr = KVM_IOPORT_AREA + dev->iobase;
u64 reg_prop[] = {
- cpu_to_fdt64(KVM_IOPORT_AREA + dev->iobase),
+ cpu_to_fdt64(addr),
cpu_to_fdt64(8),
};
- _FDT(fdt_begin_node(fdt, "U6_16550A"));
+ snprintf(dev_name, DEVICE_NAME_MAX_LEN, "U6_16550A@%llx", addr);
+
+ _FDT(fdt_begin_node(fdt, dev_name));
_FDT(fdt_property_string(fdt, "compatible", "ns16550a"));
_FDT(fdt_property(fdt, "reg", reg_prop, sizeof(reg_prop)));
generate_irq_prop(fdt, dev->irq);