Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cdc9af7c authored by Max Filippov's avatar Max Filippov
Browse files

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: default avatarMax Filippov <jcmvbkbc@gmail.com>
parent bda8932d
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -35,6 +35,13 @@
		interrupt-controller;
		interrupt-controller;
	};
	};


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

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


	enet0: ethoc@fd030000 {
	enet0: ethoc@fd030000 {
+3 −3
Original line number Original line Diff line number Diff line
@@ -135,11 +135,11 @@ static void __init update_local_mac(struct device_node *node)


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


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


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