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

Guodong Xu posted 4 patches 1 month ago
There is a newer version of this series
.../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                    |   6 +
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, 584 insertions(+), 110 deletions(-)
[PATCH v2 0/4] reset: spacemit: Add support for SpacemiT K3 SoC
Posted by Guodong Xu 1 month ago
This series adds support for the reset controller found on the SpacemiT
K3 SoC.

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.

This patchset is based on v6.19-rc4 and depends on the K3 clock drirver
patchset [3] and the K1 common clock work [2] and [1]:

Link: https://lore.kernel.org/all/20251219012819.440972-1-inochiama@gmail.com/ [1]
Link: https://lore.kernel.org/lkml/20260108-06-k1-clk-common-v4-0-badf635993d3@gentoo.org/ [2]
Link: https://lore.kernel.org/lkml/20260108-k3-clk-v5-0-42a11b74ad58@gentoo.org/ [3]
Link: https://lore.kernel.org/all/cc1cb833-2c4a-4e20-a50d-109a4919e274@riscstar.com/ [4]

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                    |   6 +
 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, 584 insertions(+), 110 deletions(-)
---
base-commit: f10c325a345fef0a688a2bcdfab1540d1c924148
change-id: 20251229-k3-reset-8d9b751ef391
prerequisite-message-id: <20251219012819.440972-1-inochiama@gmail.com>
prerequisite-patch-id: df430730ed961011cee5c5d47b7ace84b3c5ebb7
prerequisite-patch-id: 64003618c33be925602e46b7543f2c13d3f36474
prerequisite-message-id: <20260108-06-k1-clk-common-v4-0-badf635993d3@gentoo.org>
prerequisite-patch-id: 96cd13293b888c05f400daf529c3cacf17ddf002
prerequisite-patch-id: 5f6579799919c4e2e12c8c836ac4164b00ccaaa3
prerequisite-patch-id: 11e8d5cbe6f3610aa362dc0051b3173001d0a5f4
prerequisite-patch-id: 622d6606913609be04f66006609550e8c3e7f22b
prerequisite-message-id: <20260108-k3-clk-v5-0-42a11b74ad58@gentoo.org>
prerequisite-patch-id: 44a51fa6a6f0f9d2c5b7bf3295f3272d6bb7005a
prerequisite-patch-id: dce85ac6e4e94b1d2622a8231ddab3de766373ff
prerequisite-patch-id: af1fb571f0d19d72e69dd41d15fc2dbd730b17c7
prerequisite-patch-id: 1318bffbbe6044cb4ef0f77c6756ff96d69ecdf3
prerequisite-patch-id: 8856cecc299cdffcd18acf9a7476175a4d65e62e

Best regards,
-- 
Guodong Xu <guodong@riscstar.com>
Re: [PATCH v2 0/4] reset: spacemit: Add support for SpacemiT K3 SoC
Posted by Guodong Xu 3 weeks, 3 days ago
Hi, Philipp

On Thu, Jan 8, 2026 at 10:22 PM Guodong Xu <guodong@riscstar.com> wrote:
> This patchset is based on v6.19-rc4 and depends on the K3 clock drirver
> patchset [3] and the K1 common clock work [2] and [1]:
>
> Link: https://lore.kernel.org/all/20251219012819.440972-1-inochiama@gmail.com/ [1]
> Link: https://lore.kernel.org/lkml/20260108-06-k1-clk-common-v4-0-badf635993d3@gentoo.org/ [2]
> Link: https://lore.kernel.org/lkml/20260108-k3-clk-v5-0-42a11b74ad58@gentoo.org/ [3]

I am writing to update the status of these dependencies.

The clock patches have been accepted and are now present in linux-next
(since next-20260113).

To facilitate the merging of this reset driver, Yixun Lan has created an
immutable tag within his pull request to the clock subsystem. As noted
in his PR [5]:

> Please pull SpacemiT's clock changes for v6.20, This PR basically adds
> support for SpacemiT new K3 SoC, while doing this I've created an immutable
> tag (spacemit-clkrst-v6.20-3) for reset driver in case it also needs to be
> merged during same merge window, otherwise everything is normal.

Since the dependencies are now available via this immutable tag, are there
any further comments on this series, or steps I should take to utilize that
tag for a v3?

Thank you.

Link: https://lore.kernel.org/spacemit/20260114092742-GYC7933267@gentoo.org/ [5]

Best regards,
Guodong




> Link: https://lore.kernel.org/all/cc1cb833-2c4a-4e20-a50d-109a4919e274@riscstar.com/ [4]
>
> 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                    |   6 +
>  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, 584 insertions(+), 110 deletions(-)
> ---
> base-commit: f10c325a345fef0a688a2bcdfab1540d1c924148
> change-id: 20251229-k3-reset-8d9b751ef391
> prerequisite-message-id: <20251219012819.440972-1-inochiama@gmail.com>
> prerequisite-patch-id: df430730ed961011cee5c5d47b7ace84b3c5ebb7
> prerequisite-patch-id: 64003618c33be925602e46b7543f2c13d3f36474
> prerequisite-message-id: <20260108-06-k1-clk-common-v4-0-badf635993d3@gentoo.org>
> prerequisite-patch-id: 96cd13293b888c05f400daf529c3cacf17ddf002
> prerequisite-patch-id: 5f6579799919c4e2e12c8c836ac4164b00ccaaa3
> prerequisite-patch-id: 11e8d5cbe6f3610aa362dc0051b3173001d0a5f4
> prerequisite-patch-id: 622d6606913609be04f66006609550e8c3e7f22b
> prerequisite-message-id: <20260108-k3-clk-v5-0-42a11b74ad58@gentoo.org>
> prerequisite-patch-id: 44a51fa6a6f0f9d2c5b7bf3295f3272d6bb7005a
> prerequisite-patch-id: dce85ac6e4e94b1d2622a8231ddab3de766373ff
> prerequisite-patch-id: af1fb571f0d19d72e69dd41d15fc2dbd730b17c7
> prerequisite-patch-id: 1318bffbbe6044cb4ef0f77c6756ff96d69ecdf3
> prerequisite-patch-id: 8856cecc299cdffcd18acf9a7476175a4d65e62e
>
> Best regards,
> --
> Guodong Xu <guodong@riscstar.com>
>