Skip to content

Commit

Permalink
Add support for retrieving boot cpu and mpidr for M3+
Browse files Browse the repository at this point in the history
Signed-off-by: a-ramses <[email protected]>
  • Loading branch information
a-ramses committed Dec 13, 2024
1 parent dbafd05 commit e25b58a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion proxyclient/experiments/cpu_pstate_latencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
p.ic_ivau(code, len(util.data))

def bench_cpu(idx, loops=10000000):
if idx == 0:
boot_cpu_name = "cpu" + str(p.get_boot_cpu_idx())
if (cpu + idx) == boot_cpu_name:
elapsed = p.call(util.bench, loops) / tfreq
else:
elapsed = p.smp_call_sync(idx, util.bench, loops) / tfreq
Expand Down
6 changes: 6 additions & 0 deletions proxyclient/m1n1/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ class M1N1Proxy(Reloadable):
P_REBOOT = 0x010
P_SLEEP = 0x011
P_EL3_CALL = 0x012
P_GET_BOOT_CPU_IDX = 0x013
P_GET_BOOT_CPU_MPIDR = 0x014

P_WRITE64 = 0x100
P_WRITE32 = 0x101
Expand Down Expand Up @@ -725,6 +727,10 @@ def get_bootargs_rev(self):
ba_addr = self.request(self.P_GET_BOOTARGS)
rev = self.read16(ba_addr)
return (ba_addr, rev)
def get_boot_cpu_idx(self):
return self.request(self.P_GET_BOOT_CPU_IDX)
def get_boot_cpu_mpidr(self):
return self.request(self.P_GET_BOOT_CPU_MPIDR)
def get_base(self):
return self.request(self.P_GET_BASE)
def set_baud(self, baudrate):
Expand Down
6 changes: 6 additions & 0 deletions src/proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ int proxy_process(ProxyRequest *request, ProxyReply *reply)
case P_GET_BOOTARGS:
reply->retval = boot_args_addr;
break;
case P_GET_BOOT_CPU_IDX:
reply->retval = boot_cpu_idx;
break;
case P_GET_BOOT_CPU_MPIDR:
reply->retval = boot_cpu_mpidr;
break;
case P_GET_BASE:
reply->retval = (u64)_base;
break;
Expand Down
2 changes: 2 additions & 0 deletions src/proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ typedef enum {
P_REBOOT,
P_SLEEP,
P_EL3_CALL,
P_GET_BOOT_CPU_IDX,
P_GET_BOOT_CPU_MPIDR,

P_WRITE64 = 0x100, // Generic register functions
P_WRITE32,
Expand Down

0 comments on commit e25b58a

Please sign in to comment.