pmgr: Add a helper to test for pmgr features in the ADT

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2023-06-04 17:02:48 +09:00
parent 1f154402a4
commit 7ce414224c
3 changed files with 17 additions and 0 deletions

View file

@ -4,6 +4,7 @@
#include "adt.h"
#include "firmware.h"
#include "soc.h"
#include "pmgr.h"
#include "utils.h"
#define CLUSTER_PSTATE 0x20020

View file

@ -394,3 +394,17 @@ int pmgr_init(void)
return 0;
}
u32 pmgr_get_feature(const char *name)
{
u32 val = 0;
int node = adt_path_offset(adt, "/arm-io/pmgr");
if (node < 0)
return 0;
if (ADT_GETPROP(adt, node, name, &val) < 0)
return 0;
return val;
}

View file

@ -23,4 +23,6 @@ int pmgr_adt_reset(const char *path);
int pmgr_reset(int die, const char *name);
u32 pmgr_get_feature(const char *name);
#endif