Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARC: [dts] Add clk feeding into timers to DTs

This allows us to introduce timers in DT in next commit

The core clk frequency hack in AXS103 platform is also extended,
where the core clk feeding into timers is updated in-place in FDT.

Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

+79 -1
+6
arch/arc/boot/dts/axc001.dtsi
··· 26 26 27 27 ranges = <0x00000000 0xf0000000 0x10000000>; 28 28 29 + core_clk: core_clk { 30 + #clock-cells = <0>; 31 + compatible = "fixed-clock"; 32 + clock-frequency = <750000000>; 33 + }; 34 + 29 35 core_intc: arc700-intc@cpu { 30 36 compatible = "snps,arc700-intc"; 31 37 interrupt-controller;
+6
arch/arc/boot/dts/axc003.dtsi
··· 25 25 26 26 ranges = <0x00000000 0xf0000000 0x10000000>; 27 27 28 + core_clk: core_clk { 29 + #clock-cells = <0>; 30 + compatible = "fixed-clock"; 31 + clock-frequency = <90000000>; 32 + }; 33 + 28 34 core_intc: archs-intc@cpu { 29 35 compatible = "snps,archs-intc"; 30 36 interrupt-controller;
+6
arch/arc/boot/dts/axc003_idu.dtsi
··· 25 25 26 26 ranges = <0x00000000 0xf0000000 0x10000000>; 27 27 28 + core_clk: core_clk { 29 + #clock-cells = <0>; 30 + compatible = "fixed-clock"; 31 + clock-frequency = <90000000>; 32 + }; 33 + 28 34 core_intc: archs-intc@cpu { 29 35 compatible = "snps,archs-intc"; 30 36 interrupt-controller;
+6
arch/arc/boot/dts/nsim_700.dts
··· 32 32 /* child and parent address space 1:1 mapped */ 33 33 ranges; 34 34 35 + core_clk: core_clk { 36 + #clock-cells = <0>; 37 + compatible = "fixed-clock"; 38 + clock-frequency = <80000000>; 39 + }; 40 + 35 41 core_intc: interrupt-controller { 36 42 compatible = "snps,arc700-intc"; 37 43 interrupt-controller;
+6
arch/arc/boot/dts/nsim_hs.dts
··· 39 39 bus addr, parent bus addr, size */ 40 40 ranges = <0x80000000 0x0 0x80000000 0x80000000>; 41 41 42 + core_clk: core_clk { 43 + #clock-cells = <0>; 44 + compatible = "fixed-clock"; 45 + clock-frequency = <80000000>; 46 + }; 47 + 42 48 core_intc: core-interrupt-controller { 43 49 compatible = "snps,archs-intc"; 44 50 interrupt-controller;
+6
arch/arc/boot/dts/nsim_hs_idu.dts
··· 29 29 /* child and parent address space 1:1 mapped */ 30 30 ranges; 31 31 32 + core_clk: core_clk { 33 + #clock-cells = <0>; 34 + compatible = "fixed-clock"; 35 + clock-frequency = <80000000>; 36 + }; 37 + 32 38 core_intc: core-interrupt-controller { 33 39 compatible = "snps,archs-intc"; 34 40 interrupt-controller;
+6
arch/arc/boot/dts/nsimosci.dts
··· 35 35 /* child and parent address space 1:1 mapped */ 36 36 ranges; 37 37 38 + core_clk: core_clk { 39 + #clock-cells = <0>; 40 + compatible = "fixed-clock"; 41 + clock-frequency = <20000000>; 42 + }; 43 + 38 44 core_intc: interrupt-controller { 39 45 compatible = "snps,arc700-intc"; 40 46 interrupt-controller;
+6
arch/arc/boot/dts/nsimosci_hs.dts
··· 35 35 /* child and parent address space 1:1 mapped */ 36 36 ranges; 37 37 38 + core_clk: core_clk { 39 + #clock-cells = <0>; 40 + compatible = "fixed-clock"; 41 + clock-frequency = <20000000>; 42 + }; 43 + 38 44 core_intc: core-interrupt-controller { 39 45 compatible = "snps,archs-intc"; 40 46 interrupt-controller;
+6
arch/arc/boot/dts/nsimosci_hs_idu.dts
··· 33 33 /* child and parent address space 1:1 mapped */ 34 34 ranges; 35 35 36 + core_clk: core_clk { 37 + #clock-cells = <0>; 38 + compatible = "fixed-clock"; 39 + clock-frequency = <5000000>; 40 + }; 41 + 36 42 core_intc: core-interrupt-controller { 37 43 compatible = "snps,archs-intc"; 38 44 interrupt-controller;
+6
arch/arc/boot/dts/vdk_axc003.dtsi
··· 25 25 26 26 ranges = <0x00000000 0xf0000000 0x10000000>; 27 27 28 + core_clk: core_clk { 29 + #clock-cells = <0>; 30 + compatible = "fixed-clock"; 31 + clock-frequency = <50000000>; 32 + }; 33 + 28 34 core_intc: archs-intc@cpu { 29 35 compatible = "snps,archs-intc"; 30 36 interrupt-controller;
+6
arch/arc/boot/dts/vdk_axc003_idu.dtsi
··· 26 26 27 27 ranges = <0x00000000 0xf0000000 0x10000000>; 28 28 29 + core_clk: core_clk { 30 + #clock-cells = <0>; 31 + compatible = "fixed-clock"; 32 + clock-frequency = <50000000>; 33 + }; 34 + 29 35 core_intc: archs-intc@cpu { 30 36 compatible = "snps,archs-intc"; 31 37 interrupt-controller;
+13 -1
arch/arc/plat-axs10x/axs10x.c
··· 14 14 * 15 15 */ 16 16 17 + #include <linux/of_fdt.h> 17 18 #include <linux/of_platform.h> 19 + #include <linux/libfdt.h> 18 20 19 21 #include <asm/asm-offsets.h> 20 22 #include <asm/clk.h> ··· 391 389 392 390 static void __init axs103_early_init(void) 393 391 { 394 - u32 freq = arc_get_core_freq(), orig = freq; 392 + int offset = fdt_path_offset(initial_boot_params, "/cpu_card/core_clk"); 393 + const struct fdt_property *prop = fdt_get_property(initial_boot_params, 394 + offset, 395 + "clock-frequency", 396 + NULL); 397 + u32 freq = be32_to_cpu(*(u32*)(prop->data)) / 1000000, orig = freq; 395 398 396 399 /* 397 400 * AXS103 configurations for SMP/QUAD configurations share device tree ··· 445 438 } 446 439 447 440 pr_info("Freq is %dMHz\n", freq); 441 + 442 + /* Patching .dtb in-place with new core clock value */ 448 443 if (freq != orig ) { 449 444 arc_set_core_freq(freq * 1000000); 445 + freq = cpu_to_be32(freq * 1000000); 446 + fdt_setprop_inplace(initial_boot_params, offset, 447 + "clock-frequency", &freq, sizeof(freq)); 450 448 } 451 449 452 450 /* Memory maps already config in pre-bootloader */