Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1onBeK-0000r5-FQ for mharc-qemu-riscv@gnu.org; Tue, 25 Oct 2022 00:34:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onBeJ-0000qj-9X for qemu-riscv@nongnu.org; Tue, 25 Oct 2022 00:34:47 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onBeH-0000hl-3S for qemu-riscv@nongnu.org; Tue, 25 Oct 2022 00:34:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1666672484; x=1698208484; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I4CKihtthzXOfahvUWJQTfAuyO6hc7XxzMvk4ywIizA=; b=KDAYXRxWC+zxaNsAREC3vSMu5M5UccKpYMtgeIj9YfddK66avXMIAERU P0L+dZfzNOiis7NOtV+Pa/xjxRqL3w1JmfhKxu0mwjyheBXpZ8UE/+AOx fUdsxgbBc669ezr3LWaqoqccvQA8rd7OBKu7DB50t+AknVYW9xbB6pe7+ nGah8+Xd+3bT8pKcf8Att8/X6rtAsmsM5MDNZ9m5Zfic5q6x7Oo7h9ZZl JgCI955k1kCi6utLqM5a50iTkyYYvjhdZm3ralBRoLZy5iJ7VBjRnPmz4 Isasx5lwktUiCW41V34phGyZxFMzLDN1s+FR4lkHJ6PfoFZhN8hhMgBbI A==; X-IronPort-AV: E=Sophos;i="5.95,211,1661788800"; d="scan'208";a="212957807" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 25 Oct 2022 12:34:41 +0800 IronPort-SDR: sZFAlg9UDtbhnhlbpdZ3powyiJljOF/KjM2CyXleZlvE+nefrQD65YknREh36FPfV5LdpcQk5z AC6wjZQ224fhqT6IytgwIRjLc5Vcu7VmjVgHuZjcDuRImHuxm1yUqgf69j1f+p8H5Fw0T8E36o HuV2WKGl5HAYdXnPn0Hc6UIPgsV3n8FJjdADa9Tl7indYZYctpYJHE6L+6XjFw+Z7f0xcBw1hK wMN0+5E3s3/SBE/jeebSYl9wAS4uzexdwdB/3w1Wy8ehHQXglclf4X9o73pZuld2RpcTfoZni4 2iDxx/VjJR5vmZAtMpPiKhx0 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Oct 2022 20:54:04 -0700 IronPort-SDR: I8gpHKwwU407RHjYAWdRy6GtSbWUR8al3J/04msO001x3zJ8jbAr66BImMYd3LXnfqMLvr93/s cAJr0US5I7XfxSoFpeO5I9QYncEU5CNBzQ8GiUdpbjtwNtTC3cQ92xTs8Rt2L4EYDbAeqBv8SL +8HOAGty6Y488R4TgfGqCVg72NA9d9nS+3D0KCjXDBB5XqVynisNzYWTUKDpc6a+RNBNauLTYW SDAaqEMpafiZMCRjQAL5oO+DM5BgLuqaRCumtEsJ9HU75BirxTNZi4Nu+bLZi+GvZeLQgKFQHm XC0= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Oct 2022 21:34:42 -0700 Received: from usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTP id 4MxJxs0fHmz1Rwrq for ; Mon, 24 Oct 2022 21:34:41 -0700 (PDT) Authentication-Results: usg-ed-osssrv.wdc.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=opensource.wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= opensource.wdc.com; h=content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:subject:to :from; s=dkim; t=1666672480; x=1669264481; bh=I4CKihtthzXOfahvUW JQTfAuyO6hc7XxzMvk4ywIizA=; b=PnKLVV2paVFIbAIdPxJKCJyEMTnVLrODa0 lY7ODCt5s4mZ35J+OL+KnJ6dNShxJnjklYrwb6Esf34uWXvNzPJvtljdz+AqGleV mbpZ2OIitfE/ucJes4D4sk9nqwWU5tQ4bZQCwHxCGhizl7U1AHNO+tv/Dze9yXL/ 6fk5l5FM2Q1Pkhy7fLAYTTbkTSGBcqRPlZusEXxTkguXdb/+V0he/NQVqGl727Wn ogVMNDEsCVF+YNZHWiHVlR52Y9LVThF4Mq7d5pX4HRFCXqta/R59UTKF2/5wJR4z shnuxYB1PW9Qz/bNnUJaQpeCqZyEyYh/h7WVcJjoP/+hOb3eLXIA== X-Virus-Scanned: amavisd-new at usg-ed-osssrv.wdc.com Received: from usg-ed-osssrv.wdc.com ([127.0.0.1]) by usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 6T8hnEwf_4m3 for ; Mon, 24 Oct 2022 21:34:40 -0700 (PDT) Received: from oni.wdc.com (unknown [10.225.165.78]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4MxJxm42xVz1RvLy; Mon, 24 Oct 2022 21:34:36 -0700 (PDT) From: Wilfred Mallawa To: Alistair.Francis@wdc.com, palmer@dabbelt.com, bin.meng@windriver.com, qemu-riscv@nongnu.org Cc: qemu-devel@nongnu.org, Wilfred Mallawa , Alistair Francis , Bin Meng Subject: [PATCH v1 1/2] hw/riscv/opentitan: bump opentitan Date: Tue, 25 Oct 2022 14:33:36 +1000 Message-Id: <20221025043335.339815-2-wilfred.mallawa@opensource.wdc.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221025043335.339815-1-wilfred.mallawa@opensource.wdc.com> References: <20221025043335.339815-1-wilfred.mallawa@opensource.wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=216.71.154.42; envelope-from=prvs=290a5aa6e=wilfred.mallawa@opensource.wdc.com; helo=esa4.hgst.iphmx.com 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-riscv@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2022 04:34:47 -0000 From: Wilfred Mallawa This patch updates the OpenTitan model to match the specified register layout as per [1]. Which is also the latest commit of OpenTitan supported by TockOS. Note: Pinmux and Padctrl has been merged into Pinmux [2][3], this patch r= emoves any references to Padctrl. Note: OpenTitan doc [2] has not yet specified much detail regarding this, except for a note that states `TODO: this section needs to be updated to reflect the pinmux/padctrl merger` [1] https://github.com/lowRISC/opentitan/blob/d072ac505f82152678d6e04be95= c72b728a347b8/hw/top_earlgrey/sw/autogen/top_earlgrey_memory.h [2] https://docs.opentitan.org/hw/top_earlgrey/doc/design/ [3] https://docs.opentitan.org/hw/ip/pinmux/doc/#overview Signed-off-by: Wilfred Mallawa Reviewed-by: Alistair Francis Reviewed-by: Bin Meng --- hw/riscv/opentitan.c | 21 +++++++++++++-------- include/hw/riscv/opentitan.h | 9 ++++----- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/hw/riscv/opentitan.c b/hw/riscv/opentitan.c index be7ff1eea0..92493c629d 100644 --- a/hw/riscv/opentitan.c +++ b/hw/riscv/opentitan.c @@ -28,8 +28,16 @@ #include "qemu/units.h" #include "sysemu/sysemu.h" =20 +/* + * This version of the OpenTitan machine currently supports + * OpenTitan RTL version: + * + * + * MMIO mapping as per (specified commit): + * lowRISC/opentitan: hw/top_earlgrey/sw/autogen/top_earlgrey_memory.h + */ static const MemMapEntry ibex_memmap[] =3D { - [IBEX_DEV_ROM] =3D { 0x00008000, 0x8000 }, + [IBEX_DEV_ROM] =3D { 0x00008000, 0x8000 }, [IBEX_DEV_RAM] =3D { 0x10000000, 0x20000 }, [IBEX_DEV_FLASH] =3D { 0x20000000, 0x100000 }, [IBEX_DEV_UART] =3D { 0x40000000, 0x1000 }, @@ -38,17 +46,17 @@ static const MemMapEntry ibex_memmap[] =3D { [IBEX_DEV_I2C] =3D { 0x40080000, 0x1000 }, [IBEX_DEV_PATTGEN] =3D { 0x400e0000, 0x1000 }, [IBEX_DEV_TIMER] =3D { 0x40100000, 0x1000 }, - [IBEX_DEV_SENSOR_CTRL] =3D { 0x40110000, 0x1000 }, [IBEX_DEV_OTP_CTRL] =3D { 0x40130000, 0x4000 }, [IBEX_DEV_LC_CTRL] =3D { 0x40140000, 0x1000 }, - [IBEX_DEV_USBDEV] =3D { 0x40150000, 0x1000 }, + [IBEX_DEV_ALERT_HANDLER] =3D { 0x40150000, 0x1000 }, [IBEX_DEV_SPI_HOST0] =3D { 0x40300000, 0x1000 }, [IBEX_DEV_SPI_HOST1] =3D { 0x40310000, 0x1000 }, + [IBEX_DEV_USBDEV] =3D { 0x40320000, 0x1000 }, [IBEX_DEV_PWRMGR] =3D { 0x40400000, 0x1000 }, [IBEX_DEV_RSTMGR] =3D { 0x40410000, 0x1000 }, [IBEX_DEV_CLKMGR] =3D { 0x40420000, 0x1000 }, [IBEX_DEV_PINMUX] =3D { 0x40460000, 0x1000 }, - [IBEX_DEV_PADCTRL] =3D { 0x40470000, 0x1000 }, + [IBEX_DEV_SENSOR_CTRL] =3D { 0x40490000, 0x1000 }, [IBEX_DEV_FLASH_CTRL] =3D { 0x41000000, 0x1000 }, [IBEX_DEV_AES] =3D { 0x41100000, 0x1000 }, [IBEX_DEV_HMAC] =3D { 0x41110000, 0x1000 }, @@ -59,10 +67,9 @@ static const MemMapEntry ibex_memmap[] =3D { [IBEX_DEV_ENTROPY] =3D { 0x41160000, 0x1000 }, [IBEX_DEV_EDNO] =3D { 0x41170000, 0x1000 }, [IBEX_DEV_EDN1] =3D { 0x41180000, 0x1000 }, - [IBEX_DEV_ALERT_HANDLER] =3D { 0x411b0000, 0x1000 }, [IBEX_DEV_NMI_GEN] =3D { 0x411c0000, 0x1000 }, [IBEX_DEV_PERI] =3D { 0x411f0000, 0x10000 }, - [IBEX_DEV_PLIC] =3D { 0x48000000, 0x4005000 }, + [IBEX_DEV_PLIC] =3D { 0x48000000, 0x4005000 }, [IBEX_DEV_FLASH_VIRTUAL] =3D { 0x80000000, 0x80000 }, }; =20 @@ -265,8 +272,6 @@ static void lowrisc_ibex_soc_realize(DeviceState *dev= _soc, Error **errp) memmap[IBEX_DEV_CLKMGR].base, memmap[IBEX_DEV_CLKMGR].size); create_unimplemented_device("riscv.lowrisc.ibex.pinmux", memmap[IBEX_DEV_PINMUX].base, memmap[IBEX_DEV_PINMUX].size); - create_unimplemented_device("riscv.lowrisc.ibex.padctrl", - memmap[IBEX_DEV_PADCTRL].base, memmap[IBEX_DEV_PADCTRL].size); create_unimplemented_device("riscv.lowrisc.ibex.usbdev", memmap[IBEX_DEV_USBDEV].base, memmap[IBEX_DEV_USBDEV].size); create_unimplemented_device("riscv.lowrisc.ibex.flash_ctrl", diff --git a/include/hw/riscv/opentitan.h b/include/hw/riscv/opentitan.h index 6665cd5794..1fc055cdff 100644 --- a/include/hw/riscv/opentitan.h +++ b/include/hw/riscv/opentitan.h @@ -81,7 +81,6 @@ enum { IBEX_DEV_RSTMGR, IBEX_DEV_CLKMGR, IBEX_DEV_PINMUX, - IBEX_DEV_PADCTRL, IBEX_DEV_USBDEV, IBEX_DEV_FLASH_CTRL, IBEX_DEV_PLIC, @@ -109,10 +108,10 @@ enum { IBEX_UART0_RX_TIMEOUT_IRQ =3D 7, IBEX_UART0_RX_PARITY_ERR_IRQ =3D 8, IBEX_TIMER_TIMEREXPIRED0_0 =3D 127, - IBEX_SPI_HOST0_ERR_IRQ =3D 151, - IBEX_SPI_HOST0_SPI_EVENT_IRQ =3D 152, - IBEX_SPI_HOST1_ERR_IRQ =3D 153, - IBEX_SPI_HOST1_SPI_EVENT_IRQ =3D 154, + IBEX_SPI_HOST0_ERR_IRQ =3D 134, + IBEX_SPI_HOST0_SPI_EVENT_IRQ =3D 135, + IBEX_SPI_HOST1_ERR_IRQ =3D 136, + IBEX_SPI_HOST1_SPI_EVENT_IRQ =3D 137, }; =20 #endif --=20 2.37.3