Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

hongyu.chen1 and committed by
Ulf Hansson
b283b709 28a88b55

+95
+95
drivers/pmdomain/amlogic/meson-secure-pwrc.c
··· 16 16 #include <dt-bindings/power/amlogic,t7-pwrc.h> 17 17 #include <dt-bindings/power/amlogic,a4-pwrc.h> 18 18 #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> 19 22 #include <linux/arm-smccc.h> 20 23 #include <linux/firmware/meson/meson_sm.h> 21 24 #include <linux/module.h> ··· 204 201 SEC_PD(S4_AUDIO, 0), 205 202 }; 206 203 204 + static const struct meson_secure_pwrc_domain_desc s6_pwrc_domains[] = { 205 + SEC_PD(S6_DSPA, 0), 206 + SEC_PD(S6_DOS_HEVC, 0), 207 + SEC_PD(S6_DOS_VDEC, 0), 208 + SEC_PD(S6_VPU_HDMI, 0), 209 + SEC_PD(S6_U2DRD, 0), 210 + SEC_PD(S6_U3DRD, 0), 211 + SEC_PD(S6_SD_EMMC_C, 0), 212 + SEC_PD(S6_GE2D, 0), 213 + SEC_PD(S6_AMFC, 0), 214 + SEC_PD(S6_VC9000E, 0), 215 + SEC_PD(S6_DEWARP, 0), 216 + SEC_PD(S6_VICP, 0), 217 + SEC_PD(S6_SD_EMMC_A, 0), 218 + SEC_PD(S6_SD_EMMC_B, 0), 219 + /* ETH is for ethernet online wakeup, and should be always on */ 220 + SEC_PD(S6_ETH, GENPD_FLAG_ALWAYS_ON), 221 + SEC_PD(S6_PCIE, 0), 222 + SEC_PD(S6_NNA_4T, 0), 223 + SEC_PD(S6_AUDIO, 0), 224 + SEC_PD(S6_AUCPU, 0), 225 + SEC_PD(S6_ADAPT, 0), 226 + }; 227 + 228 + static const struct meson_secure_pwrc_domain_desc s7_pwrc_domains[] = { 229 + SEC_PD(S7_DOS_HEVC, 0), 230 + SEC_PD(S7_DOS_VDEC, 0), 231 + SEC_PD(S7_VPU_HDMI, 0), 232 + SEC_PD(S7_USB_COMB, 0), 233 + SEC_PD(S7_SD_EMMC_C, 0), 234 + SEC_PD(S7_GE2D, 0), 235 + SEC_PD(S7_SD_EMMC_A, 0), 236 + SEC_PD(S7_SD_EMMC_B, 0), 237 + /* ETH is for ethernet online wakeup, and should be always on */ 238 + SEC_PD(S7_ETH, GENPD_FLAG_ALWAYS_ON), 239 + SEC_PD(S7_AUCPU, 0), 240 + SEC_PD(S7_AUDIO, 0), 241 + }; 242 + 243 + static const struct meson_secure_pwrc_domain_desc s7d_pwrc_domains[] = { 244 + SEC_PD(S7D_DOS_HCODEC, 0), 245 + SEC_PD(S7D_DOS_HEVC, 0), 246 + SEC_PD(S7D_DOS_VDEC, 0), 247 + SEC_PD(S7D_VPU_HDMI, 0), 248 + SEC_PD(S7D_USB_U2DRD, 0), 249 + SEC_PD(S7D_USB_U2H, 0), 250 + SEC_PD(S7D_SSD_EMMC_C, 0), 251 + SEC_PD(S7D_GE2D, 0), 252 + SEC_PD(S7D_AMFC, 0), 253 + SEC_PD(S7D_EMMC_A, 0), 254 + SEC_PD(S7D_EMMC_B, 0), 255 + /* ETH is for ethernet online wakeup, and should be always on */ 256 + SEC_PD(S7D_ETH, GENPD_FLAG_ALWAYS_ON), 257 + SEC_PD(S7D_AUCPU, 0), 258 + SEC_PD(S7D_AUDIO, 0), 259 + /* SRAMA is used as ATF runtime memory, and should be always on */ 260 + SEC_PD(S7D_SRAMA, GENPD_FLAG_ALWAYS_ON), 261 + /* DMC0 is for DDR PHY ana/dig and DMC, and should be always on */ 262 + SEC_PD(S7D_DMC0, GENPD_FLAG_ALWAYS_ON), 263 + /* DMC1 is for DDR PHY ana/dig and DMC, and should be always on */ 264 + SEC_PD(S7D_DMC1, GENPD_FLAG_ALWAYS_ON), 265 + /* DDR should be always on */ 266 + SEC_PD(S7D_DDR, GENPD_FLAG_ALWAYS_ON), 267 + }; 268 + 207 269 static const struct meson_secure_pwrc_domain_desc t7_pwrc_domains[] = { 208 270 SEC_PD(T7_DSPA, 0), 209 271 SEC_PD(T7_DSPB, 0), ··· 435 367 .count = ARRAY_SIZE(s4_pwrc_domains), 436 368 }; 437 369 370 + static const struct meson_secure_pwrc_domain_data amlogic_secure_s6_pwrc_data = { 371 + .domains = s6_pwrc_domains, 372 + .count = ARRAY_SIZE(s6_pwrc_domains), 373 + }; 374 + 375 + static const struct meson_secure_pwrc_domain_data amlogic_secure_s7_pwrc_data = { 376 + .domains = s7_pwrc_domains, 377 + .count = ARRAY_SIZE(s7_pwrc_domains), 378 + }; 379 + 380 + static const struct meson_secure_pwrc_domain_data amlogic_secure_s7d_pwrc_data = { 381 + .domains = s7d_pwrc_domains, 382 + .count = ARRAY_SIZE(s7d_pwrc_domains), 383 + }; 384 + 438 385 static const struct meson_secure_pwrc_domain_data amlogic_secure_t7_pwrc_data = { 439 386 .domains = t7_pwrc_domains, 440 387 .count = ARRAY_SIZE(t7_pwrc_domains), ··· 475 392 { 476 393 .compatible = "amlogic,meson-s4-pwrc", 477 394 .data = &meson_secure_s4_pwrc_data, 395 + }, 396 + { 397 + .compatible = "amlogic,s6-pwrc", 398 + .data = &amlogic_secure_s6_pwrc_data, 399 + }, 400 + { 401 + .compatible = "amlogic,s7-pwrc", 402 + .data = &amlogic_secure_s7_pwrc_data, 403 + }, 404 + { 405 + .compatible = "amlogic,s7d-pwrc", 406 + .data = &amlogic_secure_s7d_pwrc_data, 478 407 }, 479 408 { 480 409 .compatible = "amlogic,t7-pwrc",