* [PATCH] powerpc/83xx: gianfar_ptp: select 1588 clock source through dts file
@ 2013-09-18 13:21 Aida Mynzhasova
2013-09-18 15:44 ` Claudiu Manoil
2013-09-18 16:08 ` Richard Cochran
0 siblings, 2 replies; 9+ messages in thread
From: Aida Mynzhasova @ 2013-09-18 13:21 UTC (permalink / raw)
To: richardcochran; +Cc: netdev
IEEE 1588 timer reference clock source is determined through hard-coded
value in gianfar_ptp driver by default. This patch allows to select ptp
clock source by means of device tree file node.
For instance:
fsl,cksel = <0>;
for using external (TSEC_TMR_CLK input) high precision timer
reference clock.
Other acceptable values:
<1> : eTSEC system clock
<2> : eTSEC1 transmit clock
<3> : RTC clock input
Signed-off-by: Aida Mynzhasova <aida.mynzhasova@skitlab.ru>
---
drivers/net/ethernet/freescale/gianfar_ptp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/gianfar_ptp.c b/drivers/net/ethernet/freescale/gianfar_ptp.c
index 098f133..e006a09 100644
--- a/drivers/net/ethernet/freescale/gianfar_ptp.c
+++ b/drivers/net/ethernet/freescale/gianfar_ptp.c
@@ -452,7 +452,9 @@ static int gianfar_ptp_probe(struct platform_device *dev)
err = -ENODEV;
etsects->caps = ptp_gianfar_caps;
- etsects->cksel = DEFAULT_CKSEL;
+
+ if (get_of_u32(node, "fsl,cksel", &etsects->cksel))
+ etsects->cksel = DEFAULT_CKSEL;
if (get_of_u32(node, "fsl,tclk-period", &etsects->tclk_period) ||
get_of_u32(node, "fsl,tmr-prsc", &etsects->tmr_prsc) ||
--
1.8.1.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] powerpc/83xx: gianfar_ptp: select 1588 clock source through dts file
2013-09-18 13:21 [PATCH] powerpc/83xx: gianfar_ptp: select 1588 clock source through dts file Aida Mynzhasova
@ 2013-09-18 15:44 ` Claudiu Manoil
2013-09-18 16:39 ` Aida Mynzhasova
2013-09-18 16:08 ` Richard Cochran
1 sibling, 1 reply; 9+ messages in thread
From: Claudiu Manoil @ 2013-09-18 15:44 UTC (permalink / raw)
To: Aida Mynzhasova; +Cc: richardcochran, netdev
On 9/18/2013 4:21 PM, Aida Mynzhasova wrote:
> IEEE 1588 timer reference clock source is determined through hard-coded
> value in gianfar_ptp driver by default. This patch allows to select ptp
> clock source by means of device tree file node.
>
> For instance:
>
> fsl,cksel = <0>;
>
Has this device tree binding been defined? (Where?)
I don't see this property in the net-next.git tree at least.
Claudiu
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] powerpc/83xx: gianfar_ptp: select 1588 clock source through dts file
2013-09-18 13:21 [PATCH] powerpc/83xx: gianfar_ptp: select 1588 clock source through dts file Aida Mynzhasova
2013-09-18 15:44 ` Claudiu Manoil
@ 2013-09-18 16:08 ` Richard Cochran
2013-09-18 16:40 ` Aida Mynzhasova
1 sibling, 1 reply; 9+ messages in thread
From: Richard Cochran @ 2013-09-18 16:08 UTC (permalink / raw)
To: Aida Mynzhasova; +Cc: netdev
On Wed, Sep 18, 2013 at 05:21:04PM +0400, Aida Mynzhasova wrote:
> IEEE 1588 timer reference clock source is determined through hard-coded
> value in gianfar_ptp driver by default. This patch allows to select ptp
> clock source by means of device tree file node.
>
> For instance:
>
> fsl,cksel = <0>;
>
> for using external (TSEC_TMR_CLK input) high precision timer
> reference clock.
>
> Other acceptable values:
>
> <1> : eTSEC system clock
> <2> : eTSEC1 transmit clock
> <3> : RTC clock input
Do the other clock sources even work at all?
We were not able to get them working.
Thanks,
Richard
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] powerpc/83xx: gianfar_ptp: select 1588 clock source through dts file
2013-09-18 15:44 ` Claudiu Manoil
@ 2013-09-18 16:39 ` Aida Mynzhasova
2013-09-19 16:30 ` Claudiu Manoil
0 siblings, 1 reply; 9+ messages in thread
From: Aida Mynzhasova @ 2013-09-18 16:39 UTC (permalink / raw)
To: Claudiu Manoil; +Cc: richardcochran, netdev
On 18.09.2013 19:44, Claudiu Manoil wrote:
>
> On 9/18/2013 4:21 PM, Aida Mynzhasova wrote:
>> IEEE 1588 timer reference clock source is determined through hard-coded
>> value in gianfar_ptp driver by default. This patch allows to select ptp
>> clock source by means of device tree file node.
>>
>> For instance:
>>
>> fsl,cksel = <0>;
>>
>
> Has this device tree binding been defined? (Where?)
> I don't see this property in the net-next.git tree at least.
>
> Claudiu
>
>
Hi Claudiu,
actually, I don't know where I should define this binding, my only idea
is to add "cksel" property description in
/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt. Am I right or I
need to do some additional changes?
Thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] powerpc/83xx: gianfar_ptp: select 1588 clock source through dts file
2013-09-18 16:08 ` Richard Cochran
@ 2013-09-18 16:40 ` Aida Mynzhasova
0 siblings, 0 replies; 9+ messages in thread
From: Aida Mynzhasova @ 2013-09-18 16:40 UTC (permalink / raw)
To: Richard Cochran; +Cc: netdev
On 18.09.2013 20:08, Richard Cochran wrote:
> On Wed, Sep 18, 2013 at 05:21:04PM +0400, Aida Mynzhasova wrote:
>> IEEE 1588 timer reference clock source is determined through hard-coded
>> value in gianfar_ptp driver by default. This patch allows to select ptp
>> clock source by means of device tree file node.
>>
>> For instance:
>>
>> fsl,cksel = <0>;
>>
>> for using external (TSEC_TMR_CLK input) high precision timer
>> reference clock.
>>
>> Other acceptable values:
>>
>> <1> : eTSEC system clock
>> <2> : eTSEC1 transmit clock
>> <3> : RTC clock input
>
> Do the other clock sources even work at all?
>
> We were not able to get them working.
>
> Thanks,
> Richard
>
Hi Richard,
I've tried to use 2 clock sources: external from TSEC_TMR_CLK input (for
this I had to update multiplexer settings in uboot) and eTSEC system
clock - counter worked fine with both.
My attempts to use eTSEC1 transmit clock and RTC clock were unsuccessful
(the system hanged up) irrespective of using hard-coded value or entry
in dts file.
Thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] powerpc/83xx: gianfar_ptp: select 1588 clock source through dts file
2013-09-18 16:39 ` Aida Mynzhasova
@ 2013-09-19 16:30 ` Claudiu Manoil
2013-09-19 17:12 ` Richard Cochran
0 siblings, 1 reply; 9+ messages in thread
From: Claudiu Manoil @ 2013-09-19 16:30 UTC (permalink / raw)
To: Aida Mynzhasova; +Cc: richardcochran, netdev
On 9/18/2013 7:39 PM, Aida Mynzhasova wrote:
> On 18.09.2013 19:44, Claudiu Manoil wrote:
>>
>> On 9/18/2013 4:21 PM, Aida Mynzhasova wrote:
>>> IEEE 1588 timer reference clock source is determined through hard-coded
>>> value in gianfar_ptp driver by default. This patch allows to select ptp
>>> clock source by means of device tree file node.
>>>
>>> For instance:
>>>
>>> fsl,cksel = <0>;
>>>
>>
>> Has this device tree binding been defined? (Where?)
>> I don't see this property in the net-next.git tree at least.
>>
>> Claudiu
>>
>>
>
> Hi Claudiu,
>
> actually, I don't know where I should define this binding, my only idea
> is to add "cksel" property description in
> /Documentation/devicetree/bindings/net/fsl-tsec-phy.txt. Am I right or I
> need to do some additional changes?
>
> Thanks.
>
>
If you ask me, updates for the device trees of several powerpc boards,
like the 83xx series (as this patch implies), should be discussed and
agreed upon on the powerpc list (linuxppc-dev@lists.ozlabs.org),
where these kind of changes are usually being discussed with people more
knowledgeable in device tree bindings and the powerpc/83xx hardware.
Regards,
Claudiu
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] powerpc/83xx: gianfar_ptp: select 1588 clock source through dts file
2013-09-19 16:30 ` Claudiu Manoil
@ 2013-09-19 17:12 ` Richard Cochran
0 siblings, 0 replies; 9+ messages in thread
From: Richard Cochran @ 2013-09-19 17:12 UTC (permalink / raw)
To: Claudiu Manoil; +Cc: Aida Mynzhasova, netdev
On Thu, Sep 19, 2013 at 07:30:02PM +0300, Claudiu Manoil wrote:
>
> If you ask me, updates for the device trees of several powerpc
> boards, like the 83xx series (as this patch implies), should be
> discussed and agreed upon on the powerpc list (linuxppc-dev@lists.ozlabs.org),
> where these kind of changes are usually being discussed with people more
> knowledgeable in device tree bindings and the powerpc/83xx hardware.
Yes, and also CC the devicetree list. The original device tree
attributes for the gianfar eTSEC timer functions were reviewed on
all three lists.
Thanks,
Richard
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] powerpc/83xx: gianfar_ptp: select 1588 clock source through dts file
@ 2013-09-24 7:39 Aida Mynzhasova
2013-09-24 17:14 ` Richard Cochran
0 siblings, 1 reply; 9+ messages in thread
From: Aida Mynzhasova @ 2013-09-24 7:39 UTC (permalink / raw)
To: linuxppc-dev; +Cc: devicetree, netdev
Currently IEEE 1588 timer reference clock source is determined through
hard-coded value in gianfar_ptp driver. This patch allows to select ptp
clock source by means of device tree file node.
For instance:
fsl,cksel = <0>;
for using external (TSEC_TMR_CLK input) high precision timer
reference clock.
Other acceptable values:
<1> : eTSEC system clock
<2> : eTSEC1 transmit clock
<3> : RTC clock input
When this attribute isn't used, eTSEC system clock will serve as
IEEE 1588 timer reference clock.
Signed-off-by: Aida Mynzhasova <aida.mynzhasova@skitlab.ru>
---
Documentation/devicetree/bindings/net/fsl-tsec-phy.txt | 2 ++
drivers/net/ethernet/freescale/gianfar_ptp.c | 4 +++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
index 2c6be03..2f889f1 100644
--- a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
+++ b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
@@ -86,6 +86,7 @@ General Properties:
Clock Properties:
+ - fsl,cksel Timer reference clock source.
- fsl,tclk-period Timer reference clock period in nanoseconds.
- fsl,tmr-prsc Prescaler, divides the output clock.
- fsl,tmr-add Frequency compensation value.
@@ -121,6 +122,7 @@ Example:
reg = <0x24E00 0xB0>;
interrupts = <12 0x8 13 0x8>;
interrupt-parent = < &ipic >;
+ fsl,cksel = <1>;
fsl,tclk-period = <10>;
fsl,tmr-prsc = <100>;
fsl,tmr-add = <0x999999A4>;
diff --git a/drivers/net/ethernet/freescale/gianfar_ptp.c b/drivers/net/ethernet/freescale/gianfar_ptp.c
index 098f133..e006a09 100644
--- a/drivers/net/ethernet/freescale/gianfar_ptp.c
+++ b/drivers/net/ethernet/freescale/gianfar_ptp.c
@@ -452,7 +452,9 @@ static int gianfar_ptp_probe(struct platform_device *dev)
err = -ENODEV;
etsects->caps = ptp_gianfar_caps;
- etsects->cksel = DEFAULT_CKSEL;
+
+ if (get_of_u32(node, "fsl,cksel", &etsects->cksel))
+ etsects->cksel = DEFAULT_CKSEL;
if (get_of_u32(node, "fsl,tclk-period", &etsects->tclk_period) ||
get_of_u32(node, "fsl,tmr-prsc", &etsects->tmr_prsc) ||
--
1.8.1.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] powerpc/83xx: gianfar_ptp: select 1588 clock source through dts file
2013-09-24 7:39 Aida Mynzhasova
@ 2013-09-24 17:14 ` Richard Cochran
0 siblings, 0 replies; 9+ messages in thread
From: Richard Cochran @ 2013-09-24 17:14 UTC (permalink / raw)
To: Aida Mynzhasova; +Cc: linuxppc-dev, devicetree, netdev
On Tue, Sep 24, 2013 at 11:39:57AM +0400, Aida Mynzhasova wrote:
> Currently IEEE 1588 timer reference clock source is determined through
> hard-coded value in gianfar_ptp driver. This patch allows to select ptp
> clock source by means of device tree file node.
>
> For instance:
>
> fsl,cksel = <0>;
>
> for using external (TSEC_TMR_CLK input) high precision timer
> reference clock.
>
> Other acceptable values:
>
> <1> : eTSEC system clock
> <2> : eTSEC1 transmit clock
> <3> : RTC clock input
I think it would be useful to have this table in the binding document
as well.
Thanks,
Richard
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-09-24 17:14 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-18 13:21 [PATCH] powerpc/83xx: gianfar_ptp: select 1588 clock source through dts file Aida Mynzhasova
2013-09-18 15:44 ` Claudiu Manoil
2013-09-18 16:39 ` Aida Mynzhasova
2013-09-19 16:30 ` Claudiu Manoil
2013-09-19 17:12 ` Richard Cochran
2013-09-18 16:08 ` Richard Cochran
2013-09-18 16:40 ` Aida Mynzhasova
-- strict thread matches above, loose matches on Subject: below --
2013-09-24 7:39 Aida Mynzhasova
2013-09-24 17:14 ` Richard Cochran
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).