From nobody Sun Feb 8 21:53:32 2026 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 56E36EB64DC for ; Mon, 3 Jul 2023 09:32:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229981AbjGCJcI (ORCPT ); Mon, 3 Jul 2023 05:32:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230088AbjGCJcG (ORCPT ); Mon, 3 Jul 2023 05:32:06 -0400 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89DB5E59; Mon, 3 Jul 2023 02:32:02 -0700 (PDT) Received: from droid01-cd.amlogic.com (10.98.11.200) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server id 15.1.2507.13; Mon, 3 Jul 2023 17:32:00 +0800 From: =Xianwei Zhao To: , , , CC: Rob Herring , Krzysztof Kozlowski , Conor Dooley , "Neil Armstrong" , Kevin Hilman , Xianwei Zhao Subject: [PATCH 1/3] dt-bindings: power: add Amlogic C3 power domains Date: Mon, 3 Jul 2023 17:31:40 +0800 Message-ID: <20230703093142.2028500-2-xianwei.zhao@amlogic.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230703093142.2028500-1-xianwei.zhao@amlogic.com> References: <20230703093142.2028500-1-xianwei.zhao@amlogic.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.98.11.200] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Xianwei Zhao Add devicetree binding document and related header file for Amlogic C3 secu= re power domains. Signed-off-by: Xianwei Zhao --- .../power/amlogic,meson-sec-pwrc.yaml | 3 ++- include/dt-bindings/power/amlogic-c3-power.h | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 include/dt-bindings/power/amlogic-c3-power.h diff --git a/Documentation/devicetree/bindings/power/amlogic,meson-sec-pwrc= .yaml b/Documentation/devicetree/bindings/power/amlogic,meson-sec-pwrc.yaml index eab21bb2050a..d80bbedfe3aa 100644 --- a/Documentation/devicetree/bindings/power/amlogic,meson-sec-pwrc.yaml +++ b/Documentation/devicetree/bindings/power/amlogic,meson-sec-pwrc.yaml @@ -12,7 +12,7 @@ maintainers: - Jianxin Pan =20 description: |+ - Secure Power Domains used in Meson A1/C1/S4 SoCs, and should be the chil= d node + Secure Power Domains used in Meson A1/C1/S4 & C3 SoCs, and should be the= child node of secure-monitor. =20 properties: @@ -20,6 +20,7 @@ properties: enum: - amlogic,meson-a1-pwrc - amlogic,meson-s4-pwrc + - amlogic,c3-pwrc =20 "#power-domain-cells": const: 1 diff --git a/include/dt-bindings/power/amlogic-c3-power.h b/include/dt-bind= ings/power/amlogic-c3-power.h new file mode 100644 index 000000000000..3403e7c0b49d --- /dev/null +++ b/include/dt-bindings/power/amlogic-c3-power.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: (GPL-2.0+ or MIT) */ +/* + * Copyright (c) 2023 Amlogic, Inc. + * Author: hongyu chen1 + */ +#ifndef _DT_BINDINGS_AMLOGIC_C3_POWER_H +#define _DT_BINDINGS_AMLOGIC_C3_POWER_H + +#define PWRC_C3_NNA_ID 0 +#define PWRC_C3_AUDIO_ID 1 +#define PWRC_C3_RESV_SEC_ID 2 +#define PWRC_C3_SDIOA_ID 3 +#define PWRC_C3_EMMC_ID 4 +#define PWRC_C3_USB_COMB_ID 5 +#define PWRC_C3_SDCARD_ID 6 +#define PWRC_C3_ETH_ID 7 +#define PWRC_C3_RESV0_ID 8 +#define PWRC_C3_GE2D_ID 9 +#define PWRC_C3_CVE_ID 10 +#define PWRC_C3_GDC_WRAP_ID 11 +#define PWRC_C3_ISP_TOP_ID 12 +#define PWRC_C3_MIPI_ISP_WRAP_ID 13 +#define PWRC_C3_VCODEC_ID 14 + +#endif + base-commit: 057889cb4244096ea5abcbe76ffd4d311c3078fe --=20 2.37.1 From nobody Sun Feb 8 21:53:32 2026 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 15D5CEB64DC for ; Mon, 3 Jul 2023 09:33:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230494AbjGCJdD (ORCPT ); Mon, 3 Jul 2023 05:33:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230323AbjGCJcz (ORCPT ); Mon, 3 Jul 2023 05:32:55 -0400 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B69518D; Mon, 3 Jul 2023 02:32:06 -0700 (PDT) Received: from droid01-cd.amlogic.com (10.98.11.200) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server id 15.1.2507.13; Mon, 3 Jul 2023 17:32:01 +0800 From: =Xianwei Zhao To: , , , CC: Rob Herring , Krzysztof Kozlowski , Conor Dooley , "Neil Armstrong" , Kevin Hilman , Xianwei Zhao Subject: [PATCH 2/3] soc: c3: Add support for power domains controller Date: Mon, 3 Jul 2023 17:31:41 +0800 Message-ID: <20230703093142.2028500-3-xianwei.zhao@amlogic.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230703093142.2028500-1-xianwei.zhao@amlogic.com> References: <20230703093142.2028500-1-xianwei.zhao@amlogic.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.98.11.200] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Xianwei Zhao Add support for C3 Power controller. C3 power control registers are in secure domain, and should be accessed by SMC. Signed-off-by: Xianwei Zhao --- drivers/soc/amlogic/meson-secure-pwrc.c | 28 ++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/= meson-secure-pwrc.c index 25b4b71df9b8..39ccc8f2e630 100644 --- a/drivers/soc/amlogic/meson-secure-pwrc.c +++ b/drivers/soc/amlogic/meson-secure-pwrc.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -132,6 +133,22 @@ static struct meson_secure_pwrc_domain_desc s4_pwrc_do= mains[] =3D { SEC_PD(S4_AUDIO, 0), }; =20 +static struct meson_secure_pwrc_domain_desc c3_pwrc_domains[] =3D { + SEC_PD(C3_NNA, 0), + SEC_PD(C3_AUDIO, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_SDIOA, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_EMMC, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_USB_COMB, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_SDCARD, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_ETH, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_GE2D, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_CVE, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_GDC_WRAP, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_ISP_TOP, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_MIPI_ISP_WRAP, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_VCODEC, 0), +}; + static int meson_secure_pwrc_probe(struct platform_device *pdev) { int i; @@ -179,7 +196,7 @@ static int meson_secure_pwrc_probe(struct platform_devi= ce *pdev) for (i =3D 0 ; i < match->count ; ++i) { struct meson_secure_pwrc_domain *dom =3D &pwrc->domains[i]; =20 - if (!match->domains[i].index) + if (!match->domains[i].name) continue; =20 dom->pwrc =3D pwrc; @@ -207,6 +224,11 @@ static struct meson_secure_pwrc_domain_data meson_secu= re_s4_pwrc_data =3D { .count =3D ARRAY_SIZE(s4_pwrc_domains), }; =20 +static struct meson_secure_pwrc_domain_data amlogic_secure_c3_pwrc_data = =3D { + .domains =3D c3_pwrc_domains, + .count =3D ARRAY_SIZE(c3_pwrc_domains), +}; + static const struct of_device_id meson_secure_pwrc_match_table[] =3D { { .compatible =3D "amlogic,meson-a1-pwrc", @@ -216,6 +238,10 @@ static const struct of_device_id meson_secure_pwrc_mat= ch_table[] =3D { .compatible =3D "amlogic,meson-s4-pwrc", .data =3D &meson_secure_s4_pwrc_data, }, + { + .compatible =3D "amlogic,c3-pwrc", + .data =3D &amlogic_secure_c3_pwrc_data, + }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, meson_secure_pwrc_match_table); --=20 2.37.1 From nobody Sun Feb 8 21:53:32 2026 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 2751CC0015E for ; Mon, 3 Jul 2023 09:33:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230149AbjGCJdA (ORCPT ); Mon, 3 Jul 2023 05:33:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230507AbjGCJc6 (ORCPT ); Mon, 3 Jul 2023 05:32:58 -0400 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66400E54; Mon, 3 Jul 2023 02:32:09 -0700 (PDT) Received: from droid01-cd.amlogic.com (10.98.11.200) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server id 15.1.2507.13; Mon, 3 Jul 2023 17:32:02 +0800 From: =Xianwei Zhao To: , , , CC: Rob Herring , Krzysztof Kozlowski , Conor Dooley , "Neil Armstrong" , Kevin Hilman , Xianwei Zhao Subject: [PATCH 3/3] arm64: dts: add support for C3 power domain controller Date: Mon, 3 Jul 2023 17:31:42 +0800 Message-ID: <20230703093142.2028500-4-xianwei.zhao@amlogic.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230703093142.2028500-1-xianwei.zhao@amlogic.com> References: <20230703093142.2028500-1-xianwei.zhao@amlogic.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.98.11.200] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Xianwei Zhao Enable power domain controller for Amlogic C3 SoC Signed-off-by: Xianwei Zhao --- arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi b/arch/arm64/boot/= dts/amlogic/amlogic-c3.dtsi index 60ad4f3eef9d..826c51b1aff6 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi +++ b/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi @@ -47,6 +47,16 @@ xtal: xtal-clk { #clock-cells =3D <0>; }; =20 + sm: secure-monitor { + compatible =3D "amlogic,meson-gxbb-sm"; + + pwrc: power-controller { + compatible =3D "amlogic,c3-pwrc"; + #power-domain-cells =3D <1>; + status =3D "okay"; + }; + }; + soc { compatible =3D "simple-bus"; #address-cells =3D <2>; --=20 2.37.1