2015-06-08 10:12:05

by Antony Pavlov

[permalink] [raw]
Subject: Re: [PATCH v4 12/12] MIPS: Add basic support for the TL-WR1043ND version 1

On Sun, 31 May 2015 02:18:26 +0200
Alban Bedel <[email protected]> wrote:

> Add a DTS for TL-WR1043ND version 1 and allow to have it built in the
> kernel to circumvent the broken u-boot found on these boards.
> Currently only the UART, LEDs and buttons are supported.
>
> Signed-off-by: Alban Bedel <[email protected]>

> --- /dev/null
> +++ b/arch/mips/boot/dts/qca/ar9132.dtsi


> +++ b/arch/mips/boot/dts/qca/ar9132_tl_wr1043nd_v1.dts
> @@ -0,0 +1,112 @@
> +/dts-v1/;
> +
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>
> +
> +#include "ar9132.dtsi"
> +
> +/ {
> + compatible = "tplink,tl-wr1043nd-v1", "qca,ar9132";
> + model = "TP-Link TL-WR1043ND Version 1";
> +
> + alias {
> + serial0 = "/ahb/apb/uart@18020000";
> + };
> +
> + memory@0 {
> + device_type = "memory";
> + reg = <0x0 0x2000000>;
> + };
> +
> + extosc: oscillator {
> + compatible = "fixed-clock";
> + #clock-cells = <0>;
> + clock-frequency = <40000000>;
> + };
> +
> + ahb {
> + apb {
> + uart@18020000 {
> + status = "okay";
> + };
> +
> + pll-controller@18050000 {
> + clocks = <&extosc>;

IMHO AR9132 SoC can't work without external oscilator.

Can we just move basic extosc declaration to SoC dt file (ar9132.dtsi)?
So board dt file ar9132_tl_wr1043nd_v1.dts will contain only oscilator
clock frequency value.

E.g.

ar9132.dtsi:
============

extosc: oscillator {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <40000000>;
};
...
ahb {
apb {

...

pll-controller@18050000 {
...
clocks = <&extosc>;
...



ar9132_tl_wr1043nd_v1.dts:
==========================

...
&extosc {
clock-frequency = <40000000>;
};


--?
Best regards,
? Antony Pavlov


2015-06-10 21:58:39

by Alban

[permalink] [raw]
Subject: Re: [PATCH v4 12/12] MIPS: Add basic support for the TL-WR1043ND version 1

On Mon, 8 Jun 2015 13:17:58 +0300
Antony Pavlov <[email protected]> wrote:

> IMHO AR9132 SoC can't work without external oscilator.
>
> Can we just move basic extosc declaration to SoC dt file
> (ar9132.dtsi)? So board dt file ar9132_tl_wr1043nd_v1.dts will
> contain only oscilator clock frequency value.

I would prefer to keep the split between the files in sync with the
hardware. I understand that most simple board designs use a fixed
oscillator, but that might not always be the case.

Alban

2015-06-15 07:36:13

by Antony Pavlov

[permalink] [raw]
Subject: Re: [PATCH v4 12/12] MIPS: Add basic support for the TL-WR1043ND version 1

On Wed, 10 Jun 2015 23:58:11 +0200
Alban <[email protected]> wrote:

> On Mon, 8 Jun 2015 13:17:58 +0300
> Antony Pavlov <[email protected]> wrote:
>
> > IMHO AR9132 SoC can't work without external oscilator.
> >
> > Can we just move basic extosc declaration to SoC dt file
> > (ar9132.dtsi)? So board dt file ar9132_tl_wr1043nd_v1.dts will
> > contain only oscilator clock frequency value.
>
> I would prefer to keep the split between the files in sync with the
> hardware. I understand that most simple board designs use a fixed
> oscillator, but that might not always be the case.
>

The AR9132 SoC __always__ use one external oscilator. So it's reasonable
to have the first mention of extosc in ar9132.dtsi not in a board file.
This description style is always sync with hardware.
On the other hand pll-controller is always part of the SoC
not a part of a board. So pll-controller on extosc dependency
have to go to SoC dts file not to a board file. In your dts description
pll-controller is a part of a dts board file.

It looks like my previous device tree structure proposal contains a small error
(extra clock-frequency field in ar9132.dtsi). I have fixed it. Please comment it.

ar9132.dtsi:
============

extosc: oscillator {
compatible = "fixed-clock";
#clock-cells = <0>;
};
...
ahb {
apb {

...

pll-controller@18050000 {
...
clocks = <&extosc>;
...



ar9132_tl_wr1043nd_v1.dts:
==========================

...
&extosc {
clock-frequency = <40000000>;
};


--
--?
Best regards,
? Antony Pavlov

2015-06-20 10:52:07

by Alban

[permalink] [raw]
Subject: Re: [PATCH v4 12/12] MIPS: Add basic support for the TL-WR1043ND version 1

On Mon, 15 Jun 2015 10:42:13 +0300
Antony Pavlov <[email protected]> wrote:

> On Wed, 10 Jun 2015 23:58:11 +0200
> Alban <[email protected]> wrote:
>
> > On Mon, 8 Jun 2015 13:17:58 +0300
> > Antony Pavlov <[email protected]> wrote:
> >
> > > IMHO AR9132 SoC can't work without external oscilator.
> > >
> > > Can we just move basic extosc declaration to SoC dt file
> > > (ar9132.dtsi)? So board dt file ar9132_tl_wr1043nd_v1.dts will
> > > contain only oscilator clock frequency value.
> >
> > I would prefer to keep the split between the files in sync with the
> > hardware. I understand that most simple board designs use a fixed
> > oscillator, but that might not always be the case.
> >
>
> The AR9132 SoC __always__ use one external oscilator.

Yes, but what I don't like is to impose the clock source being a
fixed-oscillator. What if the board use a clock from another
component that need to be represented in the DT as something else
than a fixed-oscillator?

> So it's reasonable to have the first mention of extosc in
> ar9132.dtsi not in a board file. This description style is always
> sync with hardware.

In your proposal it wouldn't as the AR9132 doesn't have a
fixed-oscillator on chip. So boards using another type of clock would
still have that fixed-oscillator hanging around.

> On the other hand pll-controller is always part
> of the SoC not a part of a board. So pll-controller on extosc
> dependency have to go to SoC dts file not to a board file. In your dts
> description pll-controller is a part of a dts board file.

The PLL controller shows up in the board DTS as the connection between
the SoC and the other components on boards has to be represented. We
could use a label and reference it in the board file but that is the
same in the end.

But that's not really the point, more important is the fact that DTS
don't allow to delete nodes. This mean that DTSI should really not
start to define more than is strictly needed.

Alban

2015-06-22 14:55:13

by Antony Pavlov

[permalink] [raw]
Subject: Re: [PATCH v4 12/12] MIPS: Add basic support for the TL-WR1043ND version 1

On Sat, 20 Jun 2015 12:51:37 +0200
Alban <[email protected]> wrote:

> On Mon, 15 Jun 2015 10:42:13 +0300
> Antony Pavlov <[email protected]> wrote:
>
> > On Wed, 10 Jun 2015 23:58:11 +0200
> > Alban <[email protected]> wrote:
> >
> > > On Mon, 8 Jun 2015 13:17:58 +0300
> > > Antony Pavlov <[email protected]> wrote:
> > >
> > > > IMHO AR9132 SoC can't work without external oscilator.
> > > >
> > > > Can we just move basic extosc declaration to SoC dt file
> > > > (ar9132.dtsi)? So board dt file ar9132_tl_wr1043nd_v1.dts will
> > > > contain only oscilator clock frequency value.
> > >
> > > I would prefer to keep the split between the files in sync with the
> > > hardware. I understand that most simple board designs use a fixed
> > > oscillator, but that might not always be the case.
> > >
> >
> > The AR9132 SoC __always__ use one external oscilator.
>
> Yes, but what I don't like is to impose the clock source being a
> fixed-oscillator. What if the board use a clock from another
> component that need to be represented in the DT as something else
> than a fixed-oscillator?

The absolute majority of the ar9132-based boards has fixed-oscillator
(Actually I suppose all of them has fixed oscillator).

If some board has different clock source then we can completely alter
extosc node in the board dts file. (But I have some doubts in existence
of such board.)

--?
Best regards,
? Antony Pavlov