From patchwork Tue Jul 26 03:06:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chukun Pan X-Patchwork-Id: 593905 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64FAFC433EF for ; Tue, 26 Jul 2022 03:06:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237475AbiGZDGz (ORCPT ); Mon, 25 Jul 2022 23:06:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237452AbiGZDGy (ORCPT ); Mon, 25 Jul 2022 23:06:54 -0400 Received: from mail-m121145.qiye.163.com (mail-m121145.qiye.163.com [115.236.121.145]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C982110578; Mon, 25 Jul 2022 20:06:51 -0700 (PDT) Received: from amadeus-VLT-WX0.lan (unknown [113.118.189.34]) by mail-m121145.qiye.163.com (Hmail) with ESMTPA id B41D9800089; Tue, 26 Jul 2022 11:06:49 +0800 (CST) From: Chukun Pan To: Matthias Brugger Cc: Krzysztof Kozlowski , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Chukun Pan Subject: [PATCH 1/3] dt-bindings: soc: update MT7623A power dt-bindings Date: Tue, 26 Jul 2022 11:06:19 +0800 Message-Id: <20220726030621.7555-1-amadeus@jmu.edu.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVkaTxpNVkoZGUgeS09DHktPSlUTARMWGhIXJBQOD1 lXWRgSC1lBWUpKSFVKSkNVSkNCVUhPWVdZFhoPEhUdFFlBWU9LSFVKSEpCSE1VS1kG X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6KyI6Lxw6IT0rOE4MGUgNNx4u K0wwFBhVSlVKTU5DQ0tPQ0pLSENNVTMWGhIXVRoWGh8eDgg7ERYOVR4fDlUYFUVZV1kSC1lBWUpK SFVKSkNVSkNCVUhPWVdZCAFZQUpCS0M3Bg++ X-HM-Tid: 0a823878b113b03akuuub41d9800089 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add new power domains(VDEC/DISP/ISP/BDP) for MT7623A from MT7623 side. Signed-off-by: Chukun Pan --- include/dt-bindings/power/mt7623a-power.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/dt-bindings/power/mt7623a-power.h b/include/dt-bindings/power/mt7623a-power.h index 2544822aa76b..27d198e207b7 100644 --- a/include/dt-bindings/power/mt7623a-power.h +++ b/include/dt-bindings/power/mt7623a-power.h @@ -6,5 +6,9 @@ #define MT7623A_POWER_DOMAIN_ETH 1 #define MT7623A_POWER_DOMAIN_HIF 2 #define MT7623A_POWER_DOMAIN_IFR_MSC 3 +#define MT7623A_POWER_DOMAIN_VDEC 4 +#define MT7623A_POWER_DOMAIN_DISP 5 +#define MT7623A_POWER_DOMAIN_ISP 6 +#define MT7623A_POWER_DOMAIN_BDP 7 #endif /* _DT_BINDINGS_POWER_MT7623A_POWER_H */ From patchwork Tue Jul 26 03:06:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chukun Pan X-Patchwork-Id: 593904 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0927CCA48B for ; Tue, 26 Jul 2022 03:06:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237490AbiGZDG4 (ORCPT ); Mon, 25 Jul 2022 23:06:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231616AbiGZDGy (ORCPT ); Mon, 25 Jul 2022 23:06:54 -0400 Received: from mail-m121145.qiye.163.com (mail-m121145.qiye.163.com [115.236.121.145]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67CCD29CBF; Mon, 25 Jul 2022 20:06:52 -0700 (PDT) Received: from amadeus-VLT-WX0.lan (unknown [113.118.189.34]) by mail-m121145.qiye.163.com (Hmail) with ESMTPA id 77CCD80008D; Tue, 26 Jul 2022 11:06:50 +0800 (CST) From: Chukun Pan To: Matthias Brugger Cc: Krzysztof Kozlowski , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Chukun Pan Subject: [PATCH 2/3] soc: mediatek: update power domain data of MT7623A Date: Tue, 26 Jul 2022 11:06:20 +0800 Message-Id: <20220726030621.7555-2-amadeus@jmu.edu.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220726030621.7555-1-amadeus@jmu.edu.cn> References: <20220726030621.7555-1-amadeus@jmu.edu.cn> MIME-Version: 1.0 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVkaGhkZVhpPHxpITh1MHRoZSFUTARMWGhIXJBQOD1 lXWRgSC1lBWUpKSFVKSkNVSkNCVUhPWVdZFhoPEhUdFFlBWU9LSFVKSktITUpVS1kG X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6NAw6MDo5LD06ME4SCU84Ny06 KCEKFBxVSlVKTU5DQ0tPQ0pKSkpCVTMWGhIXVRoWGh8eDgg7ERYOVR4fDlUYFUVZV1kSC1lBWUpK SFVKSkNVSkNCVUhPWVdZCAFZQUhOTEg3Bg++ X-HM-Tid: 0a823878b404b03akuuu77ccd80008d Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org When running OpenWrt on MT7623A, I receive a kernel warning as follows (Device dts using mt7623.dtsi): mtk-scpsys 10006000.scpsys: Failed to power on domain mfg WARNING: CPU: 0 PID: 1 at drivers/soc/mediatek/mtk-scpsys.c:457 0xc04a4130 When I switch the device dts to using mt7623a.dtsi, the system fails to boot: rcu: INFO: rcu_preempt detected stalls on CPUs/tasks: rcu: 0-...0: (0 ticks this GP) idle=146/1/0x40000000 softirq=53/53 fqs=1051 (detected by 1, t=2102 jiffies, g=-1111, q=18) Sending NMI from CPU 1 to CPUs 0: Solved the problem by duplicating the power domain of the MT7623 (except MFG) to MT7623A, the system works fine without kernel warnings/errors. Signed-off-by: Chukun Pan --- drivers/soc/mediatek/mtk-scpsys.c | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/drivers/soc/mediatek/mtk-scpsys.c b/drivers/soc/mediatek/mtk-scpsys.c index ca75b14931ec..8b5713db1ca3 100644 --- a/drivers/soc/mediatek/mtk-scpsys.c +++ b/drivers/soc/mediatek/mtk-scpsys.c @@ -910,6 +910,41 @@ static const struct scp_domain_data scp_domain_data_mt7623a[] = { .clk_id = {CLK_NONE}, .caps = MTK_SCPD_ACTIVE_WAKEUP, }, + [MT7623A_POWER_DOMAIN_VDEC] = { + .name = "vdec", + .sta_mask = PWR_STATUS_VDEC, + .ctl_offs = SPM_VDE_PWR_CON, + .sram_pdn_bits = GENMASK(11, 8), + .sram_pdn_ack_bits = GENMASK(12, 12), + .clk_id = {CLK_MM}, + .caps = MTK_SCPD_ACTIVE_WAKEUP, + }, + [MT7623A_POWER_DOMAIN_DISP] = { + .name = "disp", + .sta_mask = PWR_STATUS_DISP, + .ctl_offs = SPM_DIS_PWR_CON, + .sram_pdn_bits = GENMASK(11, 8), + .clk_id = {CLK_MM}, + .bus_prot_mask = MT2701_TOP_AXI_PROT_EN_MM_M0, + .caps = MTK_SCPD_ACTIVE_WAKEUP, + }, + [MT7623A_POWER_DOMAIN_ISP] = { + .name = "isp", + .sta_mask = PWR_STATUS_ISP, + .ctl_offs = SPM_ISP_PWR_CON, + .sram_pdn_bits = GENMASK(11, 8), + .sram_pdn_ack_bits = GENMASK(13, 12), + .clk_id = {CLK_MM}, + .caps = MTK_SCPD_ACTIVE_WAKEUP, + }, + [MT7623A_POWER_DOMAIN_BDP] = { + .name = "bdp", + .sta_mask = PWR_STATUS_BDP, + .ctl_offs = SPM_BDP_PWR_CON, + .sram_pdn_bits = GENMASK(11, 8), + .clk_id = {CLK_NONE}, + .caps = MTK_SCPD_ACTIVE_WAKEUP, + }, }; /* From patchwork Tue Jul 26 03:06:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chukun Pan X-Patchwork-Id: 593635 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C01EC43334 for ; Tue, 26 Jul 2022 03:06:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237485AbiGZDGz (ORCPT ); Mon, 25 Jul 2022 23:06:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237472AbiGZDGy (ORCPT ); Mon, 25 Jul 2022 23:06:54 -0400 Received: from mail-m121145.qiye.163.com (mail-m121145.qiye.163.com [115.236.121.145]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 530382A243; Mon, 25 Jul 2022 20:06:53 -0700 (PDT) Received: from amadeus-VLT-WX0.lan (unknown [113.118.189.34]) by mail-m121145.qiye.163.com (Hmail) with ESMTPA id 3F99E800058; Tue, 26 Jul 2022 11:06:51 +0800 (CST) From: Chukun Pan To: Matthias Brugger Cc: Krzysztof Kozlowski , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Chukun Pan Subject: [PATCH 3/3] arm: dts: mt7623: update scpsys device nodes Date: Tue, 26 Jul 2022 11:06:21 +0800 Message-Id: <20220726030621.7555-3-amadeus@jmu.edu.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220726030621.7555-1-amadeus@jmu.edu.cn> References: <20220726030621.7555-1-amadeus@jmu.edu.cn> MIME-Version: 1.0 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVlDGhlPVkJNT0lDSBhDGEpKHVUTARMWGhIXJBQOD1 lXWRgSC1lBWUpKSFVKSkNVSkNCVUhPWVdZFhoPEhUdFFlBWU9LSFVKSktISkNVS1kG X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Oio6Ehw*UT0rKE44GUgLNx4q LBgKCUxVSlVKTU5DQ0tPQ0pKQktPVTMWGhIXVRoWGh8eDgg7ERYOVR4fDlUYFUVZV1kSC1lBWUpK SFVKSkNVSkNCVUhPWVdZCAFZQUlLSU43Bg++ X-HM-Tid: 0a823878b704b03akuuu3f99e800058 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Since the power domain data of mt7623a changed, device tree should also be changed accordingly. Signed-off-by: Chukun Pan --- arch/arm/boot/dts/mt7623a.dtsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/mt7623a.dtsi b/arch/arm/boot/dts/mt7623a.dtsi index d304b62d24b5..fb2670875a66 100644 --- a/arch/arm/boot/dts/mt7623a.dtsi +++ b/arch/arm/boot/dts/mt7623a.dtsi @@ -31,8 +31,9 @@ &pcie { &scpsys { compatible = "mediatek,mt7623a-scpsys"; - clocks = <&topckgen CLK_TOP_ETHIF_SEL>; - clock-names = "ethif"; + clocks = <&topckgen CLK_TOP_MM_SEL>, + <&topckgen CLK_TOP_ETHIF_SEL>; + clock-names = "mm", "ethif"; }; &usb0 {