mbox series

[V2,0/7] rtc: ls2x: Add support for the Loongson-2K/LS7A RTC

Message ID cover.1673227292.git.zhoubinbin@loongson.cn (mailing list archive)
Headers show
Series rtc: ls2x: Add support for the Loongson-2K/LS7A RTC | expand

Message

Binbin Zhou Jan. 9, 2023, 1:35 a.m. UTC
Hi all:

The initial DT-base ls2x rtc driver was written by Wang Xuerui, He has
released five versions of patchset before, and all related mail records
are shown below if you are interested:

https://lore.kernel.org/all/?q=ls2x-rtc

In this series of patches, based on the code above, I have added the
following support:

1. Add ACPI-related support, as Loongson-3A5000 + LS7A is now ACPI-base
   by default under LoongArch architecture;
2. Add rtc alarm/walarm related functions.

I have tested on Loongson-3A5000LA+LS7A1000/LS7A2000, Loongson-2K1000LA
and Loongson-2K0500.

BTW:
There have been discussions about merging the rtc drivers of ls1x and
ls2x, but the following reasons made the merger difficult to achieve:

1. ls1x does not support ACPI, for it is only on MIPS-based system;
2. ls1x does not support alarm function.

Thanks.

-------
Changes since v1:
1. Rebased on top of latest loongarch-next;
2. Add interrupt descriptions to the ls2k and ls7a DTS files to avoid
errors when the driver gets the IRQ number, Thanks to Qing Zhang for
testing;
3. Remove some inexact CONFIG_ACPI.

Binbin Zhou (4):
  rtc: Add support for the Loongson-2K/LS7A RTC
  LoongArch: Enable LS2X RTC in loongson3_defconfig
  MIPS: Loongson64: DTS: Add RTC support to LS7A
  MIPS: Loongson64: DTS: Add RTC support to Loongson-2K

WANG Xuerui (3):
  dt-bindings: rtc: Add Loongson LS2X RTC support
  MIPS: Loongson: Enable LS2X RTC in loongson3_defconfig
  MIPS: Loongson: Enable LS2X RTC in loongson2k_defconfig

 .../devicetree/bindings/rtc/trivial-rtc.yaml  |   2 +
 arch/loongarch/configs/loongson3_defconfig    |   1 +
 .../boot/dts/loongson/loongson64-2k1000.dtsi  |   7 +
 arch/mips/boot/dts/loongson/ls7a-pch.dtsi     |   7 +
 arch/mips/configs/loongson2k_defconfig        |   1 +
 arch/mips/configs/loongson3_defconfig         |   1 +
 drivers/rtc/Kconfig                           |  11 +
 drivers/rtc/Makefile                          |   1 +
 drivers/rtc/rtc-ls2x.c                        | 379 ++++++++++++++++++
 9 files changed, 410 insertions(+)
 create mode 100644 drivers/rtc/rtc-ls2x.c

Comments

Alexandre Belloni Jan. 23, 2023, 11:15 p.m. UTC | #1
On 09/01/2023 09:35:10+0800, Binbin Zhou wrote:
> Hi all:
> 
> The initial DT-base ls2x rtc driver was written by Wang Xuerui, He has
> released five versions of patchset before, and all related mail records
> are shown below if you are interested:
> 
> https://lore.kernel.org/all/?q=ls2x-rtc
> 
> In this series of patches, based on the code above, I have added the
> following support:
> 
> 1. Add ACPI-related support, as Loongson-3A5000 + LS7A is now ACPI-base
>    by default under LoongArch architecture;
> 2. Add rtc alarm/walarm related functions.
> 
> I have tested on Loongson-3A5000LA+LS7A1000/LS7A2000, Loongson-2K1000LA
> and Loongson-2K0500.
> 
> BTW:
> There have been discussions about merging the rtc drivers of ls1x and
> ls2x, but the following reasons made the merger difficult to achieve:
> 
> 1. ls1x does not support ACPI, for it is only on MIPS-based system;

This is not a good justification, you have to support both in your
driver anyway, as shown by your CONFIG_ACPI ifdefery.

> 2. ls1x does not support alarm function.

It is just a matter of clearing a single bit, this is not difficult at
all.

> 
> Thanks.
> 
> -------
> Changes since v1:
> 1. Rebased on top of latest loongarch-next;
> 2. Add interrupt descriptions to the ls2k and ls7a DTS files to avoid
> errors when the driver gets the IRQ number, Thanks to Qing Zhang for
> testing;
> 3. Remove some inexact CONFIG_ACPI.
> 
> Binbin Zhou (4):
>   rtc: Add support for the Loongson-2K/LS7A RTC
>   LoongArch: Enable LS2X RTC in loongson3_defconfig
>   MIPS: Loongson64: DTS: Add RTC support to LS7A
>   MIPS: Loongson64: DTS: Add RTC support to Loongson-2K
> 
> WANG Xuerui (3):
>   dt-bindings: rtc: Add Loongson LS2X RTC support
>   MIPS: Loongson: Enable LS2X RTC in loongson3_defconfig
>   MIPS: Loongson: Enable LS2X RTC in loongson2k_defconfig
> 
>  .../devicetree/bindings/rtc/trivial-rtc.yaml  |   2 +
>  arch/loongarch/configs/loongson3_defconfig    |   1 +
>  .../boot/dts/loongson/loongson64-2k1000.dtsi  |   7 +
>  arch/mips/boot/dts/loongson/ls7a-pch.dtsi     |   7 +
>  arch/mips/configs/loongson2k_defconfig        |   1 +
>  arch/mips/configs/loongson3_defconfig         |   1 +
>  drivers/rtc/Kconfig                           |  11 +
>  drivers/rtc/Makefile                          |   1 +
>  drivers/rtc/rtc-ls2x.c                        | 379 ++++++++++++++++++
>  9 files changed, 410 insertions(+)
>  create mode 100644 drivers/rtc/rtc-ls2x.c
> 
> -- 
> 2.31.1
>
Binbin Zhou Jan. 31, 2023, 12:59 p.m. UTC | #2
Hi Kelvin:

Excuse me.
I am submitting the Loongson-2K/LS7A RTC driver and Alexandre would
like me to merge the ls1x rtc driver in parallel.
Unfortunately I found out that the loongson-1 does not yet support DT
and would like to ask if you have any plans to support DT?

I think this is the prerequisite for the merge.

Regards.


Binbin




On Tue, Jan 24, 2023 at 7:24 AM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
>
> On 09/01/2023 09:35:10+0800, Binbin Zhou wrote:
> > Hi all:
> >
> > The initial DT-base ls2x rtc driver was written by Wang Xuerui, He has
> > released five versions of patchset before, and all related mail records
> > are shown below if you are interested:
> >
> > https://lore.kernel.org/all/?q=ls2x-rtc
> >
> > In this series of patches, based on the code above, I have added the
> > following support:
> >
> > 1. Add ACPI-related support, as Loongson-3A5000 + LS7A is now ACPI-base
> >    by default under LoongArch architecture;
> > 2. Add rtc alarm/walarm related functions.
> >
> > I have tested on Loongson-3A5000LA+LS7A1000/LS7A2000, Loongson-2K1000LA
> > and Loongson-2K0500.
> >
> > BTW:
> > There have been discussions about merging the rtc drivers of ls1x and
> > ls2x, but the following reasons made the merger difficult to achieve:
> >
> > 1. ls1x does not support ACPI, for it is only on MIPS-based system;
>
> This is not a good justification, you have to support both in your
> driver anyway, as shown by your CONFIG_ACPI ifdefery.
>
> > 2. ls1x does not support alarm function.
>
> It is just a matter of clearing a single bit, this is not difficult at
> all.
>
> >
> > Thanks.
> >
> > -------
> > Changes since v1:
> > 1. Rebased on top of latest loongarch-next;
> > 2. Add interrupt descriptions to the ls2k and ls7a DTS files to avoid
> > errors when the driver gets the IRQ number, Thanks to Qing Zhang for
> > testing;
> > 3. Remove some inexact CONFIG_ACPI.
> >
> > Binbin Zhou (4):
> >   rtc: Add support for the Loongson-2K/LS7A RTC
> >   LoongArch: Enable LS2X RTC in loongson3_defconfig
> >   MIPS: Loongson64: DTS: Add RTC support to LS7A
> >   MIPS: Loongson64: DTS: Add RTC support to Loongson-2K
> >
> > WANG Xuerui (3):
> >   dt-bindings: rtc: Add Loongson LS2X RTC support
> >   MIPS: Loongson: Enable LS2X RTC in loongson3_defconfig
> >   MIPS: Loongson: Enable LS2X RTC in loongson2k_defconfig
> >
> >  .../devicetree/bindings/rtc/trivial-rtc.yaml  |   2 +
> >  arch/loongarch/configs/loongson3_defconfig    |   1 +
> >  .../boot/dts/loongson/loongson64-2k1000.dtsi  |   7 +
> >  arch/mips/boot/dts/loongson/ls7a-pch.dtsi     |   7 +
> >  arch/mips/configs/loongson2k_defconfig        |   1 +
> >  arch/mips/configs/loongson3_defconfig         |   1 +
> >  drivers/rtc/Kconfig                           |  11 +
> >  drivers/rtc/Makefile                          |   1 +
> >  drivers/rtc/rtc-ls2x.c                        | 379 ++++++++++++++++++
> >  9 files changed, 410 insertions(+)
> >  create mode 100644 drivers/rtc/rtc-ls2x.c
> >
> > --
> > 2.31.1
> >
>
> --
> Alexandre Belloni, co-owner and COO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
Binbin Zhou Feb. 10, 2023, 10:03 a.m. UTC | #3
On Tue, Jan 31, 2023 at 8:59 PM Binbin Zhou <zhoubb.aaron@gmail.com> wrote:
>
> Hi Kelvin:
>
> Excuse me.
> I am submitting the Loongson-2K/LS7A RTC driver and Alexandre would
> like me to merge the ls1x rtc driver in parallel.
> Unfortunately I found out that the loongson-1 does not yet support DT
> and would like to ask if you have any plans to support DT?
>
> I think this is the prerequisite for the merge.
>
> Regards.
> Binbin
>
>

Hi Alexandre:

Unfortunately there has been no reply from Keguang for the past week
or so. Can we try rtc-ls2x and rtc-ls1x to coexist until Loongson-1
supports DT?
Later on, if Keguang or someone else familiar with Loongson-1 adds DT
support, I would be happy to continue trying to merge the two drivers.

Regards.
Binbin

>
>
> On Tue, Jan 24, 2023 at 7:24 AM Alexandre Belloni
> <alexandre.belloni@bootlin.com> wrote:
> >
> > On 09/01/2023 09:35:10+0800, Binbin Zhou wrote:
> > > Hi all:
> > >
> > > The initial DT-base ls2x rtc driver was written by Wang Xuerui, He has
> > > released five versions of patchset before, and all related mail records
> > > are shown below if you are interested:
> > >
> > > https://lore.kernel.org/all/?q=ls2x-rtc
> > >
> > > In this series of patches, based on the code above, I have added the
> > > following support:
> > >
> > > 1. Add ACPI-related support, as Loongson-3A5000 + LS7A is now ACPI-base
> > >    by default under LoongArch architecture;
> > > 2. Add rtc alarm/walarm related functions.
> > >
> > > I have tested on Loongson-3A5000LA+LS7A1000/LS7A2000, Loongson-2K1000LA
> > > and Loongson-2K0500.
> > >
> > > BTW:
> > > There have been discussions about merging the rtc drivers of ls1x and
> > > ls2x, but the following reasons made the merger difficult to achieve:
> > >
> > > 1. ls1x does not support ACPI, for it is only on MIPS-based system;
> >
> > This is not a good justification, you have to support both in your
> > driver anyway, as shown by your CONFIG_ACPI ifdefery.
> >
> > > 2. ls1x does not support alarm function.
> >
> > It is just a matter of clearing a single bit, this is not difficult at
> > all.
> >
> > >
> > > Thanks.
> > >
> > > -------
> > > Changes since v1:
> > > 1. Rebased on top of latest loongarch-next;
> > > 2. Add interrupt descriptions to the ls2k and ls7a DTS files to avoid
> > > errors when the driver gets the IRQ number, Thanks to Qing Zhang for
> > > testing;
> > > 3. Remove some inexact CONFIG_ACPI.
> > >
> > > Binbin Zhou (4):
> > >   rtc: Add support for the Loongson-2K/LS7A RTC
> > >   LoongArch: Enable LS2X RTC in loongson3_defconfig
> > >   MIPS: Loongson64: DTS: Add RTC support to LS7A
> > >   MIPS: Loongson64: DTS: Add RTC support to Loongson-2K
> > >
> > > WANG Xuerui (3):
> > >   dt-bindings: rtc: Add Loongson LS2X RTC support
> > >   MIPS: Loongson: Enable LS2X RTC in loongson3_defconfig
> > >   MIPS: Loongson: Enable LS2X RTC in loongson2k_defconfig
> > >
> > >  .../devicetree/bindings/rtc/trivial-rtc.yaml  |   2 +
> > >  arch/loongarch/configs/loongson3_defconfig    |   1 +
> > >  .../boot/dts/loongson/loongson64-2k1000.dtsi  |   7 +
> > >  arch/mips/boot/dts/loongson/ls7a-pch.dtsi     |   7 +
> > >  arch/mips/configs/loongson2k_defconfig        |   1 +
> > >  arch/mips/configs/loongson3_defconfig         |   1 +
> > >  drivers/rtc/Kconfig                           |  11 +
> > >  drivers/rtc/Makefile                          |   1 +
> > >  drivers/rtc/rtc-ls2x.c                        | 379 ++++++++++++++++++
> > >  9 files changed, 410 insertions(+)
> > >  create mode 100644 drivers/rtc/rtc-ls2x.c
> > >
> > > --
> > > 2.31.1
> > >
> >
> > --
> > Alexandre Belloni, co-owner and COO, Bootlin
> > Embedded Linux and Kernel engineering
> > https://bootlin.com
> >
Alexandre Belloni Feb. 14, 2023, 11:17 p.m. UTC | #4
On 10/02/2023 18:03:07+0800, Binbin Zhou wrote:
> On Tue, Jan 31, 2023 at 8:59 PM Binbin Zhou <zhoubb.aaron@gmail.com> wrote:
> >
> > Hi Kelvin:
> >
> > Excuse me.
> > I am submitting the Loongson-2K/LS7A RTC driver and Alexandre would
> > like me to merge the ls1x rtc driver in parallel.
> > Unfortunately I found out that the loongson-1 does not yet support DT
> > and would like to ask if you have any plans to support DT?
> >
> > I think this is the prerequisite for the merge.
> >
> > Regards.
> > Binbin
> >
> >
> 
> Hi Alexandre:
> 
> Unfortunately there has been no reply from Keguang for the past week
> or so. Can we try rtc-ls2x and rtc-ls1x to coexist until Loongson-1
> supports DT?
> Later on, if Keguang or someone else familiar with Loongson-1 adds DT
> support, I would be happy to continue trying to merge the two drivers.
> 

My point is exactly that if nobody in Loongson wants to maintain
rtc-ls1x, we may just drop it. This also probably tells a lot about how
rtc-ls2x is going to be maintained once upstreamed...

> Regards.
> Binbin
> 
> >
> >
> > On Tue, Jan 24, 2023 at 7:24 AM Alexandre Belloni
> > <alexandre.belloni@bootlin.com> wrote:
> > >
> > > On 09/01/2023 09:35:10+0800, Binbin Zhou wrote:
> > > > Hi all:
> > > >
> > > > The initial DT-base ls2x rtc driver was written by Wang Xuerui, He has
> > > > released five versions of patchset before, and all related mail records
> > > > are shown below if you are interested:
> > > >
> > > > https://lore.kernel.org/all/?q=ls2x-rtc
> > > >
> > > > In this series of patches, based on the code above, I have added the
> > > > following support:
> > > >
> > > > 1. Add ACPI-related support, as Loongson-3A5000 + LS7A is now ACPI-base
> > > >    by default under LoongArch architecture;
> > > > 2. Add rtc alarm/walarm related functions.
> > > >
> > > > I have tested on Loongson-3A5000LA+LS7A1000/LS7A2000, Loongson-2K1000LA
> > > > and Loongson-2K0500.
> > > >
> > > > BTW:
> > > > There have been discussions about merging the rtc drivers of ls1x and
> > > > ls2x, but the following reasons made the merger difficult to achieve:
> > > >
> > > > 1. ls1x does not support ACPI, for it is only on MIPS-based system;
> > >
> > > This is not a good justification, you have to support both in your
> > > driver anyway, as shown by your CONFIG_ACPI ifdefery.
> > >
> > > > 2. ls1x does not support alarm function.
> > >
> > > It is just a matter of clearing a single bit, this is not difficult at
> > > all.
> > >
> > > >
> > > > Thanks.
> > > >
> > > > -------
> > > > Changes since v1:
> > > > 1. Rebased on top of latest loongarch-next;
> > > > 2. Add interrupt descriptions to the ls2k and ls7a DTS files to avoid
> > > > errors when the driver gets the IRQ number, Thanks to Qing Zhang for
> > > > testing;
> > > > 3. Remove some inexact CONFIG_ACPI.
> > > >
> > > > Binbin Zhou (4):
> > > >   rtc: Add support for the Loongson-2K/LS7A RTC
> > > >   LoongArch: Enable LS2X RTC in loongson3_defconfig
> > > >   MIPS: Loongson64: DTS: Add RTC support to LS7A
> > > >   MIPS: Loongson64: DTS: Add RTC support to Loongson-2K
> > > >
> > > > WANG Xuerui (3):
> > > >   dt-bindings: rtc: Add Loongson LS2X RTC support
> > > >   MIPS: Loongson: Enable LS2X RTC in loongson3_defconfig
> > > >   MIPS: Loongson: Enable LS2X RTC in loongson2k_defconfig
> > > >
> > > >  .../devicetree/bindings/rtc/trivial-rtc.yaml  |   2 +
> > > >  arch/loongarch/configs/loongson3_defconfig    |   1 +
> > > >  .../boot/dts/loongson/loongson64-2k1000.dtsi  |   7 +
> > > >  arch/mips/boot/dts/loongson/ls7a-pch.dtsi     |   7 +
> > > >  arch/mips/configs/loongson2k_defconfig        |   1 +
> > > >  arch/mips/configs/loongson3_defconfig         |   1 +
> > > >  drivers/rtc/Kconfig                           |  11 +
> > > >  drivers/rtc/Makefile                          |   1 +
> > > >  drivers/rtc/rtc-ls2x.c                        | 379 ++++++++++++++++++
> > > >  9 files changed, 410 insertions(+)
> > > >  create mode 100644 drivers/rtc/rtc-ls2x.c
> > > >
> > > > --
> > > > 2.31.1
> > > >
> > >
> > > --
> > > Alexandre Belloni, co-owner and COO, Bootlin
> > > Embedded Linux and Kernel engineering
> > > https://bootlin.com
> > >
Keguang Zhang Feb. 15, 2023, 2:16 a.m. UTC | #5
Hi Alexandre,
I will maintain rtc-ls1x continuously.
And I'm adding DT support for it.

On Wed, Feb 15, 2023 at 7:18 AM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
>
> On 10/02/2023 18:03:07+0800, Binbin Zhou wrote:
> > On Tue, Jan 31, 2023 at 8:59 PM Binbin Zhou <zhoubb.aaron@gmail.com> wrote:
> > >
> > > Hi Kelvin:
> > >
> > > Excuse me.
> > > I am submitting the Loongson-2K/LS7A RTC driver and Alexandre would
> > > like me to merge the ls1x rtc driver in parallel.
> > > Unfortunately I found out that the loongson-1 does not yet support DT
> > > and would like to ask if you have any plans to support DT?
> > >
> > > I think this is the prerequisite for the merge.
> > >
> > > Regards.
> > > Binbin
> > >
> > >
> >
> > Hi Alexandre:
> >
> > Unfortunately there has been no reply from Keguang for the past week
> > or so. Can we try rtc-ls2x and rtc-ls1x to coexist until Loongson-1
> > supports DT?
> > Later on, if Keguang or someone else familiar with Loongson-1 adds DT
> > support, I would be happy to continue trying to merge the two drivers.
> >
>
> My point is exactly that if nobody in Loongson wants to maintain
> rtc-ls1x, we may just drop it. This also probably tells a lot about how
> rtc-ls2x is going to be maintained once upstreamed...
>
> > Regards.
> > Binbin
> >
> > >
> > >
> > > On Tue, Jan 24, 2023 at 7:24 AM Alexandre Belloni
> > > <alexandre.belloni@bootlin.com> wrote:
> > > >
> > > > On 09/01/2023 09:35:10+0800, Binbin Zhou wrote:
> > > > > Hi all:
> > > > >
> > > > > The initial DT-base ls2x rtc driver was written by Wang Xuerui, He has
> > > > > released five versions of patchset before, and all related mail records
> > > > > are shown below if you are interested:
> > > > >
> > > > > https://lore.kernel.org/all/?q=ls2x-rtc
> > > > >
> > > > > In this series of patches, based on the code above, I have added the
> > > > > following support:
> > > > >
> > > > > 1. Add ACPI-related support, as Loongson-3A5000 + LS7A is now ACPI-base
> > > > >    by default under LoongArch architecture;
> > > > > 2. Add rtc alarm/walarm related functions.
> > > > >
> > > > > I have tested on Loongson-3A5000LA+LS7A1000/LS7A2000, Loongson-2K1000LA
> > > > > and Loongson-2K0500.
> > > > >
> > > > > BTW:
> > > > > There have been discussions about merging the rtc drivers of ls1x and
> > > > > ls2x, but the following reasons made the merger difficult to achieve:
> > > > >
> > > > > 1. ls1x does not support ACPI, for it is only on MIPS-based system;
> > > >
> > > > This is not a good justification, you have to support both in your
> > > > driver anyway, as shown by your CONFIG_ACPI ifdefery.
> > > >
> > > > > 2. ls1x does not support alarm function.
> > > >
> > > > It is just a matter of clearing a single bit, this is not difficult at
> > > > all.
> > > >
> > > > >
> > > > > Thanks.
> > > > >
> > > > > -------
> > > > > Changes since v1:
> > > > > 1. Rebased on top of latest loongarch-next;
> > > > > 2. Add interrupt descriptions to the ls2k and ls7a DTS files to avoid
> > > > > errors when the driver gets the IRQ number, Thanks to Qing Zhang for
> > > > > testing;
> > > > > 3. Remove some inexact CONFIG_ACPI.
> > > > >
> > > > > Binbin Zhou (4):
> > > > >   rtc: Add support for the Loongson-2K/LS7A RTC
> > > > >   LoongArch: Enable LS2X RTC in loongson3_defconfig
> > > > >   MIPS: Loongson64: DTS: Add RTC support to LS7A
> > > > >   MIPS: Loongson64: DTS: Add RTC support to Loongson-2K
> > > > >
> > > > > WANG Xuerui (3):
> > > > >   dt-bindings: rtc: Add Loongson LS2X RTC support
> > > > >   MIPS: Loongson: Enable LS2X RTC in loongson3_defconfig
> > > > >   MIPS: Loongson: Enable LS2X RTC in loongson2k_defconfig
> > > > >
> > > > >  .../devicetree/bindings/rtc/trivial-rtc.yaml  |   2 +
> > > > >  arch/loongarch/configs/loongson3_defconfig    |   1 +
> > > > >  .../boot/dts/loongson/loongson64-2k1000.dtsi  |   7 +
> > > > >  arch/mips/boot/dts/loongson/ls7a-pch.dtsi     |   7 +
> > > > >  arch/mips/configs/loongson2k_defconfig        |   1 +
> > > > >  arch/mips/configs/loongson3_defconfig         |   1 +
> > > > >  drivers/rtc/Kconfig                           |  11 +
> > > > >  drivers/rtc/Makefile                          |   1 +
> > > > >  drivers/rtc/rtc-ls2x.c                        | 379 ++++++++++++++++++
> > > > >  9 files changed, 410 insertions(+)
> > > > >  create mode 100644 drivers/rtc/rtc-ls2x.c
> > > > >
> > > > > --
> > > > > 2.31.1
> > > > >
> > > >
> > > > --
> > > > Alexandre Belloni, co-owner and COO, Bootlin
> > > > Embedded Linux and Kernel engineering
> > > > https://bootlin.com
> > > >
>
> --
> Alexandre Belloni, co-owner and COO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com