From nobody Tue Jun 23 18:20:17 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 D5E40C433EF for ; Tue, 1 Mar 2022 01:48:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232106AbiCABte (ORCPT ); Mon, 28 Feb 2022 20:49:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232041AbiCABta (ORCPT ); Mon, 28 Feb 2022 20:49:30 -0500 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A71B15D19A; Mon, 28 Feb 2022 17:48:45 -0800 (PST) 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.2176.14; Tue, 1 Mar 2022 09:48:41 +0800 From: Shunzhou Jiang To: CC: , , , , , , , , Subject: [PATCH V5 1/2] dt-bindings: power: add Amlogic s4 power domains bindings Date: Tue, 1 Mar 2022 09:48:36 +0800 Message-ID: <20220301014837.801642-2-shunzhou.jiang@amlogic.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220301014837.801642-1-shunzhou.jiang@amlogic.com> References: <20220301014837.801642-1-shunzhou.jiang@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" Add the bindings for the Amlogic Secure power domains, controlling the secure power domains. The bindings targets the Amlogic s4, in which the power domains registers are in secure world. Signed-off-by: Shunzhou Jiang Reviewed-by: Martin Blumenstingl --- V1->V2: fix spelling error, patchset use cover-letter v2->V3: add power domain always on reason v3->V4: clear vpu and usb power domaon always on V4->v5: add review owner in patchset --- .../power/amlogic,meson-sec-pwrc.yaml | 3 ++- include/dt-bindings/power/meson-s4-power.h | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 include/dt-bindings/power/meson-s4-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 5dae04d2936c..7657721a4e96 100644 --- a/Documentation/devicetree/bindings/power/amlogic,meson-sec-pwrc.yaml +++ b/Documentation/devicetree/bindings/power/amlogic,meson-sec-pwrc.yaml @@ -12,13 +12,14 @@ maintainers: - Jianxin Pan =20 description: |+ - Secure Power Domains used in Meson A1/C1 SoCs, and should be the child n= ode + Secure Power Domains used in Meson A1/C1/S4 SoCs, and should be the chil= d node of secure-monitor. =20 properties: compatible: enum: - amlogic,meson-a1-pwrc + - amlogic,meson-s4-pwrc =20 "#power-domain-cells": const: 1 diff --git a/include/dt-bindings/power/meson-s4-power.h b/include/dt-bindin= gs/power/meson-s4-power.h new file mode 100644 index 000000000000..462dd2cb938b --- /dev/null +++ b/include/dt-bindings/power/meson-s4-power.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: (GPL-2.0+ or MIT) */ +/* + * Copyright (c) 2021 Amlogic, Inc. + * Author: Shunzhou Jiang + */ + +#ifndef _DT_BINDINGS_MESON_S4_POWER_H +#define _DT_BINDINGS_MESON_S4_POWER_H + +#define PWRC_S4_DOS_HEVC_ID 0 +#define PWRC_S4_DOS_VDEC_ID 1 +#define PWRC_S4_VPU_HDMI_ID 2 +#define PWRC_S4_USB_COMB_ID 3 +#define PWRC_S4_GE2D_ID 4 +#define PWRC_S4_ETH_ID 5 +#define PWRC_S4_DEMOD_ID 6 +#define PWRC_S4_AUDIO_ID 7 + +#endif --=20 2.34.1 From nobody Tue Jun 23 18:20:17 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 E7A7DC433EF for ; Tue, 1 Mar 2022 01:48:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231992AbiCABti (ORCPT ); Mon, 28 Feb 2022 20:49:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232030AbiCABtb (ORCPT ); Mon, 28 Feb 2022 20:49:31 -0500 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A6C35C86B; Mon, 28 Feb 2022 17:48:47 -0800 (PST) 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.2176.14; Tue, 1 Mar 2022 09:48:43 +0800 From: Shunzhou Jiang To: CC: , , , , , , , , Subject: [PATCH V5 2/2] soc: s4: Add support for power domains controller Date: Tue, 1 Mar 2022 09:48:37 +0800 Message-ID: <20220301014837.801642-3-shunzhou.jiang@amlogic.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220301014837.801642-1-shunzhou.jiang@amlogic.com> References: <20220301014837.801642-1-shunzhou.jiang@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" Add support s4 Power controller. In s4, power control registers are in secure domain, and should be accessed by smc. Signed-off-by: Shunzhou Jiang --- V1->V2: fix spelling error, patchset use cover-letter v2->V3: add power domain always on reason v3->V4: clear vpu and usb power domaon always on V4->v5: add review owner in patchset --- drivers/soc/amlogic/meson-secure-pwrc.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/= meson-secure-pwrc.c index 59bd195fa9c9..a10a417a87db 100644 --- a/drivers/soc/amlogic/meson-secure-pwrc.c +++ b/drivers/soc/amlogic/meson-secure-pwrc.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -119,6 +120,18 @@ static struct meson_secure_pwrc_domain_desc a1_pwrc_do= mains[] =3D { SEC_PD(RSA, 0), }; =20 +static struct meson_secure_pwrc_domain_desc s4_pwrc_domains[] =3D { + SEC_PD(S4_DOS_HEVC, 0), + SEC_PD(S4_DOS_VDEC, 0), + SEC_PD(S4_VPU_HDMI, 0), + SEC_PD(S4_USB_COMB, 0), + SEC_PD(S4_GE2D, 0), + /* ETH is for ethernet online wakeup, and should be always on */ + SEC_PD(S4_ETH, GENPD_FLAG_ALWAYS_ON), + SEC_PD(S4_DEMOD, 0), + SEC_PD(S4_AUDIO, 0), +}; + static int meson_secure_pwrc_probe(struct platform_device *pdev) { int i; @@ -187,11 +200,20 @@ static struct meson_secure_pwrc_domain_data meson_sec= ure_a1_pwrc_data =3D { .count =3D ARRAY_SIZE(a1_pwrc_domains), }; =20 +static struct meson_secure_pwrc_domain_data meson_secure_s4_pwrc_data =3D { + .domains =3D s4_pwrc_domains, + .count =3D ARRAY_SIZE(s4_pwrc_domains), +}; + static const struct of_device_id meson_secure_pwrc_match_table[] =3D { { .compatible =3D "amlogic,meson-a1-pwrc", .data =3D &meson_secure_a1_pwrc_data, }, + { + .compatible =3D "amlogic,meson-s4-pwrc", + .data =3D &meson_secure_s4_pwrc_data, + }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, meson_secure_pwrc_match_table); --=20 2.34.1