[PATCH v3 0/4] reset: spacemit: Add support for SpacemiT K3 SoC

Guodong Xu posted 4 patches 2 weeks, 3 days ago
.../bindings/soc/spacemit/spacemit,k1-syscon.yaml  |   8 +-
drivers/reset/Kconfig                              |  12 +-
drivers/reset/Makefile                             |   2 +-
drivers/reset/spacemit/Kconfig                     |  36 ++++
drivers/reset/spacemit/Makefile                    |   5 +
drivers/reset/spacemit/reset-spacemit-common.c     |  77 +++++++
drivers/reset/spacemit/reset-spacemit-common.h     |  42 ++++
.../reset-spacemit-k1.c}                           | 107 +---------
drivers/reset/spacemit/reset-spacemit-k3.c         | 233 +++++++++++++++++++++
include/dt-bindings/reset/spacemit,k3-resets.h     | 171 +++++++++++++++
10 files changed, 583 insertions(+), 110 deletions(-)
[PATCH v3 0/4] reset: spacemit: Add support for SpacemiT K3 SoC
Posted by Guodong Xu 2 weeks, 3 days ago
This series adds support for the reset controller found on the SpacemiT
K3 SoC.

The clock driver changes, which defined new auxiliary device name
patterns for reset on K1 and K3, have been applied to the clock tree.
To facilitate merging, Yixun Lan has created an immutable tag
(spacemit-clkrst-v6.20-3) within his pull request to the clock
subsystem [1]. Hence, the dependencies mentioned in v2 have now
been deblocked, making the reset driver ready to be applied, if it
gets approval from review.

In this version (v3), the entire series has been rebased and tested
on top of the linux-next tag: next-20260119.

General informaiton about the series:

The K3 reset controller shares the same architecture as the K1. To
facilitate support for both and future SoCs, the existing K1 reset
driver is refactored with the following changes:

1. The existing K1 driver is moved to a dedicated 'drivers/reset/spacemit/'
   directory.
2. Common reset operations are extracted into reset-spacemit-common.{c,h}

The K3 driver is implemented using this common infrastructure.

Link: https://lore.kernel.org/linux-clk/20260114060410.3340540-1-yixun.lan@gmail.com/ [1]

Changes in v3:
 - Updated dependency status and base information.
 - Patch 1:
     Add Acked-by from Krzysztof and Alex.
 - Patch 2:
     Removed trailing blank line from Makefile.
 - Patch 1/2/3/4:
     Add Acked-by / Reviewed-by from Alex Elder.

- Link to v2: https://lore.kernel.org/r/20260108-k3-reset-v2-0-457df235efe9@riscstar.com

Changes in v2:
 - Patch 1:
     Update the commit message to explain the why.
     Update the spacemit,k1-syscon.yaml to point to k3 reset IDs
     header file.
 - Patch 3:
     Use dev->driver->owner for the reset controller owner instead of
     THIS_MODULE to fix the module reference counting issue pointed out
     by Krzysztof Kozlowski.
 - Patch 3 and 4:
     Update the K1_AUX_DEV_ID and K3_AUX_DEV_ID macros to a simpler but direct
     form, one benefit is to improve the code readability. More discussion
     can be found in Link [4].
Link to v1: https://lore.kernel.org/r/20251229-k3-reset-v1-0-eda0747bded3@riscstar.com

Signed-off-by: Guodong Xu <guodong@riscstar.com>
---
Guodong Xu (4):
      dt-bindings: soc: spacemit: Add K3 reset support and IDs
      reset: Create subdirectory for SpacemiT drivers
      reset: spacemit: Extract common K1 reset code
      reset: spacemit: Add SpacemiT K3 reset driver

 .../bindings/soc/spacemit/spacemit,k1-syscon.yaml  |   8 +-
 drivers/reset/Kconfig                              |  12 +-
 drivers/reset/Makefile                             |   2 +-
 drivers/reset/spacemit/Kconfig                     |  36 ++++
 drivers/reset/spacemit/Makefile                    |   5 +
 drivers/reset/spacemit/reset-spacemit-common.c     |  77 +++++++
 drivers/reset/spacemit/reset-spacemit-common.h     |  42 ++++
 .../reset-spacemit-k1.c}                           | 107 +---------
 drivers/reset/spacemit/reset-spacemit-k3.c         | 233 +++++++++++++++++++++
 include/dt-bindings/reset/spacemit,k3-resets.h     | 171 +++++++++++++++
 10 files changed, 583 insertions(+), 110 deletions(-)
---
base-commit: 6ada99659c6d6a0cde83e6c0f4ed0ef0ba1867e1
change-id: 20251229-k3-reset-8d9b751ef391

Best regards,
-- 
Guodong Xu <guodong@riscstar.com>
Re: [PATCH v3 0/4] reset: spacemit: Add support for SpacemiT K3 SoC
Posted by Yixun Lan 2 weeks, 1 day ago
Hi Philipp Zabel,

On 19:10 Tue 20 Jan     , Guodong Xu wrote:
> This series adds support for the reset controller found on the SpacemiT
> K3 SoC.
> 
> The clock driver changes, which defined new auxiliary device name
> patterns for reset on K1 and K3, have been applied to the clock tree.
> To facilitate merging, Yixun Lan has created an immutable tag
> (spacemit-clkrst-v6.20-3) within his pull request to the clock
> subsystem [1]. Hence, the dependencies mentioned in v2 have now
> been deblocked, making the reset driver ready to be applied, if it
> gets approval from review.
> 
> In this version (v3), the entire series has been rebased and tested
> on top of the linux-next tag: next-20260119.
> 
> General informaiton about the series:
> 
> The K3 reset controller shares the same architecture as the K1. To
> facilitate support for both and future SoCs, the existing K1 reset
> driver is refactored with the following changes:
> 
> 1. The existing K1 driver is moved to a dedicated 'drivers/reset/spacemit/'
>    directory.
> 2. Common reset operations are extracted into reset-spacemit-common.{c,h}
> 
> The K3 driver is implemented using this common infrastructure.
> 
> Link: https://lore.kernel.org/linux-clk/20260114060410.3340540-1-yixun.lan@gmail.com/ [1]
> 

Just want to ping this with my SpacemiT maintainer position, the reset
driver is the last piece that I hope can be accepted during this merge
window (target the v6.20 release), it would help other drivers since it
is a fundamental dependency..

The clock PR which is a dependency for reset has been pulled by Stephen[2],
and the driver also has been tested for a while locally
https://lore.kernel.org/r/176902257445.4027.5972559722832621691@lazor [2]

Reviewed-by: Yixun Lan <dlan@kernel.org>

-- 
Yixun Lan (dlan)
Re: [PATCH v3 0/4] reset: spacemit: Add support for SpacemiT K3 SoC
Posted by Guodong Xu 2 weeks, 3 days ago
On Tue, Jan 20, 2026 at 7:11 PM Guodong Xu <guodong@riscstar.com> wrote:
>
> This series adds support for the reset controller found on the SpacemiT
> K3 SoC.
>
> The clock driver changes, which defined new auxiliary device name
> patterns for reset on K1 and K3, have been applied to the clock tree.
> To facilitate merging, Yixun Lan has created an immutable tag
> (spacemit-clkrst-v6.20-3) within his pull request to the clock
> subsystem [1]. Hence, the dependencies mentioned in v2 have now

Apologies, I noticed the link [1] referenced was incorrect. Fixed below.

> been deblocked, making the reset driver ready to be applied, if it
> gets approval from review.
>
> In this version (v3), the entire series has been rebased and tested
> on top of the linux-next tag: next-20260119.
>
> General informaiton about the series:
>
> The K3 reset controller shares the same architecture as the K1. To
> facilitate support for both and future SoCs, the existing K1 reset
> driver is refactored with the following changes:
>
> 1. The existing K1 driver is moved to a dedicated 'drivers/reset/spacemit/'
>    directory.
> 2. Common reset operations are extracted into reset-spacemit-common.{c,h}
>
> The K3 driver is implemented using this common infrastructure.
>
> Link: https://lore.kernel.org/linux-clk/20260114060410.3340540-1-yixun.lan@gmail.com/ [1]

Please use this link for the immutable tag reference instead:
Link: https://lore.kernel.org/spacemit/20260114092742-GYC7933267@gentoo.org/ [1]

The code remains unchanged.

Best regards,
Guodong Xu

>
> Changes in v3:
>  - Updated dependency status and base information.
>  - Patch 1:
>      Add Acked-by from Krzysztof and Alex.
>  - Patch 2:
>      Removed trailing blank line from Makefile.
>  - Patch 1/2/3/4:
>      Add Acked-by / Reviewed-by from Alex Elder.
>
> - Link to v2: https://lore.kernel.org/r/20260108-k3-reset-v2-0-457df235efe9@riscstar.com
>
> Changes in v2:
>  - Patch 1:
>      Update the commit message to explain the why.
>      Update the spacemit,k1-syscon.yaml to point to k3 reset IDs
>      header file.
>  - Patch 3:
>      Use dev->driver->owner for the reset controller owner instead of
>      THIS_MODULE to fix the module reference counting issue pointed out
>      by Krzysztof Kozlowski.
>  - Patch 3 and 4:
>      Update the K1_AUX_DEV_ID and K3_AUX_DEV_ID macros to a simpler but direct
>      form, one benefit is to improve the code readability. More discussion
>      can be found in Link [4].
> Link to v1: https://lore.kernel.org/r/20251229-k3-reset-v1-0-eda0747bded3@riscstar.com
>
> Signed-off-by: Guodong Xu <guodong@riscstar.com>
> ---
> Guodong Xu (4):
>       dt-bindings: soc: spacemit: Add K3 reset support and IDs
>       reset: Create subdirectory for SpacemiT drivers
>       reset: spacemit: Extract common K1 reset code
>       reset: spacemit: Add SpacemiT K3 reset driver
>
>  .../bindings/soc/spacemit/spacemit,k1-syscon.yaml  |   8 +-
>  drivers/reset/Kconfig                              |  12 +-
>  drivers/reset/Makefile                             |   2 +-
>  drivers/reset/spacemit/Kconfig                     |  36 ++++
>  drivers/reset/spacemit/Makefile                    |   5 +
>  drivers/reset/spacemit/reset-spacemit-common.c     |  77 +++++++
>  drivers/reset/spacemit/reset-spacemit-common.h     |  42 ++++
>  .../reset-spacemit-k1.c}                           | 107 +---------
>  drivers/reset/spacemit/reset-spacemit-k3.c         | 233 +++++++++++++++++++++
>  include/dt-bindings/reset/spacemit,k3-resets.h     | 171 +++++++++++++++
>  10 files changed, 583 insertions(+), 110 deletions(-)
> ---
> base-commit: 6ada99659c6d6a0cde83e6c0f4ed0ef0ba1867e1
> change-id: 20251229-k3-reset-8d9b751ef391
>
> Best regards,
> --
> Guodong Xu <guodong@riscstar.com>
>