From nobody Fri Dec 19 04:28:50 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1588596119; cv=none; d=zohomail.com; s=zohoarc; b=hhrn8DblwH/QiH8fLIBCM6tAeIILuMGtAzUl+lbS2uswWCsUdr+VT0LLdYJOW/uHAlgqu70hyCF4te6nExY+MgoQeYse+LdjlHZDuHJ0iwRlK8t1cDQ+mMbI56vePtTiwB/40K6s9ByrcbJWBNWVvwYSQsdEfKKMd4O+nbVixSw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588596119; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yAm+X6LwZsg/LS8zarCIG4F8biyOYqPggWmduB/wNPw=; b=f+B792hxWyF7kBsc/UdVVQnE57MeFoBqEzk+VGfWuW4Ectk7I2z2g69miFz9+0we94Au/6URitbrR9sDtJUsR4v1oAMYAin0iiDHleY7I71naKRxP5KYC2ZJqSrbAe7MVwDkdVUIc8sQNv+GDtBwVPBN08jkGx0DNtrbaVSe2h8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588596119483643.4613761082701; Mon, 4 May 2020 05:41:59 -0700 (PDT) Received: from localhost ([::1]:41902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVaQ2-0008Fs-3g for importer@patchew.org; Mon, 04 May 2020 08:41:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVaHo-00007i-B5 for qemu-devel@nongnu.org; Mon, 04 May 2020 08:33:28 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:52652) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jVaHn-0000r8-2m for qemu-devel@nongnu.org; Mon, 04 May 2020 08:33:28 -0400 Received: by mail-wm1-x343.google.com with SMTP id 188so8222483wmc.2 for ; Mon, 04 May 2020 05:33:26 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id q4sm12253608wrx.9.2020.05.04.05.33.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 05:33:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=yAm+X6LwZsg/LS8zarCIG4F8biyOYqPggWmduB/wNPw=; b=HuXnaY6vFoD1S/P7Z+cQr0xpjr55nHpijyROnz7XOwHmQIn42VF9szlh2cdCW4/jkv hHzO0W4gDYJamOF2J+bKjGuK4tDuaLEk5CduD+M0/WVNLPJJn6wa7Qhpi5M68p4AXwKc E1pFY6z46lI1fF0fT/zObNisVU2LeITVL4juHIaS3OcUAJqKh19pvN8eB9qNinhpNEG+ IzrAF/ssU6Bo2T+xNold6H3DZ4B6oq/t/J/Ay2P7hgCb/vzFJPzNVFRZvWoVjhyUSfAk PhsaqoyWG9d2m1Oi1A+raGUNFkO09CiJVHlKvUvZCXOc+roUKR69SYcpTys8GLNfFUPW UEyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yAm+X6LwZsg/LS8zarCIG4F8biyOYqPggWmduB/wNPw=; b=umAwb5SFb50mbfHhFs/t7aO2RCGQtRrTJO+P+cY2YEu7r9V1DrrnXjzdTdrrooqxOI gBIqvLhOUzOqvNFUz7eQya87N8WvoIcOwYQDv/mT2qcFqqTO4YO+7GyihNNuyV4XYcbl hhAem8WJMPaZg16hVlCjv4ubCrcEa6mMDW1y612lYA+6nyxCAJei71MSXFzQQD2RjrV6 7wpKJL+XnSvlq6QyrTx33rGf+IjwbBKSM5ict7BuN4gRGs0NDTpyc5Maz7u76mS8GXB8 WaRigIpdA5rgGHkMKnVb+4CYaL96dzcI17944+8DDxeTUJ1qXgD8oYffWIE7G7S8+i0Y 2yKA== X-Gm-Message-State: AGi0PuaR5PTFwRm/hcF2MLfVU+4XDRiVO7dvSHGRj0XNthM756hTDziu Y/aNzsqBSUstBdIV25zhPtbjCFrogbDHcw== X-Google-Smtp-Source: APiQypKIeOe2qsVsMH4l2HmxfMlyiQs5P4CCIFcpKRBovyjDUAxUxpSUjh+1m3ilQ/zvhCA2HFiliw== X-Received: by 2002:a1c:44b:: with SMTP id 72mr14130561wme.58.1588595605434; Mon, 04 May 2020 05:33:25 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 12/39] hw/arm: versal: Embed the UARTs into the SoC type Date: Mon, 4 May 2020 13:32:42 +0100 Message-Id: <20200504123309.3808-13-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200504123309.3808-1-peter.maydell@linaro.org> References: <20200504123309.3808-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) From: "Edgar E. Iglesias" Embed the UARTs into the SoC type. Suggested-by: Peter Maydell Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Luc Michel Message-id: 20200427181649.26851-5-edgar.iglesias@gmail.com Signed-off-by: Peter Maydell --- include/hw/arm/xlnx-versal.h | 3 ++- hw/arm/xlnx-versal.c | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h index 6c0a692b2fd..a3dfd064b3c 100644 --- a/include/hw/arm/xlnx-versal.h +++ b/include/hw/arm/xlnx-versal.h @@ -15,6 +15,7 @@ #include "hw/sysbus.h" #include "hw/arm/boot.h" #include "hw/intc/arm_gicv3.h" +#include "hw/char/pl011.h" =20 #define TYPE_XLNX_VERSAL "xlnx-versal" #define XLNX_VERSAL(obj) OBJECT_CHECK(Versal, (obj), TYPE_XLNX_VERSAL) @@ -49,7 +50,7 @@ typedef struct Versal { MemoryRegion mr_ocm; =20 struct { - SysBusDevice *uart[XLNX_VERSAL_NR_UARTS]; + PL011State uart[XLNX_VERSAL_NR_UARTS]; SysBusDevice *gem[XLNX_VERSAL_NR_GEMS]; SysBusDevice *adma[XLNX_VERSAL_NR_ADMAS]; } iou; diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c index cc696e44c06..dbde03b7e69 100644 --- a/hw/arm/xlnx-versal.c +++ b/hw/arm/xlnx-versal.c @@ -21,7 +21,6 @@ #include "kvm_arm.h" #include "hw/misc/unimp.h" #include "hw/arm/xlnx-versal.h" -#include "hw/char/pl011.h" =20 #define XLNX_VERSAL_ACPU_TYPE ARM_CPU_TYPE_NAME("cortex-a72") #define GEM_REVISION 0x40070106 @@ -144,16 +143,17 @@ static void versal_create_uarts(Versal *s, qemu_irq *= pic) DeviceState *dev; MemoryRegion *mr; =20 - dev =3D qdev_create(NULL, TYPE_PL011); - s->lpd.iou.uart[i] =3D SYS_BUS_DEVICE(dev); + sysbus_init_child_obj(OBJECT(s), name, + &s->lpd.iou.uart[i], sizeof(s->lpd.iou.uart[= i]), + TYPE_PL011); + dev =3D DEVICE(&s->lpd.iou.uart[i]); qdev_prop_set_chr(dev, "chardev", serial_hd(i)); - object_property_add_child(OBJECT(s), name, OBJECT(dev), &error_fat= al); qdev_init_nofail(dev); =20 - mr =3D sysbus_mmio_get_region(s->lpd.iou.uart[i], 0); + mr =3D sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0); memory_region_add_subregion(&s->mr_ps, addrs[i], mr); =20 - sysbus_connect_irq(s->lpd.iou.uart[i], 0, pic[irqs[i]]); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[irqs[i]]); g_free(name); } } --=20 2.20.1