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] 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)