Skip to content

Commit

Permalink
Merge branch 'nuvoton/ma35d1' into soc/newsoc
Browse files Browse the repository at this point in the history
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

Link: https://lore.kernel.org/linux-arm-kernel/20230605040749.67964-1-ychuang570808@gmail.com/

[arnd: merging everything aside from the serial port driver for now, as
 that is still waiting for an Ack]

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

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Arnd Bergmann committed Jun 5, 2023
2 parents f1fcbaa + e4bb55d commit 207656f
Show file tree
Hide file tree
Showing 25 changed files with 2,614 additions and 3 deletions.
30 changes: 30 additions & 0 deletions Documentation/devicetree/bindings/arm/nuvoton/nuvoton,ma35d1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/arm/nuvoton/nuvoton,ma35d1.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Nuvoton MA35 series SoC based platforms

maintainers:
- Jacky Huang <ychuang3@nuvoton.com>

description: |
Boards with an ARMv8 based Nuvoton MA35 series SoC shall have
the following properties.
properties:
$nodename:
const: '/'
compatible:
oneOf:

- description: MA35D1 based boards
items:
- enum:
- nuvoton,ma35d1-iot
- nuvoton,ma35d1-som
- const: nuvoton,ma35d1

additionalProperties: true
...
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/arm/npcm/npcm.yaml#
$id: http://devicetree.org/schemas/arm/nuvoton/nuvoton,npcm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: NPCM Platforms
Expand Down
63 changes: 63 additions & 0 deletions Documentation/devicetree/bindings/clock/nuvoton,ma35d1-clk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/nuvoton,ma35d1-clk.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Nuvoton MA35D1 Clock Controller Module

maintainers:
- Chi-Fang Li <cfli0@nuvoton.com>
- Jacky Huang <ychuang3@nuvoton.com>

description: |
The MA35D1 clock controller generates clocks for the whole chip,
including system clocks and all peripheral clocks.
See also:
include/dt-bindings/clock/ma35d1-clk.h
properties:
compatible:
items:
- const: nuvoton,ma35d1-clk

reg:
maxItems: 1

"#clock-cells":
const: 1

clocks:
maxItems: 1

nuvoton,pll-mode:
description:
A list of PLL operation mode corresponding to CAPLL, DDRPLL, APLL,
EPLL, and VPLL in sequential.
maxItems: 5
items:
enum:
- integer
- fractional
- spread-spectrum
$ref: /schemas/types.yaml#/definitions/non-unique-string-array

required:
- compatible
- reg
- "#clock-cells"
- clocks

additionalProperties: false

examples:
- |
clock-controller@40460200 {
compatible = "nuvoton,ma35d1-clk";
reg = <0x40460200 0x100>;
#clock-cells = <1>;
clocks = <&clk_hxt>;
};
...
45 changes: 45 additions & 0 deletions Documentation/devicetree/bindings/reset/nuvoton,ma35d1-reset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/reset/nuvoton,ma35d1-reset.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Nuvoton MA35D1 Reset Controller

maintainers:
- Chi-Fang Li <cfli0@nuvoton.com>
- Jacky Huang <ychuang3@nuvoton.com>

description:
The system reset controller can be used to reset various peripheral
controllers in MA35D1 SoC.

properties:
compatible:
items:
- const: nuvoton,ma35d1-reset

reg:
maxItems: 1

'#reset-cells':
const: 1

required:
- compatible
- reg
- '#reset-cells'

additionalProperties: false

examples:
# system reset controller node:
- |
system-management@40460000 {
compatible = "nuvoton,ma35d1-reset";
reg = <0x40460000 0x200>;
#reset-cells = <1>;
};
...

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/serial/nuvoton,ma35d1-serial.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Nuvoton MA35D1 Universal Asynchronous Receiver/Transmitter (UART)

maintainers:
- Min-Jen Chen <mjchen@nuvoton.com>
- Jacky Huang <ychuang3@nuvoton.com>

allOf:
- $ref: serial.yaml

properties:
compatible:
const: nuvoton,ma35d1-uart

reg:
maxItems: 1

interrupts:
maxItems: 1

clocks:
maxItems: 1

required:
- compatible
- reg
- interrupts
- clocks

unevaluatedProperties: false

examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/nuvoton,ma35d1-clk.h>
serial@40700000 {
compatible = "nuvoton,ma35d1-uart";
reg = <0x40700000 0x100>;
interrupts = <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk UART0_GATE>;
};
...
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/arm/npcm/nuvoton,gcr.yaml#
$id: http://devicetree.org/schemas/soc/nuvoton/nuvoton,npcm-gcr.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Global Control Registers block in Nuvoton SoCs
Expand Down
13 changes: 12 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2502,6 +2502,18 @@ F: drivers/rtc/rtc-ab8500.c
F: drivers/rtc/rtc-pl031.c
F: drivers/soc/ux500/

ARM/NUVOTON MA35 ARCHITECTURE
M: Jacky Huang <ychuang3@nuvoton.com>
M: Shan-Chun Hung <schung@nuvoton.com>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S: Supported
F: Documentation/devicetree/bindings/*/*/*ma35*
F: Documentation/devicetree/bindings/*/*ma35*
F: arch/arm64/boot/dts/nuvoton/*ma35*
F: drivers/*/*/*ma35*
F: drivers/*/*ma35*
K: ma35d1

ARM/NUVOTON NPCM ARCHITECTURE
M: Avi Fishman <avifishman70@gmail.com>
M: Tomer Maimon <tmaimon77@gmail.com>
Expand All @@ -2513,7 +2525,6 @@ L: openbmc@lists.ozlabs.org (moderated for non-subscribers)
S: Supported
F: Documentation/devicetree/bindings/*/*/*npcm*
F: Documentation/devicetree/bindings/*/*npcm*
F: Documentation/devicetree/bindings/arm/npcm/*
F: Documentation/devicetree/bindings/rtc/nuvoton,nct3018y.yaml
F: arch/arm/boot/dts/nuvoton-npcm*
F: arch/arm/mach-npcm/
Expand Down
8 changes: 8 additions & 0 deletions arch/arm64/Kconfig.platforms
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,14 @@ config ARCH_S32

endif

config ARCH_MA35
bool "Nuvoton MA35 Architecture"
select GPIOLIB
select PINCTRL
select RESET_CONTROLLER
help
This enables support for the ARMv8 based Nuvoton MA35 series SoCs.

config ARCH_NPCM
bool "Nuvoton NPCM Architecture"
select PINCTRL
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/nuvoton/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
dtb-$(CONFIG_ARCH_MA35) += ma35d1-iot-512m.dtb
dtb-$(CONFIG_ARCH_MA35) += ma35d1-som-256m.dtb
dtb-$(CONFIG_ARCH_NPCM) += nuvoton-npcm845-evb.dtb
56 changes: 56 additions & 0 deletions arch/arm64/boot/dts/nuvoton/ma35d1-iot-512m.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2023 Nuvoton Technology Corp.
* Author: Shan-Chun Hung <schung@nuvoton.com>
* Jacky huang <ychuang3@nuvoton.com>
*/

/dts-v1/;
#include "ma35d1.dtsi"

/ {
model = "Nuvoton MA35D1-IoT";
compatible = "nuvoton,ma35d1-iot", "nuvoton,ma35d1";

aliases {
serial0 = &uart0;
};

chosen {
stdout-path = "serial0:115200n8";
};

mem: memory@80000000 {
device_type = "memory";
reg = <0x00000000 0x80000000 0 0x20000000>; /* 512M DRAM */
};

clk_hxt: clock-hxt {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <24000000>;
clock-output-names = "clk_hxt";
};
};

&uart0 {
status = "okay";
};

&clk {
assigned-clocks = <&clk CAPLL>,
<&clk DDRPLL>,
<&clk APLL>,
<&clk EPLL>,
<&clk VPLL>;
assigned-clock-rates = <800000000>,
<266000000>,
<180000000>,
<500000000>,
<102000000>;
nuvoton,pll-mode = "integer",
"fractional",
"integer",
"integer",
"integer";
};
56 changes: 56 additions & 0 deletions arch/arm64/boot/dts/nuvoton/ma35d1-som-256m.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2023 Nuvoton Technology Corp.
* Author: Shan-Chun Hung <schung@nuvoton.com>
* Jacky huang <ychuang3@nuvoton.com>
*/

/dts-v1/;
#include "ma35d1.dtsi"

/ {
model = "Nuvoton MA35D1-SOM";
compatible = "nuvoton,ma35d1-som", "nuvoton,ma35d1";

aliases {
serial0 = &uart0;
};

chosen {
stdout-path = "serial0:115200n8";
};

mem: memory@80000000 {
device_type = "memory";
reg = <0x00000000 0x80000000 0 0x10000000>; /* 256M DRAM */
};

clk_hxt: clock-hxt {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <24000000>;
clock-output-names = "clk_hxt";
};
};

&uart0 {
status = "okay";
};

&clk {
assigned-clocks = <&clk CAPLL>,
<&clk DDRPLL>,
<&clk APLL>,
<&clk EPLL>,
<&clk VPLL>;
assigned-clock-rates = <800000000>,
<266000000>,
<180000000>,
<500000000>,
<102000000>;
nuvoton,pll-mode = "integer",
"fractional",
"integer",
"integer",
"integer";
};
Loading

0 comments on commit 207656f

Please sign in to comment.