[PATCH v2 0/7] arm64: allwinner: a523: Enable MCU PRCM and NPU

Chen-Yu Tsai posted 7 patches 3 weeks ago
.../clock/allwinner,sun55i-a523-ccu.yaml      |  37 +-
.../arm64/boot/dts/allwinner/sun55i-a523.dtsi |  39 ++
drivers/clk/sunxi-ng/Kconfig                  |   5 +
drivers/clk/sunxi-ng/Makefile                 |   2 +
drivers/clk/sunxi-ng/ccu-sun55i-a523-mcu.c    | 469 ++++++++++++++++++
drivers/clk/sunxi-ng/ccu-sun55i-a523.c        |  21 +-
drivers/clk/sunxi-ng/ccu-sun55i-a523.h        |  14 -
drivers/clk/sunxi-ng/ccu_div.h                |  18 +
include/dt-bindings/clock/sun55i-a523-ccu.h   |   1 +
.../dt-bindings/clock/sun55i-a523-mcu-ccu.h   |  54 ++
.../dt-bindings/reset/sun55i-a523-mcu-ccu.h   |  30 ++
11 files changed, 671 insertions(+), 19 deletions(-)
create mode 100644 drivers/clk/sunxi-ng/ccu-sun55i-a523-mcu.c
delete mode 100644 drivers/clk/sunxi-ng/ccu-sun55i-a523.h
create mode 100644 include/dt-bindings/clock/sun55i-a523-mcu-ccu.h
create mode 100644 include/dt-bindings/reset/sun55i-a523-mcu-ccu.h
[PATCH v2 0/7] arm64: allwinner: a523: Enable MCU PRCM and NPU
Posted by Chen-Yu Tsai 3 weeks ago
From: Chen-Yu Tsai <wens@csie.org>

Hi folks,

This is v2 of my A523 MCU PRCM and NPU support series.

Changes since v1:
- Dropped dual divider clock rate read-back fix that is already merged
- DT binding
  - Moved "r-ahb" clock to the end of the list and added "r-apb0" clock
- Add NPU clk
  - Move .num to after list of clks
- MCU CCU clk driver
  - Added comment for "fixed" dividers in audio PLL clock
  - Corrected variable names for audio PLL divider clocks
  - Added comment for the reversed order of some of the DSP clock's
    parents when compared to the manual
  - Added comments for clocks and resets only found in the BSP driver
  - Corrected register offset for i2s3-asrc and bus-mcu-pwm0 clocks
  - Made "r-ahb" and new "r-apb0" external bus clocks the parents of the
    bus gate clocks, with comments if guessed which one applies
  - Moved .num_clks to after the list of clocks, making it obvious that
    the value needs to be added if more clocks are added to the list
- MCU CCU DT node
  - Enlarged MCU PRCM register range to 0x200
  - Moved "r-ahb" clock to the end of the list and added "r-apb0" clock
- Link to v1
  https://lore.kernel.org/all/20250830170901.1996227-1-wens@kernel.org/


The MCU PRCM is a Power, Reset & Clock Management block that has some
clock and reset controls for the MCU, DSP and some peripherals that the
MCU could use.

The NPU is a Vivante IP block. It is clocked from the NPU PLL from the
main clock unit, but the bus clock and reset controls lie in the MCU
PRCM.

Patch 1 adds the missing NPU module clock to the main clock control
unit's binding.

Patch 2 adds the binding for the MCU PRCM clock control unit

Patch 3 adds the missing NPU module clock.

Patch 4 adds support for power-of-two dividers to the sunxi-ng clk
library.

Patch 5 adds a new driver for the A523 MCU PRCM CCU.

Patch 6 adds a device node for the MCU PRCM CCU.

Patch 7 adds a device node for the NPU.

The NPU was only lightly tested: the driver correctly probes and detects
a model GC9000, revision 9003.

Please have a look. All patches will be merged through the sunxi tree.


Thanks
ChenYu


Chen-Yu Tsai (7):
  dt-bindings: clock: sun55i-a523-ccu: Add missing NPU module clock
  dt-bindings: clock: sun55i-a523-ccu: Add A523 MCU CCU clock controller
  clk: sunxi-ng: sun55i-a523-ccu: Add missing NPU module clock
  clk: sunxi-ng: div: support power-of-two dividers
  clk: sunxi-ng: add support for the A523/T527 MCU CCU
  arm64: dts: allwinner: a523: Add MCU PRCM CCU node
  arm64: dts: allwinner: a523: Add NPU device node

 .../clock/allwinner,sun55i-a523-ccu.yaml      |  37 +-
 .../arm64/boot/dts/allwinner/sun55i-a523.dtsi |  39 ++
 drivers/clk/sunxi-ng/Kconfig                  |   5 +
 drivers/clk/sunxi-ng/Makefile                 |   2 +
 drivers/clk/sunxi-ng/ccu-sun55i-a523-mcu.c    | 469 ++++++++++++++++++
 drivers/clk/sunxi-ng/ccu-sun55i-a523.c        |  21 +-
 drivers/clk/sunxi-ng/ccu-sun55i-a523.h        |  14 -
 drivers/clk/sunxi-ng/ccu_div.h                |  18 +
 include/dt-bindings/clock/sun55i-a523-ccu.h   |   1 +
 .../dt-bindings/clock/sun55i-a523-mcu-ccu.h   |  54 ++
 .../dt-bindings/reset/sun55i-a523-mcu-ccu.h   |  30 ++
 11 files changed, 671 insertions(+), 19 deletions(-)
 create mode 100644 drivers/clk/sunxi-ng/ccu-sun55i-a523-mcu.c
 delete mode 100644 drivers/clk/sunxi-ng/ccu-sun55i-a523.h
 create mode 100644 include/dt-bindings/clock/sun55i-a523-mcu-ccu.h
 create mode 100644 include/dt-bindings/reset/sun55i-a523-mcu-ccu.h

-- 
2.39.5
Re: [PATCH v2 0/7] arm64: allwinner: a523: Enable MCU PRCM and NPU
Posted by Chen-Yu Tsai 2 weeks, 5 days ago
On Fri, 12 Sep 2025 01:47:03 +0800, Chen-Yu Tsai wrote:
> This is v2 of my A523 MCU PRCM and NPU support series.
> 
> Changes since v1:
> - Dropped dual divider clock rate read-back fix that is already merged
> - DT binding
>   - Moved "r-ahb" clock to the end of the list and added "r-apb0" clock
> - Add NPU clk
>   - Move .num to after list of clks
> - MCU CCU clk driver
>   - Added comment for "fixed" dividers in audio PLL clock
>   - Corrected variable names for audio PLL divider clocks
>   - Added comment for the reversed order of some of the DSP clock's
>     parents when compared to the manual
>   - Added comments for clocks and resets only found in the BSP driver
>   - Corrected register offset for i2s3-asrc and bus-mcu-pwm0 clocks
>   - Made "r-ahb" and new "r-apb0" external bus clocks the parents of the
>     bus gate clocks, with comments if guessed which one applies
>   - Moved .num_clks to after the list of clocks, making it obvious that
>     the value needs to be added if more clocks are added to the list
> - MCU CCU DT node
>   - Enlarged MCU PRCM register range to 0x200
>   - Moved "r-ahb" clock to the end of the list and added "r-apb0" clock
> - Link to v1
>   https://lore.kernel.org/all/20250830170901.1996227-1-wens@kernel.org/
> 
> [...]

Applied to sunxi/shared-dt-headers-for-6.18 in local tree, thanks!

[1/7] dt-bindings: clock: sun55i-a523-ccu: Add missing NPU module clock
      commit: e9671ddd82eee96146a7359431a4e1f04ac2b076
[2/7] dt-bindings: clock: sun55i-a523-ccu: Add A523 MCU CCU clock controller
      commit: 0f610e650d4e979490ccfa4c22ca29ca547f41e7
[3/7] clk: sunxi-ng: sun55i-a523-ccu: Add missing NPU module clock
      (no commit info)
[4/7] clk: sunxi-ng: div: support power-of-two dividers
      (no commit info)
[5/7] clk: sunxi-ng: add support for the A523/T527 MCU CCU
      (no commit info)
[6/7] arm64: dts: allwinner: a523: Add MCU PRCM CCU node
      (no commit info)
[7/7] arm64: dts: allwinner: a523: Add NPU device node
      (no commit info)

Best regards,
-- 
Chen-Yu Tsai <wens@csie.org>
Re: [PATCH v2 0/7] arm64: allwinner: a523: Enable MCU PRCM and NPU
Posted by Chen-Yu Tsai 2 weeks, 5 days ago
On Fri, 12 Sep 2025 01:47:03 +0800, Chen-Yu Tsai wrote:
> This is v2 of my A523 MCU PRCM and NPU support series.
> 
> Changes since v1:
> - Dropped dual divider clock rate read-back fix that is already merged
> - DT binding
>   - Moved "r-ahb" clock to the end of the list and added "r-apb0" clock
> - Add NPU clk
>   - Move .num to after list of clks
> - MCU CCU clk driver
>   - Added comment for "fixed" dividers in audio PLL clock
>   - Corrected variable names for audio PLL divider clocks
>   - Added comment for the reversed order of some of the DSP clock's
>     parents when compared to the manual
>   - Added comments for clocks and resets only found in the BSP driver
>   - Corrected register offset for i2s3-asrc and bus-mcu-pwm0 clocks
>   - Made "r-ahb" and new "r-apb0" external bus clocks the parents of the
>     bus gate clocks, with comments if guessed which one applies
>   - Moved .num_clks to after the list of clocks, making it obvious that
>     the value needs to be added if more clocks are added to the list
> - MCU CCU DT node
>   - Enlarged MCU PRCM register range to 0x200
>   - Moved "r-ahb" clock to the end of the list and added "r-apb0" clock
> - Link to v1
>   https://lore.kernel.org/all/20250830170901.1996227-1-wens@kernel.org/
> 
> [...]

Applied to sunxi/clk-for-6.18 in local tree, thanks!

[1/7] dt-bindings: clock: sun55i-a523-ccu: Add missing NPU module clock
      commit: e9671ddd82eee96146a7359431a4e1f04ac2b076
[2/7] dt-bindings: clock: sun55i-a523-ccu: Add A523 MCU CCU clock controller
      commit: 0f610e650d4e979490ccfa4c22ca29ca547f41e7
[3/7] clk: sunxi-ng: sun55i-a523-ccu: Add missing NPU module clock
      commit: 828dea389683d8e1df687fbd4521d391df369437
[4/7] clk: sunxi-ng: div: support power-of-two dividers
      commit: 44293edd013e5ed48060e6a8848c215fd3bf8ce3
[5/7] clk: sunxi-ng: add support for the A523/T527 MCU CCU
      commit: 598e4b6713b54267acc257b3c66a269079ee4d8f
[6/7] arm64: dts: allwinner: a523: Add MCU PRCM CCU node
      (no commit info)
[7/7] arm64: dts: allwinner: a523: Add NPU device node
      (no commit info)

Best regards,
-- 
Chen-Yu Tsai <wens@csie.org>
Re: (subset) [PATCH v2 0/7] arm64: allwinner: a523: Enable MCU PRCM and NPU
Posted by Chen-Yu Tsai 2 weeks, 5 days ago
On Fri, 12 Sep 2025 01:47:03 +0800, Chen-Yu Tsai wrote:
> From: Chen-Yu Tsai <wens@csie.org>
> 
> Hi folks,
> 
> This is v2 of my A523 MCU PRCM and NPU support series.
> 
> Changes since v1:
> - Dropped dual divider clock rate read-back fix that is already merged
> - DT binding
>   - Moved "r-ahb" clock to the end of the list and added "r-apb0" clock
> - Add NPU clk
>   - Move .num to after list of clks
> - MCU CCU clk driver
>   - Added comment for "fixed" dividers in audio PLL clock
>   - Corrected variable names for audio PLL divider clocks
>   - Added comment for the reversed order of some of the DSP clock's
>     parents when compared to the manual
>   - Added comments for clocks and resets only found in the BSP driver
>   - Corrected register offset for i2s3-asrc and bus-mcu-pwm0 clocks
>   - Made "r-ahb" and new "r-apb0" external bus clocks the parents of the
>     bus gate clocks, with comments if guessed which one applies
>   - Moved .num_clks to after the list of clocks, making it obvious that
>     the value needs to be added if more clocks are added to the list
> - MCU CCU DT node
>   - Enlarged MCU PRCM register range to 0x200
>   - Moved "r-ahb" clock to the end of the list and added "r-apb0" clock
> - Link to v1
>   https://lore.kernel.org/all/20250830170901.1996227-1-wens@kernel.org/
> 
> [...]

Applied to sunxi/dt-for-6.18 in local tree, thanks!

[6/7] arm64: dts: allwinner: a523: Add MCU PRCM CCU node
      commit: edd63e54e516b54c0b7071463d6e839445efab68
[7/7] arm64: dts: allwinner: a523: Add NPU device node
      commit: a1845487afd06899502714a3500b60f815d98203

Best regards,
-- 
Chen-Yu Tsai <wens@csie.org>