From 3a2e11560a39c496265cd3ead2ced94ee36346a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Sat, 26 Nov 2022 00:58:27 +0100 Subject: [PATCH 1/3] m1n1.adt: Start parsing SIO properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Povišer --- proxyclient/m1n1/adt.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/proxyclient/m1n1/adt.py b/proxyclient/m1n1/adt.py index 00a3dfd3e..85b3cfb47 100644 --- a/proxyclient/m1n1/adt.py +++ b/proxyclient/m1n1/adt.py @@ -246,6 +246,28 @@ "pad" / Array(3, Hex(Int8ul)), ) +SIODMAShimData = Struct( + "name" / FourCC, + "base" / Hex(Int64ul), + "length" / Hex(Int64ul), + "unk1" / Hex(Int32ul), + "unk2" / Hex(Int32ul), + "unk3" / Hex(Int32ul), + "stride" / Hex(Int32ul), +) + +SIOMapRange = Struct( + "unk1" / FourCC, + "addr" / Hex(Int64ul), + "len" / Hex(Int64ul), +) + +SIODeviceType = Struct( + "id" / FourCC, + "count" / Int32ul, + "unk2" / Hex(Int32ul), +) + DEV_PROPERTIES = { "pmgr": { "*": { @@ -343,6 +365,13 @@ "apcie-*-tunables": GreedyRange(TunableLocal), } }, + "sio": { + "*": { + "map-range": SIOMapRange, + "device-type": SafeGreedyRange(SIODeviceType), + "dmashim": SafeGreedyRange(SIODMAShimData), + } + }, } def parse_prop(node, path, node_name, name, v, is_template=False): From f8b13927f25ed9f9d74bf3f01a0c47771ac2cf4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Sat, 26 Nov 2022 13:18:59 +0100 Subject: [PATCH 2/3] m1n1.adt: Parse 'segment-ranges' of coprocessor nodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Povišer --- proxyclient/m1n1/adt.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/proxyclient/m1n1/adt.py b/proxyclient/m1n1/adt.py index 85b3cfb47..12d7a8ca0 100644 --- a/proxyclient/m1n1/adt.py +++ b/proxyclient/m1n1/adt.py @@ -268,6 +268,14 @@ "unk2" / Hex(Int32ul), ) +ASCSegmentRange = Struct( + "pa" / Hex(Int64ul), + "unk" / Hex(Int64ul), + "iova" / Hex(Int64ul), + "size" / Hex(Int32ul), + "flags" / Hex(Int32ul), +) + DEV_PROPERTIES = { "pmgr": { "*": { @@ -469,6 +477,9 @@ def parse_prop(node, path, node_name, name, v, is_template=False): # parsing this correctly would require a second pass t = Array(len(v) // 4, Int32ul) + elif name == "segment-ranges": + t = SafeGreedyRange(ASCSegmentRange) + if t is not None: v = Sequence(t, Terminated).parse(v)[0] return t, v From f8e08ebe22fa4556661758e944104a208ffc4f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Sat, 26 Nov 2022 22:56:33 +0100 Subject: [PATCH 3/3] m1n1.adt: Parse 'dma-channels' of DMA-enabled peripherals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Povišer --- proxyclient/m1n1/adt.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/proxyclient/m1n1/adt.py b/proxyclient/m1n1/adt.py index 12d7a8ca0..9ea1b7a51 100644 --- a/proxyclient/m1n1/adt.py +++ b/proxyclient/m1n1/adt.py @@ -276,6 +276,17 @@ "flags" / Hex(Int32ul), ) +DMAChannelsData = Struct( + "channo" / Hex(Int32ul), + "datashape" / Hex(Int32ul), + "timeout" / Hex(Int32ul), + "limit" / Hex(Int32ul), + "threshold" / Hex(Int32ul), + "unk1" / Hex(Int32ul), + "unk2" / Hex(Int32ul), + "unk3" / Hex(Int32ul), +) + DEV_PROPERTIES = { "pmgr": { "*": { @@ -477,6 +488,9 @@ def parse_prop(node, path, node_name, name, v, is_template=False): # parsing this correctly would require a second pass t = Array(len(v) // 4, Int32ul) + elif name == "dma-channels": + t = SafeGreedyRange(DMAChannelsData) + elif name == "segment-ranges": t = SafeGreedyRange(ASCSegmentRange)