diff mbox series

[v3] ARM: dts: ls1021a: output PPS signal on FIPER2

Message ID 20200522013052.2838-1-yangbo.lu@nxp.com (mailing list archive)
State Mainlined
Commit 5656bb3857c4904d1dec6e1b8f876c1c0337274e
Headers show
Series [v3] ARM: dts: ls1021a: output PPS signal on FIPER2 | expand

Commit Message

Yangbo Lu May 22, 2020, 1:30 a.m. UTC
The timer fixed interval period pulse generator register
is used to generate periodic pulses. The down count
register loads the value programmed in the fixed period
interval (FIPER). At every tick of the timer accumulator
overflow, the counter decrements by the value of
TMR_CTRL[TCLK_PERIOD]. It generates a pulse when the down
counter value reaches zero. It reloads the down counter
in the cycle following a pulse.

To use the TMR_FIPER register to generate desired periodic
pulses. The value should programmed is,
desired_period - tclk_period

Current tmr-fiper2 value is to generate 100us periodic pulses.
(But the value should have been 99995, not 99990. The tclk_period is 5.)
This patch is to generate 1 second periodic pulses with value
999999995 programmed which is more desired by user.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
Changes for v2:
	- Added more discription in commit message.
Changes for v3:
	- Mentioned effect of the change in commit message.
---
 arch/arm/boot/dts/ls1021a.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Cochran May 22, 2020, 2:43 a.m. UTC | #1
On Fri, May 22, 2020 at 09:30:52AM +0800, Yangbo Lu wrote:
> The timer fixed interval period pulse generator register
> is used to generate periodic pulses. The down count
> register loads the value programmed in the fixed period
> interval (FIPER). At every tick of the timer accumulator
> overflow, the counter decrements by the value of
> TMR_CTRL[TCLK_PERIOD]. It generates a pulse when the down
> counter value reaches zero. It reloads the down counter
> in the cycle following a pulse.
> 
> To use the TMR_FIPER register to generate desired periodic
> pulses. The value should programmed is,
> desired_period - tclk_period
> 
> Current tmr-fiper2 value is to generate 100us periodic pulses.
> (But the value should have been 99995, not 99990. The tclk_period is 5.)
> This patch is to generate 1 second periodic pulses with value
> 999999995 programmed which is more desired by user.
> 
> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>

Acked-by: Richard Cochran <richardcochran@gmail.com>
Yangbo Lu June 8, 2020, 3:28 a.m. UTC | #2
Hi Shawn,

Will you help to merge the patch?
Thanks.

Best regards,
Yangbo Lu

> -----Original Message-----
> From: Yangbo Lu <yangbo.lu@nxp.com>
> Sent: Friday, May 22, 2020 9:31 AM
> To: linux-arm-kernel@lists.infradead.org
> Cc: Y.b. Lu <yangbo.lu@nxp.com>; Shawn Guo <shawnguo@kernel.org>; Leo Li
> <leoyang.li@nxp.com>; Richard Cochran <richardcochran@gmail.com>
> Subject: [v3] ARM: dts: ls1021a: output PPS signal on FIPER2
> 
> The timer fixed interval period pulse generator register
> is used to generate periodic pulses. The down count
> register loads the value programmed in the fixed period
> interval (FIPER). At every tick of the timer accumulator
> overflow, the counter decrements by the value of
> TMR_CTRL[TCLK_PERIOD]. It generates a pulse when the down
> counter value reaches zero. It reloads the down counter
> in the cycle following a pulse.
> 
> To use the TMR_FIPER register to generate desired periodic
> pulses. The value should programmed is,
> desired_period - tclk_period
> 
> Current tmr-fiper2 value is to generate 100us periodic pulses.
> (But the value should have been 99995, not 99990. The tclk_period is 5.)
> This patch is to generate 1 second periodic pulses with value
> 999999995 programmed which is more desired by user.
> 
> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> ---
> Changes for v2:
> 	- Added more discription in commit message.
> Changes for v3:
> 	- Mentioned effect of the change in commit message.
> ---
>  arch/arm/boot/dts/ls1021a.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
> index 760a68c..b2ff27a 100644
> --- a/arch/arm/boot/dts/ls1021a.dtsi
> +++ b/arch/arm/boot/dts/ls1021a.dtsi
> @@ -772,7 +772,7 @@
>  			fsl,tmr-prsc    = <2>;
>  			fsl,tmr-add     = <0xaaaaaaab>;
>  			fsl,tmr-fiper1  = <999999995>;
> -			fsl,tmr-fiper2  = <99990>;
> +			fsl,tmr-fiper2  = <999999995>;
>  			fsl,max-adj     = <499999999>;
>  			fsl,extts-fifo;
>  		};
> --
> 2.7.4
Leo Li June 8, 2020, 10:19 p.m. UTC | #3
> -----Original Message-----
> From: Yangbo Lu <yangbo.lu@nxp.com>
> Sent: Thursday, May 21, 2020 8:31 PM
> To: linux-arm-kernel@lists.infradead.org
> Cc: Y.b. Lu <yangbo.lu@nxp.com>; Shawn Guo <shawnguo@kernel.org>; Leo
> Li <leoyang.li@nxp.com>; Richard Cochran <richardcochran@gmail.com>
> Subject: [v3] ARM: dts: ls1021a: output PPS signal on FIPER2
> 
> The timer fixed interval period pulse generator register is used to generate
> periodic pulses. The down count register loads the value programmed in the
> fixed period interval (FIPER). At every tick of the timer accumulator overflow,
> the counter decrements by the value of TMR_CTRL[TCLK_PERIOD]. It
> generates a pulse when the down counter value reaches zero. It reloads the
> down counter in the cycle following a pulse.
> 
> To use the TMR_FIPER register to generate desired periodic pulses. The
> value should programmed is, desired_period - tclk_period
> 
> Current tmr-fiper2 value is to generate 100us periodic pulses.
> (But the value should have been 99995, not 99990. The tclk_period is 5.) This
> patch is to generate 1 second periodic pulses with value
> 999999995 programmed which is more desired by user.
> 
> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> ---
> Changes for v2:
> 	- Added more discription in commit message.
> Changes for v3:
> 	- Mentioned effect of the change in commit message.
> ---
>  arch/arm/boot/dts/ls1021a.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
> index 760a68c..b2ff27a 100644
> --- a/arch/arm/boot/dts/ls1021a.dtsi
> +++ b/arch/arm/boot/dts/ls1021a.dtsi
> @@ -772,7 +772,7 @@
>  			fsl,tmr-prsc    = <2>;
>  			fsl,tmr-add     = <0xaaaaaaab>;
>  			fsl,tmr-fiper1  = <999999995>;
> -			fsl,tmr-fiper2  = <99990>;
> +			fsl,tmr-fiper2  = <999999995>;

I noticed that the fiper2 is now the same as fiper1.  Can we just use fiper1 to generate the 1s pulse?  Or both of them have to be used?

>  			fsl,max-adj     = <499999999>;
>  			fsl,extts-fifo;
>  		};
> --
> 2.7.4
Yangbo Lu June 9, 2020, 2:29 a.m. UTC | #4
Hi Leo,

> -----Original Message-----
> From: Leo Li <leoyang.li@nxp.com>
> Sent: Tuesday, June 9, 2020 6:20 AM
> To: Y.b. Lu <yangbo.lu@nxp.com>; linux-arm-kernel@lists.infradead.org
> Cc: Y.b. Lu <yangbo.lu@nxp.com>; Shawn Guo <shawnguo@kernel.org>;
> Richard Cochran <richardcochran@gmail.com>
> Subject: RE: [v3] ARM: dts: ls1021a: output PPS signal on FIPER2
> 
> 
> 
> > -----Original Message-----
> > From: Yangbo Lu <yangbo.lu@nxp.com>
> > Sent: Thursday, May 21, 2020 8:31 PM
> > To: linux-arm-kernel@lists.infradead.org
> > Cc: Y.b. Lu <yangbo.lu@nxp.com>; Shawn Guo <shawnguo@kernel.org>; Leo
> > Li <leoyang.li@nxp.com>; Richard Cochran <richardcochran@gmail.com>
> > Subject: [v3] ARM: dts: ls1021a: output PPS signal on FIPER2
> >
> > The timer fixed interval period pulse generator register is used to generate
> > periodic pulses. The down count register loads the value programmed in the
> > fixed period interval (FIPER). At every tick of the timer accumulator overflow,
> > the counter decrements by the value of TMR_CTRL[TCLK_PERIOD]. It
> > generates a pulse when the down counter value reaches zero. It reloads the
> > down counter in the cycle following a pulse.
> >
> > To use the TMR_FIPER register to generate desired periodic pulses. The
> > value should programmed is, desired_period - tclk_period
> >
> > Current tmr-fiper2 value is to generate 100us periodic pulses.
> > (But the value should have been 99995, not 99990. The tclk_period is 5.)
> This
> > patch is to generate 1 second periodic pulses with value
> > 999999995 programmed which is more desired by user.
> >
> > Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> > ---
> > Changes for v2:
> > 	- Added more discription in commit message.
> > Changes for v3:
> > 	- Mentioned effect of the change in commit message.
> > ---
> >  arch/arm/boot/dts/ls1021a.dtsi | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
> > index 760a68c..b2ff27a 100644
> > --- a/arch/arm/boot/dts/ls1021a.dtsi
> > +++ b/arch/arm/boot/dts/ls1021a.dtsi
> > @@ -772,7 +772,7 @@
> >  			fsl,tmr-prsc    = <2>;
> >  			fsl,tmr-add     = <0xaaaaaaab>;
> >  			fsl,tmr-fiper1  = <999999995>;
> > -			fsl,tmr-fiper2  = <99990>;
> > +			fsl,tmr-fiper2  = <999999995>;
> 
> I noticed that the fiper2 is now the same as fiper1.  Can we just use fiper1 to
> generate the 1s pulse?  Or both of them have to be used?

PPS signal is frequently used by users. And more than 1 channel may be needed.
I think we can configure two PPS signals on fiper1/fiper2 in default.
For specific periodic pulse, user can configure the period wanted by themselves.
Thanks.

> 
> >  			fsl,max-adj     = <499999999>;
> >  			fsl,extts-fifo;
> >  		};
> > --
> > 2.7.4
Leo Li June 9, 2020, 9:59 p.m. UTC | #5
> -----Original Message-----
> From: Y.b. Lu <yangbo.lu@nxp.com>
> Sent: Monday, June 8, 2020 9:30 PM
> To: Leo Li <leoyang.li@nxp.com>; linux-arm-kernel@lists.infradead.org
> Cc: Shawn Guo <shawnguo@kernel.org>; Richard Cochran
> <richardcochran@gmail.com>
> Subject: RE: [v3] ARM: dts: ls1021a: output PPS signal on FIPER2
> 
> Hi Leo,
> 
> > -----Original Message-----
> > From: Leo Li <leoyang.li@nxp.com>
> > Sent: Tuesday, June 9, 2020 6:20 AM
> > To: Y.b. Lu <yangbo.lu@nxp.com>; linux-arm-kernel@lists.infradead.org
> > Cc: Y.b. Lu <yangbo.lu@nxp.com>; Shawn Guo <shawnguo@kernel.org>;
> > Richard Cochran <richardcochran@gmail.com>
> > Subject: RE: [v3] ARM: dts: ls1021a: output PPS signal on FIPER2
> >
> >
> >
> > > -----Original Message-----
> > > From: Yangbo Lu <yangbo.lu@nxp.com>
> > > Sent: Thursday, May 21, 2020 8:31 PM
> > > To: linux-arm-kernel@lists.infradead.org
> > > Cc: Y.b. Lu <yangbo.lu@nxp.com>; Shawn Guo <shawnguo@kernel.org>;
> > > Leo Li <leoyang.li@nxp.com>; Richard Cochran
> > > <richardcochran@gmail.com>
> > > Subject: [v3] ARM: dts: ls1021a: output PPS signal on FIPER2
> > >
> > > The timer fixed interval period pulse generator register is used to
> > > generate periodic pulses. The down count register loads the value
> > > programmed in the fixed period interval (FIPER). At every tick of
> > > the timer accumulator overflow, the counter decrements by the value
> > > of TMR_CTRL[TCLK_PERIOD]. It generates a pulse when the down
> counter
> > > value reaches zero. It reloads the down counter in the cycle following a
> pulse.
> > >
> > > To use the TMR_FIPER register to generate desired periodic pulses.
> > > The value should programmed is, desired_period - tclk_period
> > >
> > > Current tmr-fiper2 value is to generate 100us periodic pulses.
> > > (But the value should have been 99995, not 99990. The tclk_period is
> > > 5.)
> > This
> > > patch is to generate 1 second periodic pulses with value
> > > 999999995 programmed which is more desired by user.
> > >
> > > Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> > > ---
> > > Changes for v2:
> > > 	- Added more discription in commit message.
> > > Changes for v3:
> > > 	- Mentioned effect of the change in commit message.
> > > ---
> > >  arch/arm/boot/dts/ls1021a.dtsi | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/arch/arm/boot/dts/ls1021a.dtsi
> > > b/arch/arm/boot/dts/ls1021a.dtsi index 760a68c..b2ff27a 100644
> > > --- a/arch/arm/boot/dts/ls1021a.dtsi
> > > +++ b/arch/arm/boot/dts/ls1021a.dtsi
> > > @@ -772,7 +772,7 @@
> > >  			fsl,tmr-prsc    = <2>;
> > >  			fsl,tmr-add     = <0xaaaaaaab>;
> > >  			fsl,tmr-fiper1  = <999999995>;
> > > -			fsl,tmr-fiper2  = <99990>;
> > > +			fsl,tmr-fiper2  = <999999995>;
> >
> > I noticed that the fiper2 is now the same as fiper1.  Can we just use
> > fiper1 to generate the 1s pulse?  Or both of them have to be used?
> 
> PPS signal is frequently used by users. And more than 1 channel may be
> needed.
> I think we can configure two PPS signals on fiper1/fiper2 in default.
> For specific periodic pulse, user can configure the period wanted by
> themselves.

If this is an application specific setting, wouldn't it be better to be part of the board dts instead of the SoC dtsi?

Regards,
Leo
Yangbo Lu June 10, 2020, 3:18 a.m. UTC | #6
Hi Leo,

> -----Original Message-----
> From: Leo Li <leoyang.li@nxp.com>
> Sent: Wednesday, June 10, 2020 6:00 AM
> To: Y.b. Lu <yangbo.lu@nxp.com>; linux-arm-kernel@lists.infradead.org
> Cc: Shawn Guo <shawnguo@kernel.org>; Richard Cochran
> <richardcochran@gmail.com>
> Subject: RE: [v3] ARM: dts: ls1021a: output PPS signal on FIPER2
> 
> 
> 
> > -----Original Message-----
> > From: Y.b. Lu <yangbo.lu@nxp.com>
> > Sent: Monday, June 8, 2020 9:30 PM
> > To: Leo Li <leoyang.li@nxp.com>; linux-arm-kernel@lists.infradead.org
> > Cc: Shawn Guo <shawnguo@kernel.org>; Richard Cochran
> > <richardcochran@gmail.com>
> > Subject: RE: [v3] ARM: dts: ls1021a: output PPS signal on FIPER2
> >
> > Hi Leo,
> >
> > > -----Original Message-----
> > > From: Leo Li <leoyang.li@nxp.com>
> > > Sent: Tuesday, June 9, 2020 6:20 AM
> > > To: Y.b. Lu <yangbo.lu@nxp.com>; linux-arm-kernel@lists.infradead.org
> > > Cc: Y.b. Lu <yangbo.lu@nxp.com>; Shawn Guo <shawnguo@kernel.org>;
> > > Richard Cochran <richardcochran@gmail.com>
> > > Subject: RE: [v3] ARM: dts: ls1021a: output PPS signal on FIPER2
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Yangbo Lu <yangbo.lu@nxp.com>
> > > > Sent: Thursday, May 21, 2020 8:31 PM
> > > > To: linux-arm-kernel@lists.infradead.org
> > > > Cc: Y.b. Lu <yangbo.lu@nxp.com>; Shawn Guo <shawnguo@kernel.org>;
> > > > Leo Li <leoyang.li@nxp.com>; Richard Cochran
> > > > <richardcochran@gmail.com>
> > > > Subject: [v3] ARM: dts: ls1021a: output PPS signal on FIPER2
> > > >
> > > > The timer fixed interval period pulse generator register is used to
> > > > generate periodic pulses. The down count register loads the value
> > > > programmed in the fixed period interval (FIPER). At every tick of
> > > > the timer accumulator overflow, the counter decrements by the value
> > > > of TMR_CTRL[TCLK_PERIOD]. It generates a pulse when the down
> > counter
> > > > value reaches zero. It reloads the down counter in the cycle following a
> > pulse.
> > > >
> > > > To use the TMR_FIPER register to generate desired periodic pulses.
> > > > The value should programmed is, desired_period - tclk_period
> > > >
> > > > Current tmr-fiper2 value is to generate 100us periodic pulses.
> > > > (But the value should have been 99995, not 99990. The tclk_period is
> > > > 5.)
> > > This
> > > > patch is to generate 1 second periodic pulses with value
> > > > 999999995 programmed which is more desired by user.
> > > >
> > > > Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> > > > ---
> > > > Changes for v2:
> > > > 	- Added more discription in commit message.
> > > > Changes for v3:
> > > > 	- Mentioned effect of the change in commit message.
> > > > ---
> > > >  arch/arm/boot/dts/ls1021a.dtsi | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/arch/arm/boot/dts/ls1021a.dtsi
> > > > b/arch/arm/boot/dts/ls1021a.dtsi index 760a68c..b2ff27a 100644
> > > > --- a/arch/arm/boot/dts/ls1021a.dtsi
> > > > +++ b/arch/arm/boot/dts/ls1021a.dtsi
> > > > @@ -772,7 +772,7 @@
> > > >  			fsl,tmr-prsc    = <2>;
> > > >  			fsl,tmr-add     = <0xaaaaaaab>;
> > > >  			fsl,tmr-fiper1  = <999999995>;
> > > > -			fsl,tmr-fiper2  = <99990>;
> > > > +			fsl,tmr-fiper2  = <999999995>;
> > >
> > > I noticed that the fiper2 is now the same as fiper1.  Can we just use
> > > fiper1 to generate the 1s pulse?  Or both of them have to be used?
> >
> > PPS signal is frequently used by users. And more than 1 channel may be
> > needed.
> > I think we can configure two PPS signals on fiper1/fiper2 in default.
> > For specific periodic pulse, user can configure the period wanted by
> > themselves.
> 
> If this is an application specific setting, wouldn't it be better to be part of the
> board dts instead of the SoC dtsi?

These provide the default setting to the 1588 timer regardless the boards.
I don't think we need to copy them to each board dts file.
Thanks.

> 
> Regards,
> Leo
Yangbo Lu June 17, 2020, 4:23 a.m. UTC | #7
Hi Shawn and Leo,

Will you help to merge this patch?
Thanks.

Best regards,
Yangbo Lu

> -----Original Message-----
> From: Y.b. Lu
> Sent: Wednesday, June 10, 2020 11:18 AM
> To: Leo Li <leoyang.li@nxp.com>; linux-arm-kernel@lists.infradead.org
> Cc: Shawn Guo <shawnguo@kernel.org>; Richard Cochran
> <richardcochran@gmail.com>
> Subject: RE: [v3] ARM: dts: ls1021a: output PPS signal on FIPER2
> 
> Hi Leo,
> 
> > -----Original Message-----
> > From: Leo Li <leoyang.li@nxp.com>
> > Sent: Wednesday, June 10, 2020 6:00 AM
> > To: Y.b. Lu <yangbo.lu@nxp.com>; linux-arm-kernel@lists.infradead.org
> > Cc: Shawn Guo <shawnguo@kernel.org>; Richard Cochran
> > <richardcochran@gmail.com>
> > Subject: RE: [v3] ARM: dts: ls1021a: output PPS signal on FIPER2
> >
> >
> >
> > > -----Original Message-----
> > > From: Y.b. Lu <yangbo.lu@nxp.com>
> > > Sent: Monday, June 8, 2020 9:30 PM
> > > To: Leo Li <leoyang.li@nxp.com>; linux-arm-kernel@lists.infradead.org
> > > Cc: Shawn Guo <shawnguo@kernel.org>; Richard Cochran
> > > <richardcochran@gmail.com>
> > > Subject: RE: [v3] ARM: dts: ls1021a: output PPS signal on FIPER2
> > >
> > > Hi Leo,
> > >
> > > > -----Original Message-----
> > > > From: Leo Li <leoyang.li@nxp.com>
> > > > Sent: Tuesday, June 9, 2020 6:20 AM
> > > > To: Y.b. Lu <yangbo.lu@nxp.com>; linux-arm-kernel@lists.infradead.org
> > > > Cc: Y.b. Lu <yangbo.lu@nxp.com>; Shawn Guo <shawnguo@kernel.org>;
> > > > Richard Cochran <richardcochran@gmail.com>
> > > > Subject: RE: [v3] ARM: dts: ls1021a: output PPS signal on FIPER2
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Yangbo Lu <yangbo.lu@nxp.com>
> > > > > Sent: Thursday, May 21, 2020 8:31 PM
> > > > > To: linux-arm-kernel@lists.infradead.org
> > > > > Cc: Y.b. Lu <yangbo.lu@nxp.com>; Shawn Guo
> <shawnguo@kernel.org>;
> > > > > Leo Li <leoyang.li@nxp.com>; Richard Cochran
> > > > > <richardcochran@gmail.com>
> > > > > Subject: [v3] ARM: dts: ls1021a: output PPS signal on FIPER2
> > > > >
> > > > > The timer fixed interval period pulse generator register is used to
> > > > > generate periodic pulses. The down count register loads the value
> > > > > programmed in the fixed period interval (FIPER). At every tick of
> > > > > the timer accumulator overflow, the counter decrements by the value
> > > > > of TMR_CTRL[TCLK_PERIOD]. It generates a pulse when the down
> > > counter
> > > > > value reaches zero. It reloads the down counter in the cycle following a
> > > pulse.
> > > > >
> > > > > To use the TMR_FIPER register to generate desired periodic pulses.
> > > > > The value should programmed is, desired_period - tclk_period
> > > > >
> > > > > Current tmr-fiper2 value is to generate 100us periodic pulses.
> > > > > (But the value should have been 99995, not 99990. The tclk_period is
> > > > > 5.)
> > > > This
> > > > > patch is to generate 1 second periodic pulses with value
> > > > > 999999995 programmed which is more desired by user.
> > > > >
> > > > > Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> > > > > ---
> > > > > Changes for v2:
> > > > > 	- Added more discription in commit message.
> > > > > Changes for v3:
> > > > > 	- Mentioned effect of the change in commit message.
> > > > > ---
> > > > >  arch/arm/boot/dts/ls1021a.dtsi | 2 +-
> > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/arch/arm/boot/dts/ls1021a.dtsi
> > > > > b/arch/arm/boot/dts/ls1021a.dtsi index 760a68c..b2ff27a 100644
> > > > > --- a/arch/arm/boot/dts/ls1021a.dtsi
> > > > > +++ b/arch/arm/boot/dts/ls1021a.dtsi
> > > > > @@ -772,7 +772,7 @@
> > > > >  			fsl,tmr-prsc    = <2>;
> > > > >  			fsl,tmr-add     = <0xaaaaaaab>;
> > > > >  			fsl,tmr-fiper1  = <999999995>;
> > > > > -			fsl,tmr-fiper2  = <99990>;
> > > > > +			fsl,tmr-fiper2  = <999999995>;
> > > >
> > > > I noticed that the fiper2 is now the same as fiper1.  Can we just use
> > > > fiper1 to generate the 1s pulse?  Or both of them have to be used?
> > >
> > > PPS signal is frequently used by users. And more than 1 channel may be
> > > needed.
> > > I think we can configure two PPS signals on fiper1/fiper2 in default.
> > > For specific periodic pulse, user can configure the period wanted by
> > > themselves.
> >
> > If this is an application specific setting, wouldn't it be better to be part of the
> > board dts instead of the SoC dtsi?
> 
> These provide the default setting to the 1588 timer regardless the boards.
> I don't think we need to copy them to each board dts file.
> Thanks.
> 
> >
> > Regards,
> > Leo
Shawn Guo June 18, 2020, 7:31 a.m. UTC | #8
On Fri, May 22, 2020 at 09:30:52AM +0800, Yangbo Lu wrote:
> The timer fixed interval period pulse generator register
> is used to generate periodic pulses. The down count
> register loads the value programmed in the fixed period
> interval (FIPER). At every tick of the timer accumulator
> overflow, the counter decrements by the value of
> TMR_CTRL[TCLK_PERIOD]. It generates a pulse when the down
> counter value reaches zero. It reloads the down counter
> in the cycle following a pulse.
> 
> To use the TMR_FIPER register to generate desired periodic
> pulses. The value should programmed is,
> desired_period - tclk_period
> 
> Current tmr-fiper2 value is to generate 100us periodic pulses.
> (But the value should have been 99995, not 99990. The tclk_period is 5.)
> This patch is to generate 1 second periodic pulses with value
> 999999995 programmed which is more desired by user.
> 
> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>

Applied, thanks.
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index 760a68c..b2ff27a 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -772,7 +772,7 @@ 
 			fsl,tmr-prsc    = <2>;
 			fsl,tmr-add     = <0xaaaaaaab>;
 			fsl,tmr-fiper1  = <999999995>;
-			fsl,tmr-fiper2  = <99990>;
+			fsl,tmr-fiper2  = <999999995>;
 			fsl,max-adj     = <499999999>;
 			fsl,extts-fifo;
 		};