[PATCH v11 0/6] reset: spacemit: add K1 reset support

Alex Elder posted 6 patches 3 months, 4 weeks ago
There is a newer version of this series
.../soc/spacemit/spacemit,k1-syscon.yaml      |  29 +-
arch/riscv/boot/dts/spacemit/k1.dtsi          |  18 ++
drivers/clk/spacemit/Kconfig                  |   1 +
drivers/clk/spacemit/ccu-k1.c                 | 239 +++++++-------
drivers/reset/Kconfig                         |   9 +
drivers/reset/Makefile                        |   1 +
drivers/reset/reset-spacemit.c                | 304 ++++++++++++++++++
.../dt-bindings/clock/spacemit,k1-syscon.h    | 141 ++++++++
include/soc/spacemit/k1-syscon.h              | 160 +++++++++
9 files changed, 775 insertions(+), 127 deletions(-)
create mode 100644 drivers/reset/reset-spacemit.c
create mode 100644 include/soc/spacemit/k1-syscon.h
[PATCH v11 0/6] reset: spacemit: add K1 reset support
Posted by Alex Elder 3 months, 4 weeks ago
This series adds reset controller support for the SpacemiT K1 SoC.
A SpacemiT reset controller is implemented as an auxiliary device
associated with a clock controller (CCU).  A new header file
holds definitions used by both the clock and reset drivers.

In this version several "multi-bit" resets have been redefined as
individual ones.  For example, RESET_AUDIO had a mask that included
3 bits.  Now there are 3 separate resets (one for each bit):
RESET_AUDIO_SYS; RESET_AUDIO_MCU_CORE; and RESET_AUDIO_APMU.

The reset symbols affected (their previous names) are:
    RESET_USB3_0 ->
      RESET_USB30_AHB,  RESET_USB30_VCC, RESET_USB30_PHY 
    RESET_AUDIO ->
      RESET_AUDIO_SYS, RESET_AUDIO_MCU, RESET_AUDIO_APMU
    RESET_PCIE0 ->
      RESET_PCI0_DBI, RESET_PCI0_SLV, RESET_PCI0_MSTR, RESET_PCI0_GLB
    RESET_PCIE1 ->
      RESET_PCI1_DBI, RESET_PCI1_SLV, RESET_PCI1_MSTR, RESET_PCI1_GLB
    RESET_PCIE2 ->
      RESET_PCI2_DBI, RESET_PCI2_SLV, RESET_PCI2_MSTR, RESET_PCI2_GLB

No other code has changed since v10.

All of these patches are available here:
  https://github.com/riscstar/linux/tree/outgoing/reset-v11

					-Alex

Between version 10 and version 11:
  - Rebased onto Linux v6.16-rc1
  - Redefined several "multi-bit" resets as individual ones.

Here is version 10 of this series.
  https://lore.kernel.org/lkml/20250513215345.3631593-1-elder@riscstar.com/

All other history is available via that link, so I won't reproduce
it again here.

Alex Elder (6):
  dt-bindings: soc: spacemit: define spacemit,k1-ccu resets
  soc: spacemit: create a header for clock/reset registers
  clk: spacemit: set up reset auxiliary devices
  clk: spacemit: define three reset-only CCUs
  reset: spacemit: add support for SpacemiT CCU resets
  riscv: dts: spacemit: add reset support for the K1 SoC

 .../soc/spacemit/spacemit,k1-syscon.yaml      |  29 +-
 arch/riscv/boot/dts/spacemit/k1.dtsi          |  18 ++
 drivers/clk/spacemit/Kconfig                  |   1 +
 drivers/clk/spacemit/ccu-k1.c                 | 239 +++++++-------
 drivers/reset/Kconfig                         |   9 +
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-spacemit.c                | 304 ++++++++++++++++++
 .../dt-bindings/clock/spacemit,k1-syscon.h    | 141 ++++++++
 include/soc/spacemit/k1-syscon.h              | 160 +++++++++
 9 files changed, 775 insertions(+), 127 deletions(-)
 create mode 100644 drivers/reset/reset-spacemit.c
 create mode 100644 include/soc/spacemit/k1-syscon.h


base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
-- 
2.45.2
Re: [PATCH v11 0/6] reset: spacemit: add K1 reset support
Posted by Yixun Lan 3 months, 3 weeks ago
Hi ALL,
  As the reset driver going through several review cycles,
it becomes quite calm down now, I'd like to request to merge
it into v6.17, because various drivers (pwm, emac..) will depend
on it, even in the worst case if there is problem, I believe Alex
will help to address..

Hi Philipp,
  I'd like to query if you willing to take the reset driver -
patch [5/6] through the reset tree? It sounds more intuitive,
which also will avoid potential conflicts with Kconfig/Makefile..
  I've created a prerequisite immutable tag which could be
shared between clock and reset subsytem. It's tag -
spacemit-reset-deps-for-6.17 at SpacemiT's SoC tree [1], which 
effectively are patches [1-4] of this series.
But, to make your life easy, I've also applied patch [5/6] at tag
spacemit-reset-drv-for-6.17 [2] which has a small macro adjustment
requested by Alex at [3]
  Let me know what you think of this, thanks


Link: https://github.com/spacemit-com/linux/releases/tag/spacemit-reset-deps-for-6.17 [1]
Link: https://github.com/spacemit-com/linux/releases/tag/spacemit-reset-drv-for-6.17 [2]
Link: https://lore.kernel.org/all/528522d9-0467-428c-820a-9e9c8a6166e7@riscstar.com/ [3]

On 20:11 Thu 12 Jun     , Alex Elder wrote:
> This series adds reset controller support for the SpacemiT K1 SoC.
> A SpacemiT reset controller is implemented as an auxiliary device
> associated with a clock controller (CCU).  A new header file
> holds definitions used by both the clock and reset drivers.
> 
> In this version several "multi-bit" resets have been redefined as
> individual ones.  For example, RESET_AUDIO had a mask that included
> 3 bits.  Now there are 3 separate resets (one for each bit):
> RESET_AUDIO_SYS; RESET_AUDIO_MCU_CORE; and RESET_AUDIO_APMU.
> 
> The reset symbols affected (their previous names) are:
>     RESET_USB3_0 ->
>       RESET_USB30_AHB,  RESET_USB30_VCC, RESET_USB30_PHY 
>     RESET_AUDIO ->
>       RESET_AUDIO_SYS, RESET_AUDIO_MCU, RESET_AUDIO_APMU
>     RESET_PCIE0 ->
>       RESET_PCI0_DBI, RESET_PCI0_SLV, RESET_PCI0_MSTR, RESET_PCI0_GLB
>     RESET_PCIE1 ->
>       RESET_PCI1_DBI, RESET_PCI1_SLV, RESET_PCI1_MSTR, RESET_PCI1_GLB
>     RESET_PCIE2 ->
>       RESET_PCI2_DBI, RESET_PCI2_SLV, RESET_PCI2_MSTR, RESET_PCI2_GLB
> 
> No other code has changed since v10.
> 
> All of these patches are available here:
>   https://github.com/riscstar/linux/tree/outgoing/reset-v11
> 
> 					-Alex
> 
> Between version 10 and version 11:
>   - Rebased onto Linux v6.16-rc1
>   - Redefined several "multi-bit" resets as individual ones.
> 
> Here is version 10 of this series.
>   https://lore.kernel.org/lkml/20250513215345.3631593-1-elder@riscstar.com/
> 
> All other history is available via that link, so I won't reproduce
> it again here.
> 
> Alex Elder (6):
>   dt-bindings: soc: spacemit: define spacemit,k1-ccu resets
>   soc: spacemit: create a header for clock/reset registers
>   clk: spacemit: set up reset auxiliary devices
>   clk: spacemit: define three reset-only CCUs
>   reset: spacemit: add support for SpacemiT CCU resets
>   riscv: dts: spacemit: add reset support for the K1 SoC
> 
>  .../soc/spacemit/spacemit,k1-syscon.yaml      |  29 +-
>  arch/riscv/boot/dts/spacemit/k1.dtsi          |  18 ++
>  drivers/clk/spacemit/Kconfig                  |   1 +
>  drivers/clk/spacemit/ccu-k1.c                 | 239 +++++++-------
>  drivers/reset/Kconfig                         |   9 +
>  drivers/reset/Makefile                        |   1 +
>  drivers/reset/reset-spacemit.c                | 304 ++++++++++++++++++
>  .../dt-bindings/clock/spacemit,k1-syscon.h    | 141 ++++++++
>  include/soc/spacemit/k1-syscon.h              | 160 +++++++++
>  9 files changed, 775 insertions(+), 127 deletions(-)
>  create mode 100644 drivers/reset/reset-spacemit.c
>  create mode 100644 include/soc/spacemit/k1-syscon.h
> 
> 
> base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
> -- 
> 2.45.2
> 

-- 
Yixun Lan (dlan)
Re: [PATCH v11 0/6] reset: spacemit: add K1 reset support
Posted by Yixun Lan 3 months, 1 week ago
Hi Philipp,

On 11:17 Wed 18 Jun     , Yixun Lan wrote:
> Hi ALL,
>   As the reset driver going through several review cycles,
> it becomes quite calm down now, I'd like to request to merge
> it into v6.17, because various drivers (pwm, emac..) will depend
> on it, even in the worst case if there is problem, I believe Alex
> will help to address..
> 
> Hi Philipp,
>   I'd like to query if you willing to take the reset driver -
> patch [5/6] through the reset tree? It sounds more intuitive,
> which also will avoid potential conflicts with Kconfig/Makefile..
>   I've created a prerequisite immutable tag which could be
> shared between clock and reset subsytem. It's tag -
> spacemit-reset-deps-for-6.17 at SpacemiT's SoC tree [1], which 
> effectively are patches [1-4] of this series.
> But, to make your life easy, I've also applied patch [5/6] at tag
> spacemit-reset-drv-for-6.17 [2] which has a small macro adjustment
> requested by Alex at [3]
>   Let me know what you think of this, thanks
> 
Just want to ping this, what do you want from my side to proceed?

or do you want me to send a more formal Pull-Request for [1],
then you can apply patch [5/6] (still need to fix the macro of [3])


> 
> Link: https://github.com/spacemit-com/linux/releases/tag/spacemit-reset-deps-for-6.17 [1]
> Link: https://github.com/spacemit-com/linux/releases/tag/spacemit-reset-drv-for-6.17 [2]
> Link: https://lore.kernel.org/all/528522d9-0467-428c-820a-9e9c8a6166e7@riscstar.com/ [3]
> 
> On 20:11 Thu 12 Jun     , Alex Elder wrote:
> > This series adds reset controller support for the SpacemiT K1 SoC.
> > A SpacemiT reset controller is implemented as an auxiliary device
> > associated with a clock controller (CCU).  A new header file
> > holds definitions used by both the clock and reset drivers.
> > 
> > In this version several "multi-bit" resets have been redefined as
> > individual ones.  For example, RESET_AUDIO had a mask that included
> > 3 bits.  Now there are 3 separate resets (one for each bit):
> > RESET_AUDIO_SYS; RESET_AUDIO_MCU_CORE; and RESET_AUDIO_APMU.
> > 
> > The reset symbols affected (their previous names) are:
> >     RESET_USB3_0 ->
> >       RESET_USB30_AHB,  RESET_USB30_VCC, RESET_USB30_PHY 
> >     RESET_AUDIO ->
> >       RESET_AUDIO_SYS, RESET_AUDIO_MCU, RESET_AUDIO_APMU
> >     RESET_PCIE0 ->
> >       RESET_PCI0_DBI, RESET_PCI0_SLV, RESET_PCI0_MSTR, RESET_PCI0_GLB
> >     RESET_PCIE1 ->
> >       RESET_PCI1_DBI, RESET_PCI1_SLV, RESET_PCI1_MSTR, RESET_PCI1_GLB
> >     RESET_PCIE2 ->
> >       RESET_PCI2_DBI, RESET_PCI2_SLV, RESET_PCI2_MSTR, RESET_PCI2_GLB
> > 
> > No other code has changed since v10.
> > 
> > All of these patches are available here:
> >   https://github.com/riscstar/linux/tree/outgoing/reset-v11
> > 
> > 					-Alex
> > 
> > Between version 10 and version 11:
> >   - Rebased onto Linux v6.16-rc1
> >   - Redefined several "multi-bit" resets as individual ones.
> > 
> > Here is version 10 of this series.
> >   https://lore.kernel.org/lkml/20250513215345.3631593-1-elder@riscstar.com/
> > 
> > All other history is available via that link, so I won't reproduce
> > it again here.
> > 
> > Alex Elder (6):
> >   dt-bindings: soc: spacemit: define spacemit,k1-ccu resets
> >   soc: spacemit: create a header for clock/reset registers
> >   clk: spacemit: set up reset auxiliary devices
> >   clk: spacemit: define three reset-only CCUs
> >   reset: spacemit: add support for SpacemiT CCU resets
> >   riscv: dts: spacemit: add reset support for the K1 SoC
> > 
> >  .../soc/spacemit/spacemit,k1-syscon.yaml      |  29 +-
> >  arch/riscv/boot/dts/spacemit/k1.dtsi          |  18 ++
> >  drivers/clk/spacemit/Kconfig                  |   1 +
> >  drivers/clk/spacemit/ccu-k1.c                 | 239 +++++++-------
> >  drivers/reset/Kconfig                         |   9 +
> >  drivers/reset/Makefile                        |   1 +
> >  drivers/reset/reset-spacemit.c                | 304 ++++++++++++++++++
> >  .../dt-bindings/clock/spacemit,k1-syscon.h    | 141 ++++++++
> >  include/soc/spacemit/k1-syscon.h              | 160 +++++++++
> >  9 files changed, 775 insertions(+), 127 deletions(-)
> >  create mode 100644 drivers/reset/reset-spacemit.c
> >  create mode 100644 include/soc/spacemit/k1-syscon.h
> > 
> > 
> > base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
> > -- 
> > 2.45.2
> > 
> 
> -- 
> Yixun Lan (dlan)

-- 
Yixun Lan (dlan)
Re: [PATCH v11 0/6] reset: spacemit: add K1 reset support
Posted by Philipp Zabel 3 months, 1 week ago
On Mi, 2025-07-02 at 06:17 +0000, Yixun Lan wrote:
> Hi Philipp,
> 
> On 11:17 Wed 18 Jun     , Yixun Lan wrote:
> > Hi ALL,
> >   As the reset driver going through several review cycles,
> > it becomes quite calm down now, I'd like to request to merge
> > it into v6.17, because various drivers (pwm, emac..) will depend
> > on it, even in the worst case if there is problem, I believe Alex
> > will help to address..
> > 
> > Hi Philipp,
> >   I'd like to query if you willing to take the reset driver -
> > patch [5/6] through the reset tree? It sounds more intuitive,
> > which also will avoid potential conflicts with Kconfig/Makefile..
> >   I've created a prerequisite immutable tag which could be
> > shared between clock and reset subsytem. It's tag -
> > spacemit-reset-deps-for-6.17 at SpacemiT's SoC tree [1], which 
> > effectively are patches [1-4] of this series.
> > But, to make your life easy, I've also applied patch [5/6] at tag
> > spacemit-reset-drv-for-6.17 [2] which has a small macro adjustment
> > requested by Alex at [3]
> >   Let me know what you think of this, thanks
> > 
> Just want to ping this, what do you want from my side to proceed?
> 
> or do you want me to send a more formal Pull-Request for [1],
> then you can apply patch [5/6] (still need to fix the macro of [3])

Please send a v12, so that the latest modifications are on the list.

I'd prefer to either pick patches 1 and 5 from the list, or, if you
provide a tag with only patch 1 to be pulled into both clk and reset
trees, to merge that and then pick patch 5.

regards
Philipp
Re: [PATCH v11 0/6] reset: spacemit: add K1 reset support
Posted by Yixun Lan 3 months, 1 week ago
Hi Philipp,

On 12:14 Wed 02 Jul     , Philipp Zabel wrote:
> On Mi, 2025-07-02 at 06:17 +0000, Yixun Lan wrote:
> > Hi Philipp,
> > 
> > On 11:17 Wed 18 Jun     , Yixun Lan wrote:
> > > Hi ALL,
> > >   As the reset driver going through several review cycles,
> > > it becomes quite calm down now, I'd like to request to merge
> > > it into v6.17, because various drivers (pwm, emac..) will depend
> > > on it, even in the worst case if there is problem, I believe Alex
> > > will help to address..
> > > 
> > > Hi Philipp,
> > >   I'd like to query if you willing to take the reset driver -
> > > patch [5/6] through the reset tree? It sounds more intuitive,
> > > which also will avoid potential conflicts with Kconfig/Makefile..
> > >   I've created a prerequisite immutable tag which could be
> > > shared between clock and reset subsytem. It's tag -
> > > spacemit-reset-deps-for-6.17 at SpacemiT's SoC tree [1], which 
> > > effectively are patches [1-4] of this series.
> > > But, to make your life easy, I've also applied patch [5/6] at tag
> > > spacemit-reset-drv-for-6.17 [2] which has a small macro adjustment
> > > requested by Alex at [3]
> > >   Let me know what you think of this, thanks
> > > 
> > Just want to ping this, what do you want from my side to proceed?
> > 
> > or do you want me to send a more formal Pull-Request for [1],
> > then you can apply patch [5/6] (still need to fix the macro of [3])
> 
> Please send a v12, so that the latest modifications are on the list.
> 
> I'd prefer to either pick patches 1 and 5 from the list, or, if you
> provide a tag with only patch 1 to be pulled into both clk and reset
> trees, to merge that and then pick patch 5.
> 
I will prepare a tag of only patch 1, and leave you to pick patch 5.

So in this way, I can handle the reset - take patch 2-4 via clk tree,
and patch 6 via SoC tree..

I've sent a PR here
 https://lore.kernel.org/all/20250703151823-GYA312602@gentoo/ 

-- 
Yixun Lan (dlan)
Re: [PATCH v11 0/6] reset: spacemit: add K1 reset support
Posted by Alex Elder 3 months, 1 week ago
On 7/2/25 5:14 AM, Philipp Zabel wrote:
> On Mi, 2025-07-02 at 06:17 +0000, Yixun Lan wrote:
>> Hi Philipp,
>>
>> On 11:17 Wed 18 Jun     , Yixun Lan wrote:
>>> Hi ALL,
>>>    As the reset driver going through several review cycles,
>>> it becomes quite calm down now, I'd like to request to merge
>>> it into v6.17, because various drivers (pwm, emac..) will depend
>>> on it, even in the worst case if there is problem, I believe Alex
>>> will help to address..
>>>
>>> Hi Philipp,
>>>    I'd like to query if you willing to take the reset driver -
>>> patch [5/6] through the reset tree? It sounds more intuitive,
>>> which also will avoid potential conflicts with Kconfig/Makefile..
>>>    I've created a prerequisite immutable tag which could be
>>> shared between clock and reset subsytem. It's tag -
>>> spacemit-reset-deps-for-6.17 at SpacemiT's SoC tree [1], which
>>> effectively are patches [1-4] of this series.
>>> But, to make your life easy, I've also applied patch [5/6] at tag
>>> spacemit-reset-drv-for-6.17 [2] which has a small macro adjustment
>>> requested by Alex at [3]
>>>    Let me know what you think of this, thanks
>>>
>> Just want to ping this, what do you want from my side to proceed?
>>
>> or do you want me to send a more formal Pull-Request for [1],
>> then you can apply patch [5/6] (still need to fix the macro of [3])
> 
> Please send a v12, so that the latest modifications are on the list.
> 
> I'd prefer to either pick patches 1 and 5 from the list, or, if you
> provide a tag with only patch 1 to be pulled into both clk and reset
> trees, to merge that and then pick patch 5.

I will send v12 this morning.	-Alex


> regards
> Philipp