From patchwork Wed May 1 15:50:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 2507971 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id E515BDF230 for ; Wed, 1 May 2013 15:50:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761538Ab3EAPu4 (ORCPT ); Wed, 1 May 2013 11:50:56 -0400 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:42931 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761491Ab3EAPug (ORCPT ); Wed, 1 May 2013 11:50:36 -0400 Received: from mudshark.cambridge.arm.com (mudshark.cambridge.arm.com [10.1.203.36]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id r41FoLki024155; Wed, 1 May 2013 16:50:21 +0100 (BST) Received: by mudshark.cambridge.arm.com (Postfix, from userid 1000) id 365BEC2B17; Wed, 1 May 2013 16:50:18 +0100 (BST) From: Will Deacon To: kvm@vger.kernel.org Cc: penberg@kernel.org, marc.zyngier@arm.com, anup@brainfault.org, rusty@rustcorp.com.au, pranavkumar@linaro.org, michael@ellerman.id.au, Marc Zyngier , Will Deacon Subject: [RFC PATCH 09/11] kvm tools: 8250: add address qualifier to uart name in fdt node Date: Wed, 1 May 2013 16:50:14 +0100 Message-Id: <1367423416-24640-10-git-send-email-will.deacon@arm.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1367423416-24640-1-git-send-email-will.deacon@arm.com> References: <1367423416-24640-1-git-send-email-will.deacon@arm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Marc Zyngier 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 Signed-off-by: Will Deacon --- tools/kvm/hw/serial.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/kvm/hw/serial.c b/tools/kvm/hw/serial.c index 523a767..931067f 100644 --- a/tools/kvm/hw/serial.c +++ b/tools/kvm/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);