From ae13f159c4c0fcd7d9ee4e513194b3f2c926a862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 27 May 2024 11:26:55 +0200 Subject: [PATCH] litex_json2dts_zephyr.py: include cpu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit include cpu, to share the clock-frequency with zephyr. Signed-off-by: Fin Maaß --- litex/tools/litex_json2dts_zephyr.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/litex/tools/litex_json2dts_zephyr.py b/litex/tools/litex_json2dts_zephyr.py index 3604f4f19..329d8da54 100755 --- a/litex/tools/litex_json2dts_zephyr.py +++ b/litex/tools/litex_json2dts_zephyr.py @@ -104,6 +104,10 @@ def dts_reg_names(regs): def disabled_handler(name, parm, csr): return indent('status = "disabled";\n') +def cpu_handler(name, parm, csr): + return indent("clock-frequency = <{}>;\n".format( + csr['constants']['config_clock_frequency'] + )) def ram_handler(name, parm, csr): mem_reg = { @@ -193,6 +197,10 @@ def peripheral_handler(name, parm, csr): overlay_handlers = { + 'cpu': { + 'handler': cpu_handler, + 'alias': 'cpu0', + }, 'ctrl': { 'handler': peripheral_handler, 'alias': 'ctrl0',