From nobody Wed Feb 11 05:39:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail header.i=@wdc.com; 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=fail(p=none dis=none) header.from=wdc.com ARC-Seal: i=1; a=rsa-sha256; t=1592586516; cv=none; d=zohomail.com; s=zohoarc; b=ebDS7DAhKtByRIFmHAB2BwCmiUNU33paO9jDQ6sItmnG7eiAXarqF4lIZDH2AKijscQ+HJspBL/1pDReiWTO/tNn6TdqH/1N6oYhSsMvoZPkrYIw4/prMj3y19IBD9XCTHDXG32QrRK9uwbcMMVPm3em+LUU0RADcF6g7lskDcg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592586516; h=Content-Type:Content-Transfer-Encoding:Cc: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=cdUGT5JMyDVa6g7z01DneBRm4l+XnDY6B42to7+1IQ0=; b=CGM/607AGIeuR1tCJ9Us4FleiEMleuK9Xdmo5NDRKZOveSfeL5jxoY0tmmoTtyWTd3v8kjZWH7J9yayk7DUME0r5wF39cl3ImRJDl8UmtS/ChDKkv0/4GfK4ZoFUrqxl044wvHIvwpqV7H7VHPvlVvGMl+FtvdjGBPsjb+XziFI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail header.i=@wdc.com; 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=fail 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 1592586516130377.955850799263; Fri, 19 Jun 2020 10:08:36 -0700 (PDT) Received: from localhost ([::1]:58464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmKVG-0002ES-Sc for importer@patchew.org; Fri, 19 Jun 2020 13:08:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmKUD-0000f9-5d for qemu-devel@nongnu.org; Fri, 19 Jun 2020 13:07:29 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:24431) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmKUA-0004Pk-By for qemu-devel@nongnu.org; Fri, 19 Jun 2020 13:07:28 -0400 Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 20 Jun 2020 01:07:25 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2020 09:56:01 -0700 Received: from unknown (HELO risc6-mainframe.hgst.com) ([10.86.58.142]) by uls-op-cesaip02.wdc.com with ESMTP; 19 Jun 2020 10:07:25 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1592586448; x=1624122448; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZyHGfLXMoD/vQlrAS/c+SUX96vz+cOHa3/TUMLtyVWc=; b=kGhRpwjNSGbfcwmNKyPGUiiRrEImMVnm5KB83w8kmXC0eh8Czpb9V1Y4 eap9+r5wlmfT3L97L3UeygkJR/QrVOprISWGaK9fCbg6fmtIJxMiokqNf 9CkVsQTQhR3QhhKnna2w8dHQFK+l1+YD/A+QvnSIrBw/WEp05yVrQgEoW zIyAIAuwhHozEOfKn3A06krjwZjHEC/LaRPJEDsW8gsjDDes35LreSdSJ xKo+sF94sJnZ5CDHVQmRrWRbX/w4WLw1M0cdqH0mMs/FvrKkQyDXbbhhZ g0m7TXxOCRitx1aTtEatAJTQzFcwm0jVfXpgs/YrSFIXuNO6auJUZIVDG Q==; IronPort-SDR: Po9P9PvycdX9ExbhWAg3UAezC8IcKs416WAMKO1cLR57KWqnlRhP7rqpF3+AWJEUGaVfHQZ77N SyBQbZfCU0L24kE+6x7w/b3C7NwLXWDBpFK4HwuUsbED10MR1E68Y0jqwZxw97pDJPCsy7TBY2 KA8YTOCashF/5xjlalCLspSfnzWs2DY/Ts4aqh4EVpIxXuyzPvaZs07ihUFW9SkvjjagcsAA2E bh4mMYUZfNJ00i1SbrYTH1NXbG6g87Wzc3bHjxb29tBSifsO0E61Zx/Rf8JKI2u8VI1MaSO3Js i54= X-IronPort-AV: E=Sophos;i="5.75,256,1589212800"; d="scan'208";a="243416990" IronPort-SDR: 5S/qM5xJwe+WMPJG2iq33egEkJLmmWKLdoDtGOsYszd3xm2AnsGol6Y5xhml3mf8ZlI+YUts4w 3A1mh44f2wI+JnB8/7yotN86HjG89Q/CI= IronPort-SDR: pX4EIbFiMrPRRMf3mBSgcwb3UHD9NFFIm8ADkfnOn1H7hNqc35sxmQltERG/5aT0DiFBMEOoDH pJNQ+Q9qr/OQ== WDCIronportException: Internal From: Alistair Francis To: peter.maydell@linaro.org, qemu-devel@nongnu.org Subject: [PULL v2 14/32] riscv/opentitan: Connect the PLIC device Date: Fri, 19 Jun 2020 09:57:59 -0700 Message-Id: <20200619165817.4144200-15-alistair.francis@wdc.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619165817.4144200-1-alistair.francis@wdc.com> References: <20200619165817.4144200-1-alistair.francis@wdc.com> 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=68.232.143.124; envelope-from=prvs=4324eb4de=alistair.francis@wdc.com; helo=esa2.hgst.iphmx.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/19 13:07:24 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, SPF_HELO_PASS=-0.001, 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: , Cc: alistair23@gmail.com, Bin Meng , Alistair Francis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Alistair Francis Reviewed-by: Bin Meng Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/riscv/opentitan.h | 3 +++ hw/riscv/opentitan.c | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/hw/riscv/opentitan.h b/include/hw/riscv/opentitan.h index a4b6499444..76f72905a8 100644 --- a/include/hw/riscv/opentitan.h +++ b/include/hw/riscv/opentitan.h @@ -20,6 +20,7 @@ #define HW_OPENTITAN_H =20 #include "hw/riscv/riscv_hart.h" +#include "hw/intc/ibex_plic.h" =20 #define TYPE_RISCV_IBEX_SOC "riscv.lowrisc.ibex.soc" #define RISCV_IBEX_SOC(obj) \ @@ -31,6 +32,8 @@ typedef struct LowRISCIbexSoCState { =20 /*< public >*/ RISCVHartArrayState cpus; + IbexPlicState plic; + MemoryRegion flash_mem; MemoryRegion rom; } LowRISCIbexSoCState; diff --git a/hw/riscv/opentitan.c b/hw/riscv/opentitan.c index 011e4f7ee2..835b2c503f 100644 --- a/hw/riscv/opentitan.c +++ b/hw/riscv/opentitan.c @@ -26,6 +26,7 @@ #include "hw/riscv/boot.h" #include "exec/address-spaces.h" #include "qemu/units.h" +#include "sysemu/sysemu.h" =20 static const struct MemmapEntry { hwaddr base; @@ -94,6 +95,8 @@ static void riscv_lowrisc_ibex_soc_init(Object *obj) LowRISCIbexSoCState *s =3D RISCV_IBEX_SOC(obj); =20 object_initialize_child(obj, "cpus", &s->cpus, TYPE_RISCV_HART_ARRAY); + + object_initialize_child(obj, "plic", &s->plic, TYPE_IBEX_PLIC); } =20 static void riscv_lowrisc_ibex_soc_realize(DeviceState *dev_soc, Error **e= rrp) @@ -102,6 +105,7 @@ static void riscv_lowrisc_ibex_soc_realize(DeviceState = *dev_soc, Error **errp) MachineState *ms =3D MACHINE(qdev_get_machine()); LowRISCIbexSoCState *s =3D RISCV_IBEX_SOC(dev_soc); MemoryRegion *sys_mem =3D get_system_memory(); + Error *err =3D NULL; =20 object_property_set_str(OBJECT(&s->cpus), ms->cpu_type, "cpu-type", &error_abort); @@ -121,6 +125,14 @@ static void riscv_lowrisc_ibex_soc_realize(DeviceState= *dev_soc, Error **errp) memory_region_add_subregion(sys_mem, memmap[IBEX_FLASH].base, &s->flash_mem); =20 + /* PLIC */ + sysbus_realize(SYS_BUS_DEVICE(&s->plic), &err); + if (err !=3D NULL) { + error_propagate(errp, err); + return; + } + sysbus_mmio_map(SYS_BUS_DEVICE(&s->plic), 0, memmap[IBEX_PLIC].base); + create_unimplemented_device("riscv.lowrisc.ibex.uart", memmap[IBEX_UART].base, memmap[IBEX_UART].size); create_unimplemented_device("riscv.lowrisc.ibex.gpio", @@ -141,8 +153,6 @@ static void riscv_lowrisc_ibex_soc_realize(DeviceState = *dev_soc, Error **errp) memmap[IBEX_AES].base, memmap[IBEX_AES].size); create_unimplemented_device("riscv.lowrisc.ibex.hmac", memmap[IBEX_HMAC].base, memmap[IBEX_HMAC].size); - create_unimplemented_device("riscv.lowrisc.ibex.plic", - memmap[IBEX_PLIC].base, memmap[IBEX_PLIC].size); create_unimplemented_device("riscv.lowrisc.ibex.pinmux", memmap[IBEX_PINMUX].base, memmap[IBEX_PINMUX].size); create_unimplemented_device("riscv.lowrisc.ibex.alert_handler", --=20 2.27.0