mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-22 14:43:08 +00:00
m1n1.fw.afk.epic: Implement system endpoint & debug enable
Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
7d999ddf11
commit
270f864ae9
3 changed files with 36 additions and 0 deletions
|
@ -23,11 +23,13 @@ dcp = DCPIBootClient(u, dcp_addr, dart, disp_dart)
|
|||
dcp.dva_offset = getattr(u.adt["/arm-io/dcpext0"][0], "asc_dram_mask", 0)
|
||||
|
||||
dcp.start()
|
||||
dcp.start_ep(0x20)
|
||||
dcp.start_ep(0x23)
|
||||
dcp.start_ep(0x24)
|
||||
dcp.start_ep(0x27)
|
||||
dcp.start_ep(0x2a)
|
||||
|
||||
dcp.system.wait_for("system")
|
||||
dcp.iboot.wait_for("disp0")
|
||||
dcp.dptx.wait_for("dcpav0")
|
||||
dcp.dptx.wait_for("dcpav1")
|
||||
|
@ -36,6 +38,9 @@ dcp.dptx.wait_for("dcpdp1")
|
|||
dcp.dpport.wait_for("port0")
|
||||
dcp.dpport.wait_for("port1")
|
||||
|
||||
dcp.system.wait_for("system")
|
||||
dcp.system.system.setProperty("gAFKConfigLogMask", 0xffff)
|
||||
|
||||
print("Connect...")
|
||||
#dcp.dpport.port0.open()
|
||||
dcp.dpport.port0.getLocation()
|
||||
|
|
|
@ -49,6 +49,12 @@ EPICAnnounce = Struct(
|
|||
"props" / Optional(OSSerialize())
|
||||
)
|
||||
|
||||
EPICSetProp = Struct(
|
||||
"name_len" / Int32ul,
|
||||
"name" / Aligned(4, CString("utf8")),
|
||||
"value" / OSSerialize()
|
||||
)
|
||||
|
||||
EPICCmd = Struct(
|
||||
"retcode" / Default(Hex(Int32ul), 0),
|
||||
"rxbuf" / Hex(Int64ul),
|
||||
|
@ -174,6 +180,23 @@ class EPICStandardService(EPICService):
|
|||
def close(self):
|
||||
self.call(4, 7, bytes(16))
|
||||
|
||||
class AFKSystemService(EPICService):
|
||||
NAME = "system"
|
||||
SHORT = "system"
|
||||
|
||||
def getProperty(self, prop, val):
|
||||
pass
|
||||
#self.send_cmd(0x40, msg, 0)
|
||||
|
||||
def setProperty(self, prop, val):
|
||||
msg = {
|
||||
"name_len": (len(prop) + 3) & ~3,
|
||||
"name": prop,
|
||||
"value": val,
|
||||
}
|
||||
msg = EPICSetProp.build(msg)
|
||||
self.send_cmd(0x43, msg, 0)
|
||||
|
||||
class EPICEndpoint(AFKRingBufEndpoint):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
@ -260,3 +283,10 @@ class EPICEndpoint(AFKRingBufEndpoint):
|
|||
sub.inline_len = inline_len
|
||||
pkt = EPICHeader.build(hdr) + EPICSubHeader.build(sub) + data
|
||||
super().send_ipc(pkt)
|
||||
|
||||
class AFKSystemEndpoint(EPICEndpoint):
|
||||
SHORT = "system"
|
||||
|
||||
SERVICES = [
|
||||
AFKSystemService,
|
||||
]
|
||||
|
|
|
@ -195,6 +195,7 @@ class DCPIBootClient(StandardASC):
|
|||
DVA_OFFSET = 0xf00000000
|
||||
|
||||
ENDPOINTS = {
|
||||
0x20: AFKSystemEndpoint,
|
||||
0x23: DCPIBootEndpoint,
|
||||
0x24: DCPDPTXEndpoint,
|
||||
0x2a: DCPDPTXPortEndpoint,
|
||||
|
|
Loading…
Reference in a new issue