mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-22 06:33:03 +00:00
73a85be2b8
Enable EL0 access to MMIO/etc, but not main RAM, because AArch64 architecturally enforces EL0w ^ EL2x. Instead, create an alias of main RAM to grant EL0 full permissions, at 0x80_0000_0000. Grant EL0 full access to MMIO stuff, since EL2 will never execute from there. Signed-off-by: Hector Martin <marcan@marcan.st>
32 lines
581 B
Python
32 lines
581 B
Python
import serial, os, struct, sys, time
|
|
from proxy import *
|
|
from tgtypes import *
|
|
from utils import *
|
|
|
|
uartdev = os.environ.get("M1N1DEVICE", "/dev/ttyUSB0")
|
|
uart = serial.Serial(uartdev, 115200)
|
|
|
|
iface = UartInterface(uart, debug=False)
|
|
p = M1N1Proxy(iface, debug=False)
|
|
|
|
try:
|
|
uart.timeout = 0.15
|
|
iface.nop()
|
|
p.set_baud(1500000)
|
|
except UartTimeout:
|
|
uart.baudrate = 1500000
|
|
iface.nop()
|
|
|
|
uart.timeout = 3
|
|
|
|
u = ProxyUtils(p)
|
|
mon = RegMonitor(u)
|
|
|
|
iface.nop()
|
|
|
|
fb = u.ba.video.base
|
|
|
|
EL0_REGION = 0x8000000000
|
|
|
|
print("Base at: 0x%x" % u.base)
|
|
print("FB at: 0x%x" % fb)
|