summaryrefslogtreecommitdiff
path: root/drivers/pmdomain/amlogic/meson-secure-pwrc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pmdomain/amlogic/meson-secure-pwrc.c')
-rw-r--r--drivers/pmdomain/amlogic/meson-secure-pwrc.c65
1 files changed, 60 insertions, 5 deletions
diff --git a/drivers/pmdomain/amlogic/meson-secure-pwrc.c b/drivers/pmdomain/amlogic/meson-secure-pwrc.c
index 4d5bda0d60fc..42ce41a2fe3a 100644
--- a/drivers/pmdomain/amlogic/meson-secure-pwrc.c
+++ b/drivers/pmdomain/amlogic/meson-secure-pwrc.c
@@ -14,6 +14,8 @@
#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 <dt-bindings/power/amlogic,a4-pwrc.h>
+#include <dt-bindings/power/amlogic,a5-pwrc.h>
#include <linux/arm-smccc.h>
#include <linux/firmware/meson/meson_sm.h>
#include <linux/module.h>
@@ -45,7 +47,7 @@ struct meson_secure_pwrc_domain_desc {
struct meson_secure_pwrc_domain_data {
unsigned int count;
- struct meson_secure_pwrc_domain_desc *domains;
+ const struct meson_secure_pwrc_domain_desc *domains;
};
static bool pwrc_secure_is_off(struct meson_secure_pwrc_domain *pwrc_domain)
@@ -109,7 +111,7 @@ static int meson_secure_pwrc_on(struct generic_pm_domain *domain)
.parent = __parent, \
}
-static struct meson_secure_pwrc_domain_desc a1_pwrc_domains[] = {
+static const struct meson_secure_pwrc_domain_desc a1_pwrc_domains[] = {
SEC_PD(DSPA, 0),
SEC_PD(DSPB, 0),
/* UART should keep working in ATF after suspend and before resume */
@@ -136,7 +138,41 @@ static struct meson_secure_pwrc_domain_desc a1_pwrc_domains[] = {
SEC_PD(RSA, 0),
};
-static struct meson_secure_pwrc_domain_desc c3_pwrc_domains[] = {
+static const struct meson_secure_pwrc_domain_desc a4_pwrc_domains[] = {
+ SEC_PD(A4_AUDIO, 0),
+ SEC_PD(A4_SDIOA, 0),
+ SEC_PD(A4_EMMC, 0),
+ SEC_PD(A4_USB_COMB, 0),
+ SEC_PD(A4_ETH, 0),
+ SEC_PD(A4_VOUT, 0),
+ SEC_PD(A4_AUDIO_PDM, 0),
+ /* DMC is for DDR PHY ana/dig and DMC, and should be always on */
+ SEC_PD(A4_DMC, GENPD_FLAG_ALWAYS_ON),
+ /* WRAP is secure_top, a lot of modules are included, and should be always on */
+ SEC_PD(A4_SYS_WRAP, GENPD_FLAG_ALWAYS_ON),
+ SEC_PD(A4_AO_I2C_S, 0),
+ SEC_PD(A4_AO_UART, 0),
+ /* IR is wake up trigger source, and should be always on */
+ SEC_PD(A4_AO_IR, GENPD_FLAG_ALWAYS_ON),
+};
+
+static const struct meson_secure_pwrc_domain_desc a5_pwrc_domains[] = {
+ SEC_PD(A5_NNA, 0),
+ SEC_PD(A5_AUDIO, 0),
+ SEC_PD(A5_SDIOA, 0),
+ SEC_PD(A5_EMMC, 0),
+ SEC_PD(A5_USB_COMB, 0),
+ SEC_PD(A5_ETH, 0),
+ SEC_PD(A5_RSA, 0),
+ SEC_PD(A5_AUDIO_PDM, 0),
+ /* DMC is for DDR PHY ana/dig and DMC, and should be always on */
+ SEC_PD(A5_DMC, GENPD_FLAG_ALWAYS_ON),
+ /* WRAP is secure_top, a lot of modules are included, and should be always on */
+ SEC_PD(A5_SYS_WRAP, GENPD_FLAG_ALWAYS_ON),
+ SEC_PD(A5_DSPA, 0),
+};
+
+static const struct meson_secure_pwrc_domain_desc c3_pwrc_domains[] = {
SEC_PD(C3_NNA, 0),
SEC_PD(C3_AUDIO, 0),
SEC_PD(C3_SDIOA, 0),
@@ -153,7 +189,7 @@ static struct meson_secure_pwrc_domain_desc c3_pwrc_domains[] = {
SEC_PD(C3_VCODEC, 0),
};
-static struct meson_secure_pwrc_domain_desc s4_pwrc_domains[] = {
+static const struct meson_secure_pwrc_domain_desc s4_pwrc_domains[] = {
SEC_PD(S4_DOS_HEVC, 0),
SEC_PD(S4_DOS_VDEC, 0),
SEC_PD(S4_VPU_HDMI, 0),
@@ -165,7 +201,7 @@ 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[] = {
+static const 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),
@@ -311,6 +347,16 @@ 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_a4_pwrc_data = {
+ .domains = a4_pwrc_domains,
+ .count = ARRAY_SIZE(a4_pwrc_domains),
+};
+
+static struct meson_secure_pwrc_domain_data amlogic_secure_a5_pwrc_data = {
+ .domains = a5_pwrc_domains,
+ .count = ARRAY_SIZE(a5_pwrc_domains),
+};
+
static struct meson_secure_pwrc_domain_data amlogic_secure_c3_pwrc_data = {
.domains = c3_pwrc_domains,
.count = ARRAY_SIZE(c3_pwrc_domains),
@@ -332,6 +378,14 @@ static const struct of_device_id meson_secure_pwrc_match_table[] = {
.data = &meson_secure_a1_pwrc_data,
},
{
+ .compatible = "amlogic,a4-pwrc",
+ .data = &amlogic_secure_a4_pwrc_data,
+ },
+ {
+ .compatible = "amlogic,a5-pwrc",
+ .data = &amlogic_secure_a5_pwrc_data,
+ },
+ {
.compatible = "amlogic,c3-pwrc",
.data = &amlogic_secure_c3_pwrc_data,
},
@@ -355,4 +409,5 @@ static struct platform_driver meson_secure_pwrc_driver = {
},
};
module_platform_driver(meson_secure_pwrc_driver);
+MODULE_DESCRIPTION("Amlogic Meson Secure Power Domains driver");
MODULE_LICENSE("Dual MIT/GPL");