From 12db5c3910309d021d9c3a94bc1593f67a97abdd Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Sun, 22 May 2022 08:46:13 +0200 Subject: [PATCH] tools/reset_panic_counter.py: Use ADT to support t600x In addition make it executable and add python shebang as for the other tools. Signed-off-by: Janne Grunau --- proxyclient/tools/reset_panic_counter.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/proxyclient/tools/reset_panic_counter.py b/proxyclient/tools/reset_panic_counter.py index 9ecf5cf1..876b919b 100755 --- a/proxyclient/tools/reset_panic_counter.py +++ b/proxyclient/tools/reset_panic_counter.py @@ -6,6 +6,16 @@ sys.path.append(str(pathlib.Path(__file__).resolve().parents[1])) from m1n1.setup import * from m1n1.hw.spmi import SPMI -s = SPMI(u, "/arm-io/nub-spmi") -leg_scrpad = 0x9f00 +compatible = u.adt["/arm-io"].compatible[0] + +if compatible == "arm-io,t6000": + s = SPMI(u, "/arm-io/nub-spmi0") + leg_scrpad = u.adt["/arm-io/nub-spmi0/spmi-mpmu"].info_leg__scrpad[0] +elif compatible == "arm-io,t8103": + s = SPMI(u, "/arm-io/nub-spmi") + leg_scrpad = u.adt["/arm-io/nub-spmi/spmi-pmu"].info_leg__scrpad[0] +else: + print(f"Unknown SoC comaptible '{compatible}'") + exit() + s.write8(15, leg_scrpad + 2, 0) # error counts