From nobody Fri Oct 3 12:16:43 2025 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7F311DEFDD; Mon, 1 Sep 2025 04:24:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756700645; cv=none; b=GaQ9/oE7GDfySbPB/AJwhFwhLkz0Mq8B96DaERZVG1rkdRuHsVoD9miKeEJA4j4fVYDT2DPZQenlyBuci511fbOGoLqOVzzqV4q+YP8Db0CwVDteuU6Eq58rQheMXqNqDekzkrovPLPLE28taMc3UXTURlPGsj0l6CoeqTsp29g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756700645; c=relaxed/simple; bh=lpuh/P1JaJvF975oPEFRFTVX94rVAa187fxs5AM6K28=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZMLCc5pn6mBvAXm9mRyz+mdEwZa8/8CNBmj/RtQcidI+RFxarbcdK3wGUu0VLMgJGA6HK1dS1Kny9f0OoKy8P8DAicW7IlvgTShI2iiRDKyrfP365zo8wCLnD/R5sUbX0Dk2T7I7+yaBfj38w6aiCpa88iYewd3VUfDGKv3jtS0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=F0YBp+yz; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="F0YBp+yz" Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 08DA020A4A; Mon, 1 Sep 2025 06:24:01 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id gelxejH5fRVV; Mon, 1 Sep 2025 06:24:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1756700640; bh=lpuh/P1JaJvF975oPEFRFTVX94rVAa187fxs5AM6K28=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=F0YBp+yz14QtxYUNFlICyKrRa+gYF88OYQSCIipxQ+eqTMde3dyDQvC19qgr427dB v+GiAP+bEWGD655Q0VF+fot9JVXULWcjO1KM23VTA6CdjJ2jur0QEOtZ2cb/Orv8xd LqaSNYqokN4ZQPYhYbPtfvK4L6GgbSqNr+DVQ28iyE1u9PyqLCKlb/94bzUZ9JuzG0 XvYQKUvnPzLGcm1JiFEy27S04snFO1aKD2+zW6kjIeQH+ceFl7Mvm1lVTL82UeFLT7 hLvLhzSx9u71BYM1yds3ZQCKdTNp3zMFuNOEnF1i0ztsZbmLFulmBGFH/79fKvVlTc 9KtCO1NzcXP3g== From: Yao Zi To: Drew Fustini , Guo Ren , Fu Wei , Philipp Zabel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Michal Wilczynski Cc: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Icenowy Zheng , Han Gao , Han Gao , Yao Zi Subject: [PATCH 1/4] dt-bindings: reset: thead,th1520-reset: Add controllers for more subsys Date: Mon, 1 Sep 2025 04:23:17 +0000 Message-ID: <20250901042320.22865-2-ziyao@disroot.org> In-Reply-To: <20250901042320.22865-1-ziyao@disroot.org> References: <20250901042320.22865-1-ziyao@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" TH1520 SoC is divided into several subsystems, most of them have distinct reset controllers. Let's document reset controllers other than the one for VO subsystem and IDs for their reset signals. Signed-off-by: Yao Zi --- .../bindings/reset/thead,th1520-reset.yaml | 8 +- .../dt-bindings/reset/thead,th1520-reset.h | 219 +++++++++++++++++- 2 files changed, 223 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/reset/thead,th1520-reset.yam= l b/Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml index f2e91d0add7a..7b5053c177fe 100644 --- a/Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml +++ b/Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml @@ -16,7 +16,13 @@ maintainers: properties: compatible: enum: - - thead,th1520-reset + - thead,th1520-reset # Reset controller for VO subsystem + - thead,th1520-reset-ao + - thead,th1520-reset-ap + - thead,th1520-reset-dsp + - thead,th1520-reset-misc + - thead,th1520-reset-vi + - thead,th1520-reset-vp =20 reg: maxItems: 1 diff --git a/include/dt-bindings/reset/thead,th1520-reset.h b/include/dt-bi= ndings/reset/thead,th1520-reset.h index ee799286c175..927e251edfab 100644 --- a/include/dt-bindings/reset/thead,th1520-reset.h +++ b/include/dt-bindings/reset/thead,th1520-reset.h @@ -7,11 +7,186 @@ #ifndef _DT_BINDINGS_TH1520_RESET_H #define _DT_BINDINGS_TH1520_RESET_H =20 +/* AO Subsystem */ +#define TH1520_RESET_ID_SYSTEM 0 +#define TH1520_RESET_ID_RTC_APB 1 +#define TH1520_RESET_ID_RTC_REF 2 +#define TH1520_RESET_ID_AOGPIO_DB 3 +#define TH1520_RESET_ID_AOGPIO_APB 4 +#define TH1520_RESET_ID_AOI2C_APB 5 +#define TH1520_RESET_ID_PVT_APB 6 +#define TH1520_RESET_ID_E902_CORE 7 +#define TH1520_RESET_ID_E902_HAD 8 +#define TH1520_RESET_ID_AOTIMER_APB 9 +#define TH1520_RESET_ID_AOTIMER_CORE 10 +#define TH1520_RESET_ID_AOWDT_APB 11 +#define TH1520_RESET_ID_APSYS 12 +#define TH1520_RESET_ID_NPUSYS 13 +#define TH1520_RESET_ID_DDRSYS 14 +#define TH1520_RESET_ID_AXI_AP2CP 15 +#define TH1520_RESET_ID_AXI_CP2AP 16 +#define TH1520_RESET_ID_AXI_CP2SRAM 17 +#define TH1520_RESET_ID_AUDSYS_CORE 18 +#define TH1520_RESET_ID_AUDSYS_IOPMP 19 +#define TH1520_RESET_ID_AUDSYS 20 +#define TH1520_RESET_ID_DSP0 21 +#define TH1520_RESET_ID_DSP1 22 +#define TH1520_RESET_ID_GPU_MODULE 23 +#define TH1520_RESET_ID_VDEC 24 +#define TH1520_RESET_ID_VENC 25 +#define TH1520_RESET_ID_ADC_APB 26 +#define TH1520_RESET_ID_AUDGPIO_DB 27 +#define TH1520_RESET_ID_AUDGPIO_APB 28 +#define TH1520_RESET_ID_AOUART_IF 29 +#define TH1520_RESET_ID_AOUART_APB 30 +#define TH1520_RESET_ID_SRAM_AXI_P0 31 +#define TH1520_RESET_ID_SRAM_AXI_P1 32 +#define TH1520_RESET_ID_SRAM_AXI_P2 33 +#define TH1520_RESET_ID_SRAM_AXI_P3 34 +#define TH1520_RESET_ID_SRAM_AXI_P4 35 +#define TH1520_RESET_ID_SRAM_AXI_CORE 36 +#define TH1520_RESET_ID_SE 37 + +/* AP Subsystem */ +#define TH1520_RESET_ID_BROM 0 +#define TH1520_RESET_ID_C910_TOP 1 +#define TH1520_RESET_ID_NPU 2 +#define TH1520_RESET_ID_WDT0 3 +#define TH1520_RESET_ID_WDT1 4 +#define TH1520_RESET_ID_C910_C0 5 +#define TH1520_RESET_ID_C910_C1 5 +#define TH1520_RESET_ID_C910_C2 5 +#define TH1520_RESET_ID_C910_C3 5 +#define TH1520_RESET_ID_CHIP_DBG_CORE 6 +#define TH1520_RESET_ID_CHIP_DBG_AXI 7 +#define TH1520_RESET_ID_AXI4_CPUSYS2_AXI 8 +#define TH1520_RESET_ID_AXI4_CPUSYS2_APB 9 +#define TH1520_RESET_ID_X2H_CPUSYS 10 +#define TH1520_RESET_ID_AHB2_CPUSYS 11 +#define TH1520_RESET_ID_APB3_CPUSYS 12 +#define TH1520_RESET_ID_MBOX0_APB 13 +#define TH1520_RESET_ID_MBOX1_APB 14 +#define TH1520_RESET_ID_MBOX2_APB 15 +#define TH1520_RESET_ID_MBOX3_APB 16 +#define TH1520_RESET_ID_TIMER0_APB 17 +#define TH1520_RESET_ID_TIMER0_CORE 18 +#define TH1520_RESET_ID_TIMER1_APB 19 +#define TH1520_RESET_ID_TIMER1_CORE 20 +#define TH1520_RESET_ID_PERISYS_AHB 21 +#define TH1520_RESET_ID_PERISYS_APB1 22 +#define TH1520_RESET_ID_PERISYS_APB2 23 +#define TH1520_RESET_ID_GMAC0_APB 24 +#define TH1520_RESET_ID_GMAC0_AHB 25 +#define TH1520_RESET_ID_GMAC0_CLKGEN 26 +#define TH1520_RESET_ID_GMAC0_AXI 27 +#define TH1520_RESET_ID_UART0_APB 28 +#define TH1520_RESET_ID_UART0_IF 29 +#define TH1520_RESET_ID_UART1_APB 30 +#define TH1520_RESET_ID_UART1_IF 31 +#define TH1520_RESET_ID_UART2_APB 32 +#define TH1520_RESET_ID_UART2_IF 33 +#define TH1520_RESET_ID_UART3_APB 34 +#define TH1520_RESET_ID_UART3_IF 35 +#define TH1520_RESET_ID_UART4_APB 36 +#define TH1520_RESET_ID_UART4_IF 37 +#define TH1520_RESET_ID_UART5_APB 38 +#define TH1520_RESET_ID_UART5_IF 39 +#define TH1520_RESET_ID_QSPI0_IF 40 +#define TH1520_RESET_ID_QSPI0_APB 41 +#define TH1520_RESET_ID_QSPI1_IF 42 +#define TH1520_RESET_ID_QSPI1_APB 43 +#define TH1520_RESET_ID_SPI_IF 44 +#define TH1520_RESET_ID_SPI_APB 45 +#define TH1520_RESET_ID_I2C0_APB 46 +#define TH1520_RESET_ID_I2C0_CORE 47 +#define TH1520_RESET_ID_I2C1_APB 48 +#define TH1520_RESET_ID_I2C1_CORE 49 +#define TH1520_RESET_ID_I2C2_APB 50 +#define TH1520_RESET_ID_I2C2_CORE 51 +#define TH1520_RESET_ID_I2C3_APB 52 +#define TH1520_RESET_ID_I2C3_CORE 53 +#define TH1520_RESET_ID_I2C4_APB 54 +#define TH1520_RESET_ID_I2C4_CORE 55 +#define TH1520_RESET_ID_I2C5_APB 56 +#define TH1520_RESET_ID_I2C5_CORE 57 +#define TH1520_RESET_ID_GPIO0_DB 58 +#define TH1520_RESET_ID_GPIO0_APB 59 +#define TH1520_RESET_ID_GPIO1_DB 60 +#define TH1520_RESET_ID_GPIO1_APB 61 +#define TH1520_RESET_ID_GPIO2_DB 62 +#define TH1520_RESET_ID_GPIO2_APB 63 +#define TH1520_RESET_ID_PWM_COUNTER 64 +#define TH1520_RESET_ID_PWM_APB 65 +#define TH1520_RESET_ID_PADCTRL0_APB 66 +#define TH1520_RESET_ID_CPU2PERI_X2H 67 +#define TH1520_RESET_ID_CPU2AON_X2H 68 +#define TH1520_RESET_ID_AON2CPU_A2X 69 +#define TH1520_RESET_ID_NPUSYS_AXI 70 +#define TH1520_RESET_ID_NPUSYS_AXI_APB 71 +#define TH1520_RESET_ID_CPU2VP_X2P 72 +#define TH1520_RESET_ID_CPU2VI_X2H 73 +#define TH1520_RESET_ID_BMU_AXI 74 +#define TH1520_RESET_ID_BMU_APB 75 +#define TH1520_RESET_ID_DMAC_CPUSYS_AXI 76 +#define TH1520_RESET_ID_DMAC_CPUSYS_AHB 77 +#define TH1520_RESET_ID_SPINLOCK 78 +#define TH1520_RESET_ID_CFG2TEE 79 +#define TH1520_RESET_ID_DSMART 80 +#define TH1520_RESET_ID_GPIO3_DB 81 +#define TH1520_RESET_ID_GPIO3_APB 82 +#define TH1520_RESET_ID_PERI_I2S 83 +#define TH1520_RESET_ID_PERI_APB3 84 +#define TH1520_RESET_ID_PERI2PERI1_APB 85 +#define TH1520_RESET_ID_VPSYS_APB 86 +#define TH1520_RESET_ID_PERISYS_APB4 87 +#define TH1520_RESET_ID_GMAC1_APB 88 +#define TH1520_RESET_ID_GMAC1_AHB 89 +#define TH1520_RESET_ID_GMAC1_CLKGEN 90 +#define TH1520_RESET_ID_GMAC1_AXI 91 +#define TH1520_RESET_ID_GMAC_AXI 92 +#define TH1520_RESET_ID_GMAC_AXI_APB 93 +#define TH1520_RESET_ID_PADCTRL1_APB 94 +#define TH1520_RESET_ID_VOSYS_AXI 95 +#define TH1520_RESET_ID_VOSYS_AXI_APB 96 +#define TH1520_RESET_ID_VOSYS_AXI_X2X 97 +#define TH1520_RESET_ID_MISC2VP_X2X 98 +#define TH1520_RESET_ID_DSPSYS 99 +#define TH1520_RESET_ID_VISYS 100 +#define TH1520_RESET_ID_VOSYS 101 +#define TH1520_RESET_ID_VPSYS 102 + +/* MISC Subsystem */ +#define TH1520_RESET_ID_EMMC_SDIO_CLKGEN 0 +#define TH1520_RESET_ID_EMMC 1 +#define TH1520_RESET_ID_MISCSYS_AXI 2 +#define TH1520_RESET_ID_MISCSYS_AXI_APB 3 +#define TH1520_RESET_ID_SDIO0 4 +#define TH1520_RESET_ID_SDIO1 5 +#define TH1520_RESET_ID_USB3_APB 6 +#define TH1520_RESET_ID_USB3_PHY 7 +#define TH1520_RESET_ID_USB3_VCC 8 + +/* VI Subsystem */ +#define TH1520_RESET_ID_ISP0 0 +#define TH1520_RESET_ID_ISP1 1 +#define TH1520_RESET_ID_CSI0_APB 2 +#define TH1520_RESET_ID_CSI1_APB 3 +#define TH1520_RESET_ID_CSI2_APB 4 +#define TH1520_RESET_ID_MIPI_FIFO 5 +#define TH1520_RESET_ID_ISP_VENC_APB 6 +#define TH1520_RESET_ID_VIPRE_APB 7 +#define TH1520_RESET_ID_VIPRE_AXI 8 +#define TH1520_RESET_ID_DW200_APB 9 +#define TH1520_RESET_ID_VISYS3_AXI 10 +#define TH1520_RESET_ID_VISYS2_AXI 11 +#define TH1520_RESET_ID_VISYS1_AXI 12 +#define TH1520_RESET_ID_VISYS_AXI 13 +#define TH1520_RESET_ID_VISYS_APB 14 +#define TH1520_RESET_ID_ISP_VENC_AXI 15 + +/* VO Subsystem */ #define TH1520_RESET_ID_GPU 0 #define TH1520_RESET_ID_GPU_CLKGEN 1 -#define TH1520_RESET_ID_NPU 2 -#define TH1520_RESET_ID_WDT0 3 -#define TH1520_RESET_ID_WDT1 4 #define TH1520_RESET_ID_DPU_AHB 5 #define TH1520_RESET_ID_DPU_AXI 6 #define TH1520_RESET_ID_DPU_CORE 7 @@ -19,5 +194,43 @@ #define TH1520_RESET_ID_DSI1_APB 9 #define TH1520_RESET_ID_HDMI 10 #define TH1520_RESET_ID_HDMI_APB 11 +#define TH1520_RESET_ID_VOAXI 12 +#define TH1520_RESET_ID_VOAXI_APB 13 +#define TH1520_RESET_ID_X2H_DPU_AXI 14 +#define TH1520_RESET_ID_X2H_DPU_AHB 15 +#define TH1520_RESET_ID_X2H_DPU1_AXI 16 +#define TH1520_RESET_ID_X2H_DPU1_AHB 17 + +/* VP Subsystem */ +#define TH1520_RESET_ID_VPSYS_AXI_APB 0 +#define TH1520_RESET_ID_VPSYS_AXI 1 +#define TH1520_RESET_ID_FCE_APB 2 +#define TH1520_RESET_ID_FCE_CORE 3 +#define TH1520_RESET_ID_FCE_X2X_MASTER 4 +#define TH1520_RESET_ID_FCE_X2X_SLAVE 5 +#define TH1520_RESET_ID_G2D_APB 6 +#define TH1520_RESET_ID_G2D_ACLK 7 +#define TH1520_RESET_ID_G2D_CORE 8 +#define TH1520_RESET_ID_VDEC_APB 9 +#define TH1520_RESET_ID_VDEC_ACLK 10 +#define TH1520_RESET_ID_VDEC_CORE 11 +#define TH1520_RESET_ID_VENC_APB 12 +#define TH1520_RESET_ID_VENC_CORE 13 + +/* DSP Subsystem */ +#define TH1520_RESET_ID_X2X_DSP1 0 +#define TH1520_RESET_ID_X2X_DSP0 1 +#define TH1520_RESET_ID_X2X_SLAVE_DSP1 2 +#define TH1520_RESET_ID_X2X_SLAVE_DSP0 3 +#define TH1520_RESET_ID_DSP0_CORE 4 +#define TH1520_RESET_ID_DSP0_DEBUG 5 +#define TH1520_RESET_ID_DSP0_APB 6 +#define TH1520_RESET_ID_DSP1_CORE 4 +#define TH1520_RESET_ID_DSP1_DEBUG 5 +#define TH1520_RESET_ID_DSP1_APB 6 +#define TH1520_RESET_ID_DSPSYS_APB 7 +#define TH1520_RESET_ID_AXI4_DSPSYS_SLV 8 +#define TH1520_RESET_ID_AXI4_DSPSYS 9 +#define TH1520_RESET_ID_AXI4_DSP_RS 10 =20 #endif /* _DT_BINDINGS_TH1520_RESET_H */ --=20 2.50.1 From nobody Fri Oct 3 12:16:43 2025 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1475E224AE0; Mon, 1 Sep 2025 04:24:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756700650; cv=none; b=dtA2RZyS6xwY3QenRvAz7auiqSXnKZss6FDwbW+KNSYQ8+BTGyk/pD0fr7Ua2pVDWQjS9Yq1GuB+sdrdo3Tj6H8hbpnXs6/ZmKPVFmeSRQMg8V/QsNY0zYTbsoB0M1WS65D24KWOfCDFe4HlDCGUK/el8OoSaJ7MzgDlzdm5gIA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756700650; c=relaxed/simple; bh=AyARZ8O9kOKQYCzMN7H8nfyDa+QfPPanHy+EOHRlTZM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XqT5TKlZ4MCWLXGik/j4/JoWZpAoywVGUGjWWXF8xUgJ4fV1u3mdlk02+hjUwoar3qdu42vNbuH5Ak0sE2ArbPK4HONRweQxx9NnB38cVLtLOC995fvMHECWsPpoRv8cDz8QA4vhFwbJwfAZ1GsgaHYV0HoaiJQ5j2AdT8KyCu4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=I84SXVPt; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="I84SXVPt" Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 7A6D720A4A; Mon, 1 Sep 2025 06:24:06 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id F_DJaGlQeZov; Mon, 1 Sep 2025 06:24:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1756700645; bh=AyARZ8O9kOKQYCzMN7H8nfyDa+QfPPanHy+EOHRlTZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=I84SXVPtprJx5B7cvt8/XmOO6KhoKS5ue/q1CYtWmnXJc4c96hUItTooEuRA+1eJD C6sYbhGgMemKMo/euh3NdC778y0iEvAr40yNu3a2HUSrSxUl9rACcXvJ4V47X7/aV9 pF3VRBp3znTnDQKCfM7gmv09sue7GHPicqPeGvyosLNP8X9eZrgYaK0TXr/T2Sqz3Y 4LThA1EAsA59xmy77lcUx9jH1xTQOO6S/gsM5Y+VZi6J7Wik3QYE6DHzJO54Hlo56r QhHoDlVIefIlehFW4NBLY07RmL3jAMQqvcQu+yWJEd+gn7A6klqzGQWHY82+ITtbPc dVnZT76n1Wh3g== From: Yao Zi To: Drew Fustini , Guo Ren , Fu Wei , Philipp Zabel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Michal Wilczynski Cc: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Icenowy Zheng , Han Gao , Han Gao , Yao Zi Subject: [PATCH 2/4] reset: th1520: Prepare for supporting multiple controllers Date: Mon, 1 Sep 2025 04:23:18 +0000 Message-ID: <20250901042320.22865-3-ziyao@disroot.org> In-Reply-To: <20250901042320.22865-1-ziyao@disroot.org> References: <20250901042320.22865-1-ziyao@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" TH1520 SoC is divided into several subsystems, shipping distinct reset controllers with similar control logic. Let's make reset signal mapping a data structure specific to one compatible to prepare for introduction of more reset controllers in the future. Signed-off-by: Yao Zi --- drivers/reset/reset-th1520.c | 42 +++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/drivers/reset/reset-th1520.c b/drivers/reset/reset-th1520.c index 14d964a9c6b6..2b65a95ed021 100644 --- a/drivers/reset/reset-th1520.c +++ b/drivers/reset/reset-th1520.c @@ -29,14 +29,20 @@ #define TH1520_HDMI_SW_MAIN_RST BIT(0) #define TH1520_HDMI_SW_PRST BIT(1) =20 +struct th1520_reset_map { + u32 bit; + u32 reg; +}; + struct th1520_reset_priv { struct reset_controller_dev rcdev; struct regmap *map; + const struct th1520_reset_map *resets; }; =20 -struct th1520_reset_map { - u32 bit; - u32 reg; +struct th1520_reset_data { + const struct th1520_reset_map *resets; + size_t num; }; =20 static const struct th1520_reset_map th1520_resets[] =3D { @@ -90,7 +96,7 @@ static int th1520_reset_assert(struct reset_controller_de= v *rcdev, struct th1520_reset_priv *priv =3D to_th1520_reset(rcdev); const struct th1520_reset_map *reset; =20 - reset =3D &th1520_resets[id]; + reset =3D &priv->resets[id]; =20 return regmap_update_bits(priv->map, reset->reg, reset->bit, 0); } @@ -101,7 +107,7 @@ static int th1520_reset_deassert(struct reset_controlle= r_dev *rcdev, struct th1520_reset_priv *priv =3D to_th1520_reset(rcdev); const struct th1520_reset_map *reset; =20 - reset =3D &th1520_resets[id]; + reset =3D &priv->resets[id]; =20 return regmap_update_bits(priv->map, reset->reg, reset->bit, reset->bit); @@ -120,11 +126,14 @@ static const struct regmap_config th1520_reset_regmap= _config =3D { =20 static int th1520_reset_probe(struct platform_device *pdev) { + const struct th1520_reset_data *data; struct device *dev =3D &pdev->dev; struct th1520_reset_priv *priv; void __iomem *base; int ret; =20 + data =3D device_get_match_data(dev); + priv =3D devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; @@ -138,22 +147,31 @@ static int th1520_reset_probe(struct platform_device = *pdev) if (IS_ERR(priv->map)) return PTR_ERR(priv->map); =20 - /* Initialize GPU resets to asserted state */ - ret =3D regmap_update_bits(priv->map, TH1520_GPU_RST_CFG, - TH1520_GPU_RST_CFG_MASK, 0); - if (ret) - return ret; + if (of_device_is_compatible(dev->of_node, "thead,th1520-reset")) { + /* Initialize GPU resets to asserted state */ + ret =3D regmap_update_bits(priv->map, TH1520_GPU_RST_CFG, + TH1520_GPU_RST_CFG_MASK, 0); + if (ret) + return ret; + } =20 priv->rcdev.owner =3D THIS_MODULE; - priv->rcdev.nr_resets =3D ARRAY_SIZE(th1520_resets); + priv->rcdev.nr_resets =3D data->num; priv->rcdev.ops =3D &th1520_reset_ops; priv->rcdev.of_node =3D dev->of_node; =20 + priv->resets =3D data->resets; + return devm_reset_controller_register(dev, &priv->rcdev); } =20 +static const struct th1520_reset_data th1520_reset_data =3D { + .resets =3D th1520_resets, + .num =3D ARRAY_SIZE(th1520_resets), +}; + static const struct of_device_id th1520_reset_match[] =3D { - { .compatible =3D "thead,th1520-reset" }, + { .compatible =3D "thead,th1520-reset", .data =3D &th1520_reset_data }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, th1520_reset_match); --=20 2.50.1 From nobody Fri Oct 3 12:16:43 2025 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79D711DEFDD; Mon, 1 Sep 2025 04:24:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756700698; cv=none; b=JhaIZLOLAnVf/0IAgUj0OODQHSTf4jCN1VRBpEiZiuquD1JsAvXjyrHc52ZEZBOkHRfbuR2xN0AFBNlfFIxHKeCi5vFKrzlhzdK0leiQZQKzYO+um3FdJHyeRePkL/a1QhVaNTURvGgA+YWdbPavlR7G97RQ3VH5JO6j81MP5C4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756700698; c=relaxed/simple; bh=rWpUE0YYZOJahmFOkDt4Xcr22pBNg4weP+ZV+18qR1Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rwGaiKPcfbwUjNIFjKSpxH8P8qwMJV8eJExdegzGOs88smr0JrILOW26sWGT8FKoFH9KE0c6CxFftgAppzQA1VtqA3IdjmzYqlZxTWFcpFzfqMdU7/cmtHQXToo9u794bstAPnsC+/6lIFb9yfGsovDIjedX1nWlt0WR104g7pc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=Z3yC9zf/; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="Z3yC9zf/" Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id DF6AF20B45; Mon, 1 Sep 2025 06:24:54 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id beKylaFr0sRS; Mon, 1 Sep 2025 06:24:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1756700693; bh=rWpUE0YYZOJahmFOkDt4Xcr22pBNg4weP+ZV+18qR1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Z3yC9zf/7T11g7rc4tE2AokYuEKCuIZGzevTW4tFYtIfcGcazSkHKFZdT3tdT0QjM XU5mqIz6cSamrY1Sk4heywvcl1z3t/K/wPDMeUrcA4dOWG21VaepZuVIK3oyPSCkim ajM6esi8zVxwna9uCnotOYNRcSz0rIV2cc6w2s/cQcwfe8O0Z7gXnaoLPAZirjq5B/ SyXeZvKomTOMGqKUx/rXaAbhXE4m9tK77UZByV2ByZpGvzvgqwUcipTDR1RAqNG5on d8rPQKHRP30smEQ+6+jdljdQaj1sbMf1CKBZtve3KIj699C/J+Nb2q8UW0hwlpFeV1 kGd3vn7PPUWUQ== From: Yao Zi To: Drew Fustini , Guo Ren , Fu Wei , Philipp Zabel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Michal Wilczynski Cc: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Icenowy Zheng , Han Gao , Han Gao , Yao Zi Subject: [PATCH 3/4] reset: th1520: Support reset controllers in more subsystems Date: Mon, 1 Sep 2025 04:23:19 +0000 Message-ID: <20250901042320.22865-4-ziyao@disroot.org> In-Reply-To: <20250901042320.22865-1-ziyao@disroot.org> References: <20250901042320.22865-1-ziyao@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Introduce reset controllers for AP, MISC, VI, VP and DSP subsystems and add their reset signal mappings. Signed-off-by: Yao Zi --- drivers/reset/reset-th1520.c | 793 +++++++++++++++++++++++++++++++++++ 1 file changed, 793 insertions(+) diff --git a/drivers/reset/reset-th1520.c b/drivers/reset/reset-th1520.c index 2b65a95ed021..f9d87898cf59 100644 --- a/drivers/reset/reset-th1520.c +++ b/drivers/reset/reset-th1520.c @@ -11,6 +11,82 @@ =20 #include =20 + /* register offset in RSTGEN_R */ +#define TH1520_BROM_RST_CFG 0x0 +#define TH1520_C910_RST_CFG 0x4 +#define TH1520_CHIP_DBG_RST_CFG 0xc +#define TH1520_AXI4_CPUSYS2_RST_CFG 0x10 +#define TH1520_X2H_CPUSYS_RST_CFG 0x18 +#define TH1520_AHB2_CPUSYS_RST_CFG 0x1c +#define TH1520_APB3_CPUSYS_RST_CFG 0x20 +#define TH1520_MBOX0_RST_CFG 0x24 +#define TH1520_MBOX1_RST_CFG 0x28 +#define TH1520_MBOX2_RST_CFG 0x2c +#define TH1520_MBOX3_RST_CFG 0x30 +#define TH1520_WDT0_RST_CFG 0x34 +#define TH1520_WDT1_RST_CFG 0x38 +#define TH1520_TIMER0_RST_CFG 0x3c +#define TH1520_TIMER1_RST_CFG 0x40 +#define TH1520_PERISYS_AHB_RST_CFG 0x44 +#define TH1520_PERISYS_APB1_RST_CFG 0x48 +#define TH1520_PERISYS_APB2_RST_CFG 0x4c +#define TH1520_GMAC0_RST_CFG 0x68 +#define TH1520_UART0_RST_CFG 0x70 +#define TH1520_UART1_RST_CFG 0x74 +#define TH1520_UART2_RST_CFG 0x78 +#define TH1520_UART3_RST_CFG 0x7c +#define TH1520_UART4_RST_CFG 0x80 +#define TH1520_UART5_RST_CFG 0x84 +#define TH1520_QSPI0_RST_CFG 0x8c +#define TH1520_QSPI1_RST_CFG 0x90 +#define TH1520_SPI_RST_CFG 0x94 +#define TH1520_I2C0_RST_CFG 0x98 +#define TH1520_I2C1_RST_CFG 0x9c +#define TH1520_I2C2_RST_CFG 0xa0 +#define TH1520_I2C3_RST_CFG 0xa4 +#define TH1520_I2C4_RST_CFG 0xa8 +#define TH1520_I2C5_RST_CFG 0xac +#define TH1520_GPIO0_RST_CFG 0xb0 +#define TH1520_GPIO1_RST_CFG 0xb4 +#define TH1520_GPIO2_RST_CFG 0xb8 +#define TH1520_PWM_RST_CFG 0xc0 +#define TH1520_PADCTRL0_APSYS_RST_CFG 0xc4 +#define TH1520_CPU2PERI_X2H_RST_CFG 0xcc +#define TH1520_CPU2AON_X2H_RST_CFG 0xe4 +#define TH1520_AON2CPU_A2X_RST_CFG 0xfc +#define TH1520_NPUSYS_AXI_RST_CFG 0x128 +#define TH1520_CPU2VP_X2P_RST_CFG 0x12c +#define TH1520_CPU2VI_X2H_RST_CFG 0x138 +#define TH1520_BMU_C910_RST_CFG 0x148 +#define TH1520_DMAC_CPUSYS_RST_CFG 0x14c +#define TH1520_SPINLOCK_RST_CFG 0x178 +#define TH1520_CFG2TEE_X2H_RST_CFG 0x188 +#define TH1520_DSMART_RST_CFG 0x18c +#define TH1520_GPIO3_RST_CFG 0x1a8 +#define TH1520_I2S_RST_CFG 0x1ac +#define TH1520_IMG_NNA_RST_CFG 0x1b0 +#define TH1520_PERI_APB3_RST_CFG 0x1dc +#define TH1520_VP_SUBSYS_RST_CFG 0x1ec +#define TH1520_PERISYS_APB4_RST_CFG 0x1f8 +#define TH1520_GMAC1_RST_CFG 0x204 +#define TH1520_GMAC_AXI_RST_CFG 0x208 +#define TH1520_PADCTRL1_APSYS_RST_CFG 0x20c +#define TH1520_VOSYS_AXI_RST_CFG 0x210 +#define TH1520_VOSYS_X2X_RST_CFG 0x214 +#define TH1520_MISC2VP_X2X_RST_CFG 0x218 +#define TH1520_SUBSYS_RST_CFG 0x220 + + /* register offset in MISCSYS_REGMAP */ +#define TH1520_EMMC_RST_CFG 0x0 +#define TH1520_MISCSYS_AXI_RST_CFG 0x8 +#define TH1520_SDIO0_RST_CFG 0xc +#define TH1520_SDIO1_RST_CFG 0x10 +#define TH1520_USB3_DRD_RST_CFG 0x14 + + /* register offset in VISYS_REGMAP */ +#define TH1520_VISYS_RST_CFG 0x0 +#define TH1520_VISYS_2_RST_CFG 0x4 + /* register offset in VOSYS_REGMAP */ #define TH1520_GPU_RST_CFG 0x0 #define TH1520_GPU_RST_CFG_MASK GENMASK(1, 0) @@ -18,6 +94,8 @@ #define TH1520_DSI0_RST_CFG 0x8 #define TH1520_DSI1_RST_CFG 0xc #define TH1520_HDMI_RST_CFG 0x14 +#define TH1520_AXI4_VO_DW_AXI_RST_CFG 0x18 +#define TH1520_X2H_X4_VOSYS_DW_RST_CFG 0x20 =20 /* register values */ #define TH1520_GPU_SW_GPU_RST BIT(0) @@ -29,6 +107,16 @@ #define TH1520_HDMI_SW_MAIN_RST BIT(0) #define TH1520_HDMI_SW_PRST BIT(1) =20 + /* register offset in VPSYS_REGMAP */ +#define TH1520_AXIBUS_RST_CFG 0x0 +#define TH1520_FCE_RST_CFG 0x4 +#define TH1520_G2D_RST_CFG 0x8 +#define TH1520_VDEC_RST_CFG 0xc +#define TH1520_VENC_RST_CFG 0x10 + + /* register offset in DSP_REGMAP */ +#define TH1520_DSPSYS_RST_CFG 0x0 + struct th1520_reset_map { u32 bit; u32 reg; @@ -45,6 +133,539 @@ struct th1520_reset_data { size_t num; }; =20 +static const struct th1520_reset_map th1520_ap_resets[] =3D { + [TH1520_RESET_ID_BROM] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_BROM_RST_CFG, + }, + [TH1520_RESET_ID_C910_TOP] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_C910_RST_CFG, + }, + [TH1520_RESET_ID_NPU] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_IMG_NNA_RST_CFG, + }, + [TH1520_RESET_ID_WDT0] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_WDT0_RST_CFG, + }, + [TH1520_RESET_ID_WDT1] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_WDT1_RST_CFG, + }, + [TH1520_RESET_ID_C910_C0] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_C910_RST_CFG, + }, + [TH1520_RESET_ID_C910_C1] =3D { + .bit =3D BIT(2), + .reg =3D TH1520_C910_RST_CFG, + }, + [TH1520_RESET_ID_C910_C2] =3D { + .bit =3D BIT(3), + .reg =3D TH1520_C910_RST_CFG, + }, + [TH1520_RESET_ID_C910_C3] =3D { + .bit =3D BIT(4), + .reg =3D TH1520_C910_RST_CFG, + }, + [TH1520_RESET_ID_CHIP_DBG_CORE] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_CHIP_DBG_RST_CFG, + }, + [TH1520_RESET_ID_CHIP_DBG_AXI] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_CHIP_DBG_RST_CFG, + }, + [TH1520_RESET_ID_AXI4_CPUSYS2_AXI] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_AXI4_CPUSYS2_RST_CFG, + }, + [TH1520_RESET_ID_AXI4_CPUSYS2_APB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_AXI4_CPUSYS2_RST_CFG, + }, + [TH1520_RESET_ID_X2H_CPUSYS] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_X2H_CPUSYS_RST_CFG, + }, + [TH1520_RESET_ID_AHB2_CPUSYS] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_AHB2_CPUSYS_RST_CFG, + }, + [TH1520_RESET_ID_APB3_CPUSYS] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_APB3_CPUSYS_RST_CFG, + }, + [TH1520_RESET_ID_MBOX0_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_MBOX0_RST_CFG, + }, + [TH1520_RESET_ID_MBOX1_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_MBOX1_RST_CFG, + }, + [TH1520_RESET_ID_MBOX2_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_MBOX2_RST_CFG, + }, + [TH1520_RESET_ID_MBOX3_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_MBOX3_RST_CFG, + }, + [TH1520_RESET_ID_TIMER0_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_TIMER0_RST_CFG, + }, + [TH1520_RESET_ID_TIMER0_CORE] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_TIMER0_RST_CFG, + }, + [TH1520_RESET_ID_TIMER1_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_TIMER1_RST_CFG, + }, + [TH1520_RESET_ID_TIMER1_CORE] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_TIMER1_RST_CFG, + }, + [TH1520_RESET_ID_PERISYS_AHB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_PERISYS_AHB_RST_CFG, + }, + [TH1520_RESET_ID_PERISYS_APB1] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_PERISYS_APB1_RST_CFG, + }, + [TH1520_RESET_ID_PERISYS_APB2] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_PERISYS_APB2_RST_CFG, + }, + [TH1520_RESET_ID_GMAC0_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_GMAC0_RST_CFG, + }, + [TH1520_RESET_ID_GMAC0_AHB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_GMAC0_RST_CFG, + }, + [TH1520_RESET_ID_GMAC0_CLKGEN] =3D { + .bit =3D BIT(2), + .reg =3D TH1520_GMAC0_RST_CFG, + }, + [TH1520_RESET_ID_GMAC0_AXI] =3D { + .bit =3D BIT(3), + .reg =3D TH1520_GMAC0_RST_CFG, + }, + [TH1520_RESET_ID_UART0_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_UART0_RST_CFG, + }, + [TH1520_RESET_ID_UART0_IF] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_UART0_RST_CFG, + }, + [TH1520_RESET_ID_UART1_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_UART1_RST_CFG, + }, + [TH1520_RESET_ID_UART1_IF] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_UART1_RST_CFG, + }, + [TH1520_RESET_ID_UART2_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_UART2_RST_CFG, + }, + [TH1520_RESET_ID_UART2_IF] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_UART2_RST_CFG, + }, + [TH1520_RESET_ID_UART3_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_UART3_RST_CFG, + }, + [TH1520_RESET_ID_UART3_IF] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_UART3_RST_CFG, + }, + [TH1520_RESET_ID_UART4_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_UART4_RST_CFG, + }, + [TH1520_RESET_ID_UART4_IF] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_UART4_RST_CFG, + }, + [TH1520_RESET_ID_UART5_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_UART5_RST_CFG, + }, + [TH1520_RESET_ID_UART5_IF] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_UART5_RST_CFG, + }, + [TH1520_RESET_ID_QSPI0_IF] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_QSPI0_RST_CFG, + }, + [TH1520_RESET_ID_QSPI0_APB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_QSPI0_RST_CFG, + }, + [TH1520_RESET_ID_QSPI1_IF] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_QSPI1_RST_CFG, + }, + [TH1520_RESET_ID_QSPI1_APB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_QSPI1_RST_CFG, + }, + [TH1520_RESET_ID_SPI_IF] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_SPI_RST_CFG, + }, + [TH1520_RESET_ID_SPI_APB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_SPI_RST_CFG, + }, + [TH1520_RESET_ID_I2C0_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_I2C0_RST_CFG, + }, + [TH1520_RESET_ID_I2C0_CORE] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_I2C0_RST_CFG, + }, + [TH1520_RESET_ID_I2C1_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_I2C1_RST_CFG, + }, + [TH1520_RESET_ID_I2C1_CORE] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_I2C1_RST_CFG, + }, + [TH1520_RESET_ID_I2C2_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_I2C2_RST_CFG, + }, + [TH1520_RESET_ID_I2C2_CORE] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_I2C2_RST_CFG, + }, + [TH1520_RESET_ID_I2C3_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_I2C3_RST_CFG, + }, + [TH1520_RESET_ID_I2C3_CORE] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_I2C3_RST_CFG, + }, + [TH1520_RESET_ID_I2C4_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_I2C4_RST_CFG, + }, + [TH1520_RESET_ID_I2C4_CORE] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_I2C4_RST_CFG, + }, + [TH1520_RESET_ID_I2C5_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_I2C5_RST_CFG, + }, + [TH1520_RESET_ID_I2C5_CORE] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_I2C5_RST_CFG, + }, + [TH1520_RESET_ID_GPIO0_DB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_GPIO0_RST_CFG, + }, + [TH1520_RESET_ID_GPIO0_APB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_GPIO0_RST_CFG, + }, + [TH1520_RESET_ID_GPIO1_DB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_GPIO1_RST_CFG, + }, + [TH1520_RESET_ID_GPIO1_APB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_GPIO1_RST_CFG, + }, + [TH1520_RESET_ID_GPIO2_DB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_GPIO2_RST_CFG, + }, + [TH1520_RESET_ID_GPIO2_APB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_GPIO2_RST_CFG, + }, + [TH1520_RESET_ID_PWM_COUNTER] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_PWM_RST_CFG, + }, + [TH1520_RESET_ID_PWM_APB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_PWM_RST_CFG, + }, + [TH1520_RESET_ID_PADCTRL0_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_PADCTRL0_APSYS_RST_CFG, + }, + [TH1520_RESET_ID_CPU2PERI_X2H] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_CPU2PERI_X2H_RST_CFG, + }, + [TH1520_RESET_ID_CPU2AON_X2H] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_CPU2AON_X2H_RST_CFG, + }, + [TH1520_RESET_ID_AON2CPU_A2X] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_AON2CPU_A2X_RST_CFG, + }, + [TH1520_RESET_ID_NPUSYS_AXI] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_NPUSYS_AXI_RST_CFG, + }, + [TH1520_RESET_ID_NPUSYS_AXI_APB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_NPUSYS_AXI_RST_CFG, + }, + [TH1520_RESET_ID_CPU2VP_X2P] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_CPU2VP_X2P_RST_CFG, + }, + [TH1520_RESET_ID_CPU2VI_X2H] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_CPU2VI_X2H_RST_CFG, + }, + [TH1520_RESET_ID_BMU_AXI] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_BMU_C910_RST_CFG, + }, + [TH1520_RESET_ID_BMU_APB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_BMU_C910_RST_CFG, + }, + [TH1520_RESET_ID_DMAC_CPUSYS_AXI] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_DMAC_CPUSYS_RST_CFG, + }, + [TH1520_RESET_ID_DMAC_CPUSYS_AHB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_DMAC_CPUSYS_RST_CFG, + }, + [TH1520_RESET_ID_SPINLOCK] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_SPINLOCK_RST_CFG, + }, + [TH1520_RESET_ID_CFG2TEE] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_CFG2TEE_X2H_RST_CFG, + }, + [TH1520_RESET_ID_DSMART] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_DSMART_RST_CFG, + }, + [TH1520_RESET_ID_GPIO3_DB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_GPIO3_RST_CFG, + }, + [TH1520_RESET_ID_GPIO3_APB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_GPIO3_RST_CFG, + }, + [TH1520_RESET_ID_PERI_I2S] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_I2S_RST_CFG, + }, + [TH1520_RESET_ID_PERI_APB3] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_PERI_APB3_RST_CFG, + }, + [TH1520_RESET_ID_PERI2PERI1_APB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_PERI_APB3_RST_CFG, + }, + [TH1520_RESET_ID_VPSYS_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_VP_SUBSYS_RST_CFG, + }, + [TH1520_RESET_ID_PERISYS_APB4] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_PERISYS_APB4_RST_CFG, + }, + [TH1520_RESET_ID_GMAC1_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_GMAC1_RST_CFG, + }, + [TH1520_RESET_ID_GMAC1_AHB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_GMAC1_RST_CFG, + }, + [TH1520_RESET_ID_GMAC1_CLKGEN] =3D { + .bit =3D BIT(2), + .reg =3D TH1520_GMAC1_RST_CFG, + }, + [TH1520_RESET_ID_GMAC1_AXI] =3D { + .bit =3D BIT(3), + .reg =3D TH1520_GMAC1_RST_CFG, + }, + [TH1520_RESET_ID_GMAC_AXI] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_GMAC_AXI_RST_CFG, + }, + [TH1520_RESET_ID_GMAC_AXI_APB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_GMAC_AXI_RST_CFG, + }, + [TH1520_RESET_ID_PADCTRL1_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_PADCTRL1_APSYS_RST_CFG, + }, + [TH1520_RESET_ID_VOSYS_AXI] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_VOSYS_AXI_RST_CFG, + }, + [TH1520_RESET_ID_VOSYS_AXI_APB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_VOSYS_AXI_RST_CFG, + }, + [TH1520_RESET_ID_VOSYS_AXI_X2X] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_VOSYS_X2X_RST_CFG, + }, + [TH1520_RESET_ID_MISC2VP_X2X] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_MISC2VP_X2X_RST_CFG, + }, + [TH1520_RESET_ID_DSPSYS] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_SUBSYS_RST_CFG, + }, + [TH1520_RESET_ID_VISYS] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_SUBSYS_RST_CFG, + }, + [TH1520_RESET_ID_VOSYS] =3D { + .bit =3D BIT(2), + .reg =3D TH1520_SUBSYS_RST_CFG, + }, + [TH1520_RESET_ID_VPSYS] =3D { + .bit =3D BIT(3), + .reg =3D TH1520_SUBSYS_RST_CFG, + }, +}; + +static const struct th1520_reset_map th1520_misc_resets[] =3D { + [TH1520_RESET_ID_EMMC_SDIO_CLKGEN] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_EMMC_RST_CFG, + }, + [TH1520_RESET_ID_EMMC] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_EMMC_RST_CFG, + }, + [TH1520_RESET_ID_MISCSYS_AXI] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_MISCSYS_AXI_RST_CFG, + }, + [TH1520_RESET_ID_MISCSYS_AXI_APB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_MISCSYS_AXI_RST_CFG, + }, + [TH1520_RESET_ID_SDIO0] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_SDIO0_RST_CFG, + }, + [TH1520_RESET_ID_SDIO1] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_SDIO1_RST_CFG, + }, + [TH1520_RESET_ID_USB3_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_USB3_DRD_RST_CFG, + }, + [TH1520_RESET_ID_USB3_PHY] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_USB3_DRD_RST_CFG, + }, + [TH1520_RESET_ID_USB3_VCC] =3D { + .bit =3D BIT(2), + .reg =3D TH1520_USB3_DRD_RST_CFG, + }, +}; + +static const struct th1520_reset_map th1520_vi_resets[] =3D { + [TH1520_RESET_ID_ISP0] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_VISYS_RST_CFG, + }, + [TH1520_RESET_ID_ISP1] =3D { + .bit =3D BIT(4), + .reg =3D TH1520_VISYS_RST_CFG, + }, + [TH1520_RESET_ID_CSI0_APB] =3D { + .bit =3D BIT(16), + .reg =3D TH1520_VISYS_RST_CFG, + }, + [TH1520_RESET_ID_CSI1_APB] =3D { + .bit =3D BIT(17), + .reg =3D TH1520_VISYS_RST_CFG, + }, + [TH1520_RESET_ID_CSI2_APB] =3D { + .bit =3D BIT(18), + .reg =3D TH1520_VISYS_RST_CFG, + }, + [TH1520_RESET_ID_MIPI_FIFO] =3D { + .bit =3D BIT(20), + .reg =3D TH1520_VISYS_RST_CFG, + }, + [TH1520_RESET_ID_ISP_VENC_APB] =3D { + .bit =3D BIT(24), + .reg =3D TH1520_VISYS_RST_CFG, + }, + [TH1520_RESET_ID_VIPRE_APB] =3D { + .bit =3D BIT(28), + .reg =3D TH1520_VISYS_RST_CFG, + }, + [TH1520_RESET_ID_VIPRE_AXI] =3D { + .bit =3D BIT(29), + .reg =3D TH1520_VISYS_RST_CFG, + }, + [TH1520_RESET_ID_DW200_APB] =3D { + .bit =3D BIT(31), + .reg =3D TH1520_VISYS_RST_CFG, + }, + [TH1520_RESET_ID_VISYS3_AXI] =3D { + .bit =3D BIT(8), + .reg =3D TH1520_VISYS_2_RST_CFG, + }, + [TH1520_RESET_ID_VISYS2_AXI] =3D { + .bit =3D BIT(9), + .reg =3D TH1520_VISYS_2_RST_CFG, + }, + [TH1520_RESET_ID_VISYS1_AXI] =3D { + .bit =3D BIT(10), + .reg =3D TH1520_VISYS_2_RST_CFG, + }, + [TH1520_RESET_ID_VISYS_AXI] =3D { + .bit =3D BIT(12), + .reg =3D TH1520_VISYS_2_RST_CFG, + }, + [TH1520_RESET_ID_VISYS_APB] =3D { + .bit =3D BIT(16), + .reg =3D TH1520_VISYS_2_RST_CFG, + }, + [TH1520_RESET_ID_ISP_VENC_AXI] =3D { + .bit =3D BIT(20), + .reg =3D TH1520_VISYS_2_RST_CFG, + }, +}; + static const struct th1520_reset_map th1520_resets[] =3D { [TH1520_RESET_ID_GPU] =3D { .bit =3D TH1520_GPU_SW_GPU_RST, @@ -82,6 +703,148 @@ static const struct th1520_reset_map th1520_resets[] = =3D { .bit =3D TH1520_HDMI_SW_PRST, .reg =3D TH1520_HDMI_RST_CFG, }, + [TH1520_RESET_ID_VOAXI] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_AXI4_VO_DW_AXI_RST_CFG, + }, + [TH1520_RESET_ID_VOAXI_APB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_AXI4_VO_DW_AXI_RST_CFG, + }, + [TH1520_RESET_ID_X2H_DPU_AXI] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_X2H_X4_VOSYS_DW_RST_CFG, + }, + [TH1520_RESET_ID_X2H_DPU_AHB] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_X2H_X4_VOSYS_DW_RST_CFG, + }, + [TH1520_RESET_ID_X2H_DPU1_AXI] =3D { + .bit =3D BIT(2), + .reg =3D TH1520_X2H_X4_VOSYS_DW_RST_CFG, + }, + [TH1520_RESET_ID_X2H_DPU1_AHB] =3D { + .bit =3D BIT(3), + .reg =3D TH1520_X2H_X4_VOSYS_DW_RST_CFG, + }, +}; + +static const struct th1520_reset_map th1520_vp_resets[] =3D { + [TH1520_RESET_ID_VPSYS_AXI_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_AXIBUS_RST_CFG, + }, + [TH1520_RESET_ID_VPSYS_AXI] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_AXIBUS_RST_CFG, + }, + [TH1520_RESET_ID_FCE_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_FCE_RST_CFG, + }, + [TH1520_RESET_ID_FCE_CORE] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_FCE_RST_CFG, + }, + [TH1520_RESET_ID_FCE_X2X_MASTER] =3D { + .bit =3D BIT(4), + .reg =3D TH1520_FCE_RST_CFG, + }, + [TH1520_RESET_ID_FCE_X2X_SLAVE] =3D { + .bit =3D BIT(5), + .reg =3D TH1520_FCE_RST_CFG, + }, + [TH1520_RESET_ID_G2D_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_G2D_RST_CFG, + }, + [TH1520_RESET_ID_G2D_ACLK] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_G2D_RST_CFG, + }, + [TH1520_RESET_ID_G2D_CORE] =3D { + .bit =3D BIT(2), + .reg =3D TH1520_G2D_RST_CFG, + }, + [TH1520_RESET_ID_VDEC_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_VDEC_RST_CFG, + }, + [TH1520_RESET_ID_VDEC_ACLK] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_VDEC_RST_CFG, + }, + [TH1520_RESET_ID_VDEC_CORE] =3D { + .bit =3D BIT(2), + .reg =3D TH1520_VDEC_RST_CFG, + }, + [TH1520_RESET_ID_VENC_APB] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_VENC_RST_CFG, + }, + [TH1520_RESET_ID_VENC_CORE] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_VENC_RST_CFG, + }, +}; + +static const struct th1520_reset_map th1520_dsp_resets[] =3D { + [TH1520_RESET_ID_X2X_DSP1] =3D { + .bit =3D BIT(0), + .reg =3D TH1520_DSPSYS_RST_CFG, + }, + [TH1520_RESET_ID_X2X_DSP0] =3D { + .bit =3D BIT(1), + .reg =3D TH1520_DSPSYS_RST_CFG, + }, + [TH1520_RESET_ID_X2X_SLAVE_DSP1] =3D { + .bit =3D BIT(2), + .reg =3D TH1520_DSPSYS_RST_CFG, + }, + [TH1520_RESET_ID_X2X_SLAVE_DSP0] =3D { + .bit =3D BIT(3), + .reg =3D TH1520_DSPSYS_RST_CFG, + }, + [TH1520_RESET_ID_DSP0_CORE] =3D { + .bit =3D BIT(8), + .reg =3D TH1520_DSPSYS_RST_CFG, + }, + [TH1520_RESET_ID_DSP0_DEBUG] =3D { + .bit =3D BIT(9), + .reg =3D TH1520_DSPSYS_RST_CFG, + }, + [TH1520_RESET_ID_DSP0_APB] =3D { + .bit =3D BIT(10), + .reg =3D TH1520_DSPSYS_RST_CFG, + }, + [TH1520_RESET_ID_DSP1_CORE] =3D { + .bit =3D BIT(12), + .reg =3D TH1520_DSPSYS_RST_CFG, + }, + [TH1520_RESET_ID_DSP1_DEBUG] =3D { + .bit =3D BIT(13), + .reg =3D TH1520_DSPSYS_RST_CFG, + }, + [TH1520_RESET_ID_DSP1_APB] =3D { + .bit =3D BIT(14), + .reg =3D TH1520_DSPSYS_RST_CFG, + }, + [TH1520_RESET_ID_DSPSYS_APB] =3D { + .bit =3D BIT(16), + .reg =3D TH1520_DSPSYS_RST_CFG, + }, + [TH1520_RESET_ID_AXI4_DSPSYS_SLV] =3D { + .bit =3D BIT(20), + .reg =3D TH1520_DSPSYS_RST_CFG, + }, + [TH1520_RESET_ID_AXI4_DSPSYS] =3D { + .bit =3D BIT(24), + .reg =3D TH1520_DSPSYS_RST_CFG, + }, + [TH1520_RESET_ID_AXI4_DSP_RS] =3D { + .bit =3D BIT(26), + .reg =3D TH1520_DSPSYS_RST_CFG, + }, }; =20 static inline struct th1520_reset_priv * @@ -165,13 +928,43 @@ static int th1520_reset_probe(struct platform_device = *pdev) return devm_reset_controller_register(dev, &priv->rcdev); } =20 +static const struct th1520_reset_data th1520_ap_reset_data =3D { + .resets =3D th1520_ap_resets, + .num =3D ARRAY_SIZE(th1520_ap_resets), +}; + +static const struct th1520_reset_data th1520_misc_reset_data =3D { + .resets =3D th1520_misc_resets, + .num =3D ARRAY_SIZE(th1520_misc_resets), +}; + +static const struct th1520_reset_data th1520_vi_reset_data =3D { + .resets =3D th1520_vi_resets, + .num =3D ARRAY_SIZE(th1520_vi_resets), +}; + static const struct th1520_reset_data th1520_reset_data =3D { .resets =3D th1520_resets, .num =3D ARRAY_SIZE(th1520_resets), }; =20 +static const struct th1520_reset_data th1520_vp_reset_data =3D { + .resets =3D th1520_vp_resets, + .num =3D ARRAY_SIZE(th1520_vp_resets), +}; + +static const struct th1520_reset_data th1520_dsp_reset_data =3D { + .resets =3D th1520_dsp_resets, + .num =3D ARRAY_SIZE(th1520_dsp_resets), +}; + static const struct of_device_id th1520_reset_match[] =3D { + { .compatible =3D "thead,th1520-reset-ap", .data =3D &th1520_ap_reset_dat= a }, + { .compatible =3D "thead,th1520-reset-misc", .data =3D &th1520_misc_reset= _data }, + { .compatible =3D "thead,th1520-reset-vi", .data =3D &th1520_vi_reset_dat= a }, { .compatible =3D "thead,th1520-reset", .data =3D &th1520_reset_data }, + { .compatible =3D "thead,th1520-reset-vp", .data =3D &th1520_vp_reset_dat= a }, + { .compatible =3D "thead,th1520-reset-dsp", .data =3D &th1520_dsp_reset_d= ata }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, th1520_reset_match); --=20 2.50.1 From nobody Fri Oct 3 12:16:43 2025 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AE45229B2A; Mon, 1 Sep 2025 04:25:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756700703; cv=none; b=HenJ8ZhImpWcM4DVO5LXOS+o4qJgKy5QqNkOq42U6fbksOQwwUOb/6ug3lHJ4DVQ3sBUOBspJrGuM54gAjnmAq0XcEnj147R04Qgg9rhHrm7hKH6z5VCe907YOMUMP9vSXArJWbCAzSpDTV+q6LPokVwg4EMvb1G9oMVdyTwSTM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756700703; c=relaxed/simple; bh=IBslNheDZQKi8czdVueADyFl/OhJ12YV0b0a6fTRNBE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BQ41Ef1CB1iNYS9Yr5P8xIgW0OCfOFYZ97xBNixmfRbMwdklNLWJE5P9oEYpXb0ZuSdBQ1Kbjz5Nqk+1sYk77e1hYOWRk0LDsW1IVswSkQl1UkR03lawUL1GRvmwHnqS91RFYPvmxmYwbXBkcZe9WOzlWcxP4KPHz6hZn+bSweE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=Yjl+PQAo; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="Yjl+PQAo" Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 534D020A4A; Mon, 1 Sep 2025 06:25:00 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id xqWkWWlIwsnK; Mon, 1 Sep 2025 06:24:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1756700699; bh=IBslNheDZQKi8czdVueADyFl/OhJ12YV0b0a6fTRNBE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Yjl+PQAo4Sqf4Q068Fp2s12iFBzveSRFGCG/8eZLYHan4kdeB7UwJ50E1UTn6MK22 tfuC3D9JM1NIm+ZA4MLrTNg+32gHm8Zc0uC8p1OIrIcf9yQpBYwq6PyuWaBnRYLYeQ ufBpITelFgBXAguHxkoQrCHI6Zd4qHV2o3H4KChIiifJPywxrMHwiP6d/aLEi7jTjH ZvclS4kk1ql2qypcfKHllsNhvqPJnex01ZvXkL5B2emA9o9K58zo6qulVqgo2x0oo+ e9KDC/x0/xiEmuVkn9IKBk4F4z/QQX+bkCrg7kQ5H86hwftDeN49/kxx1x+Oui13bu xvObz2R0MMlOw== From: Yao Zi To: Drew Fustini , Guo Ren , Fu Wei , Philipp Zabel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Michal Wilczynski Cc: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Icenowy Zheng , Han Gao , Han Gao , Yao Zi Subject: [PATCH 4/4] riscv: dts: thead: Add reset controllers of more subsystems for TH1520 Date: Mon, 1 Sep 2025 04:23:20 +0000 Message-ID: <20250901042320.22865-5-ziyao@disroot.org> In-Reply-To: <20250901042320.22865-1-ziyao@disroot.org> References: <20250901042320.22865-1-ziyao@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Describe reset controllers for VI, MISC, AP, DSP and AO subsystems. The one for AO subsystem is marked as reserved, since it may be used by AON firmware. Signed-off-by: Yao Zi --- arch/riscv/boot/dts/thead/th1520.dtsi | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/th= ead/th1520.dtsi index 03f1d7319049..e9fa0df0b56c 100644 --- a/arch/riscv/boot/dts/thead/th1520.dtsi +++ b/arch/riscv/boot/dts/thead/th1520.dtsi @@ -270,6 +270,12 @@ clint: timer@ffdc000000 { <&cpu3_intc 3>, <&cpu3_intc 7>; }; =20 + rst_vi: reset-controller@ffe4040100 { + compatible =3D "thead,th1520-reset-vi"; + reg =3D <0xff 0xe4040100 0x0 0x8>; + #reset-cells =3D <1>; + }; + spi0: spi@ffe700c000 { compatible =3D "thead,th1520-spi", "snps,dw-apb-ssi"; reg =3D <0xff 0xe700c000 0x0 0x1000>; @@ -495,6 +501,18 @@ uart2: serial@ffec010000 { status =3D "disabled"; }; =20 + rst_misc: reset-controller@ffec02c000 { + compatible =3D "thead,th1520-reset-misc"; + reg =3D <0xff 0xec02c000 0x0 0x18>; + #reset-cells =3D <1>; + }; + + rst_vp: reset-controller@ffecc30000 { + compatible =3D "thead,th1520-reset-vp"; + reg =3D <0xff 0xecc30000 0x0 0x14>; + #reset-cells =3D <1>; + }; + clk: clock-controller@ffef010000 { compatible =3D "thead,th1520-clk-ap"; reg =3D <0xff 0xef010000 0x0 0x1000>; @@ -502,6 +520,18 @@ clk: clock-controller@ffef010000 { #clock-cells =3D <1>; }; =20 + rst_ap: reset-controller@ffef014000 { + compatible =3D "thead,th1520-reset-ap"; + reg =3D <0xff 0xef014000 0x0 0x1000>; + #reset-cells =3D <1>; + }; + + rst_dsp: reset-controller@ffef040028 { + compatible =3D "thead,th1520-reset-dsp"; + reg =3D <0xff 0xef040028 0x0 0x4>; + #reset-cells =3D <1>; + }; + rst: reset-controller@ffef528000 { compatible =3D "thead,th1520-reset"; reg =3D <0xff 0xef528000 0x0 0x4f>; @@ -660,6 +690,13 @@ aogpio: gpio-controller@0 { }; }; =20 + rst_ao: reset-controller@fffff44000 { + compatible =3D "thead,th1520-reset-ao"; + reg =3D <0xff 0xfff44000 0x0 0x2000>; + #reset-cells =3D <1>; + status =3D "reserved"; + }; + padctrl_aosys: pinctrl@fffff4a000 { compatible =3D "thead,th1520-pinctrl"; reg =3D <0xff 0xfff4a000 0x0 0x2000>; --=20 2.50.1