From 02c03a73b03c1501b20e17ed27c2e945246e09c1 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Fri, 8 Sep 2023 00:04:29 +0900 Subject: [PATCH] pmgr: Expose pmgr_set_mode For ISP stuff which is not declared in the ADT Signed-off-by: Hector Martin --- src/pmgr.c | 6 +----- src/pmgr.h | 6 ++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pmgr.c b/src/pmgr.c index 0b766d06..930a4396 100644 --- a/src/pmgr.c +++ b/src/pmgr.c @@ -16,10 +16,6 @@ #define PMGR_PS_ACTUAL GENMASK(7, 4) #define PMGR_PS_TARGET GENMASK(3, 0) -#define PMGR_PS_ACTIVE 0xf -#define PMGR_PS_CLKGATE 0x4 -#define PMGR_PS_PWRGATE 0x0 - #define PMGR_POLL_TIMEOUT 10000 #define PMGR_FLAG_VIRTUAL 0x10 @@ -67,7 +63,7 @@ static uintptr_t pmgr_get_psreg(u8 idx) return pmgr_reg + reg_offset; } -static int pmgr_set_mode(uintptr_t addr, u8 target_mode) +int pmgr_set_mode(uintptr_t addr, u8 target_mode) { mask32(addr, PMGR_PS_TARGET, FIELD_PREP(PMGR_PS_TARGET, target_mode)); if (poll32(addr, PMGR_PS_ACTUAL, FIELD_PREP(PMGR_PS_ACTUAL, target_mode), PMGR_POLL_TIMEOUT) < diff --git a/src/pmgr.h b/src/pmgr.h index c96f4b0f..3b61a57a 100644 --- a/src/pmgr.h +++ b/src/pmgr.h @@ -10,6 +10,10 @@ #define PMGR_DEVICE_ID GENMASK(15, 0) #define PMGR_DIE_ID GENMASK(31, 28) +#define PMGR_PS_ACTIVE 0xf +#define PMGR_PS_CLKGATE 0x4 +#define PMGR_PS_PWRGATE 0x0 + int pmgr_init(void); int pmgr_power_enable(u32 id); @@ -23,6 +27,8 @@ int pmgr_adt_reset(const char *path); int pmgr_reset(int die, const char *name); +int pmgr_set_mode(uintptr_t addr, u8 target_mode); + u32 pmgr_get_feature(const char *name); #endif