2019-08-23 22:56:18

by Biwen Li

[permalink] [raw]
Subject: [1/3] rtc/fsl: support flextimer for lx2160a

The patch supports flextimer for lx2160a

Signed-off-by: Biwen Li <[email protected]>
---
drivers/rtc/rtc-fsl-ftm-alarm.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c b/drivers/rtc/rtc-fsl-ftm-alarm.c
index 4f7259c2d6a3..2b81525f6db8 100644
--- a/drivers/rtc/rtc-fsl-ftm-alarm.c
+++ b/drivers/rtc/rtc-fsl-ftm-alarm.c
@@ -313,6 +313,7 @@ static const struct of_device_id ftm_rtc_match[] = {
{ .compatible = "fsl,ls1088a-ftm-alarm", },
{ .compatible = "fsl,ls208xa-ftm-alarm", },
{ .compatible = "fsl,ls1028a-ftm-alarm", },
+ { .compatible = "fsl,lx2160a-ftm-alarm", },
{ },
};

--
2.17.1


2019-08-23 22:57:39

by Biwen Li

[permalink] [raw]
Subject: [2/3] arm64: dts: lx2160a: add ftm_alarm0 DT node

The patch adds ftm_alarm0 DT node for Soc LX2160A
FlexTimer1 module is used to wakeup the system in deep sleep

Signed-off-by: Biwen Li <[email protected]>
---
arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi
index 5c7d1e3704cb..39d497df769e 100644
--- a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi
@@ -15,6 +15,10 @@
#address-cells = <2>;
#size-cells = <2>;

+ aliases {
+ rtc1 = &ftm_alarm0;
+ };
+
cpus {
#address-cells = <1>;
#size-cells = <0>;
@@ -769,6 +773,20 @@
timeout-sec = <30>;
};

+ rcpm: rcpm@1e34040 {
+ compatible = "fsl,lx2160a-rcpm", "fsl,qoriq-rcpm-2.1+";
+ reg = <0x0 0x1e34040 0x0 0x1c>;
+ #fsl,rcpm-wakeup-cells = <7>;
+ little-endian;
+ };
+
+ ftm_alarm0: timer@2800000 {
+ compatible = "fsl,lx2160a-ftm-alarm";
+ reg = <0x0 0x2800000 0x0 0x10000>;
+ fsl,rcpm-wakeup = <&rcpm 0x0 0x0 0x0 0x0 0x4000 0x0 0x0>;
+ interrupts = <0 44 4>;
+ };
+
usb0: usb@3100000 {
compatible = "snps,dwc3";
reg = <0x0 0x3100000 0x0 0x10000>;
--
2.17.1

2019-08-23 22:57:42

by Biwen Li

[permalink] [raw]
Subject: [3/3] rtc/fsl: support flextimer for SoC LS1021A (ARM32)

Support flextimer for SoC LS1021A (ARM32)

Signed-off-by: Biwen Li <[email protected]>
---
drivers/rtc/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 319bec4bef05..58d8b5f7cfc5 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1324,7 +1324,7 @@ config RTC_DRV_IMXDI

config RTC_DRV_FSL_FTM_ALARM
tristate "Freescale FlexTimer alarm timer"
- depends on ARCH_LAYERSCAPE
+ depends on ARCH_LAYERSCAPE || SOC_LS1021A
select FSL_RCPM
default y
help
--
2.17.1

2019-08-23 23:18:50

by Alexandre Belloni

[permalink] [raw]
Subject: Re: [1/3] rtc/fsl: support flextimer for lx2160a

On 23/08/2019 17:57:38+0800, Biwen Li wrote:
> The patch supports flextimer for lx2160a
>
> Signed-off-by: Biwen Li <[email protected]>
> ---
> drivers/rtc/rtc-fsl-ftm-alarm.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c b/drivers/rtc/rtc-fsl-ftm-alarm.c
> index 4f7259c2d6a3..2b81525f6db8 100644
> --- a/drivers/rtc/rtc-fsl-ftm-alarm.c
> +++ b/drivers/rtc/rtc-fsl-ftm-alarm.c
> @@ -313,6 +313,7 @@ static const struct of_device_id ftm_rtc_match[] = {
> { .compatible = "fsl,ls1088a-ftm-alarm", },
> { .compatible = "fsl,ls208xa-ftm-alarm", },
> { .compatible = "fsl,ls1028a-ftm-alarm", },
> + { .compatible = "fsl,lx2160a-ftm-alarm", },

Couldn't that have been part of the previous patch series?...


--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

2019-08-23 23:27:33

by Alexandre Belloni

[permalink] [raw]
Subject: Re: [1/3] rtc/fsl: support flextimer for lx2160a

On 23/08/2019 17:57:38+0800, Biwen Li wrote:
> The patch supports flextimer for lx2160a
>
> Signed-off-by: Biwen Li <[email protected]>
> ---
> drivers/rtc/rtc-fsl-ftm-alarm.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c b/drivers/rtc/rtc-fsl-ftm-alarm.c
> index 4f7259c2d6a3..2b81525f6db8 100644
> --- a/drivers/rtc/rtc-fsl-ftm-alarm.c
> +++ b/drivers/rtc/rtc-fsl-ftm-alarm.c
> @@ -313,6 +313,7 @@ static const struct of_device_id ftm_rtc_match[] = {
> { .compatible = "fsl,ls1088a-ftm-alarm", },
> { .compatible = "fsl,ls208xa-ftm-alarm", },
> { .compatible = "fsl,ls1028a-ftm-alarm", },
> + { .compatible = "fsl,lx2160a-ftm-alarm", },
> { },
> };

I've squashed it with 3/3 and in the patch adding the driver. I also
added proper documentation.

--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

2019-08-23 23:34:54

by Trent Piepho

[permalink] [raw]
Subject: Re: [1/3] rtc/fsl: support flextimer for lx2160a

On Fri, 2019-08-23 at 17:57 +0800, Biwen Li wrote:
> The patch supports flextimer for lx2160a
>
> Signed-off-by: Biwen Li <[email protected]>
> ---
> drivers/rtc/rtc-fsl-ftm-alarm.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c b/drivers/rtc/rtc-fsl-
> ftm-alarm.c
> index 4f7259c2d6a3..2b81525f6db8 100644
> --- a/drivers/rtc/rtc-fsl-ftm-alarm.c
> +++ b/drivers/rtc/rtc-fsl-ftm-alarm.c
> @@ -313,6 +313,7 @@ static const struct of_device_id ftm_rtc_match[]
> = {
> { .compatible = "fsl,ls1088a-ftm-alarm", },
> { .compatible = "fsl,ls208xa-ftm-alarm", },
> { .compatible = "fsl,ls1028a-ftm-alarm", },
> + { .compatible = "fsl,lx2160a-ftm-alarm", },
> { },
> };
>

Since there's no data associated with each compatible, it doesn't seem
like there's any need to add a new one.

What's normally done is add two compatibles in the dts, the base
version and the specific version, e.g.:

+ rcpm: rcpm@1e34040 {
+ compatible = "fsl,lx2160a-rcpm", "fsl,qoriq-cpm-2.1+";

Or in this case, compatible = "fsl,lx2160a-ftm-alarm", "fsl,ls1088a-ftm-alarm";

Then there's no need to add to the driver list.

2019-08-26 03:52:39

by Biwen Li

[permalink] [raw]
Subject: RE: [EXT] Re: [1/3] rtc/fsl: support flextimer for lx2160a

>
> On Fri, 2019-08-23 at 17:57 +0800, Biwen Li wrote:
> > The patch supports flextimer for lx2160a
> >
> > Signed-off-by: Biwen Li <[email protected]>
> > ---
> > drivers/rtc/rtc-fsl-ftm-alarm.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c b/drivers/rtc/rtc-fsl-
> > ftm-alarm.c index 4f7259c2d6a3..2b81525f6db8 100644
> > --- a/drivers/rtc/rtc-fsl-ftm-alarm.c
> > +++ b/drivers/rtc/rtc-fsl-ftm-alarm.c
> > @@ -313,6 +313,7 @@ static const struct of_device_id ftm_rtc_match[] =
> > {
> > { .compatible = "fsl,ls1088a-ftm-alarm", },
> > { .compatible = "fsl,ls208xa-ftm-alarm", },
> > { .compatible = "fsl,ls1028a-ftm-alarm", },
> > + { .compatible = "fsl,lx2160a-ftm-alarm", },
> > { },
> > };
> >
>
> Since there's no data associated with each compatible, it doesn't seem like
> there's any need to add a new one.
>
> What's normally done is add two compatibles in the dts, the base version and
> the specific version, e.g.:
>
> + rcpm: rcpm@1e34040 {
> + compatible = "fsl,lx2160a-rcpm",
> + "fsl,qoriq-cpm-2.1+";
>
> Or in this case, compatible = "fsl,lx2160a-ftm-alarm", "fsl,ls1088a-ftm-alarm";
>
> Then there's no need to add to the driver list.
Yes, it will be work. But it will be confusing. Is ls1088a same with lx2160a? No.

2019-08-26 04:53:57

by Biwen Li

[permalink] [raw]
Subject: RE: [EXT] Re: [1/3] rtc/fsl: support flextimer for lx2160a

> On 23/08/2019 17:57:38+0800, Biwen Li wrote:
> > The patch supports flextimer for lx2160a
> >
> > Signed-off-by: Biwen Li <[email protected]>
> > ---
> > drivers/rtc/rtc-fsl-ftm-alarm.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c
> > b/drivers/rtc/rtc-fsl-ftm-alarm.c index 4f7259c2d6a3..2b81525f6db8
> > 100644
> > --- a/drivers/rtc/rtc-fsl-ftm-alarm.c
> > +++ b/drivers/rtc/rtc-fsl-ftm-alarm.c
> > @@ -313,6 +313,7 @@ static const struct of_device_id ftm_rtc_match[] = {
> > { .compatible = "fsl,ls1088a-ftm-alarm", },
> > { .compatible = "fsl,ls208xa-ftm-alarm", },
> > { .compatible = "fsl,ls1028a-ftm-alarm", },
> > + { .compatible = "fsl,lx2160a-ftm-alarm", },
> > { },
> > };
>
> I've squashed it with 3/3 and in the patch adding the driver. I also added proper
> documentation.
Alexandre,Ok, thanks.
>
> --
> Alexandre Belloni, Bootlin
> Embedded Linux and Kernel engineering
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbootlin.
> com&amp;data=02%7C01%7Cbiwen.li%40nxp.com%7C7566210e899b40e873
> ff08d727d5b2a3%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6
> 37021671089906922&amp;sdata=9RgT5DBeB0HL5RhP3pI%2FuOglIe8pY3wsp
> 2fPsnwO2iQ%3D&amp;reserved=0

2019-08-26 12:44:39

by Alexandre Belloni

[permalink] [raw]
Subject: Re: [EXT] Re: [1/3] rtc/fsl: support flextimer for lx2160a

On 26/08/2019 03:37:43+0000, Biwen Li wrote:
> >
> > On Fri, 2019-08-23 at 17:57 +0800, Biwen Li wrote:
> > > The patch supports flextimer for lx2160a
> > >
> > > Signed-off-by: Biwen Li <[email protected]>
> > > ---
> > > drivers/rtc/rtc-fsl-ftm-alarm.c | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c b/drivers/rtc/rtc-fsl-
> > > ftm-alarm.c index 4f7259c2d6a3..2b81525f6db8 100644
> > > --- a/drivers/rtc/rtc-fsl-ftm-alarm.c
> > > +++ b/drivers/rtc/rtc-fsl-ftm-alarm.c
> > > @@ -313,6 +313,7 @@ static const struct of_device_id ftm_rtc_match[] =
> > > {
> > > { .compatible = "fsl,ls1088a-ftm-alarm", },
> > > { .compatible = "fsl,ls208xa-ftm-alarm", },
> > > { .compatible = "fsl,ls1028a-ftm-alarm", },
> > > + { .compatible = "fsl,lx2160a-ftm-alarm", },
> > > { },
> > > };
> > >
> >
> > Since there's no data associated with each compatible, it doesn't seem like
> > there's any need to add a new one.
> >
> > What's normally done is add two compatibles in the dts, the base version and
> > the specific version, e.g.:
> >
> > + rcpm: rcpm@1e34040 {
> > + compatible = "fsl,lx2160a-rcpm",
> > + "fsl,qoriq-cpm-2.1+";
> >
> > Or in this case, compatible = "fsl,lx2160a-ftm-alarm", "fsl,ls1088a-ftm-alarm";
> >
> > Then there's no need to add to the driver list.
> Yes, it will be work. But it will be confusing. Is ls1088a same with lx2160a? No.

Well, if you are sure it is the exact same IP that is used, then you
should only use one compatible. We usually use the name of the first SoC
that had the IP. Is it confusing anyone? Probably not because this will
be in a dtsi that nobody will read.

Note that adding so many compatbile will increase the boot time of your
platform and this is annoying many NXP customers of the i.mx line.

--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com