2021-06-10 10:40:48 +00:00
|
|
|
# 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 *
|
2022-07-03 14:30:19 +00:00
|
|
|
from .hw.pmu import PMU
|
2021-06-10 10:40:48 +00:00
|
|
|
|
2021-05-22 03:18:59 +00:00
|
|
|
# Create serial connection
|
2021-06-10 10:40:48 +00:00
|
|
|
iface = UartInterface()
|
2021-05-22 03:18:59 +00:00
|
|
|
# Construct m1n1 proxy layer over serial connection
|
2021-06-10 10:40:48 +00:00
|
|
|
p = M1N1Proxy(iface, debug=False)
|
2021-05-22 03:18:59 +00:00
|
|
|
# Customise parameters of proxy and serial port
|
|
|
|
# based on information sent over the connection
|
2021-06-10 10:40:48 +00:00
|
|
|
bootstrap_port(iface, p)
|
|
|
|
|
2021-05-22 03:18:59 +00:00
|
|
|
# Initialise the Proxy interface from values fetched from
|
|
|
|
# the remote end
|
2021-06-10 10:40:48 +00:00
|
|
|
u = ProxyUtils(p)
|
2021-05-22 03:18:59 +00:00
|
|
|
# Build a Register Monitoring object on Proxy Interface
|
2021-06-10 10:40:48 +00:00
|
|
|
mon = RegMonitor(u)
|
|
|
|
hv = HV(iface, p, u)
|
|
|
|
|
|
|
|
fb = u.ba.video.base
|
|
|
|
|
2022-08-17 04:14:23 +00:00
|
|
|
PMU(u).reset_panic_counter()
|
|
|
|
|
2021-06-10 10:40:48 +00:00
|
|
|
print(f"m1n1 base: 0x{u.base:x}")
|
2022-07-03 14:30:19 +00:00
|
|
|
|
|
|
|
PMU(u).reset_panic_counter()
|