Skip to content

Commit

Permalink
xtensa: xtfpga: use common clock framework
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Max Filippov committed Feb 21, 2014
1 parent bda8932 commit cdc9af7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 8 additions & 3 deletions arch/xtensa/boot/dts/xtfpga.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,21 @@
interrupt-controller;
};

clocks {
osc: main-oscillator {
#clock-cells = <0>;
compatible = "fixed-clock";
};
};

serial0: serial@fd050020 {
device_type = "serial";
compatible = "ns16550a";
no-loopback-test;
reg = <0xfd050020 0x20>;
reg-shift = <2>;
interrupts = <0 1>; /* external irq 0 */
/* Filled in by platform_setup from FPGA register
* clock-frequency = <100000000>;
*/
clocks = <&osc>;
};

enet0: ethoc@fd030000 {
Expand Down
6 changes: 3 additions & 3 deletions arch/xtensa/platforms/xtfpga/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ static void __init update_local_mac(struct device_node *node)

static int __init machine_setup(void)
{
struct device_node *serial;
struct device_node *clock;
struct device_node *eth = NULL;

for_each_compatible_node(serial, NULL, "ns16550a")
update_clock_frequency(serial);
for_each_node_by_name(clock, "main-oscillator")
update_clock_frequency(clock);

if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc")))
update_local_mac(eth);
Expand Down

0 comments on commit cdc9af7

Please sign in to comment.