m1n1.adt: Parse 'dma-channels' of DMA-enabled peripherals

Signed-off-by: Martin Povišer <povik@cutebit.org>
This commit is contained in:
Martin Povišer 2022-11-26 22:56:33 +01:00
parent f8b13927f2
commit f8e08ebe22

View file

@ -276,6 +276,17 @@ ASCSegmentRange = Struct(
"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)