mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-12-19 02:03:06 +00:00
pmgr: Expose pmgr_set_mode
For ISP stuff which is not declared in the ADT Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
fbe3fcd85a
commit
02c03a73b0
2 changed files with 7 additions and 5 deletions
|
@ -16,10 +16,6 @@
|
||||||
#define PMGR_PS_ACTUAL GENMASK(7, 4)
|
#define PMGR_PS_ACTUAL GENMASK(7, 4)
|
||||||
#define PMGR_PS_TARGET GENMASK(3, 0)
|
#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_POLL_TIMEOUT 10000
|
||||||
|
|
||||||
#define PMGR_FLAG_VIRTUAL 0x10
|
#define PMGR_FLAG_VIRTUAL 0x10
|
||||||
|
@ -67,7 +63,7 @@ static uintptr_t pmgr_get_psreg(u8 idx)
|
||||||
return pmgr_reg + reg_offset;
|
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));
|
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) <
|
if (poll32(addr, PMGR_PS_ACTUAL, FIELD_PREP(PMGR_PS_ACTUAL, target_mode), PMGR_POLL_TIMEOUT) <
|
||||||
|
|
|
@ -10,6 +10,10 @@
|
||||||
#define PMGR_DEVICE_ID GENMASK(15, 0)
|
#define PMGR_DEVICE_ID GENMASK(15, 0)
|
||||||
#define PMGR_DIE_ID GENMASK(31, 28)
|
#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_init(void);
|
||||||
|
|
||||||
int pmgr_power_enable(u32 id);
|
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_reset(int die, const char *name);
|
||||||
|
|
||||||
|
int pmgr_set_mode(uintptr_t addr, u8 target_mode);
|
||||||
|
|
||||||
u32 pmgr_get_feature(const char *name);
|
u32 pmgr_get_feature(const char *name);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue