* [PATCH V3 0/6] Power: T7: add power domain driver
@ 2023-08-29 2:03 Xianwei Zhao
2023-08-29 2:03 ` [PATCH V3 1/6] genpd: amlogic: modify some power domains property Xianwei Zhao
` (7 more replies)
0 siblings, 8 replies; 11+ messages in thread
From: Xianwei Zhao @ 2023-08-29 2:03 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
First patch is that remove C3 some power domain ALWAYS_ON property.
Second patch is that add driver to support power parent node.
Third patch is that turn on power if initial power domain with
"AWAY_ON" property state is off.
Other patchs adds power controller driver support for Amlogic T7 SoC.
Changes Since v2:
-Modify subject.
-Define PWRC_NO_PARENT UINT_MAX
-Remove modification that transform is_off into 1 or 0 using !!
Changes Since v1:
-Fix license from "GPL-2.0-only OR .*" to "GPL-2.0-only OR MIT".
-Modify T7_NIC flag "ALWAYS_ON"
xianwei.zhao (6):
genpd: amlogic: modify some power domains property
genpd: amlogic: add driver to support power parent node
genpd: amlogic: init power domain state
dt-bindings: power: add Amlogic T7 power domains
genpd: amlogic: Add support for T7 power domains controller
arm64: dts: amlogic: t7: add power domain controller node
.../power/amlogic,meson-sec-pwrc.yaml | 3 +-
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 6 +
drivers/genpd/amlogic/meson-secure-pwrc.c | 127 ++++++++++++++++--
include/dt-bindings/power/amlogic,t7-pwrc.h | 63 +++++++++
4 files changed, 185 insertions(+), 14 deletions(-)
create mode 100644 include/dt-bindings/power/amlogic,t7-pwrc.h
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] 11+ messages in thread
* [PATCH V3 1/6] genpd: amlogic: modify some power domains property
2023-08-29 2:03 [PATCH V3 0/6] Power: T7: add power domain driver Xianwei Zhao
@ 2023-08-29 2:03 ` Xianwei Zhao
2023-08-29 2:04 ` [PATCH V3 2/6] genpd: amlogic: add driver to support power parent node Xianwei Zhao
` (6 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Xianwei Zhao @ 2023-08-29 2:03 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>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
---
V2 -> V3: modify subject "genpd: amlogic: "
V1 -> V2: None
---
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),
};
--
2.37.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH V3 2/6] genpd: amlogic: add driver to support power parent node
2023-08-29 2:03 [PATCH V3 0/6] Power: T7: add power domain driver Xianwei Zhao
2023-08-29 2:03 ` [PATCH V3 1/6] genpd: amlogic: modify some power domains property Xianwei Zhao
@ 2023-08-29 2:04 ` Xianwei Zhao
2023-08-29 2:04 ` [PATCH V3 3/6] genpd: amlogic: init power domain state Xianwei Zhao
` (5 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Xianwei Zhao @ 2023-08-29 2:04 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>
---
V2 -> V3: modify subject "genpd: amlogic: "
define PWRC_NO_PARENT UINT_MAX
V1 -> V2: None
---
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..ecada537b19c 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 UINT_MAX
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 related [flat|nested] 11+ messages in thread
* [PATCH V3 3/6] genpd: amlogic: init power domain state
2023-08-29 2:03 [PATCH V3 0/6] Power: T7: add power domain driver Xianwei Zhao
2023-08-29 2:03 ` [PATCH V3 1/6] genpd: amlogic: modify some power domains property Xianwei Zhao
2023-08-29 2:04 ` [PATCH V3 2/6] genpd: amlogic: add driver to support power parent node Xianwei Zhao
@ 2023-08-29 2:04 ` Xianwei Zhao
2023-08-29 2:04 ` [PATCH V3 4/6] dt-bindings: power: add Amlogic T7 power domains Xianwei Zhao
` (4 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Xianwei Zhao @ 2023-08-29 2:04 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>
---
V2 -> V3: modify subject "genpd: amlogic: "
remove modification that transform is_off into 1 or 0 using !!
V1 -> V2: None
---
drivers/genpd/amlogic/meson-secure-pwrc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/genpd/amlogic/meson-secure-pwrc.c b/drivers/genpd/amlogic/meson-secure-pwrc.c
index ecada537b19c..d751c224048d 100644
--- a/drivers/genpd/amlogic/meson-secure-pwrc.c
+++ b/drivers/genpd/amlogic/meson-secure-pwrc.c
@@ -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 related [flat|nested] 11+ messages in thread
* [PATCH V3 4/6] dt-bindings: power: add Amlogic T7 power domains
2023-08-29 2:03 [PATCH V3 0/6] Power: T7: add power domain driver Xianwei Zhao
` (2 preceding siblings ...)
2023-08-29 2:04 ` [PATCH V3 3/6] genpd: amlogic: init power domain state Xianwei Zhao
@ 2023-08-29 2:04 ` Xianwei Zhao
2023-08-29 2:04 ` [PATCH V3 5/6] genpd: amlogic: Add support for T7 power domains controller Xianwei Zhao
` (3 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Xianwei Zhao @ 2023-08-29 2:04 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, Conor Dooley, Lucas Tanure
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>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Tested-by: Lucas Tanure <tanure@linux.com>
---
V2 -> V3: None
V1 -> V2: Fix license from "GPL-2.0-only OR .*" to "GPL-2.0-only OR MIT"
---
.../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..1f1f2739cc26
--- /dev/null
+++ b/include/dt-bindings/power/amlogic,t7-pwrc.h
@@ -0,0 +1,63 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+/*
+ * 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 related [flat|nested] 11+ messages in thread
* [PATCH V3 5/6] genpd: amlogic: Add support for T7 power domains controller
2023-08-29 2:03 [PATCH V3 0/6] Power: T7: add power domain driver Xianwei Zhao
` (3 preceding siblings ...)
2023-08-29 2:04 ` [PATCH V3 4/6] dt-bindings: power: add Amlogic T7 power domains Xianwei Zhao
@ 2023-08-29 2:04 ` Xianwei Zhao
2023-08-29 2:04 ` [PATCH V3 6/6] arm64: dts: amlogic: t7: add power domain controller node Xianwei Zhao
` (2 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Xianwei Zhao @ 2023-08-29 2:04 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>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
---
V2 -> V3: modify subject "genpd: amlogic: "
V1 -> V2: Modify T7_NIC flag "ALWAYS_ON"
---
drivers/genpd/amlogic/meson-secure-pwrc.c | 73 +++++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/drivers/genpd/amlogic/meson-secure-pwrc.c b/drivers/genpd/amlogic/meson-secure-pwrc.c
index d751c224048d..4d5bda0d60fc 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,69 @@ 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),
+ /* NOC is related to clk bus, and should be always on */
+ SEC_PD(T7_NOC, GENPD_FLAG_ALWAYS_ON),
+ /* 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 +321,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 +339,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 related [flat|nested] 11+ messages in thread
* [PATCH V3 6/6] arm64: dts: amlogic: t7: add power domain controller node
2023-08-29 2:03 [PATCH V3 0/6] Power: T7: add power domain driver Xianwei Zhao
` (4 preceding siblings ...)
2023-08-29 2:04 ` [PATCH V3 5/6] genpd: amlogic: Add support for T7 power domains controller Xianwei Zhao
@ 2023-08-29 2:04 ` Xianwei Zhao
2023-09-08 12:40 ` [PATCH V3 0/6] Power: T7: add power domain driver Neil Armstrong
2023-09-11 15:09 ` (subset) " Neil Armstrong
7 siblings, 0 replies; 11+ messages in thread
From: Xianwei Zhao @ 2023-08-29 2:04 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, Lucas Tanure
From: "xianwei.zhao" <xianwei.zhao@amlogic.com>
Add power domain controller node for Amlogic T7 SoC
Signed-off-by: xianwei.zhao <xianwei.zhao@amlogic.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Lucas Tanure <tanure@linux.com>
---
V2 -> V3: modify subject.
V1 -> V2: None
---
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 related [flat|nested] 11+ messages in thread
* Re: [PATCH V3 0/6] Power: T7: add power domain driver
2023-08-29 2:03 [PATCH V3 0/6] Power: T7: add power domain driver Xianwei Zhao
` (5 preceding siblings ...)
2023-08-29 2:04 ` [PATCH V3 6/6] arm64: dts: amlogic: t7: add power domain controller node Xianwei Zhao
@ 2023-09-08 12:40 ` Neil Armstrong
2023-09-08 12:45 ` Neil Armstrong
2023-09-11 15:09 ` (subset) " Neil Armstrong
7 siblings, 1 reply; 11+ messages in thread
From: Neil Armstrong @ 2023-09-08 12:40 UTC (permalink / raw)
To: Xianwei Zhao, devicetree, linux-arm-kernel, linux-amlogic,
linux-kernel, Ulf Hansson
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Kevin Hilman,
linux-pm
Hi,
On 29/08/2023 04:03, Xianwei Zhao wrote:
> First patch is that remove C3 some power domain ALWAYS_ON property.
> Second patch is that add driver to support power parent node.
> Third patch is that turn on power if initial power domain with
> "AWAY_ON" property state is off.
>
> Other patchs adds power controller driver support for Amlogic T7 SoC.
Please re-send to Ulf Hansson <ulf.hansson@linaro.org> and
linux-pm@vger.kernel.org since this driver has moved to the
GENERIC PM DOMAIN PROVIDERS subsystem.
I'll take the DT patch since bindings patch was reviewed.
Thanks,
Neil
>
> Changes Since v2:
> -Modify subject.
> -Define PWRC_NO_PARENT UINT_MAX
> -Remove modification that transform is_off into 1 or 0 using !!
>
> Changes Since v1:
> -Fix license from "GPL-2.0-only OR .*" to "GPL-2.0-only OR MIT".
> -Modify T7_NIC flag "ALWAYS_ON"
>
> xianwei.zhao (6):
> genpd: amlogic: modify some power domains property
> genpd: amlogic: add driver to support power parent node
> genpd: amlogic: init power domain state
> dt-bindings: power: add Amlogic T7 power domains
> genpd: amlogic: Add support for T7 power domains controller
> arm64: dts: amlogic: t7: add power domain controller node
>
> .../power/amlogic,meson-sec-pwrc.yaml | 3 +-
> arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 6 +
> drivers/genpd/amlogic/meson-secure-pwrc.c | 127 ++++++++++++++++--
> include/dt-bindings/power/amlogic,t7-pwrc.h | 63 +++++++++
> 4 files changed, 185 insertions(+), 14 deletions(-)
> create mode 100644 include/dt-bindings/power/amlogic,t7-pwrc.h
>
>
> base-commit: 413f5c02929bb33042bbc4ee233166550a5fca70
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH V3 0/6] Power: T7: add power domain driver
2023-09-08 12:40 ` [PATCH V3 0/6] Power: T7: add power domain driver Neil Armstrong
@ 2023-09-08 12:45 ` Neil Armstrong
2023-09-11 2:29 ` Xianwei Zhao
0 siblings, 1 reply; 11+ messages in thread
From: Neil Armstrong @ 2023-09-08 12:45 UTC (permalink / raw)
To: Xianwei Zhao, devicetree, linux-arm-kernel, linux-amlogic,
linux-kernel, Ulf Hansson
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Kevin Hilman,
linux-pm
On 08/09/2023 14:40, Neil Armstrong wrote:
> Hi,
>
> On 29/08/2023 04:03, Xianwei Zhao wrote:
>> First patch is that remove C3 some power domain ALWAYS_ON property.
>> Second patch is that add driver to support power parent node.
>> Third patch is that turn on power if initial power domain with
>> "AWAY_ON" property state is off.
>>
>> Other patchs adds power controller driver support for Amlogic T7 SoC.
>
> Please re-send to Ulf Hansson <ulf.hansson@linaro.org> and
> linux-pm@vger.kernel.org since this driver has moved to the
> GENERIC PM DOMAIN PROVIDERS subsystem.
>
> I'll take the DT patch since bindings patch was reviewed.
In fact I'll need Ulf to provide me an immutable branch or tag with
the bindings in order for me to apply the DT patch.
Neil
>
> Thanks,
> Neil
>
>>
>> Changes Since v2:
>> -Modify subject.
>> -Define PWRC_NO_PARENT UINT_MAX
>> -Remove modification that transform is_off into 1 or 0 using !!
>>
>> Changes Since v1:
>> -Fix license from "GPL-2.0-only OR .*" to "GPL-2.0-only OR MIT".
>> -Modify T7_NIC flag "ALWAYS_ON"
>>
>> xianwei.zhao (6):
>> genpd: amlogic: modify some power domains property
>> genpd: amlogic: add driver to support power parent node
>> genpd: amlogic: init power domain state
>> dt-bindings: power: add Amlogic T7 power domains
>> genpd: amlogic: Add support for T7 power domains controller
>> arm64: dts: amlogic: t7: add power domain controller node
>>
>> .../power/amlogic,meson-sec-pwrc.yaml | 3 +-
>> arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 6 +
>> drivers/genpd/amlogic/meson-secure-pwrc.c | 127 ++++++++++++++++--
>> include/dt-bindings/power/amlogic,t7-pwrc.h | 63 +++++++++
>> 4 files changed, 185 insertions(+), 14 deletions(-)
>> create mode 100644 include/dt-bindings/power/amlogic,t7-pwrc.h
>>
>>
>> base-commit: 413f5c02929bb33042bbc4ee233166550a5fca70
>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH V3 0/6] Power: T7: add power domain driver
2023-09-08 12:45 ` Neil Armstrong
@ 2023-09-11 2:29 ` Xianwei Zhao
0 siblings, 0 replies; 11+ messages in thread
From: Xianwei Zhao @ 2023-09-11 2:29 UTC (permalink / raw)
To: neil.armstrong, devicetree, linux-arm-kernel, linux-amlogic,
linux-kernel, Ulf Hansson
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Kevin Hilman,
linux-pm
Hi Neil,
Thanks.
On 2023/9/8 20:45, Neil Armstrong wrote:
> [ EXTERNAL EMAIL ]
>
> On 08/09/2023 14:40, Neil Armstrong wrote:
>> Hi,
>>
>> On 29/08/2023 04:03, Xianwei Zhao wrote:
>>> First patch is that remove C3 some power domain ALWAYS_ON property.
>>> Second patch is that add driver to support power parent node.
>>> Third patch is that turn on power if initial power domain with
>>> "AWAY_ON" property state is off.
>>>
>>> Other patchs adds power controller driver support for Amlogic T7 SoC.
>>
>> Please re-send to Ulf Hansson <ulf.hansson@linaro.org> and
>> linux-pm@vger.kernel.org since this driver has moved to the
>> GENERIC PM DOMAIN PROVIDERS subsystem.
>>
>> I'll take the DT patch since bindings patch was reviewed.
>
> In fact I'll need Ulf to provide me an immutable branch or tag with
> the bindings in order for me to apply the DT patch.
>
Will res-send.
> Neil
>
>>
>> Thanks,
>> Neil
>>
>>>
>>> Changes Since v2:
>>> -Modify subject.
>>> -Define PWRC_NO_PARENT UINT_MAX
>>> -Remove modification that transform is_off into 1 or 0 using !!
>>>
>>> Changes Since v1:
>>> -Fix license from "GPL-2.0-only OR .*" to "GPL-2.0-only OR MIT".
>>> -Modify T7_NIC flag "ALWAYS_ON"
>>>
>>> xianwei.zhao (6):
>>> genpd: amlogic: modify some power domains property
>>> genpd: amlogic: add driver to support power parent node
>>> genpd: amlogic: init power domain state
>>> dt-bindings: power: add Amlogic T7 power domains
>>> genpd: amlogic: Add support for T7 power domains controller
>>> arm64: dts: amlogic: t7: add power domain controller node
>>>
>>> .../power/amlogic,meson-sec-pwrc.yaml | 3 +-
>>> arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 6 +
>>> drivers/genpd/amlogic/meson-secure-pwrc.c | 127 ++++++++++++++++--
>>> include/dt-bindings/power/amlogic,t7-pwrc.h | 63 +++++++++
>>> 4 files changed, 185 insertions(+), 14 deletions(-)
>>> create mode 100644 include/dt-bindings/power/amlogic,t7-pwrc.h
>>>
>>>
>>> base-commit: 413f5c02929bb33042bbc4ee233166550a5fca70
>>
>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: (subset) [PATCH V3 0/6] Power: T7: add power domain driver
2023-08-29 2:03 [PATCH V3 0/6] Power: T7: add power domain driver Xianwei Zhao
` (6 preceding siblings ...)
2023-09-08 12:40 ` [PATCH V3 0/6] Power: T7: add power domain driver Neil Armstrong
@ 2023-09-11 15:09 ` Neil Armstrong
7 siblings, 0 replies; 11+ messages in thread
From: Neil Armstrong @ 2023-09-11 15:09 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 Tue, 29 Aug 2023 10:03:58 +0800, Xianwei Zhao wrote:
> First patch is that remove C3 some power domain ALWAYS_ON property.
> Second patch is that add driver to support power parent node.
> Third patch is that turn on power if initial power domain with
> "AWAY_ON" property state is off.
>
> Other patchs adds power controller driver support for Amlogic T7 SoC.
>
> [...]
Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (v6.7/arm64-dt)
[6/6] arm64: dts: amlogic: t7: add power domain controller node
https://git.kernel.org/amlogic/c/5355699dabac3c97492a30e6e01820fcaae11218
These changes has been applied on the intermediate git tree [1].
The v6.7/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
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2023-09-11 15:09 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-29 2:03 [PATCH V3 0/6] Power: T7: add power domain driver Xianwei Zhao
2023-08-29 2:03 ` [PATCH V3 1/6] genpd: amlogic: modify some power domains property Xianwei Zhao
2023-08-29 2:04 ` [PATCH V3 2/6] genpd: amlogic: add driver to support power parent node Xianwei Zhao
2023-08-29 2:04 ` [PATCH V3 3/6] genpd: amlogic: init power domain state Xianwei Zhao
2023-08-29 2:04 ` [PATCH V3 4/6] dt-bindings: power: add Amlogic T7 power domains Xianwei Zhao
2023-08-29 2:04 ` [PATCH V3 5/6] genpd: amlogic: Add support for T7 power domains controller Xianwei Zhao
2023-08-29 2:04 ` [PATCH V3 6/6] arm64: dts: amlogic: t7: add power domain controller node Xianwei Zhao
2023-09-08 12:40 ` [PATCH V3 0/6] Power: T7: add power domain driver Neil Armstrong
2023-09-08 12:45 ` Neil Armstrong
2023-09-11 2:29 ` Xianwei Zhao
2023-09-11 15:09 ` (subset) " Neil Armstrong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).