mbox series

[v13,00/10] Introduce Nuvoton ma35d1 SoC

Message ID 20230605040749.67964-1-ychuang570808@gmail.com (mailing list archive)
Headers show
Series Introduce Nuvoton ma35d1 SoC | expand

Message

Jacky Huang June 5, 2023, 4:07 a.m. UTC
From: Jacky Huang <ychuang3@nuvoton.com>

This patchset adds initial support for the Nuvoton ma35d1 SoC, including
initial device tree, clock driver, reset driver, and serial driver.

This patchset cover letter is based from the initial support for Nuvoton
ma35d1 to keep tracking the version history.

This patchset had been applied to Linux kernel 6.4.0-rc5
and tested on the Nuvoton ma35d1 SOM evaluation board.

(ma35d1 information: https://www.nuvoton.com/products/microprocessors/arm-cortex-a35-mpus/)
MA35D1 porting on linux-5.10.y can be found at: https://github.com/OpenNuvoton/MPU-Family

v13:
  - Modify serial driver
    - Added a check for oops_in_progress in ma35d1serial_console_write to
      determine whether to perform the spin_lock.
    - Rebased drivers/tty/serial/Kconfig and recreate the patch
    - Rebased MAINTAINERS and recreate the patch

v12:
  - Modify serial driver
    - Added PORT_MA35 to include/uapi/linux/serial_core.h, and apply to
      the port->type of ma35d1 serial driver
    - Added check for the return value of ioremap()
    - Fixed several coding issues
  - Rebase MAINTAINERS and recreate the patch

v11:
  - Rebase on top of 2023.05.24
  - Modify serial driver
    - Fixed several coding style issues
    - Fixed ma35d1serial_set_mctrl()
    - Added the 'MA35_' prefix to all register and bit field definitions.
    - Used 'ttyNVT' instead of 'ttyS'
  - Modify clock driver
    - Added 'source nuvoton/Kconfig' to drivers/clk/Kconfig
    - Fixed several coding issues
    - Removed unnecessary inline specifier
  - Modify reset driver
    - Fixed typo and added comments
  - Modify ma35d1.dtsi l2-cache node
    - Added cache-unified and cache-size properties

v10:
  - Change from using ARCH_NUVOTON to using ARCH_MA35. The following patch files
    have been modified:
    - patch 1 arch/arm64/Kconfig.platforms
    - patch 2 arch/arm64/configs/defconfig
    - patch 7 arch/arm64/boot/dts/nuvoton/Makefile
    - patch 8 drivers/clk/Makefile
              drivers/clk/nuvoton/Kconfig
              drivers/clk/nuvoton/Makefile
    - patch 9 drivers/reset/Kconfig
    - patch 10 drivers/tty/serial/Kconfig

v9:
  - Combine MAINTAINERS patch into patch 5 'dt-bindings: arm: Add initial bindings
    for Nuvoton platform'
  - Modify clock driver
    - Use the helper function for 64-bit division
    - Fixed minor issues
  - Modify reset driver
    - Refine coding style and add required header files
    - Add spin_lock protection
  - Add error return handling to the serial driver probe function

v8:
  - Remove '0005-dt-bindings-mfd-syscon-Add-nuvoton-ma35d1-sys-compat.patch' as it was applied.
  - Modify MAINTAINERS NUVOTON MA35 and NPCM path settings
  - Remove 'syscon' from dtsi 'sys' node and modify the corresponding yaml
  - Modify clock driver
    - Remove the header file and move definitions into .c files.
    - Use parent_data instead of parent name.
  - Modify serial driver
  - Modify reset driver
    - Modify reset register/offset lookup table to be indexed by reset id
    - Combined reset and reboot structure

v7:
  - Fixed dts system-management node and compatible driver
  - move 'nuvoton,npcm-gcr.yaml' from 'binding/arm/nuvoton' to 'binding/soc/nuvoton'
  - In ma35d1.dtsi, create the soc node for ma35d1 SoC
  - Modify the issues found in serial driver
  - Modify the issues found in clock driver
  - Modify the IDs of reset driver to be contiguous numbers and use lookup table
    to find register offset and bit position.
  - Modify MAINTAINERS NUVOTON NPCM path as npcm directory name to nuvoton

v6:
  - Combine nuvoton,ma35d1-clk.yaml and nuvoton,ma35d1-clk.h into one patch
  - Combine nuvoton,ma35d1-reset.yaml and nuvoton,ma35d1-reset.h into one patch
  - rename Documentation/devicetree/bindings/arm/npcm directory as nuvoton
  - Remove patch for adding include/linux/mfd/ma35d1-sys.h as it's not required
  - Update dtsi & dts files and move board-specific nodes to dts
  - Modify reset driver
  - Modify serial driver, fix coding style issues
  - Modify clock driver, rewrite the PLL calculation functions

v5:
  - Add ARCH_NUVOTON to arm64 Kconfig
  - Add ARCH_NUVOTON to defconfig
  - Add the clock driver
  - Add the reset driver
  - Add the serial driver
  - Add us to the maintainer

v4:
  - patch 4/5 is a resend
  - Fixed dt_binding_check errors of nuvoton,ma35d1-clk.yaml
  - Modify ma35d1.dtsi
    1. Add a node hxt_24m
    2. Fixed the base address of gic node
    3. Add clocks and clock-names to clock node
  - Fixed borad binding mistakes of nuvoton.yaml

v3:
  - added patch 4/5 and 5/5
  - introduce CONFIG_ARCH_NUVOTON option
  - add initial bindings for Nuvoton Platform boards
  - fixed coding style problem of nuvoton,ma35d1-clk.h
  - added CAPLL to clock-controller node
  - modify the chosen node of ma35d1-evb.dts
  - modify clock yaml "clk-pll-mode" to "nuvoton,clk-pll-mode"

v2:
  - fixed dt_binding_check failed of nuvoton,ma35d1-clk.yaml

Jacky Huang (10):
  arm64: Kconfig.platforms: Add config for Nuvoton MA35 platform
  arm64: defconfig: Add support for Nuvoton MA35 family SoCs
  dt-bindings: clock: nuvoton: add binding for ma35d1 clock controller
  dt-bindings: reset: nuvoton: Document ma35d1 reset control
  dt-bindings: arm: Add initial bindings for Nuvoton platform
  dt-bindings: serial: Document ma35d1 uart controller
  arm64: dts: nuvoton: Add initial ma35d1 device tree
  clk: nuvoton: Add clock driver for ma35d1 clock controller
  reset: Add Nuvoton ma35d1 reset driver support
  tty: serial: Add Nuvoton ma35d1 serial driver support

 .../bindings/arm/nuvoton/nuvoton,ma35d1.yaml  |  30 +
 .../npcm.yaml => nuvoton/nuvoton,npcm.yaml}   |   2 +-
 .../bindings/clock/nuvoton,ma35d1-clk.yaml    |  63 ++
 .../bindings/reset/nuvoton,ma35d1-reset.yaml  |  45 +
 .../serial/nuvoton,ma35d1-serial.yaml         |  48 +
 .../nuvoton/nuvoton,npcm-gcr.yaml}            |   2 +-
 MAINTAINERS                                   |  13 +-
 arch/arm64/Kconfig.platforms                  |   8 +
 arch/arm64/boot/dts/nuvoton/Makefile          |   2 +
 .../boot/dts/nuvoton/ma35d1-iot-512m.dts      |  56 ++
 .../boot/dts/nuvoton/ma35d1-som-256m.dts      |  56 ++
 arch/arm64/boot/dts/nuvoton/ma35d1.dtsi       | 234 +++++
 arch/arm64/configs/defconfig                  |   1 +
 drivers/clk/Kconfig                           |   1 +
 drivers/clk/Makefile                          |   1 +
 drivers/clk/nuvoton/Kconfig                   |  19 +
 drivers/clk/nuvoton/Makefile                  |   4 +
 drivers/clk/nuvoton/clk-ma35d1-divider.c      | 135 +++
 drivers/clk/nuvoton/clk-ma35d1-pll.c          | 361 +++++++
 drivers/clk/nuvoton/clk-ma35d1.c              | 933 ++++++++++++++++++
 drivers/reset/Kconfig                         |   6 +
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-ma35d1.c                  | 235 +++++
 drivers/tty/serial/Kconfig                    |  18 +
 drivers/tty/serial/Makefile                   |   1 +
 drivers/tty/serial/ma35d1_serial.c            | 808 +++++++++++++++
 .../dt-bindings/clock/nuvoton,ma35d1-clk.h    | 253 +++++
 .../dt-bindings/reset/nuvoton,ma35d1-reset.h  | 108 ++
 include/uapi/linux/serial_core.h              |   3 +
 29 files changed, 3444 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/nuvoton/nuvoton,ma35d1.yaml
 rename Documentation/devicetree/bindings/arm/{npcm/npcm.yaml => nuvoton/nuvoton,npcm.yaml} (93%)
 create mode 100644 Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml
 create mode 100644 Documentation/devicetree/bindings/reset/nuvoton,ma35d1-reset.yaml
 create mode 100644 Documentation/devicetree/bindings/serial/nuvoton,ma35d1-serial.yaml
 rename Documentation/devicetree/bindings/{arm/npcm/nuvoton,gcr.yaml => soc/nuvoton/nuvoton,npcm-gcr.yaml} (93%)
 create mode 100644 arch/arm64/boot/dts/nuvoton/ma35d1-iot-512m.dts
 create mode 100644 arch/arm64/boot/dts/nuvoton/ma35d1-som-256m.dts
 create mode 100644 arch/arm64/boot/dts/nuvoton/ma35d1.dtsi
 create mode 100644 drivers/clk/nuvoton/Kconfig
 create mode 100644 drivers/clk/nuvoton/Makefile
 create mode 100644 drivers/clk/nuvoton/clk-ma35d1-divider.c
 create mode 100644 drivers/clk/nuvoton/clk-ma35d1-pll.c
 create mode 100644 drivers/clk/nuvoton/clk-ma35d1.c
 create mode 100644 drivers/reset/reset-ma35d1.c
 create mode 100644 drivers/tty/serial/ma35d1_serial.c
 create mode 100644 include/dt-bindings/clock/nuvoton,ma35d1-clk.h
 create mode 100644 include/dt-bindings/reset/nuvoton,ma35d1-reset.h

Comments

Arnd Bergmann June 5, 2023, noon UTC | #1
On Mon, Jun 5, 2023, at 06:07, Jacky Huang wrote:
> From: Jacky Huang <ychuang3@nuvoton.com>
>
> This patchset adds initial support for the Nuvoton ma35d1 SoC, including
> initial device tree, clock driver, reset driver, and serial driver.
>
> This patchset cover letter is based from the initial support for Nuvoton
> ma35d1 to keep tracking the version history.
>
> This patchset had been applied to Linux kernel 6.4.0-rc5
> and tested on the Nuvoton ma35d1 SOM evaluation board.
>
> (ma35d1 information: 
> https://www.nuvoton.com/products/microprocessors/arm-cortex-a35-mpus/)
> MA35D1 porting on linux-5.10.y can be found at: 
> https://github.com/OpenNuvoton/MPU-Family
>
> v13:
>   - Modify serial driver
>     - Added a check for oops_in_progress in ma35d1serial_console_write to
>       determine whether to perform the spin_lock.
>     - Rebased drivers/tty/serial/Kconfig and recreate the patch
>     - Rebased MAINTAINERS and recreate the patch

Hi Jacky,

This is looking good to me, thanks for getting it this far.
I see all patches aside from the last one have been reviewed by
at least one person. The clock driver is still missing an Ack
from the clk maintainers, but I see that you have addressed
Stephen's concerns from an earlier review round, so I expect
this to be fine.
Stephen, let me know if you have any final concerns about this driver.

The serial port driver was still getting some last changes, so
I only picked up the binding but not the driver here. If Greg
and Jiri are happy with this version, I'd prefer to just add
this with their Ack as well, otherwise please send only that
patch for any follow-up revisions. If you can finish this
before the linux-6.5 merge window, I'd add it on top of the
other patches, otherwise it should just go through Greg's
tree.

If anything else should come up, let's handle this as patches on
top of the branch I have now pushed in [1], no need to resend
these.

      Arnd

[1] https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/log/?h=nuvoton/ma35d1
patchwork-bot+linux-soc@kernel.org June 5, 2023, 3:50 p.m. UTC | #2
Hello:

This series was applied to soc/soc.git (for-next)
by Arnd Bergmann <arnd@arndb.de>:

On Mon,  5 Jun 2023 04:07:39 +0000 you wrote:
> From: Jacky Huang <ychuang3@nuvoton.com>
> 
> This patchset adds initial support for the Nuvoton ma35d1 SoC, including
> initial device tree, clock driver, reset driver, and serial driver.
> 
> This patchset cover letter is based from the initial support for Nuvoton
> ma35d1 to keep tracking the version history.
> 
> [...]

Here is the summary with links:
  - [v13,01/10] arm64: Kconfig.platforms: Add config for Nuvoton MA35 platform
    https://git.kernel.org/soc/soc/c/64b88e9ff6c5
  - [v13,02/10] arm64: defconfig: Add support for Nuvoton MA35 family SoCs
    https://git.kernel.org/soc/soc/c/4cc2272447b8
  - [v13,03/10] dt-bindings: clock: nuvoton: add binding for ma35d1 clock controller
    https://git.kernel.org/soc/soc/c/2f8b5eb589cb
  - [v13,04/10] dt-bindings: reset: nuvoton: Document ma35d1 reset control
    https://git.kernel.org/soc/soc/c/476650a64b6b
  - [v13,05/10] dt-bindings: arm: Add initial bindings for Nuvoton platform
    https://git.kernel.org/soc/soc/c/0545810f7eda
  - [v13,06/10] dt-bindings: serial: Document ma35d1 uart controller
    https://git.kernel.org/soc/soc/c/15b53677e786
  - [v13,07/10] arm64: dts: nuvoton: Add initial ma35d1 device tree
    https://git.kernel.org/soc/soc/c/b69af0984732
  - [v13,08/10] clk: nuvoton: Add clock driver for ma35d1 clock controller
    https://git.kernel.org/soc/soc/c/691521a367cf
  - [v13,09/10] reset: Add Nuvoton ma35d1 reset driver support
    https://git.kernel.org/soc/soc/c/e4bb55d6ccf0
  - [v13,10/10] tty: serial: Add Nuvoton ma35d1 serial driver support
    (no matching commit)

You are awesome, thank you!
Jacky Huang June 6, 2023, 12:22 a.m. UTC | #3
On 2023/6/5 下午 08:00, Arnd Bergmann wrote:
> On Mon, Jun 5, 2023, at 06:07, Jacky Huang wrote:
>> From: Jacky Huang <ychuang3@nuvoton.com>
>>
>> This patchset adds initial support for the Nuvoton ma35d1 SoC, including
>> initial device tree, clock driver, reset driver, and serial driver.
>>
>> This patchset cover letter is based from the initial support for Nuvoton
>> ma35d1 to keep tracking the version history.
>>
>> This patchset had been applied to Linux kernel 6.4.0-rc5
>> and tested on the Nuvoton ma35d1 SOM evaluation board.
>>
>> (ma35d1 information:
>> https://www.nuvoton.com/products/microprocessors/arm-cortex-a35-mpus/)
>> MA35D1 porting on linux-5.10.y can be found at:
>> https://github.com/OpenNuvoton/MPU-Family
>>
>> v13:
>>    - Modify serial driver
>>      - Added a check for oops_in_progress in ma35d1serial_console_write to
>>        determine whether to perform the spin_lock.
>>      - Rebased drivers/tty/serial/Kconfig and recreate the patch
>>      - Rebased MAINTAINERS and recreate the patch
> Hi Jacky,
>
> This is looking good to me, thanks for getting it this far.
> I see all patches aside from the last one have been reviewed by
> at least one person. The clock driver is still missing an Ack
> from the clk maintainers, but I see that you have addressed
> Stephen's concerns from an earlier review round, so I expect
> this to be fine.
> Stephen, let me know if you have any final concerns about this driver.
>
> The serial port driver was still getting some last changes, so
> I only picked up the binding but not the driver here. If Greg
> and Jiri are happy with this version, I'd prefer to just add
> this with their Ack as well, otherwise please send only that
> patch for any follow-up revisions. If you can finish this
> before the linux-6.5 merge window, I'd add it on top of the
> other patches, otherwise it should just go through Greg's
> tree.
>
> If anything else should come up, let's handle this as patches on
> top of the branch I have now pushed in [1], no need to resend
> these.
>
>        Arnd
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/log/?h=nuvoton/ma35d1

Dear Arnd,

I'm glad to see that these patches have finally been accepted.
Thank you very much for all the assistance you have provided.
Once the device tree is merged, we will start submitting drivers
such as pinctrl, gpio, rtc, and so on.


Best Regards,
Jacky Huang
Arnd Bergmann June 6, 2023, 6:08 a.m. UTC | #4
On Tue, Jun 6, 2023, at 02:22, Jacky Huang wrote:
> On 2023/6/5 下午 08:00, Arnd Bergmann wrote:
>> On Mon, Jun 5, 2023, at 06:07, Jacky Huang wrote:
>
> I'm glad to see that these patches have finally been accepted.
> Thank you very much for all the assistance you have provided.
> Once the device tree is merged, we will start submitting drivers
> such as pinctrl, gpio, rtc, and so on.

I think you can start submitting all the drivers to their
respective maintainers now, just mention that the SoC support
is currently in linux-next in case they get confused about the
dependencies.

     Arnd