m1n1.fw.asc: Make DVA_OFFSET dynamic

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2022-01-19 03:16:12 +09:00
parent 2c28e13d25
commit bacb19b301
3 changed files with 3 additions and 5 deletions

View file

@ -21,6 +21,7 @@ disp_dart.dump_all()
dcp_addr = u.adt["arm-io/dcp"].get_reg(0)[0]
dcp = DCPIBootClient(u, dcp_addr, dart, disp_dart)
dcp.dva_offset = getattr(u.adt["/arm-io/dcp"][0], "asc_dram_mask", 0)
dcp.start()
dcp.start_ep(0x23)

View file

@ -16,8 +16,6 @@ class ASCDummyEndpoint(ASCBaseEndpoint):
SHORT = "dummy"
class StandardASC(ASC):
DVA_OFFSET = 0
ENDPOINTS = {
0: ASCManagementEndpoint,
1: ASCCrashLogEndpoint,
@ -35,6 +33,7 @@ class StandardASC(ASC):
self.dart = dart
self.eps = []
self.epcls = {}
self.dva_offset = 0
for cls in type(self).mro():
eps = getattr(cls, "ENDPOINTS", None)
@ -47,7 +46,7 @@ class StandardASC(ASC):
def iomap(self, addr, size):
if self.dart is None:
return addr
dva = self.DVA_OFFSET | self.dart.iomap(0, addr, size)
dva = self.dva_offset | self.dart.iomap(0, addr, size)
self.dart.invalidate_streams(1)
return dva

View file

@ -5,8 +5,6 @@ from ..asc import StandardASC
from .dcpep import DCPEndpoint
class DCPClient(StandardASC):
DVA_OFFSET = 0xf00000000
ENDPOINTS = {
0x37: DCPEndpoint,
}