Introduce Nuvoton ma35d1 SoC
v16 cover Introduce Nuvoton ma35d1 SoC
From: Jacky Huang <[email protected]>
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-rc6 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
v16:
- Removed the patch [PATCH v15 1/2] for the ma35d1 serial driver since it has already been added to tty-testing.
- Updated the patch for the ma35d1 clock driver.
There are no modifications to the driver itself compared to the previous version. Since the ma35d1 clock driver was picked at v13, we should submit modifications based on that version instead of sending a complete update to replace it. Create a new patch based on the following patch.
[v13,08/10] clk: nuvoton: Add clock driver for ma35d1 clock controller
https://git.kernel.org/soc/soc/c/691521a367cf
v15:
- Modified the serial driver
- Instead of adding a new port type PORT_MA35 to serial_core.h, now using port->type = 1.
- Updated Kconfig descriptions.
- Added a description about the name ttyNVT to the patch log.
- Modified the clock driver
- Added clk-ma35d1.h for external functions.
- Updated all parent strings as clk_parent_data.
v14:
- Removed patches PATCH v13 1/10 ~ 9/10 as they were applied
- Modify serial driver
- Fixed coding style issues
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 board 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 (1):
clk: nuvoton: Use clk_parent_data instead and add a header file
drivers/clk/nuvoton/clk-ma35d1-divider.c | 7 +- drivers/clk/nuvoton/clk-ma35d1-pll.c | 5 +- drivers/clk/nuvoton/clk-ma35d1.c | 737 +++++++++++++---------- drivers/clk/nuvoton/clk-ma35d1.h | 18 + 4 files changed, 447 insertions(+), 320 deletions(-) create mode 100644 drivers/clk/nuvoton/clk-ma35d1.h
Signature · 1 line
2.34.1
PATCH v16 1/1 clk: nuvoton: Use clk_parent_data instead and add a header file
From: Jacky Huang <[email protected]>
1. Update all parent clock string arrays with clk_parent_data structure, and replace the usage of clk_hw_register_mux() with clk_hw_register_mux_parent_data().
2. Introduce the header file clk-ma35d1.h to include shared external functions.
--- drivers/clk/nuvoton/clk-ma35d1-divider.c | 7 +- drivers/clk/nuvoton/clk-ma35d1-pll.c | 5 +- drivers/clk/nuvoton/clk-ma35d1.c | 737 +++++++++++++---------- drivers/clk/nuvoton/clk-ma35d1.h | 18 + 4 files changed, 447 insertions(+), 320 deletions(-) create mode 100644 drivers/clk/nuvoton/clk-ma35d1.h
drivers/clk/nuvoton/clk-ma35d1-divider.c +2 -5
@@ -9,6 +9,8 @@#include <linux/regmap.h> #include <linux/spinlock.h> +#include "clk-ma35d1.h" +struct ma35d1_adc_clk_div {struct clk_hw hw;void __iomem *reg;
@@ -20,11 +22,6 @@ struct ma35d1_adc_clk_div {spinlock_t *lock; }; -struct clk_hw *ma35d1_reg_adc_clkdiv (struct device *dev,const char *name, -struct clk_hw *parent_hw,spinlock_t *lock, -unsigned long flags,void __iomem *reg, -u8 shift,u8 width,u32 mask_bit); -static inline struct ma35d1_adc_clk_div *to_ma35d1_adc_clk_div (struct clk_hw *_hw) { return container_of(_hw, struct ma35d1_adc_clk_div, hw);
drivers/clk/nuvoton/clk-ma35d1-pll.c +2 -3
@@ -15,6 +15,8 @@#include <linux/units.h> #include <dt-bindings/clock/nuvoton,ma35d1-clk.h> +#include "clk-ma35d1.h" +/* PLL frequency limits */ #define PLL_FREF_MAX_FREQ (200 * HZ_PER_MHZ)#define PLL_FREF_MIN_FREQ (1 * HZ_PER_MHZ)
@@ -71,9 +73,6 @@ struct ma35d1_clk_pll {void __iomem *ctl2_base; }; -struct clk_hw *ma35d1_reg_clk_pll (struct device *dev,u32 id,u8 u8mode,const char *name, -struct clk_hw *parent_hw,void __iomem *base); -static inline struct ma35d1_clk_pll *to_ma35d1_clk_pll (struct clk_hw *_hw) { return container_of(_hw, struct ma35d1_clk_pll, hw);
drivers/clk/nuvoton/clk-ma35d1.c +425 -312
1,068 lines not on this page · raw message
drivers/clk/nuvoton/clk-ma35d1.h new file +18 -0
@@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +* Copyright (C) 2023 Nuvoton Technology Corp. +* Author: Chi-Fang Li <[email protected]> +*/ + +#ifndef __DRV_CLK_NUVOTON_MA35D1_H +#define __DRV_CLK_NUVOTON_MA35D1_H + +struct clk_hw *ma35d1_reg_clk_pll (struct device *dev,u32 id,u8 u8mode,const char *name, +struct clk_hw *parent_hw,void __iomem *base); + +struct clk_hw *ma35d1_reg_adc_clkdiv (struct device *dev,const char *name, +struct clk_hw *parent_hw,spinlock_t *lock, +unsigned long flags,void __iomem *reg, +u8 shift,u8 width,u32 mask_bit); + +#endif /* __DRV_CLK_NUVOTON_MA35D1_H */
Signature · 1 line
2.34.1
Re: [PATCH v16 1/1] clk: nuvoton: Use clk_parent_data instead and add a header file
Quoted 7 lines · Jacky Huang
From: Jacky Huang <[email protected]>
1. Update all parent clock string arrays with
clk_parent_datastructure, and replace the usage ofclk_hw_register_mux()withclk_hw_register_mux_parent_data().
2. Introduce the header fileclk-ma35d1.hto include shared external functions.
These are two things thus commits.
This is not v16. It's your first version of this patch.
Best regards,
Krzysztof
Re: [PATCH v16 1/1] clk: nuvoton: Use clk_parent_data instead and add a header file
Quoted 8 lines · Krzysztof Kozlowski
Quoted 7 lines · Jacky Huang
From: Jacky Huang <[email protected]>
1. Update all parent clock string arrays with
clk_parent_datastructure, and replace the usage ofclk_hw_register_mux()withclk_hw_register_mux_parent_data().
2. Introduce the header fileclk-ma35d1.hto include shared external functions.
Quoted 7 lines
These are two things thus commits.
This is not v16. It's your first version of this patch.
Best regards,
Krzysztof
Dear Krzysztof,
Thanks for your advice.
Okay, this is the first version, and I will split it into two separate commits and resubmit it as v2.
Best Regards,
Jacky Huang