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

pmdomain: amlogic: Add support for A5 power domains controller

Add support for the A5 power controller, whose registers are
in the secure domain and should be accessed via SMC.

Signed-off-by: Hongyu Chen <hongyu.chen1@amlogic.com>
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240627-a5_secpower-v1-2-1f47dde1270c@amlogic.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Xianwei Zhao and committed by
Ulf Hansson
8fbed2d7 1a53b80e

+26
+26
drivers/pmdomain/amlogic/meson-secure-pwrc.c
··· 15 15 #include <dt-bindings/power/meson-s4-power.h> 16 16 #include <dt-bindings/power/amlogic,t7-pwrc.h> 17 17 #include <dt-bindings/power/amlogic,a4-pwrc.h> 18 + #include <dt-bindings/power/amlogic,a5-pwrc.h> 18 19 #include <linux/arm-smccc.h> 19 20 #include <linux/firmware/meson/meson_sm.h> 20 21 #include <linux/module.h> ··· 154 153 SEC_PD(A4_AO_UART, 0), 155 154 /* IR is wake up trigger source, and should be always on */ 156 155 SEC_PD(A4_AO_IR, GENPD_FLAG_ALWAYS_ON), 156 + }; 157 + 158 + static struct meson_secure_pwrc_domain_desc a5_pwrc_domains[] = { 159 + SEC_PD(A5_NNA, 0), 160 + SEC_PD(A5_AUDIO, 0), 161 + SEC_PD(A5_SDIOA, 0), 162 + SEC_PD(A5_EMMC, 0), 163 + SEC_PD(A5_USB_COMB, 0), 164 + SEC_PD(A5_ETH, 0), 165 + SEC_PD(A5_RSA, 0), 166 + SEC_PD(A5_AUDIO_PDM, 0), 167 + /* DMC is for DDR PHY ana/dig and DMC, and should be always on */ 168 + SEC_PD(A5_DMC, GENPD_FLAG_ALWAYS_ON), 169 + /* WRAP is secure_top, a lot of modules are included, and should be always on */ 170 + SEC_PD(A5_SYS_WRAP, GENPD_FLAG_ALWAYS_ON), 171 + SEC_PD(A5_DSPA, 0), 157 172 }; 158 173 159 174 static struct meson_secure_pwrc_domain_desc c3_pwrc_domains[] = { ··· 352 335 .count = ARRAY_SIZE(a4_pwrc_domains), 353 336 }; 354 337 338 + static struct meson_secure_pwrc_domain_data amlogic_secure_a5_pwrc_data = { 339 + .domains = a5_pwrc_domains, 340 + .count = ARRAY_SIZE(a5_pwrc_domains), 341 + }; 342 + 355 343 static struct meson_secure_pwrc_domain_data amlogic_secure_c3_pwrc_data = { 356 344 .domains = c3_pwrc_domains, 357 345 .count = ARRAY_SIZE(c3_pwrc_domains), ··· 380 358 { 381 359 .compatible = "amlogic,a4-pwrc", 382 360 .data = &amlogic_secure_a4_pwrc_data, 361 + }, 362 + { 363 + .compatible = "amlogic,a5-pwrc", 364 + .data = &amlogic_secure_a5_pwrc_data, 383 365 }, 384 366 { 385 367 .compatible = "amlogic,c3-pwrc",