From 51155e5a096413d4b74a741e84d788adea93da55 Mon Sep 17 00:00:00 2001 From: Piotr Wojnarowski Date: Wed, 12 Apr 2023 18:21:32 +0200 Subject: [PATCH] [#41544] Add xlnx,zynqmp-ipi-mailbox Python peripheral --- dts2repl/dts2repl.py | 10 ++++++++++ dts2repl/models.json | 1 + 2 files changed, 11 insertions(+) diff --git a/dts2repl/dts2repl.py b/dts2repl/dts2repl.py index b81fb6f..30441c4 100755 --- a/dts2repl/dts2repl.py +++ b/dts2repl/dts2repl.py @@ -610,6 +610,16 @@ def generate(args): indent.append('size: 0x100') indent.append('initable: false') indent.append('script: "request.value = 8<<4 | 1"') + elif compat == 'xlnx,zynqmp-ipi-mailbox': + # the address of the Xilinx ZynqMP IPI mailbox is defined in its child node + for child in node.nodes.values(): + address = f'0x{child.unit_addr}' + break + else: + logging.info('ZynqMP mailbox has no children: {node}') + indent.append('size: 0x1000') + indent.append('initable: false') + indent.append('script: "request.value = {0x1e4: 0x10000}.get(request.offset, 0)"') elif model == 'Python.PythonPeripheral': indent.append('size: 0x1000') indent.append('initable: true') diff --git a/dts2repl/models.json b/dts2repl/models.json index f3f4598..729e01c 100644 --- a/dts2repl/models.json +++ b/dts2repl/models.json @@ -171,5 +171,6 @@ "xlnx,xuartps": "UART.Cadence_UART", "xlnx,zynq-slcr": "Python.PythonPeripheral", + "xlnx,zynqmp-ipi-mailbox": "Python.PythonPeripheral", "xlnx,zynqmp-uart": "UART.Cadence_UART" }