* [PATCH V2 1/4] soc: amlogic: use name instead of index as criterion
2023-07-07 0:37 [PATCH V2 0/4] Power: C3: add power domain driver Xianwei Zhao
@ 2023-07-07 0:37 ` Xianwei Zhao
2023-07-07 7:49 ` Neil Armstrong
2023-07-19 19:44 ` Dmitry Rokosov
2023-07-07 0:37 ` [PATCH V2 2/4] dt-bindings: power: add Amlogic C3 power domains Xianwei Zhao
` (4 subsequent siblings)
5 siblings, 2 replies; 14+ messages in thread
From: Xianwei Zhao @ 2023-07-07 0:37 UTC (permalink / raw)
To: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Kevin Hilman, Xianwei Zhao
The variate 'index' could be equal to zero in some SoCs. Such as C3 SoC,
PWRC_C3_NNA_ID be defined zero. Use 'name' instead of 'index' as criterion.
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
V1 -> V2: add a new patch for change.
---
drivers/soc/amlogic/meson-secure-pwrc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/meson-secure-pwrc.c
index 25b4b71df9b8..c11d65a3e3d9 100644
--- a/drivers/soc/amlogic/meson-secure-pwrc.c
+++ b/drivers/soc/amlogic/meson-secure-pwrc.c
@@ -179,7 +179,7 @@ static int meson_secure_pwrc_probe(struct platform_device *pdev)
for (i = 0 ; i < match->count ; ++i) {
struct meson_secure_pwrc_domain *dom = &pwrc->domains[i];
- if (!match->domains[i].index)
+ if (!match->domains[i].name)
continue;
dom->pwrc = pwrc;
--
2.37.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH V2 1/4] soc: amlogic: use name instead of index as criterion
2023-07-07 0:37 ` [PATCH V2 1/4] soc: amlogic: use name instead of index as criterion Xianwei Zhao
@ 2023-07-07 7:49 ` Neil Armstrong
2023-07-19 19:44 ` Dmitry Rokosov
1 sibling, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2023-07-07 7:49 UTC (permalink / raw)
To: Xianwei Zhao, devicetree, linux-arm-kernel, linux-amlogic,
linux-kernel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Kevin Hilman
On 07/07/2023 02:37, Xianwei Zhao wrote:
> The variate 'index' could be equal to zero in some SoCs. Such as C3 SoC,
> PWRC_C3_NNA_ID be defined zero. Use 'name' instead of 'index' as criterion.
>
> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
> ---
> V1 -> V2: add a new patch for change.
> ---
> drivers/soc/amlogic/meson-secure-pwrc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/meson-secure-pwrc.c
> index 25b4b71df9b8..c11d65a3e3d9 100644
> --- a/drivers/soc/amlogic/meson-secure-pwrc.c
> +++ b/drivers/soc/amlogic/meson-secure-pwrc.c
> @@ -179,7 +179,7 @@ static int meson_secure_pwrc_probe(struct platform_device *pdev)
> for (i = 0 ; i < match->count ; ++i) {
> struct meson_secure_pwrc_domain *dom = &pwrc->domains[i];
>
> - if (!match->domains[i].index)
> + if (!match->domains[i].name)
> continue;
>
> dom->pwrc = pwrc;
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH V2 1/4] soc: amlogic: use name instead of index as criterion
2023-07-07 0:37 ` [PATCH V2 1/4] soc: amlogic: use name instead of index as criterion Xianwei Zhao
2023-07-07 7:49 ` Neil Armstrong
@ 2023-07-19 19:44 ` Dmitry Rokosov
1 sibling, 0 replies; 14+ messages in thread
From: Dmitry Rokosov @ 2023-07-19 19:44 UTC (permalink / raw)
To: Xianwei Zhao
Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Kevin Hilman
On Fri, Jul 07, 2023 at 08:37:07AM +0800, Xianwei Zhao wrote:
> The variate 'index' could be equal to zero in some SoCs. Such as C3 SoC,
> PWRC_C3_NNA_ID be defined zero. Use 'name' instead of 'index' as criterion.
>
> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Reviewed-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
> ---
> V1 -> V2: add a new patch for change.
> ---
> drivers/soc/amlogic/meson-secure-pwrc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/meson-secure-pwrc.c
> index 25b4b71df9b8..c11d65a3e3d9 100644
> --- a/drivers/soc/amlogic/meson-secure-pwrc.c
> +++ b/drivers/soc/amlogic/meson-secure-pwrc.c
> @@ -179,7 +179,7 @@ static int meson_secure_pwrc_probe(struct platform_device *pdev)
> for (i = 0 ; i < match->count ; ++i) {
> struct meson_secure_pwrc_domain *dom = &pwrc->domains[i];
>
> - if (!match->domains[i].index)
> + if (!match->domains[i].name)
> continue;
>
> dom->pwrc = pwrc;
> --
> 2.37.1
>
>
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic
--
Thank you,
Dmitry
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH V2 2/4] dt-bindings: power: add Amlogic C3 power domains
2023-07-07 0:37 [PATCH V2 0/4] Power: C3: add power domain driver Xianwei Zhao
2023-07-07 0:37 ` [PATCH V2 1/4] soc: amlogic: use name instead of index as criterion Xianwei Zhao
@ 2023-07-07 0:37 ` Xianwei Zhao
2023-07-07 15:29 ` Rob Herring
2023-07-07 0:37 ` [PATCH V2 3/4] soc: c3: Add support for power domains controller Xianwei Zhao
` (3 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Xianwei Zhao @ 2023-07-07 0:37 UTC (permalink / raw)
To: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Kevin Hilman, Xianwei Zhao
Add devicetree binding document and related header file for Amlogic C3 secure power domains.
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
V1 -> V2: Mofiy filename matching compatibles.
Delete unnecessary blank line.
---
.../power/amlogic,meson-sec-pwrc.yaml | 3 ++-
include/dt-bindings/power/amlogic,c3-pwrc.h | 25 +++++++++++++++++++
2 files changed, 27 insertions(+), 1 deletion(-)
create mode 100644 include/dt-bindings/power/amlogic,c3-pwrc.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 <jianxin.pan@amlogic.com>
description: |+
- Secure Power Domains used in Meson A1/C1/S4 SoCs, and should be the child node
+ Secure Power Domains used in Meson A1/C1/S4 & C3 SoCs, and should be the child node
of secure-monitor.
properties:
@@ -20,6 +20,7 @@ properties:
enum:
- amlogic,meson-a1-pwrc
- amlogic,meson-s4-pwrc
+ - amlogic,c3-pwrc
"#power-domain-cells":
const: 1
diff --git a/include/dt-bindings/power/amlogic,c3-pwrc.h b/include/dt-bindings/power/amlogic,c3-pwrc.h
new file mode 100644
index 000000000000..1d98a25b08a4
--- /dev/null
+++ b/include/dt-bindings/power/amlogic,c3-pwrc.h
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: (GPL-2.0+ or MIT) */
+/*
+ * Copyright (c) 2023 Amlogic, Inc.
+ * Author: hongyu chen1 <hongyu.chen1@amlogic.com>
+ */
+#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
--
2.37.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH V2 2/4] dt-bindings: power: add Amlogic C3 power domains
2023-07-07 0:37 ` [PATCH V2 2/4] dt-bindings: power: add Amlogic C3 power domains Xianwei Zhao
@ 2023-07-07 15:29 ` Rob Herring
0 siblings, 0 replies; 14+ messages in thread
From: Rob Herring @ 2023-07-07 15:29 UTC (permalink / raw)
To: Xianwei Zhao
Cc: Rob Herring, Krzysztof Kozlowski, linux-amlogic, Neil Armstrong,
Kevin Hilman, devicetree, Conor Dooley, linux-arm-kernel,
linux-kernel
On Fri, 07 Jul 2023 08:37:08 +0800, Xianwei Zhao wrote:
> Add devicetree binding document and related header file for Amlogic C3 secure power domains.
>
> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
> ---
> V1 -> V2: Mofiy filename matching compatibles.
> Delete unnecessary blank line.
> ---
> .../power/amlogic,meson-sec-pwrc.yaml | 3 ++-
> include/dt-bindings/power/amlogic,c3-pwrc.h | 25 +++++++++++++++++++
> 2 files changed, 27 insertions(+), 1 deletion(-)
> create mode 100644 include/dt-bindings/power/amlogic,c3-pwrc.h
>
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH V2 3/4] soc: c3: Add support for power domains controller
2023-07-07 0:37 [PATCH V2 0/4] Power: C3: add power domain driver Xianwei Zhao
2023-07-07 0:37 ` [PATCH V2 1/4] soc: amlogic: use name instead of index as criterion Xianwei Zhao
2023-07-07 0:37 ` [PATCH V2 2/4] dt-bindings: power: add Amlogic C3 power domains Xianwei Zhao
@ 2023-07-07 0:37 ` Xianwei Zhao
2023-07-07 7:50 ` Neil Armstrong
2023-07-26 22:40 ` Kevin Hilman
2023-07-07 0:37 ` [PATCH V2 4/4] arm64: dts: add support for C3 power domain controller Xianwei Zhao
` (2 subsequent siblings)
5 siblings, 2 replies; 14+ messages in thread
From: Xianwei Zhao @ 2023-07-07 0:37 UTC (permalink / raw)
To: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Kevin Hilman, 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 <xianwei.zhao@amlogic.com>
---
V1 -> V2: Fixed some formatting.
---
drivers/soc/amlogic/meson-secure-pwrc.c | 26 +++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/meson-secure-pwrc.c
index c11d65a3e3d9..a1ffebf70de3 100644
--- a/drivers/soc/amlogic/meson-secure-pwrc.c
+++ b/drivers/soc/amlogic/meson-secure-pwrc.c
@@ -11,6 +11,7 @@
#include <linux/platform_device.h>
#include <linux/pm_domain.h>
#include <dt-bindings/power/meson-a1-power.h>
+#include <dt-bindings/power/amlogic,c3-pwrc.h>
#include <dt-bindings/power/meson-s4-power.h>
#include <linux/arm-smccc.h>
#include <linux/firmware/meson/meson_sm.h>
@@ -120,6 +121,22 @@ static struct meson_secure_pwrc_domain_desc a1_pwrc_domains[] = {
SEC_PD(RSA, 0),
};
+static struct meson_secure_pwrc_domain_desc c3_pwrc_domains[] = {
+ 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 struct meson_secure_pwrc_domain_desc s4_pwrc_domains[] = {
SEC_PD(S4_DOS_HEVC, 0),
SEC_PD(S4_DOS_VDEC, 0),
@@ -202,6 +219,11 @@ static struct meson_secure_pwrc_domain_data meson_secure_a1_pwrc_data = {
.count = ARRAY_SIZE(a1_pwrc_domains),
};
+static struct meson_secure_pwrc_domain_data amlogic_secure_c3_pwrc_data = {
+ .domains = c3_pwrc_domains,
+ .count = ARRAY_SIZE(c3_pwrc_domains),
+};
+
static struct meson_secure_pwrc_domain_data meson_secure_s4_pwrc_data = {
.domains = s4_pwrc_domains,
.count = ARRAY_SIZE(s4_pwrc_domains),
@@ -212,6 +234,10 @@ static const struct of_device_id meson_secure_pwrc_match_table[] = {
.compatible = "amlogic,meson-a1-pwrc",
.data = &meson_secure_a1_pwrc_data,
},
+ {
+ .compatible = "amlogic,c3-pwrc",
+ .data = &amlogic_secure_c3_pwrc_data,
+ },
{
.compatible = "amlogic,meson-s4-pwrc",
.data = &meson_secure_s4_pwrc_data,
--
2.37.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH V2 3/4] soc: c3: Add support for power domains controller
2023-07-07 0:37 ` [PATCH V2 3/4] soc: c3: Add support for power domains controller Xianwei Zhao
@ 2023-07-07 7:50 ` Neil Armstrong
2023-07-26 22:40 ` Kevin Hilman
1 sibling, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2023-07-07 7:50 UTC (permalink / raw)
To: Xianwei Zhao, devicetree, linux-arm-kernel, linux-amlogic,
linux-kernel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Kevin Hilman
On 07/07/2023 02:37, Xianwei Zhao wrote:
> 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 <xianwei.zhao@amlogic.com>
> ---
> V1 -> V2: Fixed some formatting.
> ---
> drivers/soc/amlogic/meson-secure-pwrc.c | 26 +++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/meson-secure-pwrc.c
> index c11d65a3e3d9..a1ffebf70de3 100644
> --- a/drivers/soc/amlogic/meson-secure-pwrc.c
> +++ b/drivers/soc/amlogic/meson-secure-pwrc.c
> @@ -11,6 +11,7 @@
> #include <linux/platform_device.h>
> #include <linux/pm_domain.h>
> #include <dt-bindings/power/meson-a1-power.h>
> +#include <dt-bindings/power/amlogic,c3-pwrc.h>
> #include <dt-bindings/power/meson-s4-power.h>
> #include <linux/arm-smccc.h>
> #include <linux/firmware/meson/meson_sm.h>
> @@ -120,6 +121,22 @@ static struct meson_secure_pwrc_domain_desc a1_pwrc_domains[] = {
> SEC_PD(RSA, 0),
> };
>
> +static struct meson_secure_pwrc_domain_desc c3_pwrc_domains[] = {
> + 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 struct meson_secure_pwrc_domain_desc s4_pwrc_domains[] = {
> SEC_PD(S4_DOS_HEVC, 0),
> SEC_PD(S4_DOS_VDEC, 0),
> @@ -202,6 +219,11 @@ static struct meson_secure_pwrc_domain_data meson_secure_a1_pwrc_data = {
> .count = ARRAY_SIZE(a1_pwrc_domains),
> };
>
> +static struct meson_secure_pwrc_domain_data amlogic_secure_c3_pwrc_data = {
> + .domains = c3_pwrc_domains,
> + .count = ARRAY_SIZE(c3_pwrc_domains),
> +};
> +
> static struct meson_secure_pwrc_domain_data meson_secure_s4_pwrc_data = {
> .domains = s4_pwrc_domains,
> .count = ARRAY_SIZE(s4_pwrc_domains),
> @@ -212,6 +234,10 @@ static const struct of_device_id meson_secure_pwrc_match_table[] = {
> .compatible = "amlogic,meson-a1-pwrc",
> .data = &meson_secure_a1_pwrc_data,
> },
> + {
> + .compatible = "amlogic,c3-pwrc",
> + .data = &amlogic_secure_c3_pwrc_data,
> + },
> {
> .compatible = "amlogic,meson-s4-pwrc",
> .data = &meson_secure_s4_pwrc_data,
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH V2 3/4] soc: c3: Add support for power domains controller
2023-07-07 0:37 ` [PATCH V2 3/4] soc: c3: Add support for power domains controller Xianwei Zhao
2023-07-07 7:50 ` Neil Armstrong
@ 2023-07-26 22:40 ` Kevin Hilman
2023-07-27 2:24 ` Xianwei Zhao
1 sibling, 1 reply; 14+ messages in thread
From: Kevin Hilman @ 2023-07-26 22:40 UTC (permalink / raw)
To: Xianwei Zhao, devicetree, linux-arm-kernel, linux-amlogic,
linux-kernel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Xianwei Zhao
Xianwei Zhao <xianwei.zhao@amlogic.com> writes:
> 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 <xianwei.zhao@amlogic.com>
> ---
> V1 -> V2: Fixed some formatting.
> ---
> drivers/soc/amlogic/meson-secure-pwrc.c | 26 +++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/meson-secure-pwrc.c
> index c11d65a3e3d9..a1ffebf70de3 100644
> --- a/drivers/soc/amlogic/meson-secure-pwrc.c
> +++ b/drivers/soc/amlogic/meson-secure-pwrc.c
> @@ -11,6 +11,7 @@
> #include <linux/platform_device.h>
> #include <linux/pm_domain.h>
> #include <dt-bindings/power/meson-a1-power.h>
> +#include <dt-bindings/power/amlogic,c3-pwrc.h>
> #include <dt-bindings/power/meson-s4-power.h>
> #include <linux/arm-smccc.h>
> #include <linux/firmware/meson/meson_sm.h>
> @@ -120,6 +121,22 @@ static struct meson_secure_pwrc_domain_desc a1_pwrc_domains[] = {
> SEC_PD(RSA, 0),
> };
>
> +static struct meson_secure_pwrc_domain_desc c3_pwrc_domains[] = {
> + 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),
> +};
All of these domains being hard-coded to ALWAYS_ON looks suspicious, and
can also be an indicator that the drivers for these domains are not
(properly) using runtime PM, or not connected to the correct domains the DT.
Similar to the tables for s4 and a1 in this same file, please describe
the reason that each of these domains needs to be hard coded to be
always on.
Thanks,
Kevin
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH V2 3/4] soc: c3: Add support for power domains controller
2023-07-26 22:40 ` Kevin Hilman
@ 2023-07-27 2:24 ` Xianwei Zhao
0 siblings, 0 replies; 14+ messages in thread
From: Xianwei Zhao @ 2023-07-27 2:24 UTC (permalink / raw)
To: Kevin Hilman, devicetree, linux-arm-kernel, linux-amlogic,
linux-kernel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong
Hi Kevin,
Thanks for your reply.
On 2023/7/27 06:40, Kevin Hilman wrote:
> [ EXTERNAL EMAIL ]
>
> Xianwei Zhao <xianwei.zhao@amlogic.com> writes:
>
>> 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 <xianwei.zhao@amlogic.com>
>> ---
>> V1 -> V2: Fixed some formatting.
>> ---
>> drivers/soc/amlogic/meson-secure-pwrc.c | 26 +++++++++++++++++++++++++
>> 1 file changed, 26 insertions(+)
>>
>> diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/meson-secure-pwrc.c
>> index c11d65a3e3d9..a1ffebf70de3 100644
>> --- a/drivers/soc/amlogic/meson-secure-pwrc.c
>> +++ b/drivers/soc/amlogic/meson-secure-pwrc.c
>> @@ -11,6 +11,7 @@
>> #include <linux/platform_device.h>
>> #include <linux/pm_domain.h>
>> #include <dt-bindings/power/meson-a1-power.h>
>> +#include <dt-bindings/power/amlogic,c3-pwrc.h>
>> #include <dt-bindings/power/meson-s4-power.h>
>> #include <linux/arm-smccc.h>
>> #include <linux/firmware/meson/meson_sm.h>
>> @@ -120,6 +121,22 @@ static struct meson_secure_pwrc_domain_desc a1_pwrc_domains[] = {
>> SEC_PD(RSA, 0),
>> };
>>
>> +static struct meson_secure_pwrc_domain_desc c3_pwrc_domains[] = {
>> + 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),
>> +};
>
> All of these domains being hard-coded to ALWAYS_ON looks suspicious, and
> can also be an indicator that the drivers for these domains are not
> (properly) using runtime PM, or not connected to the correct domains the DT.
>
> Similar to the tables for s4 and a1 in this same file, please describe
> the reason that each of these domains needs to be hard coded to be
> always on.
Will do.
>
> Thanks,
>
> Kevin
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH V2 4/4] arm64: dts: add support for C3 power domain controller
2023-07-07 0:37 [PATCH V2 0/4] Power: C3: add power domain driver Xianwei Zhao
` (2 preceding siblings ...)
2023-07-07 0:37 ` [PATCH V2 3/4] soc: c3: Add support for power domains controller Xianwei Zhao
@ 2023-07-07 0:37 ` Xianwei Zhao
2023-07-07 7:51 ` Neil Armstrong
2023-07-31 9:47 ` (subset) [PATCH V2 0/4] Power: C3: add power domain driver Neil Armstrong
2023-07-31 9:54 ` Neil Armstrong
5 siblings, 1 reply; 14+ messages in thread
From: Xianwei Zhao @ 2023-07-07 0:37 UTC (permalink / raw)
To: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Kevin Hilman, Xianwei Zhao
Enable power domain controller for Amlogic C3 SoC
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
V1 -> V2: delete status,use "okay" status by default.
---
arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
index 60ad4f3eef9d..f6603fd57551 100644
--- a/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
+++ b/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
@@ -47,6 +47,15 @@ xtal: xtal-clk {
#clock-cells = <0>;
};
+ sm: secure-monitor {
+ compatible = "amlogic,meson-gxbb-sm";
+
+ pwrc: power-controller {
+ compatible = "amlogic,c3-pwrc";
+ #power-domain-cells = <1>;
+ };
+ };
+
soc {
compatible = "simple-bus";
#address-cells = <2>;
--
2.37.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH V2 4/4] arm64: dts: add support for C3 power domain controller
2023-07-07 0:37 ` [PATCH V2 4/4] arm64: dts: add support for C3 power domain controller Xianwei Zhao
@ 2023-07-07 7:51 ` Neil Armstrong
0 siblings, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2023-07-07 7:51 UTC (permalink / raw)
To: Xianwei Zhao, devicetree, linux-arm-kernel, linux-amlogic,
linux-kernel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Kevin Hilman
On 07/07/2023 02:37, Xianwei Zhao wrote:
> Enable power domain controller for Amlogic C3 SoC
>
> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
> ---
> V1 -> V2: delete status,use "okay" status by default.
> ---
> arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
> index 60ad4f3eef9d..f6603fd57551 100644
> --- a/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi
> @@ -47,6 +47,15 @@ xtal: xtal-clk {
> #clock-cells = <0>;
> };
>
> + sm: secure-monitor {
> + compatible = "amlogic,meson-gxbb-sm";
> +
> + pwrc: power-controller {
> + compatible = "amlogic,c3-pwrc";
> + #power-domain-cells = <1>;
> + };
> + };
> +
> soc {
> compatible = "simple-bus";
> #address-cells = <2>;
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: (subset) [PATCH V2 0/4] Power: C3: add power domain driver
2023-07-07 0:37 [PATCH V2 0/4] Power: C3: add power domain driver Xianwei Zhao
` (3 preceding siblings ...)
2023-07-07 0:37 ` [PATCH V2 4/4] arm64: dts: add support for C3 power domain controller Xianwei Zhao
@ 2023-07-31 9:47 ` Neil Armstrong
2023-07-31 9:54 ` Neil Armstrong
5 siblings, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2023-07-31 9:47 UTC (permalink / raw)
To: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
Xianwei Zhao
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Kevin Hilman
Hi,
On Fri, 07 Jul 2023 08:37:06 +0800, Xianwei Zhao wrote:
> First patch is that Use 'name' instead of 'index' as criterion.
> The variate 'index' could be equal to zero in some SoCs. Such as C3 SoC,
> PWRC_C3_NNA_ID be defined zero.
>
> Other patchs adds power controller driver support for Amlogic C3 SoC.
> The power domains registers can be accessed in the secure world only.
>
> [...]
Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (v6.6/arm64-dt)
[4/4] arm64: dts: add support for C3 power domain controller
https://git.kernel.org/amlogic/c/22a9b2a488c3f0937fe0c57c96176cbea0953c20
These changes has been applied on the intermediate git tree [1].
The v6.6/arm64-dt branch will then be sent via a formal Pull Request to the Linux SoC maintainers
for inclusion in their intermediate git branches in order to be sent to Linus during
the next merge window, or sooner if it's a set of fixes.
In the cases of fixes, those will be merged in the current release candidate
kernel and as soon they appear on the Linux master branch they will be
backported to the previous Stable and Long-Stable kernels [2].
The intermediate git branches are merged daily in the linux-next tree [3],
people are encouraged testing these pre-release kernels and report issues on the
relevant mailing-lists.
If problems are discovered on those changes, please submit a signed-off-by revert
patch followed by a corrective changeset.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
[3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
--
Neil
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: (subset) [PATCH V2 0/4] Power: C3: add power domain driver
2023-07-07 0:37 [PATCH V2 0/4] Power: C3: add power domain driver Xianwei Zhao
` (4 preceding siblings ...)
2023-07-31 9:47 ` (subset) [PATCH V2 0/4] Power: C3: add power domain driver Neil Armstrong
@ 2023-07-31 9:54 ` Neil Armstrong
5 siblings, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2023-07-31 9:54 UTC (permalink / raw)
To: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
Xianwei Zhao
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Kevin Hilman
Hi,
On Fri, 07 Jul 2023 08:37:06 +0800, Xianwei Zhao wrote:
> First patch is that Use 'name' instead of 'index' as criterion.
> The variate 'index' could be equal to zero in some SoCs. Such as C3 SoC,
> PWRC_C3_NNA_ID be defined zero.
>
> Other patchs adds power controller driver support for Amlogic C3 SoC.
> The power domains registers can be accessed in the secure world only.
>
> [...]
Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (v6.6/drivers-genpd)
[1/4] soc: amlogic: use name instead of index as criterion
https://git.kernel.org/amlogic/c/fadf18180022743ff74b1f6ca4f3cff462ddaddb
[2/4] dt-bindings: power: add Amlogic C3 power domains
https://git.kernel.org/amlogic/c/83b03d62939c46c118a8d722f07ae03a87967b00
[3/4] soc: c3: Add support for power domains controller
https://git.kernel.org/amlogic/c/77e2f4e3cbd5cde442d05a7bdb6cd01565bead6d
These changes has been applied on the intermediate git tree [1].
The v6.6/drivers-genpd branch will then be sent via a formal Pull Request to the Linux SoC maintainers
for inclusion in their intermediate git branches in order to be sent to Linus during
the next merge window, or sooner if it's a set of fixes.
In the cases of fixes, those will be merged in the current release candidate
kernel and as soon they appear on the Linux master branch they will be
backported to the previous Stable and Long-Stable kernels [2].
The intermediate git branches are merged daily in the linux-next tree [3],
people are encouraged testing these pre-release kernels and report issues on the
relevant mailing-lists.
If problems are discovered on those changes, please submit a signed-off-by revert
patch followed by a corrective changeset.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
[3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
--
Neil
^ permalink raw reply [flat|nested] 14+ messages in thread