* [PATCH 1/6] soc: amlogic: modify some power domains property
2023-08-17 7:11 [PATCH 0/6] Power: T7: add power domain driver Xianwei Zhao
@ 2023-08-17 7:11 ` Xianwei Zhao
2023-08-17 7:11 ` [PATCH 2/6] soc: amlogic: add driver to support power parent node Xianwei Zhao
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Xianwei Zhao @ 2023-08-17 7:11 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
From: "xianwei.zhao" <xianwei.zhao@amlogic.com>
Some power domains for C3 can be using runtime PM,
remove ALWAYS_ON property. And add some power domains
description when ALWAYS_ON property.
Signed-off-by: xianwei.zhao <xianwei.zhao@amlogic.com>
---
drivers/genpd/amlogic/meson-secure-pwrc.c | 25 ++++++++++++-----------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/drivers/genpd/amlogic/meson-secure-pwrc.c b/drivers/genpd/amlogic/meson-secure-pwrc.c
index 89c881c56cd7..5ac2437ab8ad 100644
--- a/drivers/genpd/amlogic/meson-secure-pwrc.c
+++ b/drivers/genpd/amlogic/meson-secure-pwrc.c
@@ -122,18 +122,19 @@ static struct meson_secure_pwrc_domain_desc a1_pwrc_domains[] = {
};
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_NNA, 0),
+ SEC_PD(C3_AUDIO, 0),
+ SEC_PD(C3_SDIOA, 0),
+ SEC_PD(C3_EMMC, 0),
+ SEC_PD(C3_USB_COMB, 0),
+ SEC_PD(C3_SDCARD, 0),
+ /* ETH is for ethernet online wakeup, and should be always on */
+ SEC_PD(C3_ETH, GENPD_FLAG_ALWAYS_ON),
+ SEC_PD(C3_GE2D, 0),
+ SEC_PD(C3_CVE, 0),
+ SEC_PD(C3_GDC_WRAP, 0),
+ SEC_PD(C3_ISP_TOP, 0),
+ SEC_PD(C3_MIPI_ISP_WRAP, 0),
SEC_PD(C3_VCODEC, 0),
};
base-commit: 413f5c02929bb33042bbc4ee233166550a5fca70
--
2.37.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 2/6] soc: amlogic: add driver to support power parent node
2023-08-17 7:11 [PATCH 0/6] Power: T7: add power domain driver Xianwei Zhao
2023-08-17 7:11 ` [PATCH 1/6] soc: amlogic: modify some power domains property Xianwei Zhao
@ 2023-08-17 7:11 ` Xianwei Zhao
2023-08-17 7:11 ` [PATCH 3/6] soc: amlogic: init power domain state Xianwei Zhao
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Xianwei Zhao @ 2023-08-17 7:11 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
From: "xianwei.zhao" <xianwei.zhao@amlogic.com>
Some power domains depends on other domains, Such as Amlogic T7 SoC.
Add parent node to support this case.
Signed-off-by: xianwei.zhao <xianwei.zhao@amlogic.com>
---
drivers/genpd/amlogic/meson-secure-pwrc.c | 26 ++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/drivers/genpd/amlogic/meson-secure-pwrc.c b/drivers/genpd/amlogic/meson-secure-pwrc.c
index 5ac2437ab8ad..76527f4946b4 100644
--- a/drivers/genpd/amlogic/meson-secure-pwrc.c
+++ b/drivers/genpd/amlogic/meson-secure-pwrc.c
@@ -19,10 +19,12 @@
#define PWRC_ON 1
#define PWRC_OFF 0
+#define PWRC_NO_PARENT ((1UL << (sizeof(unsigned int) * 8)) - 1)
struct meson_secure_pwrc_domain {
struct generic_pm_domain base;
unsigned int index;
+ unsigned int parent;
struct meson_secure_pwrc *pwrc;
};
@@ -34,6 +36,7 @@ struct meson_secure_pwrc {
struct meson_secure_pwrc_domain_desc {
unsigned int index;
+ unsigned int parent;
unsigned int flags;
char *name;
bool (*is_off)(struct meson_secure_pwrc_domain *pwrc_domain);
@@ -90,8 +93,19 @@ static int meson_secure_pwrc_on(struct generic_pm_domain *domain)
{ \
.name = #__name, \
.index = PWRC_##__name##_ID, \
- .is_off = pwrc_secure_is_off, \
+ .is_off = pwrc_secure_is_off, \
.flags = __flag, \
+ .parent = PWRC_NO_PARENT, \
+}
+
+#define TOP_PD(__name, __flag, __parent) \
+[PWRC_##__name##_ID] = \
+{ \
+ .name = #__name, \
+ .index = PWRC_##__name##_ID, \
+ .is_off = pwrc_secure_is_off, \
+ .flags = __flag, \
+ .parent = __parent, \
}
static struct meson_secure_pwrc_domain_desc a1_pwrc_domains[] = {
@@ -202,6 +216,7 @@ static int meson_secure_pwrc_probe(struct platform_device *pdev)
dom->pwrc = pwrc;
dom->index = match->domains[i].index;
+ dom->parent = match->domains[i].parent;
dom->base.name = match->domains[i].name;
dom->base.flags = match->domains[i].flags;
dom->base.power_on = meson_secure_pwrc_on;
@@ -212,6 +227,15 @@ static int meson_secure_pwrc_probe(struct platform_device *pdev)
pwrc->xlate.domains[i] = &dom->base;
}
+ for (i = 0; i < match->count; i++) {
+ struct meson_secure_pwrc_domain *dom = pwrc->domains;
+
+ if (!match->domains[i].name || match->domains[i].parent == PWRC_NO_PARENT)
+ continue;
+
+ pm_genpd_add_subdomain(&dom[dom[i].parent].base, &dom[i].base);
+ }
+
return of_genpd_add_provider_onecell(pdev->dev.of_node, &pwrc->xlate);
}
--
2.37.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 3/6] soc: amlogic: init power domain state
2023-08-17 7:11 [PATCH 0/6] Power: T7: add power domain driver Xianwei Zhao
2023-08-17 7:11 ` [PATCH 1/6] soc: amlogic: modify some power domains property Xianwei Zhao
2023-08-17 7:11 ` [PATCH 2/6] soc: amlogic: add driver to support power parent node Xianwei Zhao
@ 2023-08-17 7:11 ` Xianwei Zhao
2023-08-17 7:11 ` [PATCH 4/6] dt-bindings: power: add Amlogic T7 power domains Xianwei Zhao
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Xianwei Zhao @ 2023-08-17 7:11 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
From: "xianwei.zhao" <xianwei.zhao@amlogic.com>
If initial power domain with 'AWAY_ON' property state is off,
turn on the power.
Signed-off-by: xianwei.zhao <xianwei.zhao@amlogic.com>
---
drivers/genpd/amlogic/meson-secure-pwrc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/genpd/amlogic/meson-secure-pwrc.c b/drivers/genpd/amlogic/meson-secure-pwrc.c
index 76527f4946b4..3e7e3bd25d1f 100644
--- a/drivers/genpd/amlogic/meson-secure-pwrc.c
+++ b/drivers/genpd/amlogic/meson-secure-pwrc.c
@@ -55,7 +55,7 @@ static bool pwrc_secure_is_off(struct meson_secure_pwrc_domain *pwrc_domain)
pwrc_domain->index, 0, 0, 0, 0) < 0)
pr_err("failed to get power domain status\n");
- return is_off;
+ return !!is_off;
}
static int meson_secure_pwrc_off(struct generic_pm_domain *domain)
@@ -222,6 +222,9 @@ static int meson_secure_pwrc_probe(struct platform_device *pdev)
dom->base.power_on = meson_secure_pwrc_on;
dom->base.power_off = meson_secure_pwrc_off;
+ if (match->domains[i].is_off(dom) && (dom->base.flags & GENPD_FLAG_ALWAYS_ON))
+ meson_secure_pwrc_on(&dom->base);
+
pm_genpd_init(&dom->base, NULL, match->domains[i].is_off(dom));
pwrc->xlate.domains[i] = &dom->base;
--
2.37.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 4/6] dt-bindings: power: add Amlogic T7 power domains
2023-08-17 7:11 [PATCH 0/6] Power: T7: add power domain driver Xianwei Zhao
` (2 preceding siblings ...)
2023-08-17 7:11 ` [PATCH 3/6] soc: amlogic: init power domain state Xianwei Zhao
@ 2023-08-17 7:11 ` Xianwei Zhao
2023-08-19 14:20 ` Krzysztof Kozlowski
2023-08-17 7:11 ` [PATCH 5/6] soc: amlogic: Add support for T7 power domains controller Xianwei Zhao
2023-08-17 7:11 ` [PATCH 6/6] arm64: dts: add support for T7 power domain controller Xianwei Zhao
5 siblings, 1 reply; 9+ messages in thread
From: Xianwei Zhao @ 2023-08-17 7:11 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
From: "xianwei.zhao" <xianwei.zhao@amlogic.com>
Add devicetree binding document and related header file for
Amlogic T7 secure power domains.
Signed-off-by: xianwei.zhao <xianwei.zhao@amlogic.com>
---
.../power/amlogic,meson-sec-pwrc.yaml | 3 +-
include/dt-bindings/power/amlogic,t7-pwrc.h | 63 +++++++++++++++++++
2 files changed, 65 insertions(+), 1 deletion(-)
create mode 100644 include/dt-bindings/power/amlogic,t7-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 d80bbedfe3aa..dab3d92bc273 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 & C3 SoCs, and should be the child node
+ Secure Power Domains used in Meson A1/C1/S4 & C3/T7 SoCs, and should be the child node
of secure-monitor.
properties:
@@ -21,6 +21,7 @@ properties:
- amlogic,meson-a1-pwrc
- amlogic,meson-s4-pwrc
- amlogic,c3-pwrc
+ - amlogic,t7-pwrc
"#power-domain-cells":
const: 1
diff --git a/include/dt-bindings/power/amlogic,t7-pwrc.h b/include/dt-bindings/power/amlogic,t7-pwrc.h
new file mode 100644
index 000000000000..b7a13eda563c
--- /dev/null
+++ b/include/dt-bindings/power/amlogic,t7-pwrc.h
@@ -0,0 +1,63 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR .*) */
+/*
+ * Copyright (c) 2023 Amlogic, Inc.
+ * Author: Hongyu Chen <hongyu.chen1@amlogic.com>
+ */
+#ifndef _DT_BINDINGS_AMLOGIC_T7_POWER_H
+#define _DT_BINDINGS_AMLOGIC_T7_POWER_H
+
+#define PWRC_T7_DSPA_ID 0
+#define PWRC_T7_DSPB_ID 1
+#define PWRC_T7_DOS_HCODEC_ID 2
+#define PWRC_T7_DOS_HEVC_ID 3
+#define PWRC_T7_DOS_VDEC_ID 4
+#define PWRC_T7_DOS_WAVE_ID 5
+#define PWRC_T7_VPU_HDMI_ID 6
+#define PWRC_T7_USB_COMB_ID 7
+#define PWRC_T7_PCIE_ID 8
+#define PWRC_T7_GE2D_ID 9
+#define PWRC_T7_SRAMA_ID 10
+#define PWRC_T7_SRAMB_ID 11
+#define PWRC_T7_HDMIRX_ID 12
+#define PWRC_T7_VI_CLK1_ID 13
+#define PWRC_T7_VI_CLK2_ID 14
+#define PWRC_T7_ETH_ID 15
+#define PWRC_T7_ISP_ID 16
+#define PWRC_T7_MIPI_ISP_ID 17
+#define PWRC_T7_GDC_ID 18
+#define PWRC_T7_CVE_ID 18
+#define PWRC_T7_DEWARP_ID 19
+#define PWRC_T7_SDIO_A_ID 20
+#define PWRC_T7_SDIO_B_ID 21
+#define PWRC_T7_EMMC_ID 22
+#define PWRC_T7_MALI_SC0_ID 23
+#define PWRC_T7_MALI_SC1_ID 24
+#define PWRC_T7_MALI_SC2_ID 25
+#define PWRC_T7_MALI_SC3_ID 26
+#define PWRC_T7_MALI_TOP_ID 27
+#define PWRC_T7_NNA_CORE0_ID 28
+#define PWRC_T7_NNA_CORE1_ID 29
+#define PWRC_T7_NNA_CORE2_ID 30
+#define PWRC_T7_NNA_CORE3_ID 31
+#define PWRC_T7_NNA_TOP_ID 32
+#define PWRC_T7_DDR0_ID 33
+#define PWRC_T7_DDR1_ID 34
+#define PWRC_T7_DMC0_ID 35
+#define PWRC_T7_DMC1_ID 36
+#define PWRC_T7_NOC_ID 37
+#define PWRC_T7_NIC2_ID 38
+#define PWRC_T7_NIC3_ID 39
+#define PWRC_T7_CCI_ID 40
+#define PWRC_T7_MIPI_DSI0_ID 41
+#define PWRC_T7_SPICC0_ID 42
+#define PWRC_T7_SPICC1_ID 43
+#define PWRC_T7_SPICC2_ID 44
+#define PWRC_T7_SPICC3_ID 45
+#define PWRC_T7_SPICC4_ID 46
+#define PWRC_T7_SPICC5_ID 47
+#define PWRC_T7_EDP0_ID 48
+#define PWRC_T7_EDP1_ID 49
+#define PWRC_T7_MIPI_DSI1_ID 50
+#define PWRC_T7_AUDIO_ID 51
+
+#endif
--
2.37.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH 4/6] dt-bindings: power: add Amlogic T7 power domains
2023-08-17 7:11 ` [PATCH 4/6] dt-bindings: power: add Amlogic T7 power domains Xianwei Zhao
@ 2023-08-19 14:20 ` Krzysztof Kozlowski
2023-08-21 9:40 ` Xianwei Zhao
0 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-19 14:20 UTC (permalink / raw)
To: Xianwei Zhao, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Kevin Hilman
On 17/08/2023 09:11, Xianwei Zhao wrote:
> From: "xianwei.zhao" <xianwei.zhao@amlogic.com>
> @@ -21,6 +21,7 @@ properties:
> - amlogic,meson-a1-pwrc
> - amlogic,meson-s4-pwrc
> - amlogic,c3-pwrc
> + - amlogic,t7-pwrc
>
> "#power-domain-cells":
> const: 1
> diff --git a/include/dt-bindings/power/amlogic,t7-pwrc.h b/include/dt-bindings/power/amlogic,t7-pwrc.h
> new file mode 100644
> index 000000000000..b7a13eda563c
> --- /dev/null
> +++ b/include/dt-bindings/power/amlogic,t7-pwrc.h
> @@ -0,0 +1,63 @@
> +/* SPDX-License-Identifier: (GPL-2.0-only OR .*) */
This does not look correct license. Use one recommended by checkpatch.
Best regards,
Krzysztof
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 4/6] dt-bindings: power: add Amlogic T7 power domains
2023-08-19 14:20 ` Krzysztof Kozlowski
@ 2023-08-21 9:40 ` Xianwei Zhao
0 siblings, 0 replies; 9+ messages in thread
From: Xianwei Zhao @ 2023-08-21 9:40 UTC (permalink / raw)
To: Krzysztof Kozlowski, devicetree, linux-arm-kernel, linux-amlogic,
linux-kernel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Kevin Hilman
Hi Krzystof,
Thanks for your review.
On 2023/8/19 22:20, Krzysztof Kozlowski wrote:
> [ EXTERNAL EMAIL ]
>
> On 17/08/2023 09:11, Xianwei Zhao wrote:
>> From: "xianwei.zhao" <xianwei.zhao@amlogic.com>
>
>> @@ -21,6 +21,7 @@ properties:
>> - amlogic,meson-a1-pwrc
>> - amlogic,meson-s4-pwrc
>> - amlogic,c3-pwrc
>> + - amlogic,t7-pwrc
>>
>> "#power-domain-cells":
>> const: 1
>> diff --git a/include/dt-bindings/power/amlogic,t7-pwrc.h b/include/dt-bindings/power/amlogic,t7-pwrc.h
>> new file mode 100644
>> index 000000000000..b7a13eda563c
>> --- /dev/null
>> +++ b/include/dt-bindings/power/amlogic,t7-pwrc.h
>> @@ -0,0 +1,63 @@
>> +/* SPDX-License-Identifier: (GPL-2.0-only OR .*) */
>
> This does not look correct license. Use one recommended by checkpatch.
>
Will fix it in next version.
>
>
> Best regards,
> Krzysztof
>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 5/6] soc: amlogic: Add support for T7 power domains controller
2023-08-17 7:11 [PATCH 0/6] Power: T7: add power domain driver Xianwei Zhao
` (3 preceding siblings ...)
2023-08-17 7:11 ` [PATCH 4/6] dt-bindings: power: add Amlogic T7 power domains Xianwei Zhao
@ 2023-08-17 7:11 ` Xianwei Zhao
2023-08-17 7:11 ` [PATCH 6/6] arm64: dts: add support for T7 power domain controller Xianwei Zhao
5 siblings, 0 replies; 9+ messages in thread
From: Xianwei Zhao @ 2023-08-17 7:11 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
From: "xianwei.zhao" <xianwei.zhao@amlogic.com>
Add support for T7 power controller. T7 power control
registers are in secure domain, and should be accessed by SMC.
Signed-off-by: xianwei.zhao <xianwei.zhao@amlogic.com>
---
drivers/genpd/amlogic/meson-secure-pwrc.c | 72 +++++++++++++++++++++++
1 file changed, 72 insertions(+)
diff --git a/drivers/genpd/amlogic/meson-secure-pwrc.c b/drivers/genpd/amlogic/meson-secure-pwrc.c
index 3e7e3bd25d1f..6a6d333daef4 100644
--- a/drivers/genpd/amlogic/meson-secure-pwrc.c
+++ b/drivers/genpd/amlogic/meson-secure-pwrc.c
@@ -13,6 +13,7 @@
#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 <dt-bindings/power/amlogic,t7-pwrc.h>
#include <linux/arm-smccc.h>
#include <linux/firmware/meson/meson_sm.h>
#include <linux/module.h>
@@ -164,6 +165,68 @@ static struct meson_secure_pwrc_domain_desc s4_pwrc_domains[] = {
SEC_PD(S4_AUDIO, 0),
};
+static struct meson_secure_pwrc_domain_desc t7_pwrc_domains[] = {
+ SEC_PD(T7_DSPA, 0),
+ SEC_PD(T7_DSPB, 0),
+ TOP_PD(T7_DOS_HCODEC, 0, PWRC_T7_NIC3_ID),
+ TOP_PD(T7_DOS_HEVC, 0, PWRC_T7_NIC3_ID),
+ TOP_PD(T7_DOS_VDEC, 0, PWRC_T7_NIC3_ID),
+ TOP_PD(T7_DOS_WAVE, 0, PWRC_T7_NIC3_ID),
+ SEC_PD(T7_VPU_HDMI, 0),
+ SEC_PD(T7_USB_COMB, 0),
+ SEC_PD(T7_PCIE, 0),
+ TOP_PD(T7_GE2D, 0, PWRC_T7_NIC3_ID),
+ /* SRAMA is used as ATF runtime memory, and should be always on */
+ SEC_PD(T7_SRAMA, GENPD_FLAG_ALWAYS_ON),
+ /* SRAMB is used as ATF runtime memory, and should be always on */
+ SEC_PD(T7_SRAMB, GENPD_FLAG_ALWAYS_ON),
+ SEC_PD(T7_HDMIRX, 0),
+ SEC_PD(T7_VI_CLK1, 0),
+ SEC_PD(T7_VI_CLK2, 0),
+ /* ETH is for ethernet online wakeup, and should be always on */
+ SEC_PD(T7_ETH, GENPD_FLAG_ALWAYS_ON),
+ SEC_PD(T7_ISP, 0),
+ SEC_PD(T7_MIPI_ISP, 0),
+ TOP_PD(T7_GDC, 0, PWRC_T7_NIC3_ID),
+ TOP_PD(T7_DEWARP, 0, PWRC_T7_NIC3_ID),
+ SEC_PD(T7_SDIO_A, 0),
+ SEC_PD(T7_SDIO_B, 0),
+ SEC_PD(T7_EMMC, 0),
+ TOP_PD(T7_MALI_SC0, 0, PWRC_T7_NNA_TOP_ID),
+ TOP_PD(T7_MALI_SC1, 0, PWRC_T7_NNA_TOP_ID),
+ TOP_PD(T7_MALI_SC2, 0, PWRC_T7_NNA_TOP_ID),
+ TOP_PD(T7_MALI_SC3, 0, PWRC_T7_NNA_TOP_ID),
+ SEC_PD(T7_MALI_TOP, 0),
+ TOP_PD(T7_NNA_CORE0, 0, PWRC_T7_NNA_TOP_ID),
+ TOP_PD(T7_NNA_CORE1, 0, PWRC_T7_NNA_TOP_ID),
+ TOP_PD(T7_NNA_CORE2, 0, PWRC_T7_NNA_TOP_ID),
+ TOP_PD(T7_NNA_CORE3, 0, PWRC_T7_NNA_TOP_ID),
+ SEC_PD(T7_NNA_TOP, 0),
+ SEC_PD(T7_DDR0, GENPD_FLAG_ALWAYS_ON),
+ SEC_PD(T7_DDR1, GENPD_FLAG_ALWAYS_ON),
+ /* DMC0 is for DDR PHY ana/dig and DMC, and should be always on */
+ SEC_PD(T7_DMC0, GENPD_FLAG_ALWAYS_ON),
+ /* DMC1 is for DDR PHY ana/dig and DMC, and should be always on */
+ SEC_PD(T7_DMC1, GENPD_FLAG_ALWAYS_ON),
+ SEC_PD(T7_NOC, 0),
+ /* NIC is for the Arm NIC-400 interconnect, and should be always on */
+ SEC_PD(T7_NIC2, GENPD_FLAG_ALWAYS_ON),
+ SEC_PD(T7_NIC3, 0),
+ /* CPU accesses the interleave data to the ddr need cci, and should be always on */
+ SEC_PD(T7_CCI, GENPD_FLAG_ALWAYS_ON),
+ SEC_PD(T7_MIPI_DSI0, 0),
+ SEC_PD(T7_SPICC0, 0),
+ SEC_PD(T7_SPICC1, 0),
+ SEC_PD(T7_SPICC2, 0),
+ SEC_PD(T7_SPICC3, 0),
+ SEC_PD(T7_SPICC4, 0),
+ SEC_PD(T7_SPICC5, 0),
+ SEC_PD(T7_EDP0, 0),
+ SEC_PD(T7_EDP1, 0),
+ SEC_PD(T7_MIPI_DSI1, 0),
+ SEC_PD(T7_AUDIO, 0),
+};
+
static int meson_secure_pwrc_probe(struct platform_device *pdev)
{
int i;
@@ -257,6 +320,11 @@ static struct meson_secure_pwrc_domain_data meson_secure_s4_pwrc_data = {
.count = ARRAY_SIZE(s4_pwrc_domains),
};
+static struct meson_secure_pwrc_domain_data amlogic_secure_t7_pwrc_data = {
+ .domains = t7_pwrc_domains,
+ .count = ARRAY_SIZE(t7_pwrc_domains),
+};
+
static const struct of_device_id meson_secure_pwrc_match_table[] = {
{
.compatible = "amlogic,meson-a1-pwrc",
@@ -270,6 +338,10 @@ static const struct of_device_id meson_secure_pwrc_match_table[] = {
.compatible = "amlogic,meson-s4-pwrc",
.data = &meson_secure_s4_pwrc_data,
},
+ {
+ .compatible = "amlogic,t7-pwrc",
+ .data = &amlogic_secure_t7_pwrc_data,
+ },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, meson_secure_pwrc_match_table);
--
2.37.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 6/6] arm64: dts: add support for T7 power domain controller
2023-08-17 7:11 [PATCH 0/6] Power: T7: add power domain driver Xianwei Zhao
` (4 preceding siblings ...)
2023-08-17 7:11 ` [PATCH 5/6] soc: amlogic: Add support for T7 power domains controller Xianwei Zhao
@ 2023-08-17 7:11 ` Xianwei Zhao
5 siblings, 0 replies; 9+ messages in thread
From: Xianwei Zhao @ 2023-08-17 7:11 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
From: "xianwei.zhao" <xianwei.zhao@amlogic.com>
Enable power domain controller for Amlogic T7 SoC
Signed-off-by: xianwei.zhao <xianwei.zhao@amlogic.com>
---
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
index 1423d4a79156..23cdad1b425b 100644
--- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
+++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
@@ -4,6 +4,7 @@
*/
#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/power/amlogic,t7-pwrc.h>
/ {
interrupt-parent = <&gic>;
@@ -118,6 +119,11 @@ psci {
sm: secure-monitor {
compatible = "amlogic,meson-gxbb-sm";
+
+ pwrc: power-controller {
+ compatible = "amlogic,t7-pwrc";
+ #power-domain-cells = <1>;
+ };
};
soc {
--
2.37.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 9+ messages in thread