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

xtensa: xtfpga: use common clock framework

With this change the board needs to set up single clock object, users of
this clock will get correct frequency automatically.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

+11 -6
+8 -3
arch/xtensa/boot/dts/xtfpga.dtsi
··· 35 35 interrupt-controller; 36 36 }; 37 37 38 + clocks { 39 + osc: main-oscillator { 40 + #clock-cells = <0>; 41 + compatible = "fixed-clock"; 42 + }; 43 + }; 44 + 38 45 serial0: serial@fd050020 { 39 46 device_type = "serial"; 40 47 compatible = "ns16550a"; ··· 49 42 reg = <0xfd050020 0x20>; 50 43 reg-shift = <2>; 51 44 interrupts = <0 1>; /* external irq 0 */ 52 - /* Filled in by platform_setup from FPGA register 53 - * clock-frequency = <100000000>; 54 - */ 45 + clocks = <&osc>; 55 46 }; 56 47 57 48 enet0: ethoc@fd030000 {
+3 -3
arch/xtensa/platforms/xtfpga/setup.c
··· 135 135 136 136 static int __init machine_setup(void) 137 137 { 138 - struct device_node *serial; 138 + struct device_node *clock; 139 139 struct device_node *eth = NULL; 140 140 141 - for_each_compatible_node(serial, NULL, "ns16550a") 142 - update_clock_frequency(serial); 141 + for_each_node_by_name(clock, "main-oscillator") 142 + update_clock_frequency(clock); 143 143 144 144 if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc"))) 145 145 update_local_mac(eth);