aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-meson
diff options
context:
space:
mode:
authorAlexey Romanov <avromanov@sberdevices.ru>2023-05-31 12:31:54 +0300
committerNeil Armstrong <neil.armstrong@linaro.org>2023-06-28 10:05:34 +0200
commiteb0a01e603ea40d36d14fac2b6381923b4c42bf2 (patch)
tree44bf6847574d6d822af0dd11c2cca1778b6251c7 /arch/arm/mach-meson
parent1444acbd030edc515e4b521d0eb517de7562baa7 (diff)
downloadu-boot-eb0a01e603ea40d36d14fac2b6381923b4c42bf2.tar.gz
arch/arm: meson: sm: introduce power domain functions
This commit adds functions to manage secure power domain for Amlogic SoC's using smc functionality. Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20230531093156.29240-2-avromanov@sberdevices.ru Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Diffstat (limited to 'arch/arm/mach-meson')
-rw-r--r--arch/arm/mach-meson/sm.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/mach-meson/sm.c b/arch/arm/mach-meson/sm.c
index f2ca7e76932..d600c64d0be 100644
--- a/arch/arm/mach-meson/sm.c
+++ b/arch/arm/mach-meson/sm.c
@@ -24,6 +24,7 @@
#define FN_EFUSE_READ 0x82000030
#define FN_EFUSE_WRITE 0x82000031
#define FN_CHIP_ID 0x82000044
+#define FN_PWRDM_SET 0x82000093
static void *shmem_input;
static void *shmem_output;
@@ -137,3 +138,16 @@ int meson_sm_get_reboot_reason(void)
/* The SMC call is not used, we directly use AO_SEC_SD_CFG15 */
return FIELD_GET(REBOOT_REASON_MASK, reason);
}
+
+int meson_sm_pwrdm_set(size_t index, int cmd)
+{
+ struct pt_regs regs;
+
+ regs.regs[0] = FN_PWRDM_SET;
+ regs.regs[1] = index;
+ regs.regs[2] = cmd;
+
+ smc_call(&regs);
+
+ return regs.regs[0];
+}