From 9b67898e99b87283e3ca4b8425defed4cb5ddf09 Mon Sep 17 00:00:00 2001 From: Andrew Dennison Date: Thu, 14 Oct 2021 08:51:01 +1100 Subject: [PATCH] tools/linux: add sys_clk to device tree * required for using standard devm_clk_get() clock mechanism in linux drivers --- litex/tools/litex_json2dts_linux.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/litex/tools/litex_json2dts_linux.py b/litex/tools/litex_json2dts_linux.py index 4bc91ac55..c94c8d8ee 100755 --- a/litex/tools/litex_json2dts_linux.py +++ b/litex/tools/litex_json2dts_linux.py @@ -88,6 +88,16 @@ def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_devic }; """ + # Clocks ------------------------------------------------------------------------------------------ + + dts += """ + sys_clk: pll {{ + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <{sys_clk_freq}>; + }}; +""".format(sys_clk_freq=d["constants"]["config_clock_frequency"]) + # CPU ------------------------------------------------------------------------------------------ # RISC-V