Skip to content

Commit 53773f2

Browse files
xdarklightkhilman
authored andcommitted
soc: amlogic: meson-ee-pwrc: add support for the Meson GX SoCs
Add support for the Meson GX SoCs to the meson-ee-pwrc driver. The power domains on the GX SoCs are very similar to G12A. The only known differences so far are: - The GX SoCs do not have the HHI_VPU_MEM_PD_REG2 register (for the VPU power-domain) - The GX SoCs have an additional reset line called "dvin" Signed-off-by: Martin Blumenstingl <[email protected]> Signed-off-by: Kevin Hilman <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 34217df commit 53773f2

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

drivers/soc/amlogic/meson-ee-pwrc.c

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/clk.h>
1717
#include <dt-bindings/power/meson8-power.h>
1818
#include <dt-bindings/power/meson-g12a-power.h>
19+
#include <dt-bindings/power/meson-gxbb-power.h>
1920
#include <dt-bindings/power/meson-sm1-power.h>
2021

2122
/* AO Offsets */
@@ -75,7 +76,7 @@ struct meson_ee_pwrc_domain_data {
7576

7677
/* TOP Power Domains */
7778

78-
static struct meson_ee_pwrc_top_domain g12a_pwrc_vpu = {
79+
static struct meson_ee_pwrc_top_domain gx_pwrc_vpu = {
7980
.sleep_reg = GX_AO_RTI_GEN_PWR_SLEEP0,
8081
.sleep_mask = BIT(8),
8182
.iso_reg = GX_AO_RTI_GEN_PWR_SLEEP0,
@@ -140,6 +141,12 @@ static struct meson_ee_pwrc_mem_domain g12a_pwrc_mem_vpu[] = {
140141
VPU_HHI_MEMPD(HHI_MEM_PD_REG0),
141142
};
142143

144+
static struct meson_ee_pwrc_mem_domain gxbb_pwrc_mem_vpu[] = {
145+
VPU_MEMPD(HHI_VPU_MEM_PD_REG0),
146+
VPU_MEMPD(HHI_VPU_MEM_PD_REG1),
147+
VPU_HHI_MEMPD(HHI_MEM_PD_REG0),
148+
};
149+
143150
static struct meson_ee_pwrc_mem_domain meson_pwrc_mem_eth[] = {
144151
{ HHI_MEM_PD_REG0, GENMASK(3, 2) },
145152
};
@@ -225,11 +232,17 @@ static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_audio[] = {
225232
static bool pwrc_ee_get_power(struct meson_ee_pwrc_domain *pwrc_domain);
226233

227234
static struct meson_ee_pwrc_domain_desc g12a_pwrc_domains[] = {
228-
[PWRC_G12A_VPU_ID] = VPU_PD("VPU", &g12a_pwrc_vpu, g12a_pwrc_mem_vpu,
235+
[PWRC_G12A_VPU_ID] = VPU_PD("VPU", &gx_pwrc_vpu, g12a_pwrc_mem_vpu,
229236
pwrc_ee_get_power, 11, 2),
230237
[PWRC_G12A_ETH_ID] = MEM_PD("ETH", meson_pwrc_mem_eth),
231238
};
232239

240+
static struct meson_ee_pwrc_domain_desc gxbb_pwrc_domains[] = {
241+
[PWRC_GXBB_VPU_ID] = VPU_PD("VPU", &gx_pwrc_vpu, gxbb_pwrc_mem_vpu,
242+
pwrc_ee_get_power, 12, 2),
243+
[PWRC_GXBB_ETHERNET_MEM_ID] = MEM_PD("ETH", meson_pwrc_mem_eth),
244+
};
245+
233246
static struct meson_ee_pwrc_domain_desc meson8_pwrc_domains[] = {
234247
[PWRC_MESON8_VPU_ID] = VPU_PD("VPU", &meson8_pwrc_vpu,
235248
meson8_pwrc_mem_vpu, pwrc_ee_get_power,
@@ -516,6 +529,11 @@ static struct meson_ee_pwrc_domain_data meson_ee_g12a_pwrc_data = {
516529
.domains = g12a_pwrc_domains,
517530
};
518531

532+
static struct meson_ee_pwrc_domain_data meson_ee_gxbb_pwrc_data = {
533+
.count = ARRAY_SIZE(gxbb_pwrc_domains),
534+
.domains = gxbb_pwrc_domains,
535+
};
536+
519537
static struct meson_ee_pwrc_domain_data meson_ee_m8_pwrc_data = {
520538
.count = ARRAY_SIZE(meson8_pwrc_domains),
521539
.domains = meson8_pwrc_domains,
@@ -544,6 +562,10 @@ static const struct of_device_id meson_ee_pwrc_match_table[] = {
544562
.compatible = "amlogic,meson8m2-pwrc",
545563
.data = &meson_ee_m8b_pwrc_data,
546564
},
565+
{
566+
.compatible = "amlogic,meson-gxbb-pwrc",
567+
.data = &meson_ee_gxbb_pwrc_data,
568+
},
547569
{
548570
.compatible = "amlogic,meson-g12a-pwrc",
549571
.data = &meson_ee_g12a_pwrc_data,

0 commit comments

Comments
 (0)