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

soc: s4: Add support for power domains controller

Add support s4 Power controller. In s4, power control
registers are in secure domain, and should be accessed by smc.

Signed-off-by: Shunzhou Jiang <shunzhou.jiang@amlogic.com>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20220307025357.1368673-3-shunzhou.jiang@amlogic.com

authored by

Shunzhou Jiang and committed by
Neil Armstrong
f2b03c10 40b358f6

+22
+22
drivers/soc/amlogic/meson-secure-pwrc.c
··· 11 11 #include <linux/platform_device.h> 12 12 #include <linux/pm_domain.h> 13 13 #include <dt-bindings/power/meson-a1-power.h> 14 + #include <dt-bindings/power/meson-s4-power.h> 14 15 #include <linux/arm-smccc.h> 15 16 #include <linux/firmware/meson/meson_sm.h> 16 17 #include <linux/module.h> ··· 120 119 SEC_PD(RSA, 0), 121 120 }; 122 121 122 + static struct meson_secure_pwrc_domain_desc s4_pwrc_domains[] = { 123 + SEC_PD(S4_DOS_HEVC, 0), 124 + SEC_PD(S4_DOS_VDEC, 0), 125 + SEC_PD(S4_VPU_HDMI, 0), 126 + SEC_PD(S4_USB_COMB, 0), 127 + SEC_PD(S4_GE2D, 0), 128 + /* ETH is for ethernet online wakeup, and should be always on */ 129 + SEC_PD(S4_ETH, GENPD_FLAG_ALWAYS_ON), 130 + SEC_PD(S4_DEMOD, 0), 131 + SEC_PD(S4_AUDIO, 0), 132 + }; 133 + 123 134 static int meson_secure_pwrc_probe(struct platform_device *pdev) 124 135 { 125 136 int i; ··· 200 187 .count = ARRAY_SIZE(a1_pwrc_domains), 201 188 }; 202 189 190 + static struct meson_secure_pwrc_domain_data meson_secure_s4_pwrc_data = { 191 + .domains = s4_pwrc_domains, 192 + .count = ARRAY_SIZE(s4_pwrc_domains), 193 + }; 194 + 203 195 static const struct of_device_id meson_secure_pwrc_match_table[] = { 204 196 { 205 197 .compatible = "amlogic,meson-a1-pwrc", 206 198 .data = &meson_secure_a1_pwrc_data, 199 + }, 200 + { 201 + .compatible = "amlogic,meson-s4-pwrc", 202 + .data = &meson_secure_s4_pwrc_data, 207 203 }, 208 204 { /* sentinel */ } 209 205 };