Commit e5965f36 authored by Marc Zyngier's avatar Marc Zyngier Committed by Will Deacon
Browse files

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: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
parent d28abb58
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment