summaryrefslogtreecommitdiff
path: root/tools/proxyclient/m1n1/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/proxyclient/m1n1/setup.py')
-rw-r--r--tools/proxyclient/m1n1/setup.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/proxyclient/m1n1/setup.py b/tools/proxyclient/m1n1/setup.py
new file mode 100644
index 0000000..8a66287
--- /dev/null
+++ b/tools/proxyclient/m1n1/setup.py
@@ -0,0 +1,33 @@
+# SPDX-License-Identifier: MIT
+import os, struct, sys, time
+
+from .hv import HV
+from .proxy import *
+from .proxyutils import *
+from .sysreg import *
+from .tgtypes import *
+from .utils import *
+from .hw.pmu import PMU
+
+# Create serial connection
+iface = UartInterface()
+# Construct m1n1 proxy layer over serial connection
+p = M1N1Proxy(iface, debug=False)
+# Customise parameters of proxy and serial port
+# based on information sent over the connection
+bootstrap_port(iface, p)
+
+# Initialise the Proxy interface from values fetched from
+# the remote end
+u = ProxyUtils(p)
+# Build a Register Monitoring object on Proxy Interface
+mon = RegMonitor(u)
+hv = HV(iface, p, u)
+
+fb = u.ba.video.base
+
+PMU(u).reset_panic_counter()
+
+print(f"m1n1 base: 0x{u.base:x}")
+
+PMU(u).reset_panic_counter()