From nobody Sat Jun 28 15:47:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 151915020418220.953451807908777; Tue, 20 Feb 2018 10:10:04 -0800 (PST) Received: from localhost ([::1]:56998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eoCMd-0005eS-4d for importer@patchew.org; Tue, 20 Feb 2018 13:10:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eoCGd-0008Hf-7O for qemu-devel@nongnu.org; Tue, 20 Feb 2018 13:03:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eoCGc-0001m2-34 for qemu-devel@nongnu.org; Tue, 20 Feb 2018 13:03:51 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:46554) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eoCGV-0001ae-6U; Tue, 20 Feb 2018 13:03:43 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1eoCGI-0008RC-2L; Tue, 20 Feb 2018 18:03:30 +0000 From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Tue, 20 Feb 2018 18:03:11 +0000 Message-Id: <20180220180325.29818-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180220180325.29818-1-peter.maydell@linaro.org> References: <20180220180325.29818-1-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH 05/19] armv7m: Forward idau property to CPU object X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Create an "idau" property on the armv7m container object which we can forward to the CPU object. Annoyingly, we can't use object_property_add_alias() because the CPU object we want to forward to doesn't exist until the armv7m container is realized. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- include/hw/arm/armv7m.h | 3 +++ hw/arm/armv7m.c | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/include/hw/arm/armv7m.h b/include/hw/arm/armv7m.h index 35ab757264..5c3f406ccc 100644 --- a/include/hw/arm/armv7m.h +++ b/include/hw/arm/armv7m.h @@ -12,6 +12,7 @@ =20 #include "hw/sysbus.h" #include "hw/intc/armv7m_nvic.h" +#include "target/arm/idau.h" =20 #define TYPE_BITBAND "ARM,bitband-memory" #define BITBAND(obj) OBJECT_CHECK(BitBandState, (obj), TYPE_BITBAND) @@ -40,6 +41,7 @@ typedef struct { * + Property "memory": MemoryRegion defining the physical address space * that CPU accesses see. (The NVIC, bitbanding and other CPU-internal * devices will be automatically layered on top of this view.) + * + Property "idau": IDAU interface (forwarded to CPU object) */ typedef struct ARMv7MState { /*< private >*/ @@ -58,6 +60,7 @@ typedef struct ARMv7MState { char *cpu_type; /* MemoryRegion the board provides to us (with its devices, RAM, etc) = */ MemoryRegion *board_memory; + Object *idau; } ARMv7MState; =20 #endif diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index facc536b07..189066812c 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -19,6 +19,7 @@ #include "sysemu/qtest.h" #include "qemu/error-report.h" #include "exec/address-spaces.h" +#include "target/arm/idau.h" =20 /* Bitbanded IO. Each word corresponds to a single bit. */ =20 @@ -162,6 +163,11 @@ static void armv7m_realize(DeviceState *dev, Error **e= rrp) =20 object_property_set_link(OBJECT(s->cpu), OBJECT(&s->container), "memor= y", &error_abort); + object_property_set_link(OBJECT(s->cpu), s->idau, "idau", &err); + if (err !=3D NULL) { + error_propagate(errp, err); + return; + } object_property_set_bool(OBJECT(s->cpu), true, "realized", &err); if (err !=3D NULL) { error_propagate(errp, err); @@ -217,6 +223,7 @@ static Property armv7m_properties[] =3D { DEFINE_PROP_STRING("cpu-type", ARMv7MState, cpu_type), DEFINE_PROP_LINK("memory", ARMv7MState, board_memory, TYPE_MEMORY_REGI= ON, MemoryRegion *), + DEFINE_PROP_LINK("idau", ARMv7MState, idau, TYPE_IDAU_INTERFACE, Objec= t *), DEFINE_PROP_END_OF_LIST(), }; =20 --=20 2.16.1