m1n1.hv: Guard UART0 pmgr regs

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2021-09-20 02:48:23 +09:00
parent c461b5d033
commit 5c99406790

View file

@ -1018,10 +1018,12 @@ class HV(Reloadable):
pmgr0_start, _ = self.adt["/arm-io/pmgr"].get_reg(0)
pmgr_hooks = (0x23b700220, 0x23b700270) # UART0
if self.iodev == IODEV.USB0:
pmgr_hooks = (0x23b700420, 0x23d280098, 0x23d280088)
pmgr_hooks += (0x23b700420, 0x23d280098, 0x23d280088)
elif self.iodev == IODEV.USB1:
pmgr_hooks = (0x23b700448, 0x23d2800a0, 0x23d280090)
pmgr_hooks += (0x23b700448, 0x23d2800a0, 0x23d280090)
for addr in pmgr_hooks:
self.map_hook(addr, 4, write=wh, read=rh)