2021-01-16 15:50:13 +00:00
|
|
|
import serial, os, struct, sys, time
|
|
|
|
from proxy import *
|
|
|
|
from tgtypes import *
|
|
|
|
from utils import *
|
|
|
|
|
|
|
|
uartdev = os.environ.get("M1N1DEVICE", "/dev/ttyUSB0")
|
2021-02-02 18:51:41 +00:00
|
|
|
uart = serial.Serial(uartdev, 115200)
|
2021-01-16 15:50:13 +00:00
|
|
|
|
2021-02-02 18:51:41 +00:00
|
|
|
iface = UartInterface(uart, debug=False)
|
2021-01-16 15:50:13 +00:00
|
|
|
p = M1N1Proxy(iface, debug=False)
|
2021-02-02 18:51:41 +00:00
|
|
|
|
|
|
|
try:
|
|
|
|
uart.timeout = 0.15
|
|
|
|
iface.nop()
|
|
|
|
p.set_baud(1500000)
|
|
|
|
except UartTimeout:
|
|
|
|
uart.baudrate = 1500000
|
|
|
|
iface.nop()
|
|
|
|
|
2021-02-02 19:52:17 +00:00
|
|
|
uart.timeout = 3
|
|
|
|
|
2021-01-16 15:50:13 +00:00
|
|
|
u = ProxyUtils(p)
|
|
|
|
mon = RegMonitor(u)
|
|
|
|
|
|
|
|
iface.nop()
|
|
|
|
|
2021-01-23 13:33:12 +00:00
|
|
|
fb = u.ba.video.base
|
|
|
|
|
2021-02-24 12:44:21 +00:00
|
|
|
EL0_REGION = 0x8000000000
|
|
|
|
|
2021-01-16 15:50:13 +00:00
|
|
|
print("Base at: 0x%x" % u.base)
|
2021-01-23 13:33:12 +00:00
|
|
|
print("FB at: 0x%x" % fb)
|