Skip to content

Commit b283b70

Browse files
hongyu.chen1Ulf Hansson
authored andcommitted
pmdomain: amlogic: Add support for S6 S7 S7D power domains controller
Add support for the S6 S7 S7D power controller, whose registers are in the secure domain and should be accessed via SMC. Signed-off-by: hongyu.chen1 <hongyu.chen1@amlogic.com> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com> Link: https://lore.kernel.org/r/20250822-pm-s6-s7-s7d-v1-2-82e3f3aff327@amlogic.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 28a88b5 commit b283b70

1 file changed

Lines changed: 95 additions & 0 deletions

File tree

drivers/pmdomain/amlogic/meson-secure-pwrc.c

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
#include <dt-bindings/power/amlogic,t7-pwrc.h>
1717
#include <dt-bindings/power/amlogic,a4-pwrc.h>
1818
#include <dt-bindings/power/amlogic,a5-pwrc.h>
19+
#include <dt-bindings/power/amlogic,s6-pwrc.h>
20+
#include <dt-bindings/power/amlogic,s7-pwrc.h>
21+
#include <dt-bindings/power/amlogic,s7d-pwrc.h>
1922
#include <linux/arm-smccc.h>
2023
#include <linux/firmware/meson/meson_sm.h>
2124
#include <linux/module.h>
@@ -201,6 +204,71 @@ static const struct meson_secure_pwrc_domain_desc s4_pwrc_domains[] = {
201204
SEC_PD(S4_AUDIO, 0),
202205
};
203206

207+
static const struct meson_secure_pwrc_domain_desc s6_pwrc_domains[] = {
208+
SEC_PD(S6_DSPA, 0),
209+
SEC_PD(S6_DOS_HEVC, 0),
210+
SEC_PD(S6_DOS_VDEC, 0),
211+
SEC_PD(S6_VPU_HDMI, 0),
212+
SEC_PD(S6_U2DRD, 0),
213+
SEC_PD(S6_U3DRD, 0),
214+
SEC_PD(S6_SD_EMMC_C, 0),
215+
SEC_PD(S6_GE2D, 0),
216+
SEC_PD(S6_AMFC, 0),
217+
SEC_PD(S6_VC9000E, 0),
218+
SEC_PD(S6_DEWARP, 0),
219+
SEC_PD(S6_VICP, 0),
220+
SEC_PD(S6_SD_EMMC_A, 0),
221+
SEC_PD(S6_SD_EMMC_B, 0),
222+
/* ETH is for ethernet online wakeup, and should be always on */
223+
SEC_PD(S6_ETH, GENPD_FLAG_ALWAYS_ON),
224+
SEC_PD(S6_PCIE, 0),
225+
SEC_PD(S6_NNA_4T, 0),
226+
SEC_PD(S6_AUDIO, 0),
227+
SEC_PD(S6_AUCPU, 0),
228+
SEC_PD(S6_ADAPT, 0),
229+
};
230+
231+
static const struct meson_secure_pwrc_domain_desc s7_pwrc_domains[] = {
232+
SEC_PD(S7_DOS_HEVC, 0),
233+
SEC_PD(S7_DOS_VDEC, 0),
234+
SEC_PD(S7_VPU_HDMI, 0),
235+
SEC_PD(S7_USB_COMB, 0),
236+
SEC_PD(S7_SD_EMMC_C, 0),
237+
SEC_PD(S7_GE2D, 0),
238+
SEC_PD(S7_SD_EMMC_A, 0),
239+
SEC_PD(S7_SD_EMMC_B, 0),
240+
/* ETH is for ethernet online wakeup, and should be always on */
241+
SEC_PD(S7_ETH, GENPD_FLAG_ALWAYS_ON),
242+
SEC_PD(S7_AUCPU, 0),
243+
SEC_PD(S7_AUDIO, 0),
244+
};
245+
246+
static const struct meson_secure_pwrc_domain_desc s7d_pwrc_domains[] = {
247+
SEC_PD(S7D_DOS_HCODEC, 0),
248+
SEC_PD(S7D_DOS_HEVC, 0),
249+
SEC_PD(S7D_DOS_VDEC, 0),
250+
SEC_PD(S7D_VPU_HDMI, 0),
251+
SEC_PD(S7D_USB_U2DRD, 0),
252+
SEC_PD(S7D_USB_U2H, 0),
253+
SEC_PD(S7D_SSD_EMMC_C, 0),
254+
SEC_PD(S7D_GE2D, 0),
255+
SEC_PD(S7D_AMFC, 0),
256+
SEC_PD(S7D_EMMC_A, 0),
257+
SEC_PD(S7D_EMMC_B, 0),
258+
/* ETH is for ethernet online wakeup, and should be always on */
259+
SEC_PD(S7D_ETH, GENPD_FLAG_ALWAYS_ON),
260+
SEC_PD(S7D_AUCPU, 0),
261+
SEC_PD(S7D_AUDIO, 0),
262+
/* SRAMA is used as ATF runtime memory, and should be always on */
263+
SEC_PD(S7D_SRAMA, GENPD_FLAG_ALWAYS_ON),
264+
/* DMC0 is for DDR PHY ana/dig and DMC, and should be always on */
265+
SEC_PD(S7D_DMC0, GENPD_FLAG_ALWAYS_ON),
266+
/* DMC1 is for DDR PHY ana/dig and DMC, and should be always on */
267+
SEC_PD(S7D_DMC1, GENPD_FLAG_ALWAYS_ON),
268+
/* DDR should be always on */
269+
SEC_PD(S7D_DDR, GENPD_FLAG_ALWAYS_ON),
270+
};
271+
204272
static const struct meson_secure_pwrc_domain_desc t7_pwrc_domains[] = {
205273
SEC_PD(T7_DSPA, 0),
206274
SEC_PD(T7_DSPB, 0),
@@ -367,6 +435,21 @@ static const struct meson_secure_pwrc_domain_data meson_secure_s4_pwrc_data = {
367435
.count = ARRAY_SIZE(s4_pwrc_domains),
368436
};
369437

438+
static const struct meson_secure_pwrc_domain_data amlogic_secure_s6_pwrc_data = {
439+
.domains = s6_pwrc_domains,
440+
.count = ARRAY_SIZE(s6_pwrc_domains),
441+
};
442+
443+
static const struct meson_secure_pwrc_domain_data amlogic_secure_s7_pwrc_data = {
444+
.domains = s7_pwrc_domains,
445+
.count = ARRAY_SIZE(s7_pwrc_domains),
446+
};
447+
448+
static const struct meson_secure_pwrc_domain_data amlogic_secure_s7d_pwrc_data = {
449+
.domains = s7d_pwrc_domains,
450+
.count = ARRAY_SIZE(s7d_pwrc_domains),
451+
};
452+
370453
static const struct meson_secure_pwrc_domain_data amlogic_secure_t7_pwrc_data = {
371454
.domains = t7_pwrc_domains,
372455
.count = ARRAY_SIZE(t7_pwrc_domains),
@@ -393,6 +476,18 @@ static const struct of_device_id meson_secure_pwrc_match_table[] = {
393476
.compatible = "amlogic,meson-s4-pwrc",
394477
.data = &meson_secure_s4_pwrc_data,
395478
},
479+
{
480+
.compatible = "amlogic,s6-pwrc",
481+
.data = &amlogic_secure_s6_pwrc_data,
482+
},
483+
{
484+
.compatible = "amlogic,s7-pwrc",
485+
.data = &amlogic_secure_s7_pwrc_data,
486+
},
487+
{
488+
.compatible = "amlogic,s7d-pwrc",
489+
.data = &amlogic_secure_s7d_pwrc_data,
490+
},
396491
{
397492
.compatible = "amlogic,t7-pwrc",
398493
.data = &amlogic_secure_t7_pwrc_data,

0 commit comments

Comments
 (0)