From bacb19b301600c294c40f898519ded11d26dfc1c Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Wed, 19 Jan 2022 03:16:12 +0900 Subject: [PATCH] m1n1.fw.asc: Make DVA_OFFSET dynamic Signed-off-by: Hector Martin --- proxyclient/experiments/dcp_iboot.py | 1 + proxyclient/m1n1/fw/asc/__init__.py | 5 ++--- proxyclient/m1n1/fw/dcp/client.py | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/proxyclient/experiments/dcp_iboot.py b/proxyclient/experiments/dcp_iboot.py index 1ee76dc7..b3abaec7 100755 --- a/proxyclient/experiments/dcp_iboot.py +++ b/proxyclient/experiments/dcp_iboot.py @@ -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) diff --git a/proxyclient/m1n1/fw/asc/__init__.py b/proxyclient/m1n1/fw/asc/__init__.py index 210fbc47..3c9c5835 100644 --- a/proxyclient/m1n1/fw/asc/__init__.py +++ b/proxyclient/m1n1/fw/asc/__init__.py @@ -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 diff --git a/proxyclient/m1n1/fw/dcp/client.py b/proxyclient/m1n1/fw/dcp/client.py index a2aeab87..941ab202 100644 --- a/proxyclient/m1n1/fw/dcp/client.py +++ b/proxyclient/m1n1/fw/dcp/client.py @@ -5,8 +5,6 @@ from ..asc import StandardASC from .dcpep import DCPEndpoint class DCPClient(StandardASC): - DVA_OFFSET = 0xf00000000 - ENDPOINTS = { 0x37: DCPEndpoint, }