linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/39] Add support for sam9x7 SoC family
@ 2024-02-23 17:13 Varshini Rajendran
  2024-02-23 17:22 ` [PATCH v4 01/39] dt-bindings: net: cdns,macb: add sam9x7 ethernet interface Varshini Rajendran
                   ` (43 more replies)
  0 siblings, 44 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:13 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, mturquette, sboyd, herbert,
	davem, andi.shyti, tglx, tudor.ambarus, miquel.raynal, richard,
	vigneshr, edumazet, kuba, pabeni, linus.walleij, sre,
	u.kleine-koenig, p.zabel, olivia, radu_nicolae.pirea,
	richard.genoud, gregkh, jirislaby, lgirdwood, broonie, wim,
	linux, linux, andrei.simion, mihai.sain, varshini.rajendran,
	andre.przywara, neil.armstrong, tony, durai.manickamkr,
	geert+renesas, arnd, Jason, rdunlap, rientjes, vbabka, mripard,
	codrin.ciubotariu, eugen.hristev, devicetree, linux-arm-kernel,
	linux-kernel, linux-clk, linux-crypto, linux-i2c, linux-mtd,
	netdev, linux-gpio, linux-pm, linux-pwm, linux-rtc, linux-spi,
	linux-serial, alsa-devel, linux-sound, linux-watchdog

This patch series adds support for the new SoC family - sam9x7.
 - The device tree, configs and drivers are added
 - Clock driver for sam9x7 is added
 - Support for basic peripherals is added
 - Target board SAM9X75 Curiosity is added

 Changes in v4:
 --------------

 - Addressed all the review comments in the patches
 - Picked up all Acked-by and Reviewed-by tags
 - Dropped applied patches from the series
 - Added pwm node and related dt binding documentation
 - Added support for exporting some clocks to DT
 - Dropped USB related patches and changes. See NOTE.
 - All the specific changes are captured in the corresponding patches

 NOTE: Owing to the discussion here
 https://lore.kernel.org/linux-devicetree/CAL_JsqJ9PrX6fj-EbffeJce09MXs=B7t+KS_kOinxaRx38=WxA@mail.gmail.com/
 the USB related changes are dropped from this series in order to enable
 us to work on the mentioned issues before adding new compatibles as
 said. The issues/warnings will be addressed in subsequent patches.
 After which the USB related support for sam9x7 SoCs will be added. Hope
 this works out fine.

 Changes in v3:
 --------------

 - Fixed the DT documentation errors pointed out in v2.
 - Dropped Acked-by tag in tcb DT doc patch as it had to be adapted
   according to sam9x7 correctly.
 - Picked by the previously missed tags.
 - Dropped this patch "dt-bindings: usb: generic-ehci: Document clock-names
   property" as the warning was not found while validating DT-schema for
   at91-sam9x75_curiosity.dtb.
 - Dropped redundant words in the commit message.
 - Fixed the CHECK_DTBS warnings validated against
   at91-sam9x75_curiosity.dtb.
 - Renamed dt nodes according to naming convention.
 - Dropped unwanted status property in dts.
 - Removed nodes that are not in use from the board dts.
 - Removed spi DT doc patch from the series as it was already applied
   and a fix patch was applied subsequently. Added a patch to remove the
   compatible to adapt sam9x7.
 - Added sam9x7 compatibles in usb dt documentation.


 Changes in v2:
 --------------

 - Added sam9x7 specific compatibles in DT with fallbacks
 - Documented all the newly added DT compatible strings
 - Added device tree for the target board sam9x75 curiosity and
   documented the same in the DT bindings documentation
 - Removed the dt nodes that are not supported at the moment
 - Removed the configs added by previous version that are not supported
   at the moment
 - Fixed all the corrections in the commit message
 - Changed all the instances of copyright year to 2023
 - Added sam9x7 flag in PIT64B configuration
 - Moved macro definitions to header file
 - Added another divider in mck characteristics in the pmc driver
 - Fixed the memory leak in the pmc driver
 - Dropped patches that are no longer needed
 - Picked up Acked-by and Reviewed-by tags


Varshini Rajendran (39):
  dt-bindings: net: cdns,macb: add sam9x7 ethernet interface
  dt-bindings: atmel-sysreg: add sam9x7
  dt-bindings: crypto: add sam9x7 in Atmel AES
  dt-bindings: crypto: add sam9x7 in Atmel SHA
  dt-bindings: crypto: add sam9x7 in Atmel TDES
  dt-bindings: i2c: at91: Add sam9x7 compatible string
  dt-bindings: atmel-ssc: add microchip,sam9x7-ssc
  dt-bindings: atmel-nand: add microchip,sam9x7-pmecc
  dt-bindings: pinctrl: at91: add sam9x7
  dt-bindings: rng: atmel,at91-trng: add sam9x7 TRNG
  dt-bindings: rtt: at91rm9260: add sam9x7 compatible
  dt-bindings: serial: atmel,at91-usart: add compatible for sam9x7.
  ASoC: dt-bindings: atmel-classd: add sam9x7 compatible
  dt-bindings: pwm: at91: Add sam9x7 compatible strings list
  dt-bindings: watchdog: sama5d4-wdt: add compatible for sam9x7-wdt
  spi: dt-bindings: atmel,at91rm9200-spi: remove 9x60 compatible from
    list
  ASoC: dt-bindings: microchip: add sam9x7
  ARM: at91: pm: add support for sam9x7 SoC family
  ARM: at91: pm: add sam9x7 SoC init config
  ARM: at91: add support in SoC driver for new sam9x7
  dt-bindings: clk: at91: add sam9x7
  dt-bindings: clk: at91: add sam9x7 clock controller
  clk: at91: clk-sam9x60-pll: re-factor to support individual core freq
    outputs
  clk: at91: sam9x7: add support for HW PLL freq dividers
  clk: at91: sama7g5: move mux table macros to header file
  dt-bindings: clock: at91: Allow PLLs to be exported and referenced in
    DT
  clk: at91: sam9x7: add sam9x7 pmc driver
  dt-bindings: irqchip/atmel-aic5: Add support for sam9x7 aic
  irqchip/atmel-aic5: Add support to get nirqs from DT for sam9x60 &
    sam9x7
  power: reset: at91-poweroff: lookup for proper pmc dt node for sam9x7
  power: reset: at91-reset: add reset support for sam9x7 SoC
  power: reset: at91-reset: add sdhwc support for sam9x7 SoC
  dt-bindings: reset: atmel,at91sam9260-reset: add sam9x7
  dt-bindings: power: reset: atmel,sama5d2-shdwc: add sam9x7
  ARM: at91: Kconfig: add config flag for SAM9X7 SoC
  ARM: configs: at91: enable config flags for sam9x7 SoC family
  ARM: dts: at91: sam9x7: add device tree for SoC
  dt-bindings: arm: add sam9x75 curiosity board
  ARM: dts: at91: sam9x75_curiosity: add sam9x75 curiosity board

 .../devicetree/bindings/arm/atmel-at91.yaml   |    6 +
 .../devicetree/bindings/arm/atmel-sysregs.txt |    7 +-
 .../bindings/clock/atmel,at91rm9200-pmc.yaml  |    2 +
 .../bindings/clock/atmel,at91sam9x5-sckc.yaml |    4 +-
 .../crypto/atmel,at91sam9g46-aes.yaml         |    6 +-
 .../crypto/atmel,at91sam9g46-sha.yaml         |    6 +-
 .../crypto/atmel,at91sam9g46-tdes.yaml        |    6 +-
 .../bindings/i2c/atmel,at91sam-i2c.yaml       |    4 +-
 .../interrupt-controller/atmel,aic.txt        |    2 +-
 .../devicetree/bindings/misc/atmel-ssc.txt    |    1 +
 .../devicetree/bindings/mtd/atmel-nand.txt    |    1 +
 .../devicetree/bindings/net/cdns,macb.yaml    |    5 +
 .../bindings/pinctrl/atmel,at91-pinctrl.txt   |    2 +
 .../power/reset/atmel,sama5d2-shdwc.yaml      |    3 +
 .../bindings/pwm/atmel,at91sam-pwm.yaml       |    3 +
 .../reset/atmel,at91sam9260-reset.yaml        |    4 +
 .../bindings/rng/atmel,at91-trng.yaml         |    4 +
 .../bindings/rtc/atmel,at91sam9260-rtt.yaml   |    4 +-
 .../bindings/serial/atmel,at91-usart.yaml     |   12 +-
 .../bindings/sound/atmel,sama5d2-classd.yaml  |    7 +-
 .../sound/microchip,sama7g5-i2smcc.yaml       |   11 +-
 .../bindings/spi/atmel,at91rm9200-spi.yaml    |    1 -
 .../bindings/watchdog/atmel,sama5d4-wdt.yaml  |   12 +-
 arch/arm/boot/dts/microchip/Makefile          |    3 +
 .../dts/microchip/at91-sam9x75_curiosity.dts  |  309 +++++
 arch/arm/boot/dts/microchip/sam9x60.dtsi      |    1 +
 arch/arm/boot/dts/microchip/sam9x7.dtsi       | 1214 +++++++++++++++++
 arch/arm/configs/at91_dt_defconfig            |    1 +
 arch/arm/mach-at91/Kconfig                    |   23 +-
 arch/arm/mach-at91/Makefile                   |    1 +
 arch/arm/mach-at91/generic.h                  |    2 +
 arch/arm/mach-at91/pm.c                       |   35 +
 arch/arm/mach-at91/sam9x7.c                   |   34 +
 drivers/clk/at91/Makefile                     |    1 +
 drivers/clk/at91/clk-sam9x60-pll.c            |   50 +-
 drivers/clk/at91/pmc.h                        |   18 +
 drivers/clk/at91/sam9x60.c                    |    7 +
 drivers/clk/at91/sam9x7.c                     |  946 +++++++++++++
 drivers/clk/at91/sama7g5.c                    |   42 +-
 drivers/irqchip/irq-atmel-aic5.c              |   12 +-
 drivers/power/reset/Kconfig                   |    4 +-
 drivers/power/reset/at91-sama5d2_shdwc.c      |    1 +
 drivers/soc/atmel/soc.c                       |   23 +
 drivers/soc/atmel/soc.h                       |    9 +
 include/dt-bindings/clock/at91.h              |    4 +
 45 files changed, 2788 insertions(+), 65 deletions(-)
 create mode 100644 arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts
 create mode 100644 arch/arm/boot/dts/microchip/sam9x7.dtsi
 create mode 100644 arch/arm/mach-at91/sam9x7.c
 create mode 100644 drivers/clk/at91/sam9x7.c

-- 
2.25.1


^ permalink raw reply	[flat|nested] 92+ messages in thread

* [PATCH v4 01/39] dt-bindings: net: cdns,macb: add sam9x7 ethernet interface
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
@ 2024-02-23 17:22 ` Varshini Rajendran
  2024-02-23 17:22 ` [PATCH v4 02/39] dt-bindings: atmel-sysreg: add sam9x7 Varshini Rajendran
                   ` (42 subsequent siblings)
  43 siblings, 0 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:22 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, nicolas.ferre, claudiu.beznea, netdev, devicetree,
	linux-kernel
  Cc: varshini.rajendran, Rob Herring

Add documentation for sam9x7 ethernet interface.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Acked-by: Rob Herring <robh@kernel.org>
---
Changes in v4:
- Changed the fallback compatible as const as per the comment.
---
 Documentation/devicetree/bindings/net/cdns,macb.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documentation/devicetree/bindings/net/cdns,macb.yaml
index bf8894a0257e..2c71e2cf3a2f 100644
--- a/Documentation/devicetree/bindings/net/cdns,macb.yaml
+++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml
@@ -59,6 +59,11 @@ properties:
           - cdns,gem                  # Generic
           - cdns,macb                 # Generic
 
+      - items:
+          - enum:
+              - microchip,sam9x7-gem     # Microchip SAM9X7 gigabit ethernet interface
+          - const: microchip,sama7g5-gem # Microchip SAMA7G5 gigabit ethernet interface
+
   reg:
     minItems: 1
     items:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 02/39] dt-bindings: atmel-sysreg: add sam9x7
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
  2024-02-23 17:22 ` [PATCH v4 01/39] dt-bindings: net: cdns,macb: add sam9x7 ethernet interface Varshini Rajendran
@ 2024-02-23 17:22 ` Varshini Rajendran
  2024-02-23 17:23 ` [PATCH v4 03/39] dt-bindings: crypto: add sam9x7 in Atmel AES Varshini Rajendran
                   ` (41 subsequent siblings)
  43 siblings, 0 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:22 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, sebastian.reichel,
	varshini.rajendran, devicetree, linux-arm-kernel, linux-kernel
  Cc: Krzysztof Kozlowski

Add RAM controller & SFR DT bindings.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Changes in v4:
- Updated Acked-by tag
---
 Documentation/devicetree/bindings/arm/atmel-sysregs.txt | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/atmel-sysregs.txt b/Documentation/devicetree/bindings/arm/atmel-sysregs.txt
index 67a66bf74895..1339298203c6 100644
--- a/Documentation/devicetree/bindings/arm/atmel-sysregs.txt
+++ b/Documentation/devicetree/bindings/arm/atmel-sysregs.txt
@@ -11,7 +11,8 @@ PIT Timer required properties:
   shared across all System Controller members.
 
 PIT64B Timer required properties:
-- compatible: Should be "microchip,sam9x60-pit64b"
+- compatible: Should be "microchip,sam9x60-pit64b" or
+			"microchip,sam9x7-pit64b", "microchip,sam9x60-pit64b"
 - reg: Should contain registers location and length
 - interrupts: Should contain interrupt for PIT64B timer
 - clocks: Should contain the available clock sources for PIT64B timer.
@@ -31,7 +32,8 @@ RAMC SDRAM/DDR Controller required properties:
 			"atmel,at91sam9g45-ddramc",
 			"atmel,sama5d3-ddramc",
 			"microchip,sam9x60-ddramc",
-			"microchip,sama7g5-uddrc"
+			"microchip,sama7g5-uddrc",
+			"microchip,sam9x7-ddramc", "atmel,sama5d3-ddramc".
 - reg: Should contain registers location and length
 
 Examples:
@@ -63,6 +65,7 @@ required properties:
 	"atmel,<chip>-sfrbu", "syscon"
   <chip> can be "sama5d3", "sama5d4" or "sama5d2".
   It also can be "microchip,sam9x60-sfr", "syscon".
+  It also can be "microchip,sam9x7-sfr", "microchip,sam9x60-sfr", "syscon".
 - reg: Should contain registers location and length
 
 	sfr@f0038000 {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 03/39] dt-bindings: crypto: add sam9x7 in Atmel AES
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
  2024-02-23 17:22 ` [PATCH v4 01/39] dt-bindings: net: cdns,macb: add sam9x7 ethernet interface Varshini Rajendran
  2024-02-23 17:22 ` [PATCH v4 02/39] dt-bindings: atmel-sysreg: add sam9x7 Varshini Rajendran
@ 2024-02-23 17:23 ` Varshini Rajendran
  2024-02-26  9:18   ` Tudor Ambarus
  2024-02-23 17:23 ` [PATCH v4 04/39] dt-bindings: crypto: add sam9x7 in Atmel SHA Varshini Rajendran
                   ` (40 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:23 UTC (permalink / raw)
  To: herbert, davem, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea, tudor.ambarus,
	linux-crypto, devicetree, linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran, Rob Herring

Add DT bindings for atmel AES.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Acked-by: Rob Herring <robh@kernel.org>
---
Changes in v4:
- Updated Acked-by tag
---
 .../devicetree/bindings/crypto/atmel,at91sam9g46-aes.yaml   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-aes.yaml b/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-aes.yaml
index 0b7383b3106b..7dc0748444fd 100644
--- a/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-aes.yaml
+++ b/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-aes.yaml
@@ -12,7 +12,11 @@ maintainers:
 
 properties:
   compatible:
-    const: atmel,at91sam9g46-aes
+    oneOf:
+      - const: atmel,at91sam9g46-aes
+      - items:
+          - const: microchip,sam9x7-aes
+          - const: atmel,at91sam9g46-aes
 
   reg:
     maxItems: 1
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 04/39] dt-bindings: crypto: add sam9x7 in Atmel SHA
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (2 preceding siblings ...)
  2024-02-23 17:23 ` [PATCH v4 03/39] dt-bindings: crypto: add sam9x7 in Atmel AES Varshini Rajendran
@ 2024-02-23 17:23 ` Varshini Rajendran
  2024-02-26  9:23   ` Tudor Ambarus
  2024-02-23 17:24 ` [PATCH v4 05/39] dt-bindings: crypto: add sam9x7 in Atmel TDES Varshini Rajendran
                   ` (39 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:23 UTC (permalink / raw)
  To: herbert, davem, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea, tudor.ambarus,
	linux-crypto, devicetree, linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran, Rob Herring

Add DT bindings for atmel SHA.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Acked-by: Rob Herring <robh@kernel.org>
---
Changes in v4:
- Updated Acked-by tag
---
 .../devicetree/bindings/crypto/atmel,at91sam9g46-sha.yaml   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-sha.yaml b/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-sha.yaml
index ee2ffb034325..d378c53314dd 100644
--- a/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-sha.yaml
+++ b/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-sha.yaml
@@ -12,7 +12,11 @@ maintainers:
 
 properties:
   compatible:
-    const: atmel,at91sam9g46-sha
+    oneOf:
+      - const: atmel,at91sam9g46-sha
+      - items:
+          - const: microchip,sam9x7-sha
+          - const: atmel,at91sam9g46-sha
 
   reg:
     maxItems: 1
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 05/39] dt-bindings: crypto: add sam9x7 in Atmel TDES
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (3 preceding siblings ...)
  2024-02-23 17:23 ` [PATCH v4 04/39] dt-bindings: crypto: add sam9x7 in Atmel SHA Varshini Rajendran
@ 2024-02-23 17:24 ` Varshini Rajendran
  2024-02-24 19:50   ` Conor Dooley
  2024-02-26  9:24   ` Tudor Ambarus
  2024-02-23 17:24 ` [PATCH v4 06/39] dt-bindings: i2c: at91: Add sam9x7 compatible string Varshini Rajendran
                   ` (38 subsequent siblings)
  43 siblings, 2 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:24 UTC (permalink / raw)
  To: herbert, davem, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea, tudor.ambarus,
	linux-crypto, devicetree, linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran

Add DT bindings for atmel TDES.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
---
Changes in v4:
- Updated Acked-by tag
---
 .../devicetree/bindings/crypto/atmel,at91sam9g46-tdes.yaml  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-tdes.yaml b/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-tdes.yaml
index 3d6ed24b1b00..6a441f79efea 100644
--- a/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-tdes.yaml
+++ b/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-tdes.yaml
@@ -12,7 +12,11 @@ maintainers:
 
 properties:
   compatible:
-    const: atmel,at91sam9g46-tdes
+    oneOf:
+      - const: atmel,at91sam9g46-tdes
+      - items:
+          - const: microchip,sam9x7-tdes
+          - const: atmel,at91sam9g46-tdes
 
   reg:
     maxItems: 1
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 06/39] dt-bindings: i2c: at91: Add sam9x7 compatible string
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (4 preceding siblings ...)
  2024-02-23 17:24 ` [PATCH v4 05/39] dt-bindings: crypto: add sam9x7 in Atmel TDES Varshini Rajendran
@ 2024-02-23 17:24 ` Varshini Rajendran
  2024-02-24 19:49   ` Conor Dooley
  2024-02-23 17:25 ` [PATCH v4 07/39] dt-bindings: atmel-ssc: add microchip,sam9x7-ssc Varshini Rajendran
                   ` (37 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:24 UTC (permalink / raw)
  To: andi.shyti, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea, linux-i2c,
	devicetree, linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran

Add compatible string for sam9x7.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
Changes in v4:
- Made sam9x7 compatible as an enum with sama7g5 compatible
- Removed the sam9x7 compatible from allOf section as it was not needed
  like pointed out
---
 Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml b/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
index 6adedd3ec399..b1c13bab2472 100644
--- a/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
+++ b/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
@@ -25,7 +25,9 @@ properties:
               - atmel,sama5d2-i2c
               - microchip,sam9x60-i2c
       - items:
-          - const: microchip,sama7g5-i2c
+          - enum:
+              - microchip,sama7g5-i2c
+              - microchip,sam9x7-i2c
           - const: microchip,sam9x60-i2c
 
   reg:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 07/39] dt-bindings: atmel-ssc: add microchip,sam9x7-ssc
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (5 preceding siblings ...)
  2024-02-23 17:24 ` [PATCH v4 06/39] dt-bindings: i2c: at91: Add sam9x7 compatible string Varshini Rajendran
@ 2024-02-23 17:25 ` Varshini Rajendran
  2024-02-23 17:25 ` [PATCH v4 08/39] dt-bindings: atmel-nand: add microchip,sam9x7-pmecc Varshini Rajendran
                   ` (36 subsequent siblings)
  43 siblings, 0 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:25 UTC (permalink / raw)
  To: claudiu.beznea, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, linux-arm-kernel, devicetree,
	linux-kernel
  Cc: varshini.rajendran, Krzysztof Kozlowski

Add microchip,sam9x7-ssc to DT bindings documentation.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Changes in v4:
- Updated Acked-by tag
---
 Documentation/devicetree/bindings/misc/atmel-ssc.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/misc/atmel-ssc.txt b/Documentation/devicetree/bindings/misc/atmel-ssc.txt
index f9fb412642fe..894875826de9 100644
--- a/Documentation/devicetree/bindings/misc/atmel-ssc.txt
+++ b/Documentation/devicetree/bindings/misc/atmel-ssc.txt
@@ -2,6 +2,7 @@
 
 Required properties:
 - compatible: "atmel,at91rm9200-ssc" or "atmel,at91sam9g45-ssc"
+	       or "microchip,sam9x7-ssc", "atmel,at91sam9g45-ssc"
 	- atmel,at91rm9200-ssc: support pdc transfer
 	- atmel,at91sam9g45-ssc: support dma transfer
 - reg: Should contain SSC registers location and length
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 08/39] dt-bindings: atmel-nand: add microchip,sam9x7-pmecc
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (6 preceding siblings ...)
  2024-02-23 17:25 ` [PATCH v4 07/39] dt-bindings: atmel-ssc: add microchip,sam9x7-ssc Varshini Rajendran
@ 2024-02-23 17:25 ` Varshini Rajendran
  2024-02-24 19:50   ` Conor Dooley
  2024-02-26 10:43   ` Miquel Raynal
  2024-02-23 17:25 ` [PATCH v4 09/39] dt-bindings: pinctrl: at91: add sam9x7 Varshini Rajendran
                   ` (35 subsequent siblings)
  43 siblings, 2 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:25 UTC (permalink / raw)
  To: tudor.ambarus, miquel.raynal, richard, vigneshr, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linux-mtd, devicetree,
	linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran

Add microchip,sam9x7-pmecc to DT bindings documentation.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
 Documentation/devicetree/bindings/mtd/atmel-nand.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/mtd/atmel-nand.txt b/Documentation/devicetree/bindings/mtd/atmel-nand.txt
index 50645828ac20..4598930851d9 100644
--- a/Documentation/devicetree/bindings/mtd/atmel-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/atmel-nand.txt
@@ -56,6 +56,7 @@ Required properties:
 	"atmel,sama5d4-pmecc"
 	"atmel,sama5d2-pmecc"
 	"microchip,sam9x60-pmecc"
+	"microchip,sam9x7-pmecc", "atmel,at91sam9g45-pmecc"
 - reg: should contain 2 register ranges. The first one is pointing to the PMECC
        block, and the second one to the PMECC_ERRLOC block.
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 09/39] dt-bindings: pinctrl: at91: add sam9x7
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (7 preceding siblings ...)
  2024-02-23 17:25 ` [PATCH v4 08/39] dt-bindings: atmel-nand: add microchip,sam9x7-pmecc Varshini Rajendran
@ 2024-02-23 17:25 ` Varshini Rajendran
  2024-02-29 13:41   ` Linus Walleij
  2024-02-23 17:25 ` [PATCH v4 10/39] dt-bindings: rng: atmel,at91-trng: add sam9x7 TRNG Varshini Rajendran
                   ` (34 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:25 UTC (permalink / raw)
  To: linus.walleij, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea, linux-gpio,
	devicetree, linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran, Krzysztof Kozlowski

Add device tree binding for SAM9X7 pin controller.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Changes in v4:
- Updated Acked-by tag
---
 .../devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt          | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt
index e8abbdad7b5d..0aa1a53012d6 100644
--- a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt
+++ b/Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt
@@ -20,6 +20,7 @@ such as pull-up, multi drive, etc.
 Required properties for iomux controller:
 - compatible: "atmel,at91rm9200-pinctrl" or "atmel,at91sam9x5-pinctrl"
 		or "atmel,sama5d3-pinctrl" or "microchip,sam9x60-pinctrl"
+		or "microchip,sam9x7-pinctrl", "microchip,sam9x60-pinctrl"
 - atmel,mux-mask: array of mask (periph per bank) to describe if a pin can be
   configured in this periph mode. All the periph and bank need to be describe.
 
@@ -120,6 +121,7 @@ Some requirements for using atmel,at91rm9200-pinctrl binding:
 For each bank the required properties are:
 - compatible: "atmel,at91sam9x5-gpio" or "atmel,at91rm9200-gpio" or
   "microchip,sam9x60-gpio"
+  or "microchip,sam9x7-gpio", "microchip,sam9x60-gpio", "atmel,at91rm9200-gpio"
 - reg: physical base address and length of the controller's registers
 - interrupts: interrupt outputs from the controller
 - interrupt-controller: marks the device node as an interrupt controller
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 10/39] dt-bindings: rng: atmel,at91-trng: add sam9x7 TRNG
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (8 preceding siblings ...)
  2024-02-23 17:25 ` [PATCH v4 09/39] dt-bindings: pinctrl: at91: add sam9x7 Varshini Rajendran
@ 2024-02-23 17:25 ` Varshini Rajendran
  2024-02-23 17:25 ` [PATCH v4 11/39] dt-bindings: rtt: at91rm9260: add sam9x7 compatible Varshini Rajendran
                   ` (33 subsequent siblings)
  43 siblings, 0 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:25 UTC (permalink / raw)
  To: olivia, herbert, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea,
	varshini.rajendran, linux-crypto, devicetree, linux-arm-kernel,
	linux-kernel
  Cc: Krzysztof Kozlowski

Add compatbile for Microchip sam9x7 TRNG.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Changes in v4:
- Updated Reviewed-by tag
---
 Documentation/devicetree/bindings/rng/atmel,at91-trng.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/rng/atmel,at91-trng.yaml b/Documentation/devicetree/bindings/rng/atmel,at91-trng.yaml
index 3ce45456d867..b38f8252342e 100644
--- a/Documentation/devicetree/bindings/rng/atmel,at91-trng.yaml
+++ b/Documentation/devicetree/bindings/rng/atmel,at91-trng.yaml
@@ -21,6 +21,10 @@ properties:
           - enum:
               - microchip,sama7g5-trng
           - const: atmel,at91sam9g45-trng
+      - items:
+          - enum:
+              - microchip,sam9x7-trng
+          - const: microchip,sam9x60-trng
 
   clocks:
     maxItems: 1
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 11/39] dt-bindings: rtt: at91rm9260: add sam9x7 compatible
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (9 preceding siblings ...)
  2024-02-23 17:25 ` [PATCH v4 10/39] dt-bindings: rng: atmel,at91-trng: add sam9x7 TRNG Varshini Rajendran
@ 2024-02-23 17:25 ` Varshini Rajendran
  2024-02-24 19:51   ` Conor Dooley
  2024-02-29 21:27   ` (subset) " Alexandre Belloni
  2024-02-23 17:25 ` [PATCH v4 12/39] dt-bindings: serial: atmel,at91-usart: add compatible for sam9x7 Varshini Rajendran
                   ` (32 subsequent siblings)
  43 siblings, 2 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:25 UTC (permalink / raw)
  To: alexandre.belloni, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, claudiu.beznea, linux-rtc, devicetree,
	linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran

Add compatible for SAM9X7 RTT.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
Changes in v4:
- Made sam9x7 compatible as an enum with sam9x60 compatible as
  suggested
---
 .../devicetree/bindings/rtc/atmel,at91sam9260-rtt.yaml        | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/rtc/atmel,at91sam9260-rtt.yaml b/Documentation/devicetree/bindings/rtc/atmel,at91sam9260-rtt.yaml
index b80b85c394ac..a7f6c1d1a08a 100644
--- a/Documentation/devicetree/bindings/rtc/atmel,at91sam9260-rtt.yaml
+++ b/Documentation/devicetree/bindings/rtc/atmel,at91sam9260-rtt.yaml
@@ -19,7 +19,9 @@ properties:
       - items:
           - const: atmel,at91sam9260-rtt
       - items:
-          - const: microchip,sam9x60-rtt
+          - enum:
+              - microchip,sam9x60-rtt
+              - microchip,sam9x7-rtt
           - const: atmel,at91sam9260-rtt
       - items:
           - const: microchip,sama7g5-rtt
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 12/39] dt-bindings: serial: atmel,at91-usart: add compatible for sam9x7.
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (10 preceding siblings ...)
  2024-02-23 17:25 ` [PATCH v4 11/39] dt-bindings: rtt: at91rm9260: add sam9x7 compatible Varshini Rajendran
@ 2024-02-23 17:25 ` Varshini Rajendran
  2024-02-24 20:02   ` Conor Dooley
  2024-02-23 17:26 ` [PATCH v4 13/39] ASoC: dt-bindings: atmel-classd: add sam9x7 compatible Varshini Rajendran
                   ` (31 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:25 UTC (permalink / raw)
  To: radu_nicolae.pirea, richard.genoud, gregkh, jirislaby, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linux-kernel, linux-spi,
	linux-serial, devicetree, linux-arm-kernel
  Cc: varshini.rajendran

Add sam9x7 compatible to DT bindings documentation.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
Changes in v4:
- Fixed the wrong addition of compatible
- Added further compatibles that are possible correct (as per DT)
---
 .../devicetree/bindings/serial/atmel,at91-usart.yaml | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml b/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
index 65cb2e5c5eee..30af537e8e81 100644
--- a/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
+++ b/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
@@ -23,11 +23,17 @@ properties:
           - const: atmel,at91sam9260-dbgu
           - const: atmel,at91sam9260-usart
       - items:
-          - const: microchip,sam9x60-usart
+          - enum:
+              - microchip,sam9x60-usart
+              - microchip,sam9x7-usart
           - const: atmel,at91sam9260-usart
       - items:
-          - const: microchip,sam9x60-dbgu
-          - const: microchip,sam9x60-usart
+          - enum:
+              - microchip,sam9x60-dbgu
+              - microchip,sam9x7-dbgu
+          - enum:
+              - microchip,sam9x60-usart
+              - microchip,sam9x7-usart
           - const: atmel,at91sam9260-dbgu
           - const: atmel,at91sam9260-usart
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 13/39] ASoC: dt-bindings: atmel-classd: add sam9x7 compatible
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (11 preceding siblings ...)
  2024-02-23 17:25 ` [PATCH v4 12/39] dt-bindings: serial: atmel,at91-usart: add compatible for sam9x7 Varshini Rajendran
@ 2024-02-23 17:26 ` Varshini Rajendran
  2024-02-24 19:48   ` Conor Dooley
  2024-02-23 17:26 ` [PATCH v4 14/39] dt-bindings: pwm: at91: Add sam9x7 compatible strings list Varshini Rajendran
                   ` (30 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:26 UTC (permalink / raw)
  To: claudiu.beznea, lgirdwood, broonie, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, alsa-devel, linux-sound, devicetree,
	linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran

Add sam9x7 compatible to DT bindings documentation.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
Changes in v4:
- Changed the subject prefix matching the subsystem
- Removed unwanted '-items' from the syntax
---
 .../devicetree/bindings/sound/atmel,sama5d2-classd.yaml    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/sound/atmel,sama5d2-classd.yaml b/Documentation/devicetree/bindings/sound/atmel,sama5d2-classd.yaml
index 43d04702ac2d..ae3162fcfe02 100644
--- a/Documentation/devicetree/bindings/sound/atmel,sama5d2-classd.yaml
+++ b/Documentation/devicetree/bindings/sound/atmel,sama5d2-classd.yaml
@@ -18,7 +18,12 @@ description:
 
 properties:
   compatible:
-    const: atmel,sama5d2-classd
+    oneOf:
+      - items:
+          - const: atmel,sama5d2-classd
+      - items:
+          - const: microchip,sam9x7-classd
+          - const: atmel,sama5d2-classd
 
   reg:
     maxItems: 1
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 14/39] dt-bindings: pwm: at91: Add sam9x7 compatible strings list
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (12 preceding siblings ...)
  2024-02-23 17:26 ` [PATCH v4 13/39] ASoC: dt-bindings: atmel-classd: add sam9x7 compatible Varshini Rajendran
@ 2024-02-23 17:26 ` Varshini Rajendran
  2024-02-24 20:03   ` Conor Dooley
       [not found]   ` <igmm3npqcnjuhhncfd22pjhjuzbtsl25jfzbpcsyx5bu2xbbto@ynp7psnpldxr>
  2024-02-23 17:26 ` [PATCH v4 15/39] dt-bindings: watchdog: sama5d4-wdt: add compatible for sam9x7-wdt Varshini Rajendran
                   ` (29 subsequent siblings)
  43 siblings, 2 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:26 UTC (permalink / raw)
  To: claudiu.beznea, u.kleine-koenig, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, nicolas.ferre, alexandre.belloni, linux-arm-kernel,
	linux-pwm, devicetree, linux-kernel
  Cc: varshini.rajendran

Add compatible strings list for SAM9X7.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
 Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml b/Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml
index d84268b59784..96cd6f3c3546 100644
--- a/Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml
+++ b/Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml
@@ -25,6 +25,9 @@ properties:
       - items:
           - const: microchip,sama7g5-pwm
           - const: atmel,sama5d2-pwm
+      - items:
+          - const: microchip,sam9x7-pwm
+          - const: microchip,sam9x60-pwm
 
   reg:
     maxItems: 1
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 15/39] dt-bindings: watchdog: sama5d4-wdt: add compatible for sam9x7-wdt
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (13 preceding siblings ...)
  2024-02-23 17:26 ` [PATCH v4 14/39] dt-bindings: pwm: at91: Add sam9x7 compatible strings list Varshini Rajendran
@ 2024-02-23 17:26 ` Varshini Rajendran
  2024-02-24 20:04   ` Conor Dooley
  2024-02-23 17:26 ` [PATCH v4 16/39] spi: dt-bindings: atmel,at91rm9200-spi: remove 9x60 compatible from list Varshini Rajendran
                   ` (28 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:26 UTC (permalink / raw)
  To: wim, linux, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea, eugen.hristev,
	linux-watchdog, devicetree, linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran

Add compatible microchip,sam9x7-wdt to DT bindings documentation.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
Changes in v4:
- Removed unnecessary '-items' from the syntax
- Changed enum as const as per the comment
---
 .../bindings/watchdog/atmel,sama5d4-wdt.yaml         | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/watchdog/atmel,sama5d4-wdt.yaml b/Documentation/devicetree/bindings/watchdog/atmel,sama5d4-wdt.yaml
index 816f85ee2c77..cdf87db36183 100644
--- a/Documentation/devicetree/bindings/watchdog/atmel,sama5d4-wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/atmel,sama5d4-wdt.yaml
@@ -14,10 +14,14 @@ allOf:
 
 properties:
   compatible:
-    enum:
-      - atmel,sama5d4-wdt
-      - microchip,sam9x60-wdt
-      - microchip,sama7g5-wdt
+    oneOf:
+      - enum:
+          - atmel,sama5d4-wdt
+          - microchip,sam9x60-wdt
+          - microchip,sama7g5-wdt
+      - items:
+          - const: microchip,sam9x7-wdt
+          - const: microchip,sam9x60-wdt
 
   reg:
     maxItems: 1
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 16/39] spi: dt-bindings: atmel,at91rm9200-spi: remove 9x60 compatible from list
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (14 preceding siblings ...)
  2024-02-23 17:26 ` [PATCH v4 15/39] dt-bindings: watchdog: sama5d4-wdt: add compatible for sam9x7-wdt Varshini Rajendran
@ 2024-02-23 17:26 ` Varshini Rajendran
  2024-02-26  9:09   ` Tudor Ambarus
  2024-02-23 17:26 ` [PATCH v4 17/39] ASoC: dt-bindings: microchip: add sam9x7 Varshini Rajendran
                   ` (27 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:26 UTC (permalink / raw)
  To: broonie, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea, tudor.ambarus,
	linux-spi, devicetree, linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran

Remove microchip,sam9x60-spi compatible from the list as the driver used
has the compatible atmel,at91rm9200-spi and sam9x60 devices also use the
same compatible as fallback. So removing the microchip,sam9x60-spi
compatible from the list since it is not needed.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
Changes in v4:
- Elaborated the explanation in the commit message to justify the patch
---
 Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml b/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml
index 58367587bfbc..32e7c14033c2 100644
--- a/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml
+++ b/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml
@@ -22,7 +22,6 @@ properties:
           - const: atmel,at91rm9200-spi
       - items:
           - const: microchip,sam9x7-spi
-          - const: microchip,sam9x60-spi
           - const: atmel,at91rm9200-spi
 
   reg:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 17/39] ASoC: dt-bindings: microchip: add sam9x7
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (15 preceding siblings ...)
  2024-02-23 17:26 ` [PATCH v4 16/39] spi: dt-bindings: atmel,at91rm9200-spi: remove 9x60 compatible from list Varshini Rajendran
@ 2024-02-23 17:26 ` Varshini Rajendran
  2024-02-23 17:27 ` [PATCH v4 18/39] ARM: at91: pm: add support for sam9x7 SoC family Varshini Rajendran
                   ` (26 subsequent siblings)
  43 siblings, 0 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:26 UTC (permalink / raw)
  To: claudiu.beznea, lgirdwood, broonie, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, codrin.ciubotariu, alsa-devel,
	linux-sound, devicetree, linux-kernel
  Cc: varshini.rajendran, Conor Dooley

Add sam9x7 compatible in the DT documentation.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
---
Changes in v4:
- Updated Acked-by tag
---
 .../bindings/sound/microchip,sama7g5-i2smcc.yaml      | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/sound/microchip,sama7g5-i2smcc.yaml b/Documentation/devicetree/bindings/sound/microchip,sama7g5-i2smcc.yaml
index 651f61c7c25a..fb630a184350 100644
--- a/Documentation/devicetree/bindings/sound/microchip,sama7g5-i2smcc.yaml
+++ b/Documentation/devicetree/bindings/sound/microchip,sama7g5-i2smcc.yaml
@@ -24,9 +24,14 @@ properties:
     const: 0
 
   compatible:
-    enum:
-      - microchip,sam9x60-i2smcc
-      - microchip,sama7g5-i2smcc
+    oneOf:
+      - enum:
+          - microchip,sam9x60-i2smcc
+          - microchip,sama7g5-i2smcc
+      - items:
+          - enum:
+              - microchip,sam9x7-i2smcc
+          - const: microchip,sam9x60-i2smcc
 
   reg:
     maxItems: 1
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 18/39] ARM: at91: pm: add support for sam9x7 SoC family
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (16 preceding siblings ...)
  2024-02-23 17:26 ` [PATCH v4 17/39] ASoC: dt-bindings: microchip: add sam9x7 Varshini Rajendran
@ 2024-02-23 17:27 ` Varshini Rajendran
  2024-03-03 12:20   ` claudiu beznea
  2024-02-23 17:27 ` [PATCH v4 19/39] ARM: at91: pm: add sam9x7 SoC init config Varshini Rajendran
                   ` (25 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:27 UTC (permalink / raw)
  To: linux, nicolas.ferre, alexandre.belloni, claudiu.beznea,
	linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran, Claudiu Beznea

Add support and pm init config for sam9x7 SoC.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 arch/arm/mach-at91/generic.h |  2 ++
 arch/arm/mach-at91/pm.c      | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 0c3960a8b3eb..acf0b3c82a30 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -12,6 +12,7 @@
 extern void __init at91rm9200_pm_init(void);
 extern void __init at91sam9_pm_init(void);
 extern void __init sam9x60_pm_init(void);
+extern void __init sam9x7_pm_init(void);
 extern void __init sama5_pm_init(void);
 extern void __init sama5d2_pm_init(void);
 extern void __init sama7_pm_init(void);
@@ -19,6 +20,7 @@ extern void __init sama7_pm_init(void);
 static inline void __init at91rm9200_pm_init(void) { }
 static inline void __init at91sam9_pm_init(void) { }
 static inline void __init sam9x60_pm_init(void) { }
+static inline void __init sam9x7_pm_init(void) { }
 static inline void __init sama5_pm_init(void) { }
 static inline void __init sama5d2_pm_init(void) { }
 static inline void __init sama7_pm_init(void) { }
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 345b91dc6627..b81556387aa3 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -233,6 +233,17 @@ static const struct of_device_id sama7g5_ws_ids[] = {
 	{ /* sentinel */ }
 };
 
+static const struct of_device_id sam9x7_ws_ids[] = {
+	{ .compatible = "microchip,sam9x60-rtc",	.data = &ws_info[1] },
+	{ .compatible = "atmel,at91rm9200-ohci",	.data = &ws_info[2] },
+	{ .compatible = "usb-ohci",			.data = &ws_info[2] },
+	{ .compatible = "atmel,at91sam9g45-ehci",	.data = &ws_info[2] },
+	{ .compatible = "usb-ehci",			.data = &ws_info[2] },
+	{ .compatible = "microchip,sam9x60-rtt",	.data = &ws_info[4] },
+	{ .compatible = "microchip,sam9x7-gem",		.data = &ws_info[5] },
+	{ /* sentinel */ }
+};
+
 static int at91_pm_config_ws(unsigned int pm_mode, bool set)
 {
 	const struct wakeup_source_info *wsi;
@@ -1135,6 +1146,7 @@ static const struct of_device_id gmac_ids[] __initconst = {
 	{ .compatible = "atmel,sama5d2-gem" },
 	{ .compatible = "atmel,sama5d29-gem" },
 	{ .compatible = "microchip,sama7g5-gem" },
+	{ .compatible = "microchip,sam9x7-gem" },
 	{ },
 };
 
@@ -1362,6 +1374,7 @@ static const struct of_device_id atmel_pmc_ids[] __initconst = {
 	{ .compatible = "atmel,sama5d2-pmc", .data = &pmc_infos[1] },
 	{ .compatible = "microchip,sam9x60-pmc", .data = &pmc_infos[4] },
 	{ .compatible = "microchip,sama7g5-pmc", .data = &pmc_infos[5] },
+	{ .compatible = "microchip,sam9x7-pmc", .data = &pmc_infos[4] },
 	{ /* sentinel */ },
 };
 
@@ -1499,6 +1512,28 @@ void __init sam9x60_pm_init(void)
 	soc_pm.config_pmc_ws = at91_sam9x60_config_pmc_ws;
 }
 
+void __init sam9x7_pm_init(void)
+{
+	static const int modes[] __initconst = {
+		AT91_PM_STANDBY, AT91_PM_ULP0,
+	};
+
+	int ret;
+
+	if (!IS_ENABLED(CONFIG_SOC_SAM9X7))
+		return;
+
+	at91_pm_modes_validate(modes, ARRAY_SIZE(modes));
+	ret = at91_dt_ramc(false);
+	if (ret)
+		return;
+
+	at91_pm_init(NULL);
+
+	soc_pm.ws_ids = sam9x7_ws_ids;
+	soc_pm.config_pmc_ws = at91_sam9x60_config_pmc_ws;
+}
+
 void __init at91sam9_pm_init(void)
 {
 	int ret;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 19/39] ARM: at91: pm: add sam9x7 SoC init config
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (17 preceding siblings ...)
  2024-02-23 17:27 ` [PATCH v4 18/39] ARM: at91: pm: add support for sam9x7 SoC family Varshini Rajendran
@ 2024-02-23 17:27 ` Varshini Rajendran
  2024-03-03 12:20   ` claudiu beznea
  2024-02-23 17:27 ` [PATCH v4 20/39] ARM: at91: add support in SoC driver for new sam9x7 Varshini Rajendran
                   ` (24 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:27 UTC (permalink / raw)
  To: linux, nicolas.ferre, alexandre.belloni, claudiu.beznea,
	linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran

Add SoC init config for sam9x7 family.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
 arch/arm/mach-at91/Makefile |  1 +
 arch/arm/mach-at91/sam9x7.c | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 arch/arm/mach-at91/sam9x7.c

diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 794bd12ab0a8..7d8a7bc44e65 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -7,6 +7,7 @@
 obj-$(CONFIG_SOC_AT91RM9200)	+= at91rm9200.o
 obj-$(CONFIG_SOC_AT91SAM9)	+= at91sam9.o
 obj-$(CONFIG_SOC_SAM9X60)	+= sam9x60.o
+obj-$(CONFIG_SOC_SAM9X7)	+= sam9x7.o
 obj-$(CONFIG_SOC_SAMA5)		+= sama5.o sam_secure.o
 obj-$(CONFIG_SOC_SAMA7)		+= sama7.o
 obj-$(CONFIG_SOC_SAMV7)		+= samv7.o
diff --git a/arch/arm/mach-at91/sam9x7.c b/arch/arm/mach-at91/sam9x7.c
new file mode 100644
index 000000000000..d998fb327860
--- /dev/null
+++ b/arch/arm/mach-at91/sam9x7.c
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Setup code for SAM9X7.
+ *
+ * Copyright (C) 2023 Microchip Technology Inc. and its subsidiaries
+ *
+ * Author: Varshini Rajendran <varshini.rajendran@microchip.com>
+ */
+
+#include <linux/of.h>
+#include <linux/of_platform.h>
+
+#include <asm/mach/arch.h>
+#include <asm/system_misc.h>
+
+#include "generic.h"
+
+static void __init sam9x7_init(void)
+{
+	of_platform_default_populate(NULL, NULL, NULL);
+
+	sam9x7_pm_init();
+}
+
+static const char *const sam9x7_dt_board_compat[] __initconst = {
+	"microchip,sam9x7",
+	NULL
+};
+
+DT_MACHINE_START(sam9x7_dt, "Microchip SAM9X7")
+	/* Maintainer: Microchip */
+	.init_machine	= sam9x7_init,
+	.dt_compat	= sam9x7_dt_board_compat,
+MACHINE_END
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 20/39] ARM: at91: add support in SoC driver for new sam9x7
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (18 preceding siblings ...)
  2024-02-23 17:27 ` [PATCH v4 19/39] ARM: at91: pm: add sam9x7 SoC init config Varshini Rajendran
@ 2024-02-23 17:27 ` Varshini Rajendran
  2024-02-26 17:01   ` Nicolas Ferre
  2024-03-03 12:21   ` claudiu beznea
  2024-02-23 17:27 ` [PATCH v4 21/39] dt-bindings: clk: at91: add sam9x7 Varshini Rajendran
                   ` (23 subsequent siblings)
  43 siblings, 2 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:27 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, claudiu.beznea,
	varshini.rajendran, linux-arm-kernel, linux-kernel
  Cc: Claudiu Beznea

Add support for SAM9X7 SoC in the SoC driver.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
Changes in v4:
- Sorted the entries alphabetically as per comment from Claudiu
- Updated EXID
Note: Did not remove the Reviewed-by tag since the changes were only
cosmetic and did not affect functionality
---
 drivers/soc/atmel/soc.c | 23 +++++++++++++++++++++++
 drivers/soc/atmel/soc.h |  9 +++++++++
 2 files changed, 32 insertions(+)

diff --git a/drivers/soc/atmel/soc.c b/drivers/soc/atmel/soc.c
index cc9a3e107479..cae3452cbc60 100644
--- a/drivers/soc/atmel/soc.c
+++ b/drivers/soc/atmel/soc.c
@@ -101,6 +101,29 @@ static const struct at91_soc socs[] __initconst = {
 		 AT91_CIDR_VERSION_MASK, SAM9X60_D6K_EXID_MATCH,
 		 "sam9x60 8MiB SDRAM SiP", "sam9x60"),
 #endif
+#ifdef CONFIG_SOC_SAM9X7
+	AT91_SOC(SAM9X7_CIDR_MATCH, AT91_CIDR_MATCH_MASK,
+		 AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
+		 "sam9x75", "sam9x7"),
+	AT91_SOC(SAM9X7_CIDR_MATCH, AT91_CIDR_MATCH_MASK,
+		 AT91_CIDR_VERSION_MASK, SAM9X72_EXID_MATCH,
+		 "sam9x72", "sam9x7"),
+	AT91_SOC(SAM9X7_CIDR_MATCH, AT91_CIDR_MATCH_MASK,
+		 AT91_CIDR_VERSION_MASK, SAM9X70_EXID_MATCH,
+		 "sam9x70", "sam9x7"),
+	AT91_SOC(SAM9X7_CIDR_MATCH, SAM9X75_D1G_EXID_MATCH,
+		 AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
+		 "sam9x75 1Gb DDR3L SiP ", "sam9x7"),
+	AT91_SOC(SAM9X7_CIDR_MATCH, SAM9X75_D5M_EXID_MATCH,
+		 AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
+		 "sam9x75 512Mb DDR2 SiP", "sam9x7"),
+	AT91_SOC(SAM9X7_CIDR_MATCH, SAM9X75_D1M_EXID_MATCH,
+		 AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
+		 "sam9x75 128Mb DDR2 SiP", "sam9x7"),
+	AT91_SOC(SAM9X7_CIDR_MATCH, SAM9X75_D2G_EXID_MATCH,
+		 AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
+		 "sam9x75 2Gb DDR3L SiP", "sam9x7"),
+#endif
 #ifdef CONFIG_SOC_SAMA5
 	AT91_SOC(SAMA5D2_CIDR_MATCH, AT91_CIDR_MATCH_MASK,
 		 AT91_CIDR_VERSION_MASK, SAMA5D21CU_EXID_MATCH,
diff --git a/drivers/soc/atmel/soc.h b/drivers/soc/atmel/soc.h
index 7a9f47ce85fb..fc4157c5f6e3 100644
--- a/drivers/soc/atmel/soc.h
+++ b/drivers/soc/atmel/soc.h
@@ -44,6 +44,7 @@ at91_soc_init(const struct at91_soc *socs);
 #define AT91SAM9X5_CIDR_MATCH		0x019a05a0
 #define AT91SAM9N12_CIDR_MATCH		0x019a07a0
 #define SAM9X60_CIDR_MATCH		0x019b35a0
+#define SAM9X7_CIDR_MATCH		0x09750020
 #define SAMA7G5_CIDR_MATCH		0x00162100
 
 #define AT91SAM9M11_EXID_MATCH		0x00000001
@@ -74,6 +75,14 @@ at91_soc_init(const struct at91_soc *socs);
 #define SAMA7G54_D2G_EXID_MATCH		0x00000020
 #define SAMA7G54_D4G_EXID_MATCH		0x00000028
 
+#define SAM9X70_EXID_MATCH		0x00000005
+#define SAM9X72_EXID_MATCH		0x00000004
+#define SAM9X75_D1G_EXID_MATCH		0x00000018
+#define SAM9X75_D2G_EXID_MATCH		0x00000020
+#define SAM9X75_D1M_EXID_MATCH		0x00000003
+#define SAM9X75_D5M_EXID_MATCH		0x00000010
+#define SAM9X75_EXID_MATCH		0x00000000
+
 #define AT91SAM9XE128_CIDR_MATCH	0x329973a0
 #define AT91SAM9XE256_CIDR_MATCH	0x329a93a0
 #define AT91SAM9XE512_CIDR_MATCH	0x329aa3a0
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 21/39] dt-bindings: clk: at91: add sam9x7
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (19 preceding siblings ...)
  2024-02-23 17:27 ` [PATCH v4 20/39] ARM: at91: add support in SoC driver for new sam9x7 Varshini Rajendran
@ 2024-02-23 17:27 ` Varshini Rajendran
  2024-02-24 20:05   ` Conor Dooley
  2024-03-11  5:32   ` claudiu beznea
  2024-02-23 17:27 ` [PATCH v4 22/39] dt-bindings: clk: at91: add sam9x7 clock controller Varshini Rajendran
                   ` (22 subsequent siblings)
  43 siblings, 2 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:27 UTC (permalink / raw)
  To: mturquette, sboyd, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea, linux-clk,
	devicetree, linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran

Add bindings for SAM9X7's slow clock controller.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
Changes in v4:
- Added sam9x7 compatible as an enum with sama7g5 compatible as per the
  review comment
---
 .../devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml b/Documentation/devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml
index 7be29877e6d2..ab81f0b55ad5 100644
--- a/Documentation/devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml
+++ b/Documentation/devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml
@@ -18,7 +18,9 @@ properties:
           - atmel,sama5d4-sckc
           - microchip,sam9x60-sckc
       - items:
-          - const: microchip,sama7g5-sckc
+          - enum:
+              - microchip,sama7g5-sckc
+              - microchip,sam9x7-sckc
           - const: microchip,sam9x60-sckc
 
   reg:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 22/39] dt-bindings: clk: at91: add sam9x7 clock controller
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (20 preceding siblings ...)
  2024-02-23 17:27 ` [PATCH v4 21/39] dt-bindings: clk: at91: add sam9x7 Varshini Rajendran
@ 2024-02-23 17:27 ` Varshini Rajendran
  2024-02-24 20:06   ` Conor Dooley
  2024-03-11  5:33   ` claudiu beznea
  2024-02-23 17:27 ` [PATCH v4 23/39] clk: at91: clk-sam9x60-pll: re-factor to support individual core freq outputs Varshini Rajendran
                   ` (21 subsequent siblings)
  43 siblings, 2 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:27 UTC (permalink / raw)
  To: mturquette, sboyd, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea, linux-clk,
	devicetree, linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran

Add bindings for SAM9X7's pmc.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
Changes in v4:
- Added the sam9x7 compatible in the allOf section
---
 .../devicetree/bindings/clock/atmel,at91rm9200-pmc.yaml         | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/clock/atmel,at91rm9200-pmc.yaml b/Documentation/devicetree/bindings/clock/atmel,at91rm9200-pmc.yaml
index c1bdcd9058ed..eb5cd33ea9aa 100644
--- a/Documentation/devicetree/bindings/clock/atmel,at91rm9200-pmc.yaml
+++ b/Documentation/devicetree/bindings/clock/atmel,at91rm9200-pmc.yaml
@@ -43,6 +43,7 @@ properties:
               - atmel,sama5d4-pmc
               - microchip,sam9x60-pmc
               - microchip,sama7g5-pmc
+              - microchip,sam9x7-pmc
           - const: syscon
 
   reg:
@@ -89,6 +90,7 @@ allOf:
             enum:
               - microchip,sam9x60-pmc
               - microchip,sama7g5-pmc
+              - microchip,sam9x7-pmc
     then:
       properties:
         clocks:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 23/39] clk: at91: clk-sam9x60-pll: re-factor to support individual core freq outputs
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (21 preceding siblings ...)
  2024-02-23 17:27 ` [PATCH v4 22/39] dt-bindings: clk: at91: add sam9x7 clock controller Varshini Rajendran
@ 2024-02-23 17:27 ` Varshini Rajendran
  2024-02-23 17:27 ` [PATCH v4 24/39] clk: at91: sam9x7: add support for HW PLL freq dividers Varshini Rajendran
                   ` (20 subsequent siblings)
  43 siblings, 0 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:27 UTC (permalink / raw)
  To: mturquette, sboyd, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, varshini.rajendran, mripard, linux-clk,
	linux-arm-kernel, linux-kernel

SAM9X7 SoC family supports different core output frequencies for
different PLL IDs. To handle the same in the PLL driver, a separate
parameter core_output is added. The sam9x60 and sama7g5 SoC PMC drivers
are aligned to the PLL driver by adding the core output freq range in
the PLL characteristics configurations.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
 drivers/clk/at91/clk-sam9x60-pll.c | 12 ++++++------
 drivers/clk/at91/pmc.h             |  1 +
 drivers/clk/at91/sam9x60.c         |  7 +++++++
 drivers/clk/at91/sama7g5.c         |  7 +++++++
 4 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/at91/clk-sam9x60-pll.c b/drivers/clk/at91/clk-sam9x60-pll.c
index ff65f7b916f0..b0314dfd7393 100644
--- a/drivers/clk/at91/clk-sam9x60-pll.c
+++ b/drivers/clk/at91/clk-sam9x60-pll.c
@@ -23,9 +23,6 @@
 #define UPLL_DIV		2
 #define PLL_MUL_MAX		(FIELD_GET(PMC_PLL_CTRL1_MUL_MSK, UINT_MAX) + 1)
 
-#define FCORE_MIN		(600000000)
-#define FCORE_MAX		(1200000000)
-
 #define PLL_MAX_ID		7
 
 struct sam9x60_pll_core {
@@ -194,7 +191,8 @@ static long sam9x60_frac_pll_compute_mul_frac(struct sam9x60_pll_core *core,
 	unsigned long nmul = 0;
 	unsigned long nfrac = 0;
 
-	if (rate < FCORE_MIN || rate > FCORE_MAX)
+	if (rate < core->characteristics->core_output[0].min ||
+	    rate > core->characteristics->core_output[0].max)
 		return -ERANGE;
 
 	/*
@@ -214,7 +212,8 @@ static long sam9x60_frac_pll_compute_mul_frac(struct sam9x60_pll_core *core,
 	}
 
 	/* Check if resulted rate is a valid.  */
-	if (tmprate < FCORE_MIN || tmprate > FCORE_MAX)
+	if (tmprate < core->characteristics->core_output[0].min ||
+	    tmprate > core->characteristics->core_output[0].max)
 		return -ERANGE;
 
 	if (update) {
@@ -669,7 +668,8 @@ sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock,
 			goto free;
 		}
 
-		ret = sam9x60_frac_pll_compute_mul_frac(&frac->core, FCORE_MIN,
+		ret = sam9x60_frac_pll_compute_mul_frac(&frac->core,
+							characteristics->core_output[0].min,
 							parent_rate, true);
 		if (ret < 0) {
 			hw = ERR_PTR(ret);
diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h
index 0f52e80bcd49..bb9da35198d9 100644
--- a/drivers/clk/at91/pmc.h
+++ b/drivers/clk/at91/pmc.h
@@ -75,6 +75,7 @@ struct clk_pll_characteristics {
 	struct clk_range input;
 	int num_output;
 	const struct clk_range *output;
+	const struct clk_range *core_output;
 	u16 *icpll;
 	u8 *out;
 	u8 upll : 1;
diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c
index e309cbf3cb9a..db6db9e2073e 100644
--- a/drivers/clk/at91/sam9x60.c
+++ b/drivers/clk/at91/sam9x60.c
@@ -26,10 +26,16 @@ static const struct clk_range plla_outputs[] = {
 	{ .min = 2343750, .max = 1200000000 },
 };
 
+/* Fractional PLL core output range. */
+static const struct clk_range core_outputs[] = {
+	{ .min = 600000000, .max = 1200000000 },
+};
+
 static const struct clk_pll_characteristics plla_characteristics = {
 	.input = { .min = 12000000, .max = 48000000 },
 	.num_output = ARRAY_SIZE(plla_outputs),
 	.output = plla_outputs,
+	.core_output = core_outputs,
 };
 
 static const struct clk_range upll_outputs[] = {
@@ -40,6 +46,7 @@ static const struct clk_pll_characteristics upll_characteristics = {
 	.input = { .min = 12000000, .max = 48000000 },
 	.num_output = ARRAY_SIZE(upll_outputs),
 	.output = upll_outputs,
+	.core_output = core_outputs,
 	.upll = true,
 };
 
diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c
index 91b5c6f14819..e6eb5afba93d 100644
--- a/drivers/clk/at91/sama7g5.c
+++ b/drivers/clk/at91/sama7g5.c
@@ -116,11 +116,17 @@ static const struct clk_range pll_outputs[] = {
 	{ .min = 2343750, .max = 1200000000 },
 };
 
+/* Fractional PLL core output range. */
+static const struct clk_range core_outputs[] = {
+	{ .min = 600000000, .max = 1200000000 },
+};
+
 /* CPU PLL characteristics. */
 static const struct clk_pll_characteristics cpu_pll_characteristics = {
 	.input = { .min = 12000000, .max = 50000000 },
 	.num_output = ARRAY_SIZE(cpu_pll_outputs),
 	.output = cpu_pll_outputs,
+	.core_output = core_outputs,
 };
 
 /* PLL characteristics. */
@@ -128,6 +134,7 @@ static const struct clk_pll_characteristics pll_characteristics = {
 	.input = { .min = 12000000, .max = 50000000 },
 	.num_output = ARRAY_SIZE(pll_outputs),
 	.output = pll_outputs,
+	.core_output = core_outputs,
 };
 
 /*
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 24/39] clk: at91: sam9x7: add support for HW PLL freq dividers
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (22 preceding siblings ...)
  2024-02-23 17:27 ` [PATCH v4 23/39] clk: at91: clk-sam9x60-pll: re-factor to support individual core freq outputs Varshini Rajendran
@ 2024-02-23 17:27 ` Varshini Rajendran
  2024-03-11  5:34   ` claudiu beznea
  2024-02-23 17:28 ` [PATCH v4 25/39] clk: at91: sama7g5: move mux table macros to header file Varshini Rajendran
                   ` (19 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:27 UTC (permalink / raw)
  To: mturquette, sboyd, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, varshini.rajendran, mripard, linux-clk,
	linux-arm-kernel, linux-kernel

Add support for hardware dividers for PLL IDs in sam9x7 SoC. The system
PLL - PLLA and the system PLL divided by 2 - PLLADIV2 with PLL ID 0 and
4 respectively, both have a hardware divider /2. This has to taken into
account in the software to obtain the right frequencies. Support for the
same is added in the PLL driver.

fcorepllack -----> HW Div = 2 -+--> fpllack
                               |
                               +--> HW Div = 2 ---> fplladiv2ck

In this case the corepll freq is 1600 MHz. So, the plla freq is 800 MHz
after the hardware divider and the plladiv2 freq is 400 MHz after the
hardware divider (Given that the DIVPMC is 0).

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
 drivers/clk/at91/clk-sam9x60-pll.c | 38 ++++++++++++++++++++++++++----
 drivers/clk/at91/pmc.h             |  1 +
 2 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/at91/clk-sam9x60-pll.c b/drivers/clk/at91/clk-sam9x60-pll.c
index b0314dfd7393..1f80759309c0 100644
--- a/drivers/clk/at91/clk-sam9x60-pll.c
+++ b/drivers/clk/at91/clk-sam9x60-pll.c
@@ -73,9 +73,15 @@ static unsigned long sam9x60_frac_pll_recalc_rate(struct clk_hw *hw,
 {
 	struct sam9x60_pll_core *core = to_sam9x60_pll_core(hw);
 	struct sam9x60_frac *frac = to_sam9x60_frac(core);
+	unsigned long freq;
 
-	return parent_rate * (frac->mul + 1) +
+	freq = parent_rate * (frac->mul + 1) +
 		DIV_ROUND_CLOSEST_ULL((u64)parent_rate * frac->frac, (1 << 22));
+
+	if (core->layout->div2)
+		freq >>= 1;
+
+	return freq;
 }
 
 static int sam9x60_frac_pll_set(struct sam9x60_pll_core *core)
@@ -432,6 +438,12 @@ static unsigned long sam9x60_div_pll_recalc_rate(struct clk_hw *hw,
 	return DIV_ROUND_CLOSEST_ULL(parent_rate, (div->div + 1));
 }
 
+static unsigned long sam9x60_fixed_div_pll_recalc_rate(struct clk_hw *hw,
+						       unsigned long parent_rate)
+{
+	return parent_rate >> 1;
+}
+
 static long sam9x60_div_pll_compute_div(struct sam9x60_pll_core *core,
 					unsigned long *parent_rate,
 					unsigned long rate)
@@ -606,6 +618,16 @@ static const struct clk_ops sam9x60_div_pll_ops_chg = {
 	.restore_context = sam9x60_div_pll_restore_context,
 };
 
+static const struct clk_ops sam9x60_fixed_div_pll_ops = {
+	.prepare = sam9x60_div_pll_prepare,
+	.unprepare = sam9x60_div_pll_unprepare,
+	.is_prepared = sam9x60_div_pll_is_prepared,
+	.recalc_rate = sam9x60_fixed_div_pll_recalc_rate,
+	.round_rate = sam9x60_div_pll_round_rate,
+	.save_context = sam9x60_div_pll_save_context,
+	.restore_context = sam9x60_div_pll_restore_context,
+};
+
 struct clk_hw * __init
 sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock,
 			      const char *name, const char *parent_name,
@@ -725,10 +747,16 @@ sam9x60_clk_register_div_pll(struct regmap *regmap, spinlock_t *lock,
 	else
 		init.parent_names = &parent_name;
 	init.num_parents = 1;
-	if (flags & CLK_SET_RATE_GATE)
-		init.ops = &sam9x60_div_pll_ops;
-	else
-		init.ops = &sam9x60_div_pll_ops_chg;
+
+	if (layout->div2) {
+		init.ops = &sam9x60_fixed_div_pll_ops;
+	} else {
+		if (flags & CLK_SET_RATE_GATE)
+			init.ops = &sam9x60_div_pll_ops;
+		else
+			init.ops = &sam9x60_div_pll_ops_chg;
+	}
+
 	init.flags = flags;
 
 	div->core.id = id;
diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h
index bb9da35198d9..91d1c6305d95 100644
--- a/drivers/clk/at91/pmc.h
+++ b/drivers/clk/at91/pmc.h
@@ -64,6 +64,7 @@ struct clk_pll_layout {
 	u8 frac_shift;
 	u8 div_shift;
 	u8 endiv_shift;
+	u8 div2;
 };
 
 extern const struct clk_pll_layout at91rm9200_pll_layout;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 25/39] clk: at91: sama7g5: move mux table macros to header file
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (23 preceding siblings ...)
  2024-02-23 17:27 ` [PATCH v4 24/39] clk: at91: sam9x7: add support for HW PLL freq dividers Varshini Rajendran
@ 2024-02-23 17:28 ` Varshini Rajendran
  2024-02-23 17:28 ` [PATCH v4 26/39] dt-bindings: clock: at91: Allow PLLs to be exported and referenced in DT Varshini Rajendran
                   ` (18 subsequent siblings)
  43 siblings, 0 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:28 UTC (permalink / raw)
  To: mturquette, sboyd, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, mripard, varshini.rajendran, linux-clk,
	linux-arm-kernel, linux-kernel

Move the mux table init and fill macro function definitions from the
sama7g5 pmc driver to the pmc.h header file since they will be used
by other SoC's pmc drivers as well like sam9x7.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
 drivers/clk/at91/pmc.h     | 16 ++++++++++++++++
 drivers/clk/at91/sama7g5.c | 35 ++++++++++-------------------------
 2 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h
index 91d1c6305d95..4fb29ca111f7 100644
--- a/drivers/clk/at91/pmc.h
+++ b/drivers/clk/at91/pmc.h
@@ -121,6 +121,22 @@ struct at91_clk_pms {
 
 #define ndck(a, s) (a[s - 1].id + 1)
 #define nck(a) (a[ARRAY_SIZE(a) - 1].id + 1)
+
+#define PMC_INIT_TABLE(_table, _count)			\
+	do {						\
+		u8 _i;					\
+		for (_i = 0; _i < (_count); _i++)	\
+			(_table)[_i] = _i;		\
+	} while (0)
+
+#define PMC_FILL_TABLE(_to, _from, _count)		\
+	do {						\
+		u8 _i;					\
+		for (_i = 0; _i < (_count); _i++) {	\
+			(_to)[_i] = (_from)[_i];	\
+		}					\
+	} while (0)
+
 struct pmc_data *pmc_data_allocate(unsigned int ncore, unsigned int nsystem,
 				   unsigned int nperiph, unsigned int ngck,
 				   unsigned int npck);
diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c
index e6eb5afba93d..6706d1305baa 100644
--- a/drivers/clk/at91/sama7g5.c
+++ b/drivers/clk/at91/sama7g5.c
@@ -16,21 +16,6 @@
 
 #include "pmc.h"
 
-#define SAMA7G5_INIT_TABLE(_table, _count)		\
-	do {						\
-		u8 _i;					\
-		for (_i = 0; _i < (_count); _i++)	\
-			(_table)[_i] = _i;		\
-	} while (0)
-
-#define SAMA7G5_FILL_TABLE(_to, _from, _count)		\
-	do {						\
-		u8 _i;					\
-		for (_i = 0; _i < (_count); _i++) {	\
-			(_to)[_i] = (_from)[_i];	\
-		}					\
-	} while (0)
-
 static DEFINE_SPINLOCK(pmc_pll_lock);
 static DEFINE_SPINLOCK(pmc_mck0_lock);
 static DEFINE_SPINLOCK(pmc_mckX_lock);
@@ -1119,17 +1104,17 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
 		if (!mux_table)
 			goto err_free;
 
-		SAMA7G5_INIT_TABLE(mux_table, 3);
-		SAMA7G5_FILL_TABLE(&mux_table[3], sama7g5_mckx[i].ep_mux_table,
-				   sama7g5_mckx[i].ep_count);
+		PMC_INIT_TABLE(mux_table, 3);
+		PMC_FILL_TABLE(&mux_table[3], sama7g5_mckx[i].ep_mux_table,
+			       sama7g5_mckx[i].ep_count);
 		for (j = 0; j < sama7g5_mckx[i].ep_count; j++) {
 			u8 pll_id = sama7g5_mckx[i].ep[j].pll_id;
 			u8 pll_compid = sama7g5_mckx[i].ep[j].pll_compid;
 
 			tmp_parent_hws[j] = sama7g5_plls[pll_id][pll_compid].hw;
 		}
-		SAMA7G5_FILL_TABLE(&parent_hws[3], tmp_parent_hws,
-				   sama7g5_mckx[i].ep_count);
+		PMC_FILL_TABLE(&parent_hws[3], tmp_parent_hws,
+			       sama7g5_mckx[i].ep_count);
 
 		hw = at91_clk_sama7g5_register_master(regmap, sama7g5_mckx[i].n,
 				   num_parents, NULL, parent_hws, mux_table,
@@ -1215,17 +1200,17 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
 		if (!mux_table)
 			goto err_free;
 
-		SAMA7G5_INIT_TABLE(mux_table, 3);
-		SAMA7G5_FILL_TABLE(&mux_table[3], sama7g5_gck[i].pp_mux_table,
-				   sama7g5_gck[i].pp_count);
+		PMC_INIT_TABLE(mux_table, 3);
+		PMC_FILL_TABLE(&mux_table[3], sama7g5_gck[i].pp_mux_table,
+			       sama7g5_gck[i].pp_count);
 		for (j = 0; j < sama7g5_gck[i].pp_count; j++) {
 			u8 pll_id = sama7g5_gck[i].pp[j].pll_id;
 			u8 pll_compid = sama7g5_gck[i].pp[j].pll_compid;
 
 			tmp_parent_hws[j] = sama7g5_plls[pll_id][pll_compid].hw;
 		}
-		SAMA7G5_FILL_TABLE(&parent_hws[3], tmp_parent_hws,
-				   sama7g5_gck[i].pp_count);
+		PMC_FILL_TABLE(&parent_hws[3], tmp_parent_hws,
+			       sama7g5_gck[i].pp_count);
 
 		hw = at91_clk_register_generated(regmap, &pmc_pcr_lock,
 						 &sama7g5_pcr_layout,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 26/39] dt-bindings: clock: at91: Allow PLLs to be exported and referenced in DT
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (24 preceding siblings ...)
  2024-02-23 17:28 ` [PATCH v4 25/39] clk: at91: sama7g5: move mux table macros to header file Varshini Rajendran
@ 2024-02-23 17:28 ` Varshini Rajendran
  2024-03-01 21:26   ` Rob Herring
  2024-02-23 17:28 ` [PATCH v4 27/39] clk: at91: sam9x7: add sam9x7 pmc driver Varshini Rajendran
                   ` (17 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:28 UTC (permalink / raw)
  To: mturquette, sboyd, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea, linux-clk,
	devicetree, linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran

Allow PLLADIV2 and LVDSPLL to be referenced as a PMC_TYPE_CORE
clock from phandle in DT for sam9x7 SoC family.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
 include/dt-bindings/clock/at91.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/dt-bindings/clock/at91.h b/include/dt-bindings/clock/at91.h
index 3e3972a814c1..6ede88c3992d 100644
--- a/include/dt-bindings/clock/at91.h
+++ b/include/dt-bindings/clock/at91.h
@@ -38,6 +38,10 @@
 #define PMC_CPU			(PMC_MAIN + 9)
 #define PMC_MCK1		(PMC_MAIN + 10)
 
+/* SAM9X7 */
+#define PMC_PLLADIV2		(PMC_MAIN + 11)
+#define PMC_LVDSPLL		(PMC_MAIN + 12)
+
 #ifndef AT91_PMC_MOSCS
 #define AT91_PMC_MOSCS		0		/* MOSCS Flag */
 #define AT91_PMC_LOCKA		1		/* PLLA Lock */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 27/39] clk: at91: sam9x7: add sam9x7 pmc driver
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (25 preceding siblings ...)
  2024-02-23 17:28 ` [PATCH v4 26/39] dt-bindings: clock: at91: Allow PLLs to be exported and referenced in DT Varshini Rajendran
@ 2024-02-23 17:28 ` Varshini Rajendran
  2024-03-11  5:58   ` claudiu beznea
  2024-02-23 17:28 ` [PATCH v4 28/39] dt-bindings: irqchip/atmel-aic5: Add support for sam9x7 aic Varshini Rajendran
                   ` (16 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:28 UTC (permalink / raw)
  To: mturquette, sboyd, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, varshini.rajendran, linux-kernel, linux-clk,
	linux-arm-kernel

Add a driver for the PMC clocks of sam9x7 Soc family.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
Changes in v4:
- Changed variable name alloc_mem to clk_mux_buffer to be more
  suggestive
- Changed description of @f structure member appropriately
---
 drivers/clk/at91/Makefile |   1 +
 drivers/clk/at91/sam9x7.c | 946 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 947 insertions(+)
 create mode 100644 drivers/clk/at91/sam9x7.c

diff --git a/drivers/clk/at91/Makefile b/drivers/clk/at91/Makefile
index 89061b85e7d2..8e3684ba2c74 100644
--- a/drivers/clk/at91/Makefile
+++ b/drivers/clk/at91/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_SOC_AT91SAM9) += at91sam9260.o at91sam9rl.o at91sam9x5.o dt-compat.
 obj-$(CONFIG_SOC_AT91SAM9) += at91sam9g45.o dt-compat.o
 obj-$(CONFIG_SOC_AT91SAM9) += at91sam9n12.o at91sam9x5.o dt-compat.o
 obj-$(CONFIG_SOC_SAM9X60) += sam9x60.o
+obj-$(CONFIG_SOC_SAM9X7) += sam9x7.o
 obj-$(CONFIG_SOC_SAMA5D3) += sama5d3.o dt-compat.o
 obj-$(CONFIG_SOC_SAMA5D4) += sama5d4.o dt-compat.o
 obj-$(CONFIG_SOC_SAMA5D2) += sama5d2.o dt-compat.o
diff --git a/drivers/clk/at91/sam9x7.c b/drivers/clk/at91/sam9x7.c
new file mode 100644
index 000000000000..d03387d2e35a
--- /dev/null
+++ b/drivers/clk/at91/sam9x7.c
@@ -0,0 +1,946 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * SAM9X7 PMC code.
+ *
+ * Copyright (C) 2023 Microchip Technology Inc. and its subsidiaries
+ *
+ * Author: Varshini Rajendran <varshini.rajendran@microchip.com>
+ *
+ */
+#include <linux/clk.h>
+#include <linux/clk-provider.h>
+#include <linux/mfd/syscon.h>
+#include <linux/slab.h>
+
+#include <dt-bindings/clock/at91.h>
+
+#include "pmc.h"
+
+static DEFINE_SPINLOCK(pmc_pll_lock);
+static DEFINE_SPINLOCK(mck_lock);
+
+/**
+ * enum pll_ids - PLL clocks identifiers
+ * @PLL_ID_PLLA:	PLLA identifier
+ * @PLL_ID_UPLL:	UPLL identifier
+ * @PLL_ID_AUDIO:	Audio PLL identifier
+ * @PLL_ID_LVDS:	LVDS PLL identifier
+ * @PLL_ID_PLLA_DIV2:	PLLA DIV2 identifier
+ * @PLL_ID_MAX:		Max PLL Identifier
+ */
+enum pll_ids {
+	PLL_ID_PLLA,
+	PLL_ID_UPLL,
+	PLL_ID_AUDIO,
+	PLL_ID_LVDS,
+	PLL_ID_PLLA_DIV2,
+	PLL_ID_MAX,
+};
+
+/**
+ * enum pll_type - PLL type identifiers
+ * @PLL_TYPE_FRAC:	fractional PLL identifier
+ * @PLL_TYPE_DIV:	divider PLL identifier
+ */
+enum pll_type {
+	PLL_TYPE_FRAC,
+	PLL_TYPE_DIV,
+};
+
+static const struct clk_master_characteristics mck_characteristics = {
+	.output = { .min = 32000000, .max = 266666667 },
+	.divisors = { 1, 2, 4, 3, 5},
+	.have_div3_pres = 1,
+};
+
+static const struct clk_master_layout sam9x7_master_layout = {
+	.mask = 0x373,
+	.pres_shift = 4,
+	.offset = 0x28,
+};
+
+/* Fractional PLL core output range. */
+static const struct clk_range plla_core_outputs[] = {
+	{ .min = 375000000, .max = 1600000000 },
+};
+
+static const struct clk_range upll_core_outputs[] = {
+	{ .min = 600000000, .max = 1200000000 },
+};
+
+static const struct clk_range lvdspll_core_outputs[] = {
+	{ .min = 400000000, .max = 800000000 },
+};
+
+static const struct clk_range audiopll_core_outputs[] = {
+	{ .min = 400000000, .max = 800000000 },
+};
+
+static const struct clk_range plladiv2_core_outputs[] = {
+	{ .min = 375000000, .max = 1600000000 },
+};
+
+/* Fractional PLL output range. */
+static const struct clk_range plla_outputs[] = {
+	{ .min = 732421, .max = 800000000 },
+};
+
+static const struct clk_range upll_outputs[] = {
+	{ .min = 300000000, .max = 600000000 },
+};
+
+static const struct clk_range lvdspll_outputs[] = {
+	{ .min = 10000000, .max = 800000000 },
+};
+
+static const struct clk_range audiopll_outputs[] = {
+	{ .min = 10000000, .max = 800000000 },
+};
+
+static const struct clk_range plladiv2_outputs[] = {
+	{ .min = 366210, .max = 400000000 },
+};
+
+/* PLL characteristics. */
+static const struct clk_pll_characteristics plla_characteristics = {
+	.input = { .min = 20000000, .max = 50000000 },
+	.num_output = ARRAY_SIZE(plla_outputs),
+	.output = plla_outputs,
+	.core_output = plla_core_outputs,
+};
+
+static const struct clk_pll_characteristics upll_characteristics = {
+	.input = { .min = 20000000, .max = 50000000 },
+	.num_output = ARRAY_SIZE(upll_outputs),
+	.output = upll_outputs,
+	.core_output = upll_core_outputs,
+	.upll = true,
+};
+
+static const struct clk_pll_characteristics lvdspll_characteristics = {
+	.input = { .min = 20000000, .max = 50000000 },
+	.num_output = ARRAY_SIZE(lvdspll_outputs),
+	.output = lvdspll_outputs,
+	.core_output = lvdspll_core_outputs,
+};
+
+static const struct clk_pll_characteristics audiopll_characteristics = {
+	.input = { .min = 20000000, .max = 50000000 },
+	.num_output = ARRAY_SIZE(audiopll_outputs),
+	.output = audiopll_outputs,
+	.core_output = audiopll_core_outputs,
+};
+
+static const struct clk_pll_characteristics plladiv2_characteristics = {
+	.input = { .min = 20000000, .max = 50000000 },
+	.num_output = ARRAY_SIZE(plladiv2_outputs),
+	.output = plladiv2_outputs,
+	.core_output = plladiv2_core_outputs,
+};
+
+/* Layout for fractional PLL ID PLLA. */
+static const struct clk_pll_layout plla_frac_layout = {
+	.mul_mask = GENMASK(31, 24),
+	.frac_mask = GENMASK(21, 0),
+	.mul_shift = 24,
+	.frac_shift = 0,
+	.div2 = 1,
+};
+
+/* Layout for fractional PLLs. */
+static const struct clk_pll_layout pll_frac_layout = {
+	.mul_mask = GENMASK(31, 24),
+	.frac_mask = GENMASK(21, 0),
+	.mul_shift = 24,
+	.frac_shift = 0,
+};
+
+/* Layout for DIV PLLs. */
+static const struct clk_pll_layout pll_divpmc_layout = {
+	.div_mask = GENMASK(7, 0),
+	.endiv_mask = BIT(29),
+	.div_shift = 0,
+	.endiv_shift = 29,
+};
+
+/* Layout for DIV PLL ID PLLADIV2. */
+static const struct clk_pll_layout plladiv2_divpmc_layout = {
+	.div_mask = GENMASK(7, 0),
+	.endiv_mask = BIT(29),
+	.div_shift = 0,
+	.endiv_shift = 29,
+	.div2 = 1,
+};
+
+/* Layout for DIVIO dividers. */
+static const struct clk_pll_layout pll_divio_layout = {
+	.div_mask	= GENMASK(19, 12),
+	.endiv_mask	= BIT(30),
+	.div_shift	= 12,
+	.endiv_shift	= 30,
+};
+
+/*
+ * PLL clocks description
+ * @n:		clock name
+ * @p:		clock parent
+ * @l:		clock layout
+ * @t:		clock type
+ * @c:		pll characteristics
+ * @f:		clock flags
+ * @eid:	export index in sam9x7->chws[] array
+ */
+static const struct {
+	const char *n;
+	const char *p;
+	const struct clk_pll_layout *l;
+	u8 t;
+	const struct clk_pll_characteristics *c;
+	unsigned long f;
+	u8 eid;
+} sam9x7_plls[][PLL_ID_MAX] = {
+	[PLL_ID_PLLA] = {
+		{
+			.n = "plla_fracck",
+			.p = "mainck",
+			.l = &plla_frac_layout,
+			.t = PLL_TYPE_FRAC,
+			/*
+			 * This feeds plla_divpmcck which feeds CPU. It should
+			 * not be disabled.
+			 */
+			.f = CLK_IS_CRITICAL | CLK_SET_RATE_GATE,
+			.c = &plla_characteristics,
+		},
+
+		{
+			.n = "plla_divpmcck",
+			.p = "plla_fracck",
+			.l = &pll_divpmc_layout,
+			.t = PLL_TYPE_DIV,
+			/* This feeds CPU. It should not be disabled */
+			.f = CLK_IS_CRITICAL | CLK_SET_RATE_GATE,
+			.eid = PMC_PLLACK,
+			.c = &plla_characteristics,
+		},
+	},
+
+	[PLL_ID_UPLL] = {
+		{
+			.n = "upll_fracck",
+			.p = "main_osc",
+			.l = &pll_frac_layout,
+			.t = PLL_TYPE_FRAC,
+			.f = CLK_SET_RATE_GATE,
+			.c = &upll_characteristics,
+		},
+
+		{
+			.n = "upll_divpmcck",
+			.p = "upll_fracck",
+			.l = &pll_divpmc_layout,
+			.t = PLL_TYPE_DIV,
+			.f = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE |
+			     CLK_SET_RATE_PARENT,
+			.eid = PMC_UTMI,
+			.c = &upll_characteristics,
+		},
+	},
+
+	[PLL_ID_AUDIO] = {
+		{
+			.n = "audiopll_fracck",
+			.p = "main_osc",
+			.l = &pll_frac_layout,
+			.f = CLK_SET_RATE_GATE,
+			.c = &audiopll_characteristics,
+			.t = PLL_TYPE_FRAC,
+		},
+
+		{
+			.n = "audiopll_divpmcck",
+			.p = "audiopll_fracck",
+			.l = &pll_divpmc_layout,
+			.f = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE |
+			     CLK_SET_RATE_PARENT,
+			.c = &audiopll_characteristics,
+			.eid = PMC_AUDIOPMCPLL,
+			.t = PLL_TYPE_DIV,
+		},
+
+		{
+			.n = "audiopll_diviock",
+			.p = "audiopll_fracck",
+			.l = &pll_divio_layout,
+			.f = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE |
+			     CLK_SET_RATE_PARENT,
+			.c = &audiopll_characteristics,
+			.eid = PMC_AUDIOIOPLL,
+			.t = PLL_TYPE_DIV,
+		},
+	},
+
+	[PLL_ID_LVDS] = {
+		{
+			.n = "lvdspll_fracck",
+			.p = "main_osc",
+			.l = &pll_frac_layout,
+			.f = CLK_SET_RATE_GATE,
+			.c = &lvdspll_characteristics,
+			.t = PLL_TYPE_FRAC,
+		},
+
+		{
+			.n = "lvdspll_divpmcck",
+			.p = "lvdspll_fracck",
+			.l = &pll_divpmc_layout,
+			.f = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE |
+			     CLK_SET_RATE_PARENT,
+			.c = &lvdspll_characteristics,
+			.eid = PMC_LVDSPLL,
+			.t = PLL_TYPE_DIV,
+		},
+	},
+
+	[PLL_ID_PLLA_DIV2] = {
+		{
+			.n = "plla_div2pmcck",
+			.p = "plla_fracck",
+			.l = &plladiv2_divpmc_layout,
+			/*
+			 * This may feed critical parts of the system like timers.
+			 * It should not be disabled.
+			 */
+			.f = CLK_IS_CRITICAL | CLK_SET_RATE_GATE,
+			.c = &plladiv2_characteristics,
+			.eid = PMC_PLLADIV2,
+			.t = PLL_TYPE_DIV,
+		},
+	},
+};
+
+static const struct clk_programmable_layout sam9x7_programmable_layout = {
+	.pres_mask = 0xff,
+	.pres_shift = 8,
+	.css_mask = 0x1f,
+	.have_slck_mck = 0,
+	.is_pres_direct = 1,
+};
+
+static const struct clk_pcr_layout sam9x7_pcr_layout = {
+	.offset = 0x88,
+	.cmd = BIT(31),
+	.gckcss_mask = GENMASK(12, 8),
+	.pid_mask = GENMASK(6, 0),
+};
+
+static const struct {
+	char *n;
+	char *p;
+	u8 id;
+	unsigned long flags;
+} sam9x7_systemck[] = {
+	/*
+	 * ddrck feeds DDR controller and is enabled by bootloader thus we need
+	 * to keep it enabled in case there is no Linux consumer for it.
+	 */
+	{ .n = "ddrck",		.p = "masterck_div",	.id = 2,	.flags = CLK_IS_CRITICAL },
+	{ .n = "uhpck",		.p = "usbck",		.id = 6 },
+	{ .n = "pck0",		.p = "prog0",		.id = 8 },
+	{ .n = "pck1",		.p = "prog1",		.id = 9 },
+};
+
+/*
+ * Peripheral clocks description
+ * @n:		clock name
+ * @f:		clock flags
+ * @id:		peripheral id
+ */
+static const struct {
+	char *n;
+	unsigned long f;
+	u8 id;
+} sam9x7_periphck[] = {
+	{ .n = "pioA_clk",	.id = 2, },
+	{ .n = "pioB_clk",	.id = 3, },
+	{ .n = "pioC_clk",	.id = 4, },
+	{ .n = "flex0_clk",	.id = 5, },
+	{ .n = "flex1_clk",	.id = 6, },
+	{ .n = "flex2_clk",	.id = 7, },
+	{ .n = "flex3_clk",	.id = 8, },
+	{ .n = "flex6_clk",	.id = 9, },
+	{ .n = "flex7_clk",	.id = 10, },
+	{ .n = "flex8_clk",	.id = 11, },
+	{ .n = "sdmmc0_clk",	.id = 12, },
+	{ .n = "flex4_clk",	.id = 13, },
+	{ .n = "flex5_clk",	.id = 14, },
+	{ .n = "flex9_clk",	.id = 15, },
+	{ .n = "flex10_clk",	.id = 16, },
+	{ .n = "tcb0_clk",	.id = 17, },
+	{ .n = "pwm_clk",	.id = 18, },
+	{ .n = "adc_clk",	.id = 19, },
+	{ .n = "dma0_clk",	.id = 20, },
+	{ .n = "uhphs_clk",	.id = 22, },
+	{ .n = "udphs_clk",	.id = 23, },
+	{ .n = "macb0_clk",	.id = 24, },
+	{ .n = "lcd_clk",	.id = 25, },
+	{ .n = "sdmmc1_clk",	.id = 26, },
+	{ .n = "ssc_clk",	.id = 28, },
+	{ .n = "can0_clk",	.id = 29, },
+	{ .n = "can1_clk",	.id = 30, },
+	{ .n = "flex11_clk",	.id = 32, },
+	{ .n = "flex12_clk",	.id = 33, },
+	{ .n = "i2s_clk",	.id = 34, },
+	{ .n = "qspi_clk",	.id = 35, },
+	{ .n = "gfx2d_clk",	.id = 36, },
+	{ .n = "pit64b0_clk",	.id = 37, },
+	{ .n = "trng_clk",	.id = 38, },
+	{ .n = "aes_clk",	.id = 39, },
+	{ .n = "tdes_clk",	.id = 40, },
+	{ .n = "sha_clk",	.id = 41, },
+	{ .n = "classd_clk",	.id = 42, },
+	{ .n = "isi_clk",	.id = 43, },
+	{ .n = "pioD_clk",	.id = 44, },
+	{ .n = "tcb1_clk",	.id = 45, },
+	{ .n = "dbgu_clk",	.id = 47, },
+	/*
+	 * mpddr_clk feeds DDR controller and is enabled by bootloader thus we
+	 * need to keep it enabled in case there is no Linux consumer for it.
+	 */
+	{ .n = "mpddr_clk",	.id = 49,	.f = CLK_IS_CRITICAL },
+	{ .n = "csi2dc_clk",	.id = 52, },
+	{ .n = "csi4l_clk",	.id = 53, },
+	{ .n = "dsi4l_clk",	.id = 54, },
+	{ .n = "lvdsc_clk",	.id = 56, },
+	{ .n = "pit64b1_clk",	.id = 58, },
+	{ .n = "puf_clk",	.id = 59, },
+	{ .n = "gmactsu_clk",	.id = 67, },
+};
+
+/*
+ * Generic clock description
+ * @n:			clock name
+ * @pp:			PLL parents
+ * @pp_mux_table:	PLL parents mux table
+ * @r:			clock output range
+ * @pp_chg_id:		id in parent array of changeable PLL parent
+ * @pp_count:		PLL parents count
+ * @id:			clock id
+ */
+static const struct {
+	const char *n;
+	const char *pp[8];
+	const char pp_mux_table[8];
+	struct clk_range r;
+	int pp_chg_id;
+	u8 pp_count;
+	u8 id;
+} sam9x7_gck[] = {
+	{
+		.n = "flex0_gclk",
+		.id = 5,
+		.pp = { "plla_div2pmcck", },
+		.pp_mux_table = { 8, },
+		.pp_count = 1,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "flex1_gclk",
+		.id = 6,
+		.pp = { "plla_div2pmcck", },
+		.pp_mux_table = { 8, },
+		.pp_count = 1,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "flex2_gclk",
+		.id = 7,
+		.pp = { "plla_div2pmcck", },
+		.pp_mux_table = { 8, },
+		.pp_count = 1,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "flex3_gclk",
+		.id = 8,
+		.pp = { "plla_div2pmcck", },
+		.pp_mux_table = { 8, },
+		.pp_count = 1,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "flex6_gclk",
+		.id = 9,
+		.pp = { "plla_div2pmcck", },
+		.pp_mux_table = { 8, },
+		.pp_count = 1,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "flex7_gclk",
+		.id = 10,
+		.pp = { "plla_div2pmcck", },
+		.pp_mux_table = { 8, },
+		.pp_count = 1,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "flex8_gclk",
+		.id = 11,
+		.pp = { "plla_div2pmcck", },
+		.pp_mux_table = { 8, },
+		.pp_count = 1,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "sdmmc0_gclk",
+		.id = 12,
+		.r = { .max = 105000000 },
+		.pp = { "audiopll_divpmcck", "plla_div2pmcck", },
+		.pp_mux_table = { 6, 8, },
+		.pp_count = 2,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "flex4_gclk",
+		.id = 13,
+		.pp = { "plla_div2pmcck", },
+		.pp_mux_table = { 8, },
+		.pp_count = 1,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "flex5_gclk",
+		.id = 14,
+		.pp = { "plla_div2pmcck", },
+		.pp_mux_table = { 8, },
+		.pp_count = 1,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "flex9_gclk",
+		.id = 15,
+		.pp = { "plla_div2pmcck", },
+		.pp_mux_table = { 8, },
+		.pp_count = 1,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "flex10_gclk",
+		.id = 16,
+		.pp = { "plla_div2pmcck", },
+		.pp_mux_table = { 8, },
+		.pp_count = 1,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "tcb0_gclk",
+		.id = 17,
+		.pp = { "audiopll_divpmcck", "plla_div2pmcck", },
+		.pp_mux_table = { 6, 8, },
+		.pp_count = 2,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "adc_gclk",
+		.id = 19,
+		.pp = { "upll_divpmcck", "plla_div2pmcck", },
+		.pp_mux_table = { 5, 8, },
+		.pp_count = 2,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "lcd_gclk",
+		.id = 25,
+		.r = { .max = 75000000 },
+		.pp = { "audiopll_divpmcck", "plla_div2pmcck", },
+		.pp_mux_table = { 6, 8, },
+		.pp_count = 2,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "sdmmc1_gclk",
+		.id = 26,
+		.r = { .max = 105000000 },
+		.pp = { "audiopll_divpmcck", "plla_div2pmcck", },
+		.pp_mux_table = { 6, 8, },
+		.pp_count = 2,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "mcan0_gclk",
+		.id = 29,
+		.r = { .max = 80000000 },
+		.pp = { "upll_divpmcck", "plla_div2pmcck", },
+		.pp_mux_table = { 5, 8, },
+		.pp_count = 2,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "mcan1_gclk",
+		.id = 30,
+		.r = { .max = 80000000 },
+		.pp = { "upll_divpmcck", "plla_div2pmcck", },
+		.pp_mux_table = { 5, 8, },
+		.pp_count = 2,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "flex11_gclk",
+		.id = 32,
+		.pp = { "plla_div2pmcck", },
+		.pp_mux_table = { 8, },
+		.pp_count = 1,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "flex12_gclk",
+		.id = 33,
+		.pp = { "plla_div2pmcck", },
+		.pp_mux_table = { 8, },
+		.pp_count = 1,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "i2s_gclk",
+		.id = 34,
+		.r = { .max = 100000000 },
+		.pp = { "audiopll_divpmcck", "plla_div2pmcck", },
+		.pp_mux_table = { 6, 8, },
+		.pp_count = 2,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "qspi_gclk",
+		.id = 35,
+		.r = { .max = 20000000 },
+		.pp = { "audiopll_divpmcck", "plla_div2pmcck", },
+		.pp_mux_table = { 6, 8, },
+		.pp_count = 2,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "pit64b0_gclk",
+		.id = 37,
+		.pp = { "plla_div2pmcck", },
+		.pp_mux_table = { 8, },
+		.pp_count = 1,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "classd_gclk",
+		.id = 42,
+		.r = { .max = 100000000 },
+		.pp = { "audiopll_divpmcck", "plla_div2pmcck", },
+		.pp_mux_table = { 6, 8, },
+		.pp_count = 2,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "tcb1_gclk",
+		.id = 45,
+		.pp = { "audiopll_divpmcck", "plla_div2pmcck", },
+		.pp_mux_table = { 6, 8, },
+		.pp_count = 2,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "dbgu_gclk",
+		.id = 47,
+		.pp = { "plla_div2pmcck", },
+		.pp_mux_table = { 8, },
+		.pp_count = 1,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "mipiphy_gclk",
+		.id = 55,
+		.r = { .max = 27000000 },
+		.pp = { "plla_div2pmcck", },
+		.pp_mux_table = { 8, },
+		.pp_count = 1,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "pit64b1_gclk",
+		.id = 58,
+		.pp = { "plla_div2pmcck", },
+		.pp_mux_table = { 8, },
+		.pp_count = 1,
+		.pp_chg_id = INT_MIN,
+	},
+
+	{
+		.n = "gmac_gclk",
+		.id = 67,
+		.pp = { "audiopll_divpmcck", "plla_div2pmcck", },
+		.pp_mux_table = { 6, 8, },
+		.pp_count = 2,
+		.pp_chg_id = INT_MIN,
+	},
+};
+
+static void __init sam9x7_pmc_setup(struct device_node *np)
+{
+	struct clk_range range = CLK_RANGE(0, 0);
+	const char *td_slck_name, *md_slck_name, *mainxtal_name;
+	struct pmc_data *sam9x7_pmc;
+	const char *parent_names[9];
+	void **clk_mux_buffer = NULL;
+	int clk_mux_buffer_size = 0;
+	struct clk_hw *main_osc_hw;
+	struct regmap *regmap;
+	struct clk_hw *hw;
+	int i, j;
+
+	i = of_property_match_string(np, "clock-names", "td_slck");
+	if (i < 0)
+		return;
+
+	td_slck_name = of_clk_get_parent_name(np, i);
+
+	i = of_property_match_string(np, "clock-names", "md_slck");
+	if (i < 0)
+		return;
+
+	md_slck_name = of_clk_get_parent_name(np, i);
+
+	i = of_property_match_string(np, "clock-names", "main_xtal");
+	if (i < 0)
+		return;
+	mainxtal_name = of_clk_get_parent_name(np, i);
+
+	regmap = device_node_to_regmap(np);
+	if (IS_ERR(regmap))
+		return;
+
+	sam9x7_pmc = pmc_data_allocate(PMC_LVDSPLL + 1,
+				       nck(sam9x7_systemck),
+				       nck(sam9x7_periphck),
+				       nck(sam9x7_gck), 8);
+	if (!sam9x7_pmc)
+		return;
+
+	clk_mux_buffer = kmalloc(sizeof(void *) *
+				 (ARRAY_SIZE(sam9x7_gck)),
+				 GFP_KERNEL);
+	if (!clk_mux_buffer)
+		goto err_free;
+
+	hw = at91_clk_register_main_rc_osc(regmap, "main_rc_osc", 12000000,
+					   50000000);
+	if (IS_ERR(hw))
+		goto err_free;
+
+	hw = at91_clk_register_main_osc(regmap, "main_osc", mainxtal_name, NULL, 0);
+	if (IS_ERR(hw))
+		goto err_free;
+	main_osc_hw = hw;
+
+	parent_names[0] = "main_rc_osc";
+	parent_names[1] = "main_osc";
+	hw = at91_clk_register_sam9x5_main(regmap, "mainck", parent_names, NULL, 2);
+	if (IS_ERR(hw))
+		goto err_free;
+
+	sam9x7_pmc->chws[PMC_MAIN] = hw;
+
+	for (i = 0; i < PLL_ID_MAX; i++) {
+		for (j = 0; j < 3; j++) {
+			struct clk_hw *parent_hw;
+
+			if (!sam9x7_plls[i][j].n)
+				continue;
+
+			switch (sam9x7_plls[i][j].t) {
+			case PLL_TYPE_FRAC:
+				if (!strcmp(sam9x7_plls[i][j].p, "mainck"))
+					parent_hw = sam9x7_pmc->chws[PMC_MAIN];
+				else if (!strcmp(sam9x7_plls[i][j].p, "main_osc"))
+					parent_hw = main_osc_hw;
+				else
+					parent_hw = __clk_get_hw(of_clk_get_by_name
+								 (np, sam9x7_plls[i][j].p));
+
+				hw = sam9x60_clk_register_frac_pll(regmap,
+								   &pmc_pll_lock,
+								   sam9x7_plls[i][j].n,
+								   sam9x7_plls[i][j].p,
+								   parent_hw, i,
+								   sam9x7_plls[i][j].c,
+								   sam9x7_plls[i][j].l,
+								   sam9x7_plls[i][j].f);
+				break;
+
+			case PLL_TYPE_DIV:
+				hw = sam9x60_clk_register_div_pll(regmap,
+								  &pmc_pll_lock,
+								  sam9x7_plls[i][j].n,
+								  sam9x7_plls[i][j].p, NULL, i,
+								  sam9x7_plls[i][j].c,
+								  sam9x7_plls[i][j].l,
+								  sam9x7_plls[i][j].f, 0);
+				break;
+
+			default:
+				continue;
+			}
+
+			if (IS_ERR(hw))
+				goto err_free;
+
+			if (sam9x7_plls[i][j].eid)
+				sam9x7_pmc->chws[sam9x7_plls[i][j].eid] = hw;
+		}
+	}
+
+	parent_names[0] = md_slck_name;
+	parent_names[1] = "mainck";
+	parent_names[2] = "plla_divpmcck";
+	parent_names[3] = "upll_divpmcck";
+	hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4,
+					   parent_names, NULL, &sam9x7_master_layout,
+					   &mck_characteristics, &mck_lock);
+	if (IS_ERR(hw))
+		goto err_free;
+
+	hw = at91_clk_register_master_div(regmap, "masterck_div",
+					  "masterck_pres", NULL, &sam9x7_master_layout,
+					  &mck_characteristics, &mck_lock,
+					  CLK_SET_RATE_GATE, 0);
+	if (IS_ERR(hw))
+		goto err_free;
+
+	sam9x7_pmc->chws[PMC_MCK] = hw;
+
+	parent_names[0] = "plla_divpmcck";
+	parent_names[1] = "upll_divpmcck";
+	parent_names[2] = "main_osc";
+	hw = sam9x60_clk_register_usb(regmap, "usbck", parent_names, 3);
+	if (IS_ERR(hw))
+		goto err_free;
+
+	parent_names[0] = md_slck_name;
+	parent_names[1] = td_slck_name;
+	parent_names[2] = "mainck";
+	parent_names[3] = "masterck_div";
+	parent_names[4] = "plla_divpmcck";
+	parent_names[5] = "upll_divpmcck";
+	parent_names[6] = "audiopll_divpmcck";
+	for (i = 0; i < 2; i++) {
+		char name[6];
+
+		snprintf(name, sizeof(name), "prog%d", i);
+
+		hw = at91_clk_register_programmable(regmap, name,
+						    parent_names, NULL, 7, i,
+						    &sam9x7_programmable_layout,
+						    NULL);
+		if (IS_ERR(hw))
+			goto err_free;
+
+		sam9x7_pmc->pchws[i] = hw;
+	}
+
+	for (i = 0; i < ARRAY_SIZE(sam9x7_systemck); i++) {
+		hw = at91_clk_register_system(regmap, sam9x7_systemck[i].n,
+					      sam9x7_systemck[i].p, NULL,
+					      sam9x7_systemck[i].id,
+					      sam9x7_systemck[i].flags);
+		if (IS_ERR(hw))
+			goto err_free;
+
+		sam9x7_pmc->shws[sam9x7_systemck[i].id] = hw;
+	}
+
+	for (i = 0; i < ARRAY_SIZE(sam9x7_periphck); i++) {
+		hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
+							 &sam9x7_pcr_layout,
+							 sam9x7_periphck[i].n,
+							 "masterck_div", NULL,
+							 sam9x7_periphck[i].id,
+							 &range, INT_MIN,
+							 sam9x7_periphck[i].f);
+		if (IS_ERR(hw))
+			goto err_free;
+
+		sam9x7_pmc->phws[sam9x7_periphck[i].id] = hw;
+	}
+
+	parent_names[0] = md_slck_name;
+	parent_names[1] = td_slck_name;
+	parent_names[2] = "mainck";
+	parent_names[3] = "masterck_div";
+	for (i = 0; i < ARRAY_SIZE(sam9x7_gck); i++) {
+		u8 num_parents = 4 + sam9x7_gck[i].pp_count;
+		u32 *mux_table;
+
+		mux_table = kmalloc_array(num_parents, sizeof(*mux_table),
+					  GFP_KERNEL);
+		if (!mux_table)
+			goto err_free;
+
+		PMC_INIT_TABLE(mux_table, 4);
+		PMC_FILL_TABLE(&mux_table[4], sam9x7_gck[i].pp_mux_table,
+			       sam9x7_gck[i].pp_count);
+		PMC_FILL_TABLE(&parent_names[4], sam9x7_gck[i].pp,
+			       sam9x7_gck[i].pp_count);
+
+		hw = at91_clk_register_generated(regmap, &pmc_pcr_lock,
+						 &sam9x7_pcr_layout,
+						 sam9x7_gck[i].n,
+						 parent_names, NULL, mux_table,
+						 num_parents,
+						 sam9x7_gck[i].id,
+						 &sam9x7_gck[i].r,
+						 sam9x7_gck[i].pp_chg_id);
+		if (IS_ERR(hw))
+			goto err_free;
+
+		sam9x7_pmc->ghws[sam9x7_gck[i].id] = hw;
+		clk_mux_buffer[clk_mux_buffer_size++] = mux_table;
+	}
+
+	of_clk_add_hw_provider(np, of_clk_hw_pmc_get, sam9x7_pmc);
+	kfree(clk_mux_buffer);
+
+	return;
+
+err_free:
+	if (clk_mux_buffer) {
+		for (i = 0; i < clk_mux_buffer_size; i++)
+			kfree(clk_mux_buffer[i]);
+		kfree(clk_mux_buffer);
+	}
+	kfree(sam9x7_pmc);
+}
+
+/* Some clks are used for a clocksource */
+CLK_OF_DECLARE(sam9x7_pmc, "microchip,sam9x7-pmc", sam9x7_pmc_setup);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 28/39] dt-bindings: irqchip/atmel-aic5: Add support for sam9x7 aic
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (26 preceding siblings ...)
  2024-02-23 17:28 ` [PATCH v4 27/39] clk: at91: sam9x7: add sam9x7 pmc driver Varshini Rajendran
@ 2024-02-23 17:28 ` Varshini Rajendran
  2024-02-23 17:29 ` [PATCH v4 29/39] irqchip/atmel-aic5: Add support to get nirqs from DT for sam9x60 & sam9x7 Varshini Rajendran
                   ` (15 subsequent siblings)
  43 siblings, 0 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:28 UTC (permalink / raw)
  To: tglx, robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linux-kernel, devicetree,
	linux-arm-kernel
  Cc: varshini.rajendran, Krzysztof Kozlowski

Document the support added for the Advanced interrupt controller(AIC)
chip in the sam9x7 SoC family.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Changes in v4:
- Updated Acked-by tag.
---
 .../devicetree/bindings/interrupt-controller/atmel,aic.txt      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt b/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt
index 7079d44bf3ba..5fb9366c94a1 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt
@@ -4,7 +4,7 @@ Required properties:
 - compatible: Should be:
     - "atmel,<chip>-aic" where  <chip> can be "at91rm9200", "sama5d2",
       "sama5d3" or "sama5d4"
-    - "microchip,<chip>-aic" where <chip> can be "sam9x60"
+    - "microchip,<chip>-aic" where <chip> can be "sam9x60" or "sam9x7"
 
 - interrupt-controller: Identifies the node as an interrupt controller.
 - #interrupt-cells: The number of cells to define the interrupts. It should be 3.
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 29/39] irqchip/atmel-aic5: Add support to get nirqs from DT for sam9x60 & sam9x7
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (27 preceding siblings ...)
  2024-02-23 17:28 ` [PATCH v4 28/39] dt-bindings: irqchip/atmel-aic5: Add support for sam9x7 aic Varshini Rajendran
@ 2024-02-23 17:29 ` Varshini Rajendran
  2024-03-03 12:21   ` claudiu beznea
  2024-02-23 17:29 ` [PATCH v4 30/39] power: reset: at91-poweroff: lookup for proper pmc dt node for sam9x7 Varshini Rajendran
                   ` (14 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:29 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, tglx, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, andre.przywara, mani,
	shawnguo, durai.manickamkr, varshini.rajendran, devicetree,
	linux-kernel, linux-arm-kernel

Add support to get number of IRQs from the respective DT node for sam9x60
and sam9x7 devices. Since only this factor differs between the two SoCs,
this patch adds support for the same. Adapt the sam9x60 dtsi
accordingly.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
Changes in v4:
- Changed the implementation to fetch the NIRQs from DT as per the
  comment to avoid introducing a new compatible when this is the only
  difference between the SoCs related to this IP.
---
 arch/arm/boot/dts/microchip/sam9x60.dtsi |  1 +
 drivers/irqchip/irq-atmel-aic5.c         | 11 ++++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/microchip/sam9x60.dtsi b/arch/arm/boot/dts/microchip/sam9x60.dtsi
index 73d570a17269..e405f68c9f54 100644
--- a/arch/arm/boot/dts/microchip/sam9x60.dtsi
+++ b/arch/arm/boot/dts/microchip/sam9x60.dtsi
@@ -1201,6 +1201,7 @@ aic: interrupt-controller@fffff100 {
 				interrupt-controller;
 				reg = <0xfffff100 0x100>;
 				atmel,external-irqs = <31>;
+				microchip,nr-irqs = <50>;
 			};
 
 			dbgu: serial@fffff200 {
diff --git a/drivers/irqchip/irq-atmel-aic5.c b/drivers/irqchip/irq-atmel-aic5.c
index 145535bd7560..5d96ad8860d3 100644
--- a/drivers/irqchip/irq-atmel-aic5.c
+++ b/drivers/irqchip/irq-atmel-aic5.c
@@ -398,11 +398,16 @@ static int __init sama5d4_aic5_of_init(struct device_node *node,
 }
 IRQCHIP_DECLARE(sama5d4_aic5, "atmel,sama5d4-aic", sama5d4_aic5_of_init);
 
-#define NR_SAM9X60_IRQS		50
-
 static int __init sam9x60_aic5_of_init(struct device_node *node,
 				       struct device_node *parent)
 {
-	return aic5_of_init(node, parent, NR_SAM9X60_IRQS);
+	int ret, nr_irqs;
+
+	ret = of_property_read_u32(node, "microchip,nr-irqs", &nr_irqs);
+	if (ret) {
+		pr_err("Not found microchip,nr-irqs property\n");
+		return ret;
+	}
+	return aic5_of_init(node, parent, nr_irqs);
 }
 IRQCHIP_DECLARE(sam9x60_aic5, "microchip,sam9x60-aic", sam9x60_aic5_of_init);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 30/39] power: reset: at91-poweroff: lookup for proper pmc dt node for sam9x7
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (28 preceding siblings ...)
  2024-02-23 17:29 ` [PATCH v4 29/39] irqchip/atmel-aic5: Add support to get nirqs from DT for sam9x60 & sam9x7 Varshini Rajendran
@ 2024-02-23 17:29 ` Varshini Rajendran
  2024-03-03 12:22   ` claudiu beznea
  2024-02-23 17:29 ` [PATCH v4 31/39] power: reset: at91-reset: add reset support for sam9x7 SoC Varshini Rajendran
                   ` (13 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:29 UTC (permalink / raw)
  To: claudiu.beznea, sre, nicolas.ferre, alexandre.belloni, linux-pm,
	linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran, Sebastian Reichel

Use sam9x7 pmc's compatible to lookup for in the SHDWC driver.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
Changes in v4:
- Updated Acked-by tag
---
 drivers/power/reset/at91-sama5d2_shdwc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/reset/at91-sama5d2_shdwc.c b/drivers/power/reset/at91-sama5d2_shdwc.c
index 959ce0dbe91d..2121d7e74e12 100644
--- a/drivers/power/reset/at91-sama5d2_shdwc.c
+++ b/drivers/power/reset/at91-sama5d2_shdwc.c
@@ -326,6 +326,7 @@ static const struct of_device_id at91_pmc_ids[] = {
 	{ .compatible = "atmel,sama5d2-pmc" },
 	{ .compatible = "microchip,sam9x60-pmc" },
 	{ .compatible = "microchip,sama7g5-pmc" },
+	{ .compatible = "microchip,sam9x7-pmc" },
 	{ /* Sentinel. */ }
 };
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 31/39] power: reset: at91-reset: add reset support for sam9x7 SoC
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (29 preceding siblings ...)
  2024-02-23 17:29 ` [PATCH v4 30/39] power: reset: at91-poweroff: lookup for proper pmc dt node for sam9x7 Varshini Rajendran
@ 2024-02-23 17:29 ` Varshini Rajendran
  2024-02-23 17:30 ` [PATCH v4 32/39] power: reset: at91-reset: add sdhwc " Varshini Rajendran
                   ` (12 subsequent siblings)
  43 siblings, 0 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:29 UTC (permalink / raw)
  To: sre, linux-pm, linux-kernel; +Cc: varshini.rajendran, Sebastian Reichel

Add power reset support for SAM9X7 SoC.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
Changes in v4:
- Updated Acked-by tag
---
 drivers/power/reset/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index fece990af4a7..e3ebebc1f80d 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -26,7 +26,7 @@ config POWER_RESET_AT91_POWEROFF
 config POWER_RESET_AT91_RESET
 	tristate "Atmel AT91 reset driver"
 	depends on ARCH_AT91
-	default SOC_AT91SAM9 || SOC_SAM9X60 || SOC_SAMA5
+	default SOC_AT91SAM9 || SOC_SAM9X60 || SOC_SAM9X7 || SOC_SAMA5
 	help
 	  This driver supports restart for Atmel AT91SAM9 and SAMA5
 	  SoCs
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 32/39] power: reset: at91-reset: add sdhwc support for sam9x7 SoC
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (30 preceding siblings ...)
  2024-02-23 17:29 ` [PATCH v4 31/39] power: reset: at91-reset: add reset support for sam9x7 SoC Varshini Rajendran
@ 2024-02-23 17:30 ` Varshini Rajendran
  2024-02-23 17:30 ` [PATCH v4 33/39] dt-bindings: reset: atmel,at91sam9260-reset: add sam9x7 Varshini Rajendran
                   ` (11 subsequent siblings)
  43 siblings, 0 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:30 UTC (permalink / raw)
  To: sre, linux-pm, linux-kernel; +Cc: varshini.rajendran, Sebastian Reichel

Add shutdown controller support for SAM9X7 SoC.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
Changes in v4:
- Updated Acked-by tag
---
 drivers/power/reset/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index e3ebebc1f80d..dafb0126f683 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -34,7 +34,7 @@ config POWER_RESET_AT91_RESET
 config POWER_RESET_AT91_SAMA5D2_SHDWC
 	tristate "Atmel AT91 SAMA5D2-Compatible shutdown controller driver"
 	depends on ARCH_AT91
-	default SOC_SAM9X60 || SOC_SAMA5
+	default SOC_SAM9X60 || SOC_SAM9X7 || SOC_SAMA5
 	help
 	  This driver supports the alternate shutdown controller for some Atmel
 	  SAMA5 SoCs. It is present for example on SAMA5D2 SoC.
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 33/39] dt-bindings: reset: atmel,at91sam9260-reset: add sam9x7
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (31 preceding siblings ...)
  2024-02-23 17:30 ` [PATCH v4 32/39] power: reset: at91-reset: add sdhwc " Varshini Rajendran
@ 2024-02-23 17:30 ` Varshini Rajendran
  2024-02-23 17:30 ` [PATCH v4 34/39] dt-bindings: power: reset: atmel,sama5d2-shdwc: " Varshini Rajendran
                   ` (10 subsequent siblings)
  43 siblings, 0 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:30 UTC (permalink / raw)
  To: p.zabel, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea, devicetree,
	linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran, Krzysztof Kozlowski

Add documentation for SAM9X7 reset controller.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
---
Changes in v4:
- Updated Acked-by and Reviewed-by tags.
---
 .../devicetree/bindings/reset/atmel,at91sam9260-reset.yaml    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/reset/atmel,at91sam9260-reset.yaml b/Documentation/devicetree/bindings/reset/atmel,at91sam9260-reset.yaml
index 98465d26949e..c3b33bbc7319 100644
--- a/Documentation/devicetree/bindings/reset/atmel,at91sam9260-reset.yaml
+++ b/Documentation/devicetree/bindings/reset/atmel,at91sam9260-reset.yaml
@@ -26,6 +26,10 @@ properties:
       - items:
           - const: atmel,sama5d3-rstc
           - const: atmel,at91sam9g45-rstc
+      - items:
+          - enum:
+              - microchip,sam9x7-rstc
+          - const: microchip,sam9x60-rstc
 
   reg:
     minItems: 1
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 34/39] dt-bindings: power: reset: atmel,sama5d2-shdwc: add sam9x7
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (32 preceding siblings ...)
  2024-02-23 17:30 ` [PATCH v4 33/39] dt-bindings: reset: atmel,at91sam9260-reset: add sam9x7 Varshini Rajendran
@ 2024-02-23 17:30 ` Varshini Rajendran
  2024-02-23 17:30 ` [PATCH v4 35/39] ARM: at91: Kconfig: add config flag for SAM9X7 SoC Varshini Rajendran
                   ` (9 subsequent siblings)
  43 siblings, 0 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:30 UTC (permalink / raw)
  To: claudiu.beznea, sre, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, linux-pm, devicetree,
	linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran, Krzysztof Kozlowski, Sebastian Reichel

Add shutdown controller DT bindings.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
Changes in v4:
- Updated Acked-by and Reviewed-by tags
---
 .../devicetree/bindings/power/reset/atmel,sama5d2-shdwc.yaml   | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/power/reset/atmel,sama5d2-shdwc.yaml b/Documentation/devicetree/bindings/power/reset/atmel,sama5d2-shdwc.yaml
index 8c58e12cdb60..0735ceb7c103 100644
--- a/Documentation/devicetree/bindings/power/reset/atmel,sama5d2-shdwc.yaml
+++ b/Documentation/devicetree/bindings/power/reset/atmel,sama5d2-shdwc.yaml
@@ -22,6 +22,9 @@ properties:
       - enum:
           - atmel,sama5d2-shdwc
           - microchip,sam9x60-shdwc
+      - items:
+          - const: microchip,sam9x7-shdwc
+          - const: microchip,sam9x60-shdwc
 
   reg:
     maxItems: 1
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 35/39] ARM: at91: Kconfig: add config flag for SAM9X7 SoC
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (33 preceding siblings ...)
  2024-02-23 17:30 ` [PATCH v4 34/39] dt-bindings: power: reset: atmel,sama5d2-shdwc: " Varshini Rajendran
@ 2024-02-23 17:30 ` Varshini Rajendran
  2024-03-03 12:22   ` claudiu beznea
  2024-02-23 17:30 ` [PATCH v4 36/39] ARM: configs: at91: enable config flags for sam9x7 SoC family Varshini Rajendran
                   ` (8 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:30 UTC (permalink / raw)
  To: linux, nicolas.ferre, alexandre.belloni, claudiu.beznea,
	linux-arm-kernel, linux-kernel
  Cc: varshini.rajendran

Add config flag for sam9x7 SoC.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
---
Changes in v4:
- Updated Reviewed-by tag
---
 arch/arm/mach-at91/Kconfig | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index a8c022b4c053..49d38a3a47de 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -141,11 +141,28 @@ config SOC_SAM9X60
 	help
 	  Select this if you are using Microchip's SAM9X60 SoC
 
+config SOC_SAM9X7
+	bool "SAM9X7"
+	depends on ARCH_MULTI_V5
+	select ATMEL_AIC5_IRQ
+	select ATMEL_PM if PM
+	select ATMEL_SDRAMC
+	select CPU_ARM926T
+	select HAVE_AT91_USB_CLK
+	select HAVE_AT91_GENERATED_CLK
+	select HAVE_AT91_SAM9X60_PLL
+	select MEMORY
+	select PINCTRL_AT91
+	select SOC_SAM_V4_V5
+	select SRAM if PM
+	help
+	  Select this if you are using Microchip's SAM9X7 SoC
+
 comment "Clocksource driver selection"
 
 config ATMEL_CLOCKSOURCE_PIT
 	bool "Periodic Interval Timer (PIT) support"
-	depends on SOC_AT91SAM9 || SOC_SAM9X60 || SOC_SAMA5
+	depends on SOC_AT91SAM9 || SOC_SAM9X60 || SOC_SAM9X7 || SOC_SAMA5
 	default SOC_AT91SAM9 || SOC_SAMA5
 	select ATMEL_PIT
 	help
@@ -155,7 +172,7 @@ config ATMEL_CLOCKSOURCE_PIT
 
 config ATMEL_CLOCKSOURCE_TCB
 	bool "Timer Counter Blocks (TCB) support"
-	default SOC_AT91RM9200 || SOC_AT91SAM9 || SOC_SAM9X60 || SOC_SAMA5
+	default SOC_AT91RM9200 || SOC_AT91SAM9 || SOC_SAM9X60 || SOC_SAM9X7 || SOC_SAMA5
 	select ATMEL_TCB_CLKSRC
 	help
 	  Select this to get a high precision clocksource based on a
@@ -166,7 +183,7 @@ config ATMEL_CLOCKSOURCE_TCB
 
 config MICROCHIP_CLOCKSOURCE_PIT64B
 	bool "64-bit Periodic Interval Timer (PIT64B) support"
-	default SOC_SAM9X60 || SOC_SAMA7
+	default SOC_SAM9X60 || SOC_SAM9X7 || SOC_SAMA7
 	select MICROCHIP_PIT64B
 	help
 	  Select this to get a high resolution clockevent (SAM9X60) or
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 36/39] ARM: configs: at91: enable config flags for sam9x7 SoC family
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (34 preceding siblings ...)
  2024-02-23 17:30 ` [PATCH v4 35/39] ARM: at91: Kconfig: add config flag for SAM9X7 SoC Varshini Rajendran
@ 2024-02-23 17:30 ` Varshini Rajendran
  2024-02-23 17:30 ` [PATCH v4 37/39] ARM: dts: at91: sam9x7: add device tree for SoC Varshini Rajendran
                   ` (7 subsequent siblings)
  43 siblings, 0 replies; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:30 UTC (permalink / raw)
  To: linux, nicolas.ferre, alexandre.belloni, claudiu.beznea, arnd,
	geert+renesas, mpe, palmer, vbabka, rdunlap, varshini.rajendran,
	linux-arm-kernel, linux-kernel

Enable config flags for SAM9X7 SoC for the sam9x7 SoC family.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
 arch/arm/configs/at91_dt_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/at91_dt_defconfig b/arch/arm/configs/at91_dt_defconfig
index 1d53aec4c836..880f0c0f4cc3 100644
--- a/arch/arm/configs/at91_dt_defconfig
+++ b/arch/arm/configs/at91_dt_defconfig
@@ -16,6 +16,7 @@ CONFIG_ARCH_AT91=y
 CONFIG_SOC_AT91RM9200=y
 CONFIG_SOC_AT91SAM9=y
 CONFIG_SOC_SAM9X60=y
+CONFIG_SOC_SAM9X7=y
 # CONFIG_ATMEL_CLOCKSOURCE_PIT is not set
 CONFIG_AEABI=y
 CONFIG_UACCESS_WITH_MEMCPY=y
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 37/39] ARM: dts: at91: sam9x7: add device tree for SoC
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (35 preceding siblings ...)
  2024-02-23 17:30 ` [PATCH v4 36/39] ARM: configs: at91: enable config flags for sam9x7 SoC family Varshini Rajendran
@ 2024-02-23 17:30 ` Varshini Rajendran
  2024-03-03 12:24   ` claudiu beznea
  2024-02-23 17:31 ` [PATCH v4 38/39] dt-bindings: arm: add sam9x75 curiosity board Varshini Rajendran
                   ` (6 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:30 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, varshini.rajendran,
	nicolas.ferre, devicetree, linux-kernel

Add device tree file for SAM9X7 SoC family.

Co-developed-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
Changes in v4:
- Added pwm node support
- Added microchip,nr-irqs to the interrupt-controller node for the
  driver to fetch the NIRQs
- Dropped USB nodes owing to the discussion here
 https://lore.kernel.org/linux-devicetree/CAL_JsqJ9PrX6fj-EbffeJce09MXs=B7t+KS_kOinxaRx38=WxA@mail.gmail.com/
(Explained elaborartely in the cover letter)
---
 arch/arm/boot/dts/microchip/sam9x7.dtsi | 1214 +++++++++++++++++++++++
 1 file changed, 1214 insertions(+)
 create mode 100644 arch/arm/boot/dts/microchip/sam9x7.dtsi

diff --git a/arch/arm/boot/dts/microchip/sam9x7.dtsi b/arch/arm/boot/dts/microchip/sam9x7.dtsi
new file mode 100644
index 000000000000..ddbeb456bb59
--- /dev/null
+++ b/arch/arm/boot/dts/microchip/sam9x7.dtsi
@@ -0,0 +1,1214 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * sam9x7.dtsi - Device Tree Include file for Microchip SAM9X7 SoC family
+ *
+ * Copyright (C) 2023 Microchip Technology Inc. and its subsidiaries
+ *
+ * Author: Varshini Rajendran <varshini.rajendran@microchip.com>
+ */
+
+#include <dt-bindings/clock/at91.h>
+#include <dt-bindings/dma/at91.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/mfd/at91-usart.h>
+#include <dt-bindings/mfd/atmel-flexcom.h>
+#include <dt-bindings/pinctrl/at91.h>
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	model = "Microchip SAM9X7 SoC";
+	compatible = "microchip,sam9x7";
+	interrupt-parent = <&aic>;
+
+	aliases {
+		serial0 = &dbgu;
+		gpio0 = &pioA;
+		gpio1 = &pioB;
+		gpio2 = &pioC;
+		gpio3 = &pioD;
+	};
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu@0 {
+			compatible = "arm,arm926ej-s";
+			device_type = "cpu";
+			reg = <0>;
+		};
+	};
+
+	clocks {
+		slow_xtal: clock-slowxtal {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+		};
+
+		main_xtal: clock-mainxtal {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+		};
+	};
+
+	sram: sram@300000 {
+		compatible = "mmio-sram";
+		reg = <0x300000 0x10000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0 0x300000 0x10000>;
+	};
+
+	ahb {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		sdmmc0: mmc@80000000 {
+			compatible = "microchip,sam9x7-sdhci", "microchip,sam9x60-sdhci";
+			reg = <0x80000000 0x300>;
+			interrupts = <12 IRQ_TYPE_LEVEL_HIGH 0>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 12>, <&pmc PMC_TYPE_GCK 12>;
+			clock-names = "hclock", "multclk";
+			assigned-clocks = <&pmc PMC_TYPE_GCK 12>;
+			assigned-clock-rates = <100000000>;
+			status = "disabled";
+		};
+
+		sdmmc1: mmc@90000000 {
+			compatible = "microchip,sam9x7-sdhci", "microchip,sam9x60-sdhci";
+			reg = <0x90000000 0x300>;
+			interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 26>, <&pmc PMC_TYPE_GCK 26>;
+			clock-names = "hclock", "multclk";
+			assigned-clocks = <&pmc PMC_TYPE_GCK 26>;
+			assigned-clock-rates = <100000000>;
+			status = "disabled";
+		};
+	};
+
+	apb {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		flx4: flexcom@f0000000 {
+			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
+			reg = <0xf0000000 0x200>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 13>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x0 0xf0000000 0x800>;
+			status = "disabled";
+
+			uart4: serial@200 {
+				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
+				reg = <0x200 0x200>;
+				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 7>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(8))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(9))>;
+				dma-names = "tx", "rx";
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 13>;
+				clock-names = "usart";
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			spi4: spi@400 {
+				compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
+				reg = <0x400 0x200>;
+				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 13>;
+				clock-names = "spi_clk";
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(8))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(9))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			i2c4: i2c@600 {
+				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
+				reg = <0x600 0x200>;
+				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 13>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(8))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(9))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+		};
+
+		flx5: flexcom@f0004000 {
+			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
+			reg = <0xf0004000 0x200>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 14>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x0 0xf0004000 0x800>;
+			status = "disabled";
+
+			uart5: serial@200 {
+				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
+				reg = <0x200 0x200>;
+				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 7>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(10))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(11))>;
+				dma-names = "tx", "rx";
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 14>;
+				clock-names = "usart";
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			spi5: spi@400 {
+				compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
+				reg = <0x400 0x200>;
+				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 14>;
+				clock-names = "spi_clk";
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(10))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(11))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			i2c5: i2c@600 {
+				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
+				reg = <0x600 0x200>;
+				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 14>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(10))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(11))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+		};
+
+		dma0: dma-controller@f0008000 {
+			compatible = "microchip,sam9x7-dma", "atmel,sama5d4-dma";
+			reg = <0xf0008000 0x1000>;
+			interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>;
+			#dma-cells = <1>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 20>;
+			clock-names = "dma_clk";
+			status = "disabled";
+		};
+
+		ssc: ssc@f0010000 {
+			compatible = "microchip,sam9x7-ssc", "atmel,at91sam9g45-ssc";
+			reg = <0xf0010000 0x4000>;
+			interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>;
+			dmas = <&dma0
+				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+				 AT91_XDMAC_DT_PERID(38))>,
+			       <&dma0
+				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+				 AT91_XDMAC_DT_PERID(39))>;
+			dma-names = "tx", "rx";
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 28>;
+			clock-names = "pclk";
+			status = "disabled";
+		};
+
+		i2s: i2s@f001c000 {
+			compatible = "microchip,sam9x7-i2smcc", "microchip,sam9x60-i2smcc";
+			reg = <0xf001c000 0x100>;
+			interrupts = <34 IRQ_TYPE_LEVEL_HIGH 7>;
+			dmas = <&dma0
+				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+				 AT91_XDMAC_DT_PERID(36))>,
+			       <&dma0
+				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+				 AT91_XDMAC_DT_PERID(37))>;
+			dma-names = "tx", "rx";
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 34>, <&pmc PMC_TYPE_GCK 34>;
+			clock-names = "pclk", "gclk";
+			status = "disabled";
+		};
+
+		flx11: flexcom@f0020000 {
+			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
+			reg = <0xf0020000 0x200>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 32>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x0 0xf0020000 0x800>;
+			status = "disabled";
+
+			uart11: serial@200 {
+				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
+				reg = <0x200 0x200>;
+				interrupts = <32 IRQ_TYPE_LEVEL_HIGH 7>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(22))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(23))>;
+				dma-names = "tx", "rx";
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 32>;
+				clock-names = "usart";
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			i2c11: i2c@600 {
+				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
+				reg = <0x600 0x200>;
+				interrupts = <32 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 32>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(22))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(23))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+		};
+
+		flx12: flexcom@f0024000 {
+			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
+			reg = <0xf0024000 0x200>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 33>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x0 0xf0024000 0x800>;
+			status = "disabled";
+
+			uart12: serial@200 {
+				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
+				reg = <0x200 0x200>;
+				interrupts = <33 IRQ_TYPE_LEVEL_HIGH 7>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(24))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(25))>;
+				dma-names = "tx", "rx";
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 33>;
+				clock-names = "usart";
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			i2c12: i2c@600 {
+				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
+				reg = <0x600 0x200>;
+				interrupts = <33 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 33>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(24))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(25))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+		};
+
+		pit64b0: timer@f0028000 {
+			compatible = "microchip,sam9x7-pit64b", "microchip,sam9x60-pit64b";
+			reg = <0xf0028000 0x100>;
+			interrupts = <37 IRQ_TYPE_LEVEL_HIGH 7>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 37>, <&pmc PMC_TYPE_GCK 37>;
+			clock-names = "pclk", "gclk";
+		};
+
+		sha: crypto@f002c000 {
+			compatible = "microchip,sam9x7-sha", "atmel,at91sam9g46-sha";
+			reg = <0xf002c000 0x100>;
+			interrupts = <41 IRQ_TYPE_LEVEL_HIGH 0>;
+			dmas = <&dma0
+				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+				 AT91_XDMAC_DT_PERID(34))>;
+			dma-names = "tx";
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 41>;
+			clock-names = "sha_clk";
+		};
+
+		trng: rng@f0030000 {
+			compatible = "microchip,sam9x7-trng", "microchip,sam9x60-trng";
+			reg = <0xf0030000 0x100>;
+			interrupts = <38 IRQ_TYPE_LEVEL_HIGH 0>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 38>;
+			status = "disabled";
+		};
+
+		aes: crypto@f0034000 {
+			compatible = "microchip,sam9x7-aes", "atmel,at91sam9g46-aes";
+			reg = <0xf0034000 0x100>;
+			interrupts = <39 IRQ_TYPE_LEVEL_HIGH 0>;
+			dmas = <&dma0
+				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+				 AT91_XDMAC_DT_PERID(32))>,
+			       <&dma0
+				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+				 AT91_XDMAC_DT_PERID(33))>;
+			dma-names = "tx", "rx";
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 39>;
+			clock-names = "aes_clk";
+		};
+
+		tdes: crypto@f0038000 {
+			compatible = "microchip,sam9x7-tdes", "atmel,at91sam9g46-tdes";
+			reg = <0xf0038000 0x100>;
+			interrupts = <40 IRQ_TYPE_LEVEL_HIGH 0>;
+			dmas = <&dma0
+				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+				 AT91_XDMAC_DT_PERID(31))>,
+			       <&dma0
+				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+				 AT91_XDMAC_DT_PERID(30))>;
+			dma-names = "tx", "rx";
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 40>;
+			clock-names = "tdes_clk";
+		};
+
+		classd: classd@f003c000 {
+			compatible = "microchip,sam9x7-classd", "atmel,sama5d2-classd";
+			reg = <0xf003c000 0x100>;
+			interrupts = <42 IRQ_TYPE_LEVEL_HIGH 7>;
+			dmas = <&dma0
+				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+				 AT91_XDMAC_DT_PERID(35))>;
+			dma-names = "tx";
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 42>, <&pmc PMC_TYPE_GCK 42>;
+			clock-names = "pclk", "gclk";
+			status = "disabled";
+		};
+
+		pit64b1: timer@f0040000 {
+			compatible = "microchip,sam9x7-pit64b", "microchip,sam9x60-pit64b";
+			reg = <0xf0040000 0x100>;
+			interrupts = <58 IRQ_TYPE_LEVEL_HIGH 7>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 58>, <&pmc PMC_TYPE_GCK 58>;
+			clock-names = "pclk", "gclk";
+		};
+
+		can0: can@f8000000 {
+			compatible = "bosch,m_can";
+			reg = <0xf8000000 0x100>, <0x300000 0x7800>;
+			reg-names = "m_can", "message_ram";
+			interrupts = <29 IRQ_TYPE_LEVEL_HIGH 0
+				      68 IRQ_TYPE_LEVEL_HIGH 0>;
+			interrupt-names = "int0", "int1";
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 29>, <&pmc PMC_TYPE_GCK 29>;
+			clock-names = "hclk", "cclk";
+			assigned-clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_GCK 29>;
+			assigned-clock-rates = <480000000>, <40000000>;
+			assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_CORE PMC_UTMI>;
+			bosch,mram-cfg = <0x3400 0 0 64 0 0 32 32>;
+			status = "disabled";
+		};
+
+		can1: can@f8004000 {
+			compatible = "bosch,m_can";
+			reg = <0xf8004000 0x100>, <0x300000 0xbc00>;
+			reg-names = "m_can", "message_ram";
+			interrupts = <30 IRQ_TYPE_LEVEL_HIGH 0
+				      69 IRQ_TYPE_LEVEL_HIGH 0>;
+			interrupt-names = "int0", "int1";
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 30>, <&pmc PMC_TYPE_GCK 30>;
+			clock-names = "hclk", "cclk";
+			assigned-clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_GCK 30>;
+			assigned-clock-rates = <480000000>, <40000000>;
+			assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_CORE PMC_UTMI>;
+			bosch,mram-cfg = <0x7800 0 0 64 0 0 32 32>;
+			status = "disabled";
+		};
+
+		tcb: timer@f8008000 {
+			compatible = "microchip,sam9x7-tcb","atmel,sama5d2-tcb", "simple-mfd", "syscon";
+			reg = <0xf8008000 0x100>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 17>, <&pmc PMC_TYPE_GCK 17>, <&clk32k 0>;
+			clock-names = "t0_clk", "gclk", "slow_clk";
+			status = "disabled";
+		};
+
+		flx6: flexcom@f8010000 {
+			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
+			reg = <0xf8010000 0x200>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 9>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x0 0xf8010000 0x800>;
+			status = "disabled";
+
+			uart6: serial@200 {
+				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
+				reg = <0x200 0x200>;
+				interrupts = <9 IRQ_TYPE_LEVEL_HIGH 7>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(12))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(13))>;
+				dma-names = "tx", "rx";
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 9>;
+				clock-names = "usart";
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			i2c6: i2c@600 {
+				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
+				reg = <0x600 0x200>;
+				interrupts = <9 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 9>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(12))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(13))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+		};
+
+		flx7: flexcom@f8014000 {
+			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
+			reg = <0xf8014000 0x200>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 10>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x0 0xf8014000 0x800>;
+			status = "disabled";
+
+			uart7: serial@200 {
+				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
+				reg = <0x200 0x200>;
+				interrupts = <10 IRQ_TYPE_LEVEL_HIGH 7>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(14))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(15))>;
+				dma-names = "tx", "rx";
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 10>;
+				clock-names = "usart";
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			i2c7: i2c@600 {
+				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
+				reg = <0x600 0x200>;
+				interrupts = <10 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 10>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(14))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(15))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+		};
+
+		flx8: flexcom@f8018000 {
+			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
+			reg = <0xf8018000 0x200>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 11>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x0 0xf8018000 0x800>;
+			status = "disabled";
+
+			uart8: serial@200 {
+				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
+				reg = <0x200 0x200>;
+				interrupts = <11 IRQ_TYPE_LEVEL_HIGH 7>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(16))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(17))>;
+				dma-names = "tx", "rx";
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 11>;
+				clock-names = "usart";
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			i2c8: i2c@600 {
+				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
+				reg = <0x600 0x200>;
+				interrupts = <11 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 11>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(16))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(17))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+		};
+
+		flx0: flexcom@f801c000 {
+			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
+			reg = <0xf801c000 0x200>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x0 0xf801c000 0x800>;
+			status = "disabled";
+
+			uart0: serial@200 {
+				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
+				reg = <0x200 0x200>;
+				interrupts = <5 IRQ_TYPE_LEVEL_HIGH 7>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(0))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(1))>;
+				dma-names = "tx", "rx";
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
+				clock-names = "usart";
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			spi0: spi@400 {
+				compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
+				reg = <0x400 0x200>;
+				interrupts = <5 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
+				clock-names = "spi_clk";
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(0))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(1))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			i2c0: i2c@600 {
+				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
+				reg = <0x600 0x200>;
+				interrupts = <5 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(0))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(1))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+		};
+
+		flx1: flexcom@f8020000 {
+			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
+			reg = <0xf8020000 0x200>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 6>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x0 0xf8020000 0x800>;
+			status = "disabled";
+
+			uart1: serial@200 {
+				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
+				reg = <0x200 0x200>;
+				interrupts = <6 IRQ_TYPE_LEVEL_HIGH 7>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(2))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(3))>;
+				dma-names = "tx", "rx";
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 6>;
+				clock-names = "usart";
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			spi1: spi@400 {
+				compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
+				reg = <0x400 0x200>;
+				interrupts = <6 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 6>;
+				clock-names = "spi_clk";
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(2))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(3))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			i2c1: i2c@600 {
+				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
+				reg = <0x600 0x200>;
+				interrupts = <6 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 6>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(2))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(3))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+		};
+
+		flx2: flexcom@f8024000 {
+			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
+			reg = <0xf8024000 0x200>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 7>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x0 0xf8024000 0x800>;
+			status = "disabled";
+
+			uart2: serial@200 {
+				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
+				reg = <0x200 0x200>;
+				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 7>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(4))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(5))>;
+				dma-names = "tx", "rx";
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 7>;
+				clock-names = "usart";
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			spi2: spi@400 {
+				compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
+				reg = <0x400 0x200>;
+				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 7>;
+				clock-names = "spi_clk";
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(4))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(5))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			i2c2: i2c@600 {
+				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
+				reg = <0x600 0x200>;
+				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 7>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(4))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(5))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+		};
+
+		flx3: flexcom@f8028000 {
+			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
+			reg = <0xf8028000 0x200>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 8>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x0 0xf8028000 0x800>;
+			status = "disabled";
+
+			uart3: serial@200 {
+				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
+				reg = <0x200 0x200>;
+				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 7>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(6))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(7))>;
+				dma-names = "tx", "rx";
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 8>;
+				clock-names = "usart";
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			spi3: spi@400 {
+				compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
+				reg = <0x400 0x200>;
+				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 8>;
+				clock-names = "spi_clk";
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(6))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(7))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			i2c3: i2c@600 {
+				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
+				reg = <0x600 0x200>;
+				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 8>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(6))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(7))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+		};
+
+		gmac: ethernet@f802c000 {
+			compatible = "microchip,sam9x7-gem", "microchip,sama7g5-gem" ;
+			reg = <0xf802c000 0x1000>;
+			interrupts = <24 IRQ_TYPE_LEVEL_HIGH 3		/* Queue 0 */
+				      60 IRQ_TYPE_LEVEL_HIGH 3          /* Queue 1 */
+				      61 IRQ_TYPE_LEVEL_HIGH 3          /* Queue 2 */
+				      62 IRQ_TYPE_LEVEL_HIGH 3          /* Queue 3 */
+				      63 IRQ_TYPE_LEVEL_HIGH 3          /* Queue 4 */
+				      64 IRQ_TYPE_LEVEL_HIGH 3>;        /* Queue 5 */
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 24>, <&pmc PMC_TYPE_PERIPHERAL 24>, <&pmc PMC_TYPE_GCK 24>, <&pmc PMC_TYPE_GCK 67>;
+			clock-names = "hclk", "pclk", "tx_clk", "tsu_clk";
+			assigned-clocks = <&pmc PMC_TYPE_GCK 67>;
+			status = "disabled";
+		};
+
+		pwm0: pwm@f8034000 {
+			compatible = "microchip,sam9x7-pwm", "microchip,sam9x60-pwm";
+			reg = <0xf8034000 0x300>;
+			interrupts = <18 IRQ_TYPE_LEVEL_HIGH 4>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 18>;
+			#pwm-cells = <3>;
+			status= "disabled";
+		};
+
+		flx9: flexcom@f8040000 {
+			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
+			reg = <0xf8040000 0x200>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 15>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x0 0xf8040000 0x800>;
+			status = "disabled";
+
+			uart9: serial@200 {
+				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
+				reg = <0x200 0x200>;
+				interrupts = <15 IRQ_TYPE_LEVEL_HIGH 7>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(18))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(19))>;
+				dma-names = "tx", "rx";
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 15>;
+				clock-names = "usart";
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			i2c9: i2c@600 {
+				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
+				reg = <0x600 0x200>;
+				interrupts = <15 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 15>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(18))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(19))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+		};
+
+		flx10: flexcom@f8044000 {
+			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
+			reg = <0xf8044000 0x200>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 16>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x0 0xf8044000 0x800>;
+			status = "disabled";
+
+			uart10: serial@200 {
+				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
+				reg = <0x200 0x200>;
+				interrupts = <16 IRQ_TYPE_LEVEL_HIGH 7>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(20))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(21))>;
+				dma-names = "tx", "rx";
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 16>;
+				clock-names = "usart";
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+
+			i2c10: i2c@600 {
+				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
+				reg = <0x600 0x200>;
+				interrupts = <16 IRQ_TYPE_LEVEL_HIGH 7>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 16>;
+				dmas = <&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(20))>,
+					<&dma0
+					(AT91_XDMAC_DT_MEM_IF(0) |
+					 AT91_XDMAC_DT_PER_IF(1) |
+					 AT91_XDMAC_DT_PERID(21))>;
+				dma-names = "tx", "rx";
+				atmel,fifo-size = <16>;
+				status = "disabled";
+			};
+		};
+
+		sfr: sfr@f8050000 {
+			compatible = "microchip,sam9x7-sfr", "microchip,sam9x60-sfr", "syscon";
+			reg = <0xf8050000 0x100>;
+		};
+
+		matrix: matrix@ffffde00 {
+			compatible = "microchip,sam9x7-matrix", "atmel,at91sam9x5-matrix", "syscon";
+			reg = <0xffffde00 0x200>;
+		};
+
+		pmecc: ecc-engine@ffffe000 {
+			compatible = "microchip,sam9x7-pmecc", "atmel,at91sam9g45-pmecc";
+			reg = <0xffffe000 0x300>,
+			      <0xffffe600 0x100>;
+		};
+
+		mpddrc: mpddrc@ffffe800 {
+			compatible = "microchip,sam9x7-ddramc", "atmel,sama5d3-ddramc";
+			reg = <0xffffe800 0x200>;
+			clocks = <&pmc PMC_TYPE_SYSTEM 2>, <&pmc PMC_TYPE_CORE PMC_MCK>;
+			clock-names = "ddrck", "mpddr";
+		};
+
+		smc: smc@ffffea00 {
+			compatible = "microchip,sam9x7-smc", "atmel,at91sam9260-smc", "syscon";
+			reg = <0xffffea00 0x100>;
+		};
+
+		aic: interrupt-controller@fffff100 {
+			compatible = "microchip,sam9x7-aic", "microchip,sam9x60-aic";
+			reg = <0xfffff100 0x100>;
+			#interrupt-cells = <3>;
+			interrupt-controller;
+			atmel,external-irqs = <31>;
+			microchip,nr-irqs = <70>;
+		};
+
+		dbgu: serial@fffff200 {
+			compatible = "microchip,sam9x7-dbgu", "microchip,sam9x7-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart";
+			reg = <0xfffff200 0x200>;
+			atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
+			interrupts = <47 IRQ_TYPE_LEVEL_HIGH 7>;
+			dmas = <&dma0
+				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+				 AT91_XDMAC_DT_PERID(28))>,
+			       <&dma0
+				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+				 AT91_XDMAC_DT_PERID(29))>;
+			dma-names = "tx", "rx";
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 47>;
+			clock-names = "usart";
+			status = "disabled";
+		};
+
+		pinctrl: pinctrl@fffff400 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "microchip,sam9x7-pinctrl", "microchip,sam9x60-pinctrl", "simple-mfd";
+			ranges = <0xfffff400 0xfffff400 0x800>;
+
+			/* mux-mask corresponding to sam9x7 SoC in TFBGA228L package */
+			atmel,mux-mask = <
+					 /*  A		B	   C	      D	  */
+					 0xffffffff 0xffffefc0 0xc0ffd000 0x00000000	/* pioA */
+					 0x07ffffff 0x0805fe7f 0x01ff9f80 0x06078000	/* pioB */
+					 0xffffffff 0x07dfffff 0xfa3fffff 0x00000000	/* pioC */
+					 0x00003fff 0x00003fe0 0x0000003f 0x00000000	/* pioD */
+					 >;
+
+			pioA: gpio@fffff400 {
+				compatible = "microchip,sam9x7-gpio", "microchip,sam9x60-gpio", "atmel,at91rm9200-gpio";
+				reg = <0xfffff400 0x200>;
+				interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+				#gpio-cells = <2>;
+				gpio-controller;
+				interrupt-controller;
+				#interrupt-cells = <2>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 2>;
+			};
+
+			pioB: gpio@fffff600 {
+				compatible = "microchip,sam9x7-gpio", "microchip,sam9x60-gpio", "atmel,at91rm9200-gpio";
+				reg = <0xfffff600 0x200>;
+				interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+				#gpio-cells = <2>;
+				gpio-controller;
+				#gpio-lines = <26>;
+				interrupt-controller;
+				#interrupt-cells = <2>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 3>;
+			};
+
+			pioC: gpio@fffff800 {
+				compatible = "microchip,sam9x7-gpio", "microchip,sam9x60-gpio", "atmel,at91rm9200-gpio";
+				reg = <0xfffff800 0x200>;
+				interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
+				#gpio-cells = <2>;
+				gpio-controller;
+				interrupt-controller;
+				#interrupt-cells = <2>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 4>;
+			};
+
+			pioD: gpio@fffffa00 {
+				compatible = "microchip,sam9x7-gpio", "microchip,sam9x60-gpio", "atmel,at91rm9200-gpio";
+				reg = <0xfffffa00 0x200>;
+				interrupts = <44 IRQ_TYPE_LEVEL_HIGH 1>;
+				#gpio-cells = <2>;
+				gpio-controller;
+				#gpio-lines = <22>;
+				interrupt-controller;
+				#interrupt-cells = <2>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 44>;
+			};
+		};
+
+		pmc: clock-controller@fffffc00 {
+			compatible = "microchip,sam9x7-pmc", "syscon";
+			reg = <0xfffffc00 0x200>;
+			interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+			#clock-cells = <2>;
+			clocks = <&clk32k 1>, <&clk32k 0>, <&main_xtal>;
+			clock-names = "td_slck", "md_slck", "main_xtal";
+		};
+
+		reset_controller: reset-controller@fffffe00 {
+			compatible = "microchip,sam9x7-rstc", "microchip,sam9x60-rstc";
+			reg = <0xfffffe00 0x10>;
+			clocks = <&clk32k 0>;
+		};
+
+		power_management: power-management@fffffe10 {
+			compatible = "microchip,sam9x7-shdwc", "microchip,sam9x60-shdwc";
+			reg = <0xfffffe10 0x10>;
+			clocks = <&clk32k 0>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			atmel,wakeup-rtc-timer;
+			atmel,wakeup-rtt-timer;
+			status = "disabled";
+		};
+
+		rtt: rtc@fffffe20 {
+			compatible = "microchip,sam9x7-rtt", "atmel,at91sam9260-rtt";
+			reg = <0xfffffe20 0x20>;
+			interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+			clocks = <&clk32k 0>;
+		};
+
+		clk32k: sckc@fffffe50 {
+			compatible = "microchip,sam9x7-sckc", "microchip,sam9x60-sckc";
+			reg = <0xfffffe50 0x4>;
+			clocks = <&slow_xtal>;
+			#clock-cells = <1>;
+		};
+
+		gpbr: syscon@fffffe60 {
+			compatible = "microchip,sam9x7-gbpr", "atmel,at91sam9260-gpbr", "syscon";
+			reg = <0xfffffe60 0x10>;
+		};
+
+		rtc: rtc@fffffea8 {
+			compatible = "microchip,sam9x7-rtc", "microchip,sam9x60-rtc";
+			reg = <0xfffffea8 0x100>;
+			interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+			clocks = <&clk32k 0>;
+		};
+
+		watchdog: watchdog@ffffff80 {
+			compatible = "microchip,sam9x7-wdt", "microchip,sam9x60-wdt";
+			reg = <0xffffff80 0x24>;
+			interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+			status = "disabled";
+		};
+	};
+};
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 38/39] dt-bindings: arm: add sam9x75 curiosity board
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (36 preceding siblings ...)
  2024-02-23 17:30 ` [PATCH v4 37/39] ARM: dts: at91: sam9x7: add device tree for SoC Varshini Rajendran
@ 2024-02-23 17:31 ` Varshini Rajendran
  2024-03-01 21:26   ` Rob Herring
  2024-02-23 17:31 ` [PATCH v4 39/39] ARM: dts: at91: sam9x75_curiosity: " Varshini Rajendran
                   ` (5 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:31 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, mihai.sain,
	varshini.rajendran, andrei.simion, devicetree, linux-arm-kernel,
	linux-kernel

Add documentation for SAM9X75 Curiosity board.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
 Documentation/devicetree/bindings/arm/atmel-at91.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/atmel-at91.yaml b/Documentation/devicetree/bindings/arm/atmel-at91.yaml
index 89d75fbb1de4..d74d3a4701ac 100644
--- a/Documentation/devicetree/bindings/arm/atmel-at91.yaml
+++ b/Documentation/devicetree/bindings/arm/atmel-at91.yaml
@@ -106,6 +106,12 @@ properties:
           - const: microchip,sam9x60
           - const: atmel,at91sam9
 
+      - description: Microchip SAM9X7 Evaluation Boards
+        items:
+          - const: microchip,sam9x75-curiosity
+          - const: microchip,sam9x7
+          - const: atmel,at91sam9
+
       - description: Nattis v2 board with Natte v2 power board
         items:
           - const: axentia,nattis-2
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* [PATCH v4 39/39] ARM: dts: at91: sam9x75_curiosity: add sam9x75 curiosity board
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (37 preceding siblings ...)
  2024-02-23 17:31 ` [PATCH v4 38/39] dt-bindings: arm: add sam9x75 curiosity board Varshini Rajendran
@ 2024-02-23 17:31 ` Varshini Rajendran
  2024-03-03 12:19   ` claudiu beznea
  2024-02-24  1:18 ` (subset) [PATCH v4 00/39] Add support for sam9x7 SoC family Mark Brown
                   ` (4 subsequent siblings)
  43 siblings, 1 reply; 92+ messages in thread
From: Varshini Rajendran @ 2024-02-23 17:31 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, andre.przywara,
	gregory.clement, linus.walleij, baruch, varshini.rajendran,
	mihai.sain, devicetree, linux-kernel, linux-arm-kernel

Add device tree file for sam9x75 curiosity board.

Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
---
Changes in v4:
- Removed full node paths
- Renamed Leds with color names
- Corrected regulator node names
- Added support for classd and i2s nodes and their corresponding
  pinctrl nodes
- Dropped USB nodes owing to the discussion here
https://lore.kernel.org/linux-devicetree/CAL_JsqJ9PrX6fj-EbffeJce09MXs=B7t+KS_kOinxaRx38=WxA@mail.gmail.com/
(Explained elaborately in the cover letter)
- Updated the linux,code property with the necessary value
---
 arch/arm/boot/dts/microchip/Makefile          |   3 +
 .../dts/microchip/at91-sam9x75_curiosity.dts  | 309 ++++++++++++++++++
 2 files changed, 312 insertions(+)
 create mode 100644 arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts

diff --git a/arch/arm/boot/dts/microchip/Makefile b/arch/arm/boot/dts/microchip/Makefile
index efde9546c8f4..5b3d518da319 100644
--- a/arch/arm/boot/dts/microchip/Makefile
+++ b/arch/arm/boot/dts/microchip/Makefile
@@ -12,6 +12,7 @@ DTC_FLAGS_at91-sama5d3_eds := -@
 DTC_FLAGS_at91-sama5d3_xplained := -@
 DTC_FLAGS_at91-sama5d4_xplained := -@
 DTC_FLAGS_at91-sama7g5ek := -@
+DTC_FLAGS_at91-sam9x75_curiosity := -@
 dtb-$(CONFIG_SOC_AT91RM9200) += \
 	at91rm9200ek.dtb \
 	mpa1600.dtb
@@ -59,6 +60,8 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \
 dtb-$(CONFIG_SOC_SAM9X60) += \
 	at91-sam9x60_curiosity.dtb \
 	at91-sam9x60ek.dtb
+dtb-$(CONFIG_SOC_SAM9X7) += \
+	at91-sam9x75_curiosity.dtb
 dtb-$(CONFIG_SOC_SAM_V7) += \
 	at91-kizbox2-2.dtb \
 	at91-kizbox3-hs.dtb \
diff --git a/arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts b/arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts
new file mode 100644
index 000000000000..be37022d3d05
--- /dev/null
+++ b/arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts
@@ -0,0 +1,309 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * at91-sam9x75_curiosity.dts - Device Tree file for Microchip SAM9X75 Curiosity board
+ *
+ * Copyright (C) 2023 Microchip Technology Inc. and its subsidiaries
+ *
+ * Author: Varshini Rajendran <varshini.rajendran@microchip.com>
+ */
+/dts-v1/;
+#include "sam9x7.dtsi"
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "Microchip SAM9X75 Curiosity";
+	compatible = "microchip,sam9x75-curiosity", "microchip,sam9x7", "atmel,at91sam9";
+
+	aliases {
+		i2c0 = &i2c6;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_key_gpio_default>;
+
+		button-user {
+			label = "USER";
+			gpios = <&pioC 9 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_0>;
+			wakeup-source;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_led_gpio_default>;
+
+		led-red {
+			label = "red";
+			gpios = <&pioC 19 GPIO_ACTIVE_HIGH>;
+		};
+
+		led-green {
+			label = "green";
+			gpios = <&pioC 21 GPIO_ACTIVE_HIGH>;
+		};
+
+		led-blue {
+			label = "blue";
+			gpios = <&pioC 20 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
+	memory@20000000 {
+		device_type = "memory";
+		reg = <0x20000000 0x10000000>;
+	};
+};
+
+&classd {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_classd>;
+	atmel,pwm-type = "diff";
+	atmel,non-overlap-time = <10>;
+	status = "okay";
+};
+
+&dbgu {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_dbgu>;
+	status = "okay";
+};
+
+&dma0 {
+	status = "okay";
+};
+
+&flx6 {
+	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
+	status = "okay";
+};
+
+&i2c6 {
+	#address-cells = <1>;
+	#size-cells = <0>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_flx6_default>;
+	i2c-analog-filter;
+	i2c-digital-filter;
+	i2c-digital-filter-width-ns = <35>;
+	status = "okay";
+
+	pmic@5b {
+		compatible = "microchip,mcp16502";
+		reg = <0x5b>;
+
+		regulators {
+			vdd_3v3: VDD_IO {
+				regulator-name = "VDD_IO";
+				regulator-min-microvolt = <3000000>;
+				regulator-max-microvolt = <3600000>;
+				regulator-initial-mode = <2>;
+				regulator-allowed-modes = <2>, <4>;
+				regulator-always-on;
+
+				regulator-state-standby {
+					regulator-on-in-suspend;
+					regulator-mode = <4>;
+				};
+
+				regulator-state-mem {
+					regulator-mode = <4>;
+				};
+			};
+
+			vddioddr: VDD_DDR {
+				regulator-name = "VDD_DDR";
+				regulator-min-microvolt = <1283000>;
+				regulator-max-microvolt = <1450000>;
+				regulator-initial-mode = <2>;
+				regulator-allowed-modes = <2>, <4>;
+				regulator-always-on;
+
+				regulator-state-standby {
+					regulator-on-in-suspend;
+					regulator-mode = <4>;
+				};
+
+				regulator-state-mem {
+					regulator-on-in-suspend;
+					regulator-mode = <4>;
+				};
+			};
+
+			vddcore: VDD_CORE {
+				regulator-name = "VDD_CORE";
+				regulator-min-microvolt = <500000>;
+				regulator-max-microvolt = <1210000>;
+				regulator-initial-mode = <2>;
+				regulator-allowed-modes = <2>, <4>;
+				regulator-always-on;
+
+				regulator-state-standby {
+					regulator-on-in-suspend;
+					regulator-mode = <4>;
+				};
+
+				regulator-state-mem {
+					regulator-mode = <4>;
+				};
+			};
+
+			vddcpu: VDD_OTHER {
+				regulator-name = "VDD_OTHER";
+				regulator-min-microvolt = <1700000>;
+				regulator-max-microvolt = <3600000>;
+				regulator-initial-mode = <2>;
+				regulator-allowed-modes = <2>, <4>;
+				regulator-ramp-delay = <3125>;
+				regulator-always-on;
+
+				regulator-state-standby {
+					regulator-on-in-suspend;
+					regulator-mode = <4>;
+				};
+
+				regulator-state-mem {
+					regulator-mode = <4>;
+				};
+			};
+
+			vldo1: LDO1 {
+				regulator-name = "LDO1";
+				regulator-min-microvolt = <1200000>;
+				regulator-max-microvolt = <3700000>;
+				regulator-always-on;
+
+				regulator-state-standby {
+					regulator-on-in-suspend;
+				};
+			};
+
+			vldo2: LDO2 {
+				regulator-name = "LDO2";
+				regulator-min-microvolt = <1200000>;
+				regulator-max-microvolt = <3700000>;
+
+				regulator-state-standby {
+					regulator-on-in-suspend;
+				};
+			};
+		};
+	};
+};
+
+&i2s {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2s_default>;
+	#sound-dai-cells = <0>;
+	status = "disabled";
+};
+
+&main_xtal {
+	clock-frequency = <24000000>;
+};
+
+&pinctrl {
+
+	classd {
+		pinctrl_classd: classd {
+			atmel,pins =
+				<AT91_PIOA 18 AT91_PERIPH_C AT91_PINCTRL_PULL_UP
+				 AT91_PIOA 19 AT91_PERIPH_C AT91_PINCTRL_PULL_DOWN>;
+		};
+	};
+
+	dbgu {
+		pinctrl_dbgu: dbgu-0 {
+			atmel,pins = <AT91_PIOA 26 AT91_PERIPH_A AT91_PINCTRL_PULL_UP
+				      AT91_PIOA 27 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+		};
+	};
+
+	flexcom {
+		pinctrl_flx6_default: flx6-twi {
+			atmel,pins =
+				<AT91_PIOA 24 AT91_PERIPH_A AT91_PINCTRL_PULL_UP
+				 AT91_PIOA 25 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
+		};
+	};
+
+	gpio-keys {
+		pinctrl_key_gpio_default: key-gpio-default {
+			atmel,pins = <AT91_PIOC 9 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+		};
+	};
+
+	i2s {
+		pinctrl_i2s_default: i2s {
+			atmel,pins =
+				<AT91_PIOB 26 AT91_PERIPH_D AT91_PINCTRL_NONE		/* I2SCK */
+				 AT91_PIOB 15 AT91_PERIPH_D AT91_PINCTRL_NONE		/* I2SWS */
+				 AT91_PIOB 16 AT91_PERIPH_D AT91_PINCTRL_NONE		/* I2SDIN */
+				 AT91_PIOB 17 AT91_PERIPH_D AT91_PINCTRL_NONE		/* I2SDOUT */
+				 AT91_PIOB 25 AT91_PERIPH_D AT91_PINCTRL_NONE>;		/* I2SMCK */
+		};
+	};
+
+	leds {
+		pinctrl_led_gpio_default: led-gpio-default {
+			atmel,pins = <AT91_PIOC 19 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
+				      AT91_PIOC 21 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
+				      AT91_PIOC 20 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+		};
+	};
+
+	sdmmc0 {
+		pinctrl_sdmmc0_default: sdmmc0 {
+			atmel,pins =
+				<AT91_PIOA 2 AT91_PERIPH_A (AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)					/* PA2 CK  periph A with pullup */
+				 AT91_PIOA 1 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)		/* PA1 CMD periph A with pullup */
+				 AT91_PIOA 0 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)		/* PA0 DAT0 periph A */
+				 AT91_PIOA 3 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)		/* PA3 DAT1 periph A with pullup */
+				 AT91_PIOA 4 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)		/* PA4 DAT2 periph A with pullup */
+				 AT91_PIOA 5 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)>;	/* PA5 DAT3 periph A with pullup */
+		};
+	};
+
+}; /* pinctrl */
+
+&rtt {
+	atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
+};
+
+&sdmmc0 {
+	bus-width = <4>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_sdmmc0_default>;
+	cd-gpios = <&pioA 23 GPIO_ACTIVE_LOW>;
+	disable-wp;
+	status = "okay";
+};
+
+&slow_xtal {
+	clock-frequency = <32768>;
+};
+
+&power_management {
+	debounce-delay-us = <976>;
+	status = "okay";
+
+	input@0 {
+		reg = <0>;
+	};
+};
+
+&trng {
+	status = "okay";
+};
+
+&watchdog {
+	status = "okay";
+};
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 92+ messages in thread

* Re: (subset) [PATCH v4 00/39] Add support for sam9x7 SoC family
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (38 preceding siblings ...)
  2024-02-23 17:31 ` [PATCH v4 39/39] ARM: dts: at91: sam9x75_curiosity: " Varshini Rajendran
@ 2024-02-24  1:18 ` Mark Brown
  2024-02-27  1:21 ` Andi Shyti
                   ` (3 subsequent siblings)
  43 siblings, 0 replies; 92+ messages in thread
From: Mark Brown @ 2024-02-24  1:18 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, mturquette, sboyd, herbert,
	davem, andi.shyti, tglx, tudor.ambarus, miquel.raynal, richard,
	vigneshr, edumazet, kuba, pabeni, linus.walleij, sre,
	u.kleine-koenig, p.zabel, olivia, radu_nicolae.pirea,
	richard.genoud, gregkh, jirislaby, lgirdwood, wim, linux, linux,
	andrei.simion, mihai.sain, andre.przywara, neil.armstrong, tony,
	durai.manickamkr, geert+renesas, arnd, Jason, rdunlap, rientjes,
	vbabka, mripard, codrin.ciubotariu, eugen.hristev, devicetree,
	linux-arm-kernel, linux-kernel, linux-clk, linux-crypto,
	linux-i2c, linux-mtd, netdev, linux-gpio, linux-pm, linux-pwm,
	linux-rtc, linux-spi, linux-serial, alsa-devel, linux-sound,
	linux-watchdog, Varshini Rajendran

On Fri, 23 Feb 2024 22:43:42 +0530, Varshini Rajendran wrote:
> This patch series adds support for the new SoC family - sam9x7.
>  - The device tree, configs and drivers are added
>  - Clock driver for sam9x7 is added
>  - Support for basic peripherals is added
>  - Target board SAM9X75 Curiosity is added
> 
>  Changes in v4:
>  --------------
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[13/39] ASoC: dt-bindings: atmel-classd: add sam9x7 compatible
        commit: 89f3180d5915d4ea40e044ee102cd5c1ec81e7ef
[17/39] ASoC: dt-bindings: microchip: add sam9x7
        commit: c06a7a8e885753a024163bbb0dfd7349e8054643

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 13/39] ASoC: dt-bindings: atmel-classd: add sam9x7 compatible
  2024-02-23 17:26 ` [PATCH v4 13/39] ASoC: dt-bindings: atmel-classd: add sam9x7 compatible Varshini Rajendran
@ 2024-02-24 19:48   ` Conor Dooley
  0 siblings, 0 replies; 92+ messages in thread
From: Conor Dooley @ 2024-02-24 19:48 UTC (permalink / raw)
  To: Varshini Rajendran
  Cc: claudiu.beznea, lgirdwood, broonie, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, alsa-devel, linux-sound, devicetree,
	linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1229 bytes --]

On Fri, Feb 23, 2024 at 10:56:08PM +0530, Varshini Rajendran wrote:
> Add sam9x7 compatible to DT bindings documentation.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> ---
> Changes in v4:
> - Changed the subject prefix matching the subsystem

> - Removed unwanted '-items' from the syntax

Did you? The diff looks identical to v3.

Thanks,
Conor.

> ---
>  .../devicetree/bindings/sound/atmel,sama5d2-classd.yaml    | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/sound/atmel,sama5d2-classd.yaml b/Documentation/devicetree/bindings/sound/atmel,sama5d2-classd.yaml
> index 43d04702ac2d..ae3162fcfe02 100644
> --- a/Documentation/devicetree/bindings/sound/atmel,sama5d2-classd.yaml
> +++ b/Documentation/devicetree/bindings/sound/atmel,sama5d2-classd.yaml
> @@ -18,7 +18,12 @@ description:
>  
>  properties:
>    compatible:
> -    const: atmel,sama5d2-classd
> +    oneOf:
> +      - items:
> +          - const: atmel,sama5d2-classd
> +      - items:
> +          - const: microchip,sam9x7-classd
> +          - const: atmel,sama5d2-classd
>  
>    reg:
>      maxItems: 1
> -- 
> 2.25.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 06/39] dt-bindings: i2c: at91: Add sam9x7 compatible string
  2024-02-23 17:24 ` [PATCH v4 06/39] dt-bindings: i2c: at91: Add sam9x7 compatible string Varshini Rajendran
@ 2024-02-24 19:49   ` Conor Dooley
  0 siblings, 0 replies; 92+ messages in thread
From: Conor Dooley @ 2024-02-24 19:49 UTC (permalink / raw)
  To: Varshini Rajendran
  Cc: andi.shyti, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea, linux-i2c,
	devicetree, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1266 bytes --]

On Fri, Feb 23, 2024 at 10:54:59PM +0530, Varshini Rajendran wrote:
> Add compatible string for sam9x7.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

> ---
> Changes in v4:
> - Made sam9x7 compatible as an enum with sama7g5 compatible
> - Removed the sam9x7 compatible from allOf section as it was not needed
>   like pointed out
> ---
>  Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml b/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
> index 6adedd3ec399..b1c13bab2472 100644
> --- a/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
> +++ b/Documentation/devicetree/bindings/i2c/atmel,at91sam-i2c.yaml
> @@ -25,7 +25,9 @@ properties:
>                - atmel,sama5d2-i2c
>                - microchip,sam9x60-i2c
>        - items:
> -          - const: microchip,sama7g5-i2c
> +          - enum:
> +              - microchip,sama7g5-i2c
> +              - microchip,sam9x7-i2c
>            - const: microchip,sam9x60-i2c
>  
>    reg:
> -- 
> 2.25.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 05/39] dt-bindings: crypto: add sam9x7 in Atmel TDES
  2024-02-23 17:24 ` [PATCH v4 05/39] dt-bindings: crypto: add sam9x7 in Atmel TDES Varshini Rajendran
@ 2024-02-24 19:50   ` Conor Dooley
  2024-02-26  9:24   ` Tudor Ambarus
  1 sibling, 0 replies; 92+ messages in thread
From: Conor Dooley @ 2024-02-24 19:50 UTC (permalink / raw)
  To: Varshini Rajendran
  Cc: herbert, davem, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea, tudor.ambarus,
	linux-crypto, devicetree, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 311 bytes --]

On Fri, Feb 23, 2024 at 10:54:45PM +0530, Varshini Rajendran wrote:
> Add DT bindings for atmel TDES.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 08/39] dt-bindings: atmel-nand: add microchip,sam9x7-pmecc
  2024-02-23 17:25 ` [PATCH v4 08/39] dt-bindings: atmel-nand: add microchip,sam9x7-pmecc Varshini Rajendran
@ 2024-02-24 19:50   ` Conor Dooley
  2024-02-26 10:43   ` Miquel Raynal
  1 sibling, 0 replies; 92+ messages in thread
From: Conor Dooley @ 2024-02-24 19:50 UTC (permalink / raw)
  To: Varshini Rajendran
  Cc: tudor.ambarus, miquel.raynal, richard, vigneshr, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linux-mtd, devicetree,
	linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1039 bytes --]

On Fri, Feb 23, 2024 at 10:55:20PM +0530, Varshini Rajendran wrote:
> Add microchip,sam9x7-pmecc to DT bindings documentation.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

> ---
>  Documentation/devicetree/bindings/mtd/atmel-nand.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/mtd/atmel-nand.txt b/Documentation/devicetree/bindings/mtd/atmel-nand.txt
> index 50645828ac20..4598930851d9 100644
> --- a/Documentation/devicetree/bindings/mtd/atmel-nand.txt
> +++ b/Documentation/devicetree/bindings/mtd/atmel-nand.txt
> @@ -56,6 +56,7 @@ Required properties:
>  	"atmel,sama5d4-pmecc"
>  	"atmel,sama5d2-pmecc"
>  	"microchip,sam9x60-pmecc"
> +	"microchip,sam9x7-pmecc", "atmel,at91sam9g45-pmecc"
>  - reg: should contain 2 register ranges. The first one is pointing to the PMECC
>         block, and the second one to the PMECC_ERRLOC block.
>  
> -- 
> 2.25.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 11/39] dt-bindings: rtt: at91rm9260: add sam9x7 compatible
  2024-02-23 17:25 ` [PATCH v4 11/39] dt-bindings: rtt: at91rm9260: add sam9x7 compatible Varshini Rajendran
@ 2024-02-24 19:51   ` Conor Dooley
  2024-02-29 21:27   ` (subset) " Alexandre Belloni
  1 sibling, 0 replies; 92+ messages in thread
From: Conor Dooley @ 2024-02-24 19:51 UTC (permalink / raw)
  To: Varshini Rajendran
  Cc: alexandre.belloni, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, claudiu.beznea, linux-rtc, devicetree,
	linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1233 bytes --]

On Fri, Feb 23, 2024 at 10:55:52PM +0530, Varshini Rajendran wrote:
> Add compatible for SAM9X7 RTT.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

> ---
> Changes in v4:
> - Made sam9x7 compatible as an enum with sam9x60 compatible as
>   suggested
> ---
>  .../devicetree/bindings/rtc/atmel,at91sam9260-rtt.yaml        | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/rtc/atmel,at91sam9260-rtt.yaml b/Documentation/devicetree/bindings/rtc/atmel,at91sam9260-rtt.yaml
> index b80b85c394ac..a7f6c1d1a08a 100644
> --- a/Documentation/devicetree/bindings/rtc/atmel,at91sam9260-rtt.yaml
> +++ b/Documentation/devicetree/bindings/rtc/atmel,at91sam9260-rtt.yaml
> @@ -19,7 +19,9 @@ properties:
>        - items:
>            - const: atmel,at91sam9260-rtt
>        - items:
> -          - const: microchip,sam9x60-rtt
> +          - enum:
> +              - microchip,sam9x60-rtt
> +              - microchip,sam9x7-rtt
>            - const: atmel,at91sam9260-rtt
>        - items:
>            - const: microchip,sama7g5-rtt
> -- 
> 2.25.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 12/39] dt-bindings: serial: atmel,at91-usart: add compatible for sam9x7.
  2024-02-23 17:25 ` [PATCH v4 12/39] dt-bindings: serial: atmel,at91-usart: add compatible for sam9x7 Varshini Rajendran
@ 2024-02-24 20:02   ` Conor Dooley
  2024-02-28  7:03     ` Varshini.Rajendran
  0 siblings, 1 reply; 92+ messages in thread
From: Conor Dooley @ 2024-02-24 20:02 UTC (permalink / raw)
  To: Varshini Rajendran
  Cc: radu_nicolae.pirea, richard.genoud, gregkh, jirislaby, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linux-kernel, linux-spi,
	linux-serial, devicetree, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 2347 bytes --]

On Fri, Feb 23, 2024 at 10:55:59PM +0530, Varshini Rajendran wrote:
> Add sam9x7 compatible to DT bindings documentation.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> ---
> Changes in v4:
> - Fixed the wrong addition of compatible
> - Added further compatibles that are possible correct (as per DT)
> ---
>  .../devicetree/bindings/serial/atmel,at91-usart.yaml | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml b/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
> index 65cb2e5c5eee..30af537e8e81 100644
> --- a/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
> +++ b/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
> @@ -23,11 +23,17 @@ properties:
>            - const: atmel,at91sam9260-dbgu
>            - const: atmel,at91sam9260-usart
>        - items:
> -          - const: microchip,sam9x60-usart
> +          - enum:
> +              - microchip,sam9x60-usart
> +              - microchip,sam9x7-usart
>            - const: atmel,at91sam9260-usart
>        - items:
> -          - const: microchip,sam9x60-dbgu
> -          - const: microchip,sam9x60-usart
> +          - enum:
> +              - microchip,sam9x60-dbgu
> +              - microchip,sam9x7-dbgu

> +          - enum:
> +              - microchip,sam9x60-usart
> +              - microchip,sam9x7-usart

This doesn't make sense - this enum should be a const.
I don't really understand the idea behind of the original binding here that
allowed:
"microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"

Specifically, I don't get the purpose of the "microchip,sam9x60-usart".
Either make it
      - items:
          - enum:
              - microchip,sam9x60-dbgu
              - microchip,sam9x7-dbgu
          - const: microchip,sam9x60-usart
          - const: atmel,at91sam9260-dbgu
          - const: atmel,at91sam9260-usart
or add
      - items:
          - const: microchip,sam9x60-dbgu
          - const: atmel,at91sam9260-dbgu
          - const: atmel,at91sam9260-usart
or explain exactly why this needs to be
"chipa-dgbu", "chipa-usart", "chipb-dbgu", "chipb-dbgu"

Thanks,
Conor.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 14/39] dt-bindings: pwm: at91: Add sam9x7 compatible strings list
  2024-02-23 17:26 ` [PATCH v4 14/39] dt-bindings: pwm: at91: Add sam9x7 compatible strings list Varshini Rajendran
@ 2024-02-24 20:03   ` Conor Dooley
       [not found]   ` <igmm3npqcnjuhhncfd22pjhjuzbtsl25jfzbpcsyx5bu2xbbto@ynp7psnpldxr>
  1 sibling, 0 replies; 92+ messages in thread
From: Conor Dooley @ 2024-02-24 20:03 UTC (permalink / raw)
  To: Varshini Rajendran
  Cc: claudiu.beznea, u.kleine-koenig, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, nicolas.ferre, alexandre.belloni, linux-arm-kernel,
	linux-pwm, devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1010 bytes --]

On Fri, Feb 23, 2024 at 10:56:19PM +0530, Varshini Rajendran wrote:
> Add compatible strings list for SAM9X7.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

> ---
>  Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml b/Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml
> index d84268b59784..96cd6f3c3546 100644
> --- a/Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml
> +++ b/Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml
> @@ -25,6 +25,9 @@ properties:
>        - items:
>            - const: microchip,sama7g5-pwm
>            - const: atmel,sama5d2-pwm
> +      - items:
> +          - const: microchip,sam9x7-pwm
> +          - const: microchip,sam9x60-pwm
>  
>    reg:
>      maxItems: 1
> -- 
> 2.25.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 15/39] dt-bindings: watchdog: sama5d4-wdt: add compatible for sam9x7-wdt
  2024-02-23 17:26 ` [PATCH v4 15/39] dt-bindings: watchdog: sama5d4-wdt: add compatible for sam9x7-wdt Varshini Rajendran
@ 2024-02-24 20:04   ` Conor Dooley
  0 siblings, 0 replies; 92+ messages in thread
From: Conor Dooley @ 2024-02-24 20:04 UTC (permalink / raw)
  To: Varshini Rajendran
  Cc: wim, linux, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea, eugen.hristev,
	linux-watchdog, devicetree, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 288 bytes --]

On Fri, Feb 23, 2024 at 10:56:27PM +0530, Varshini Rajendran wrote:
> Add compatible microchip,sam9x7-wdt to DT bindings documentation.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 21/39] dt-bindings: clk: at91: add sam9x7
  2024-02-23 17:27 ` [PATCH v4 21/39] dt-bindings: clk: at91: add sam9x7 Varshini Rajendran
@ 2024-02-24 20:05   ` Conor Dooley
  2024-03-11  5:32   ` claudiu beznea
  1 sibling, 0 replies; 92+ messages in thread
From: Conor Dooley @ 2024-02-24 20:05 UTC (permalink / raw)
  To: Varshini Rajendran
  Cc: mturquette, sboyd, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea, linux-clk,
	devicetree, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1239 bytes --]

On Fri, Feb 23, 2024 at 10:57:32PM +0530, Varshini Rajendran wrote:
> Add bindings for SAM9X7's slow clock controller.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

> ---
> Changes in v4:
> - Added sam9x7 compatible as an enum with sama7g5 compatible as per the
>   review comment
> ---
>  .../devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml      | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml b/Documentation/devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml
> index 7be29877e6d2..ab81f0b55ad5 100644
> --- a/Documentation/devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml
> +++ b/Documentation/devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml
> @@ -18,7 +18,9 @@ properties:
>            - atmel,sama5d4-sckc
>            - microchip,sam9x60-sckc
>        - items:
> -          - const: microchip,sama7g5-sckc
> +          - enum:
> +              - microchip,sama7g5-sckc
> +              - microchip,sam9x7-sckc
>            - const: microchip,sam9x60-sckc
>  
>    reg:
> -- 
> 2.25.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 22/39] dt-bindings: clk: at91: add sam9x7 clock controller
  2024-02-23 17:27 ` [PATCH v4 22/39] dt-bindings: clk: at91: add sam9x7 clock controller Varshini Rajendran
@ 2024-02-24 20:06   ` Conor Dooley
  2024-03-11  5:33   ` claudiu beznea
  1 sibling, 0 replies; 92+ messages in thread
From: Conor Dooley @ 2024-02-24 20:06 UTC (permalink / raw)
  To: Varshini Rajendran
  Cc: mturquette, sboyd, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea, linux-clk,
	devicetree, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 253 bytes --]

On Fri, Feb 23, 2024 at 10:57:41PM +0530, Varshini Rajendran wrote:
> Add bindings for SAM9X7's pmc.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 16/39] spi: dt-bindings: atmel,at91rm9200-spi: remove 9x60 compatible from list
  2024-02-23 17:26 ` [PATCH v4 16/39] spi: dt-bindings: atmel,at91rm9200-spi: remove 9x60 compatible from list Varshini Rajendran
@ 2024-02-26  9:09   ` Tudor Ambarus
  2024-02-28  9:28     ` Varshini.Rajendran
  0 siblings, 1 reply; 92+ messages in thread
From: Tudor Ambarus @ 2024-02-26  9:09 UTC (permalink / raw)
  To: Varshini Rajendran, broonie, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, nicolas.ferre, alexandre.belloni, claudiu.beznea,
	linux-spi, devicetree, linux-arm-kernel, linux-kernel



On 23.02.2024 19:26, Varshini Rajendran wrote:
> Remove microchip,sam9x60-spi compatible from the list as the driver used
> has the compatible atmel,at91rm9200-spi and sam9x60 devices also use the
> same compatible as fallback. So removing the microchip,sam9x60-spi
> compatible from the list since it is not needed.
> 

I find this wrong. I though we shall add compatibles for each SoC. Are
the registers and fields the same for the SPI IPs in these 2 SoCs? Even
if they are the same, are you sure the IPs are integrated in the same way?

> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> ---
> Changes in v4:
> - Elaborated the explanation in the commit message to justify the patch
> ---
>  Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml b/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml
> index 58367587bfbc..32e7c14033c2 100644
> --- a/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml
> +++ b/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml
> @@ -22,7 +22,6 @@ properties:
>            - const: atmel,at91rm9200-spi
>        - items:
>            - const: microchip,sam9x7-spi
> -          - const: microchip,sam9x60-spi
>            - const: atmel,at91rm9200-spi
>  
>    reg:

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 03/39] dt-bindings: crypto: add sam9x7 in Atmel AES
  2024-02-23 17:23 ` [PATCH v4 03/39] dt-bindings: crypto: add sam9x7 in Atmel AES Varshini Rajendran
@ 2024-02-26  9:18   ` Tudor Ambarus
  0 siblings, 0 replies; 92+ messages in thread
From: Tudor Ambarus @ 2024-02-26  9:18 UTC (permalink / raw)
  To: Varshini Rajendran, herbert, davem, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linux-crypto, devicetree,
	linux-arm-kernel, linux-kernel
  Cc: Rob Herring



On 23.02.2024 19:23, Varshini Rajendran wrote:
> Add DT bindings for atmel AES.
>

This would have deserved a better commit message, I (we) spent a lot of
time deciding whether this is the correct approach.
https://lore.kernel.org/linux-arm-kernel/342de8f3-852f-9bfa-39c4-4d820f349305@linaro.org/

> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> Acked-by: Rob Herring <robh@kernel.org>

Anyway:
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> Changes in v4:
> - Updated Acked-by tag
> ---
>  .../devicetree/bindings/crypto/atmel,at91sam9g46-aes.yaml   | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-aes.yaml b/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-aes.yaml
> index 0b7383b3106b..7dc0748444fd 100644
> --- a/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-aes.yaml
> +++ b/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-aes.yaml
> @@ -12,7 +12,11 @@ maintainers:
>  
>  properties:
>    compatible:
> -    const: atmel,at91sam9g46-aes
> +    oneOf:
> +      - const: atmel,at91sam9g46-aes
> +      - items:
> +          - const: microchip,sam9x7-aes
> +          - const: atmel,at91sam9g46-aes
>  
>    reg:
>      maxItems: 1

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 04/39] dt-bindings: crypto: add sam9x7 in Atmel SHA
  2024-02-23 17:23 ` [PATCH v4 04/39] dt-bindings: crypto: add sam9x7 in Atmel SHA Varshini Rajendran
@ 2024-02-26  9:23   ` Tudor Ambarus
  0 siblings, 0 replies; 92+ messages in thread
From: Tudor Ambarus @ 2024-02-26  9:23 UTC (permalink / raw)
  To: Varshini Rajendran, herbert, davem, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linux-crypto, devicetree,
	linux-arm-kernel, linux-kernel
  Cc: Rob Herring



On 23.02.2024 19:23, Varshini Rajendran wrote:
> Add DT bindings for atmel SHA.

This would have deserved a better commit message, I (we) spent a lot of
time deciding whether this is the correct approach.
https://lore.kernel.org/linux-arm-kernel/342de8f3-852f-9bfa-39c4-4d820f349305@linaro.org/

Anyway:
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>

> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> Acked-by: Rob Herring <robh@kernel.org>
> ---
> Changes in v4:
> - Updated Acked-by tag
> ---
>  .../devicetree/bindings/crypto/atmel,at91sam9g46-sha.yaml   | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-sha.yaml b/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-sha.yaml
> index ee2ffb034325..d378c53314dd 100644
> --- a/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-sha.yaml
> +++ b/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-sha.yaml
> @@ -12,7 +12,11 @@ maintainers:
>  
>  properties:
>    compatible:
> -    const: atmel,at91sam9g46-sha
> +    oneOf:
> +      - const: atmel,at91sam9g46-sha
> +      - items:
> +          - const: microchip,sam9x7-sha
> +          - const: atmel,at91sam9g46-sha
>  
>    reg:
>      maxItems: 1

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 05/39] dt-bindings: crypto: add sam9x7 in Atmel TDES
  2024-02-23 17:24 ` [PATCH v4 05/39] dt-bindings: crypto: add sam9x7 in Atmel TDES Varshini Rajendran
  2024-02-24 19:50   ` Conor Dooley
@ 2024-02-26  9:24   ` Tudor Ambarus
  1 sibling, 0 replies; 92+ messages in thread
From: Tudor Ambarus @ 2024-02-26  9:24 UTC (permalink / raw)
  To: Varshini Rajendran, herbert, davem, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linux-crypto, devicetree,
	linux-arm-kernel, linux-kernel



On 23.02.2024 19:24, Varshini Rajendran wrote:
> Add DT bindings for atmel TDES.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

This would have deserved a better commit message, I (we) spent a lot of
time deciding whether this is the correct approach.
https://lore.kernel.org/linux-arm-kernel/342de8f3-852f-9bfa-39c4-4d820f349305@linaro.org/

Anyway:
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>

> ---
> Changes in v4:
> - Updated Acked-by tag
> ---
>  .../devicetree/bindings/crypto/atmel,at91sam9g46-tdes.yaml  | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-tdes.yaml b/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-tdes.yaml
> index 3d6ed24b1b00..6a441f79efea 100644
> --- a/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-tdes.yaml
> +++ b/Documentation/devicetree/bindings/crypto/atmel,at91sam9g46-tdes.yaml
> @@ -12,7 +12,11 @@ maintainers:
>  
>  properties:
>    compatible:
> -    const: atmel,at91sam9g46-tdes
> +    oneOf:
> +      - const: atmel,at91sam9g46-tdes
> +      - items:
> +          - const: microchip,sam9x7-tdes
> +          - const: atmel,at91sam9g46-tdes
>  
>    reg:
>      maxItems: 1

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 08/39] dt-bindings: atmel-nand: add microchip,sam9x7-pmecc
  2024-02-23 17:25 ` [PATCH v4 08/39] dt-bindings: atmel-nand: add microchip,sam9x7-pmecc Varshini Rajendran
  2024-02-24 19:50   ` Conor Dooley
@ 2024-02-26 10:43   ` Miquel Raynal
  1 sibling, 0 replies; 92+ messages in thread
From: Miquel Raynal @ 2024-02-26 10:43 UTC (permalink / raw)
  To: Varshini Rajendran, tudor.ambarus, miquel.raynal, richard,
	vigneshr, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, claudiu.beznea, linux-mtd,
	devicetree, linux-arm-kernel, linux-kernel

On Fri, 2024-02-23 at 17:25:20 UTC, Varshini Rajendran wrote:
> Add microchip,sam9x7-pmecc to DT bindings documentation.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 20/39] ARM: at91: add support in SoC driver for new sam9x7
  2024-02-23 17:27 ` [PATCH v4 20/39] ARM: at91: add support in SoC driver for new sam9x7 Varshini Rajendran
@ 2024-02-26 17:01   ` Nicolas Ferre
  2024-03-03 12:21   ` claudiu beznea
  1 sibling, 0 replies; 92+ messages in thread
From: Nicolas Ferre @ 2024-02-26 17:01 UTC (permalink / raw)
  To: Varshini Rajendran, alexandre.belloni, claudiu.beznea,
	linux-arm-kernel, linux-kernel
  Cc: Claudiu Beznea

On 23/02/2024 at 18:27, Varshini Rajendran - I67070 wrote:
> Add support for SAM9X7 SoC in the SoC driver.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> ---
> Changes in v4:
> - Sorted the entries alphabetically as per comment from Claudiu
> - Updated EXID
> Note: Did not remove the Reviewed-by tag since the changes were only
> cosmetic and did not affect functionality
> ---
>   drivers/soc/atmel/soc.c | 23 +++++++++++++++++++++++
>   drivers/soc/atmel/soc.h |  9 +++++++++
>   2 files changed, 32 insertions(+)
> 
> diff --git a/drivers/soc/atmel/soc.c b/drivers/soc/atmel/soc.c
> index cc9a3e107479..cae3452cbc60 100644
> --- a/drivers/soc/atmel/soc.c
> +++ b/drivers/soc/atmel/soc.c
> @@ -101,6 +101,29 @@ static const struct at91_soc socs[] __initconst = {
>   		 AT91_CIDR_VERSION_MASK, SAM9X60_D6K_EXID_MATCH,
>   		 "sam9x60 8MiB SDRAM SiP", "sam9x60"),
>   #endif
> +#ifdef CONFIG_SOC_SAM9X7
> +	AT91_SOC(SAM9X7_CIDR_MATCH, AT91_CIDR_MATCH_MASK,
> +		 AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
> +		 "sam9x75", "sam9x7"),
> +	AT91_SOC(SAM9X7_CIDR_MATCH, AT91_CIDR_MATCH_MASK,
> +		 AT91_CIDR_VERSION_MASK, SAM9X72_EXID_MATCH,
> +		 "sam9x72", "sam9x7"),
> +	AT91_SOC(SAM9X7_CIDR_MATCH, AT91_CIDR_MATCH_MASK,
> +		 AT91_CIDR_VERSION_MASK, SAM9X70_EXID_MATCH,
> +		 "sam9x70", "sam9x7"),
> +	AT91_SOC(SAM9X7_CIDR_MATCH, SAM9X75_D1G_EXID_MATCH,
> +		 AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
> +		 "sam9x75 1Gb DDR3L SiP ", "sam9x7"),
> +	AT91_SOC(SAM9X7_CIDR_MATCH, SAM9X75_D5M_EXID_MATCH,
> +		 AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
> +		 "sam9x75 512Mb DDR2 SiP", "sam9x7"),
> +	AT91_SOC(SAM9X7_CIDR_MATCH, SAM9X75_D1M_EXID_MATCH,
> +		 AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
> +		 "sam9x75 128Mb DDR2 SiP", "sam9x7"),
> +	AT91_SOC(SAM9X7_CIDR_MATCH, SAM9X75_D2G_EXID_MATCH,
> +		 AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
> +		 "sam9x75 2Gb DDR3L SiP", "sam9x7"),

(as highlighted in previous review of this patch):
https://lore.kernel.org/linux-arm-kernel/20230728102905.267131-1-varshini.rajendran@microchip.com/T/#m2dac0ce9e1991c3d714785062a76ccdce11a02a6

I want RAM size in Bytes.

Sorry but NACK.

Best regards,
   Nicolas

> +#endif
>   #ifdef CONFIG_SOC_SAMA5
>   	AT91_SOC(SAMA5D2_CIDR_MATCH, AT91_CIDR_MATCH_MASK,
>   		 AT91_CIDR_VERSION_MASK, SAMA5D21CU_EXID_MATCH,
> diff --git a/drivers/soc/atmel/soc.h b/drivers/soc/atmel/soc.h
> index 7a9f47ce85fb..fc4157c5f6e3 100644
> --- a/drivers/soc/atmel/soc.h
> +++ b/drivers/soc/atmel/soc.h
> @@ -44,6 +44,7 @@ at91_soc_init(const struct at91_soc *socs);
>   #define AT91SAM9X5_CIDR_MATCH		0x019a05a0
>   #define AT91SAM9N12_CIDR_MATCH		0x019a07a0
>   #define SAM9X60_CIDR_MATCH		0x019b35a0
> +#define SAM9X7_CIDR_MATCH		0x09750020
>   #define SAMA7G5_CIDR_MATCH		0x00162100
>   
>   #define AT91SAM9M11_EXID_MATCH		0x00000001
> @@ -74,6 +75,14 @@ at91_soc_init(const struct at91_soc *socs);
>   #define SAMA7G54_D2G_EXID_MATCH		0x00000020
>   #define SAMA7G54_D4G_EXID_MATCH		0x00000028
>   
> +#define SAM9X70_EXID_MATCH		0x00000005
> +#define SAM9X72_EXID_MATCH		0x00000004
> +#define SAM9X75_D1G_EXID_MATCH		0x00000018
> +#define SAM9X75_D2G_EXID_MATCH		0x00000020
> +#define SAM9X75_D1M_EXID_MATCH		0x00000003
> +#define SAM9X75_D5M_EXID_MATCH		0x00000010
> +#define SAM9X75_EXID_MATCH		0x00000000
> +
>   #define AT91SAM9XE128_CIDR_MATCH	0x329973a0
>   #define AT91SAM9XE256_CIDR_MATCH	0x329a93a0
>   #define AT91SAM9XE512_CIDR_MATCH	0x329aa3a0


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: (subset) [PATCH v4 00/39] Add support for sam9x7 SoC family
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (39 preceding siblings ...)
  2024-02-24  1:18 ` (subset) [PATCH v4 00/39] Add support for sam9x7 SoC family Mark Brown
@ 2024-02-27  1:21 ` Andi Shyti
  2024-02-27  3:20 ` patchwork-bot+netdevbpf
                   ` (2 subsequent siblings)
  43 siblings, 0 replies; 92+ messages in thread
From: Andi Shyti @ 2024-02-27  1:21 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, mturquette, sboyd, herbert,
	davem, tglx, tudor.ambarus, miquel.raynal, richard, vigneshr,
	edumazet, kuba, pabeni, linus.walleij, sre, u.kleine-koenig,
	p.zabel, olivia, radu_nicolae.pirea, richard.genoud, gregkh,
	jirislaby, lgirdwood, broonie, wim, linux, linux, andrei.simion,
	mihai.sain, andre.przywara, neil.armstrong, tony,
	durai.manickamkr, geert+renesas, arnd, Jason, rdunlap, rientjes,
	vbabka, mripard, codrin.ciubotariu, eugen.hristev, devicetree,
	linux-arm-kernel, linux-kernel, linux-clk, linux-crypto,
	linux-i2c, linux-mtd, netdev, linux-gpio, linux-pm, linux-pwm,
	linux-rtc, linux-spi, linux-serial, alsa-devel, linux-sound,
	linux-watchdog, Varshini Rajendran

Hi

On Fri, 23 Feb 2024 22:43:42 +0530, Varshini Rajendran wrote:
> This patch series adds support for the new SoC family - sam9x7.
>  - The device tree, configs and drivers are added
>  - Clock driver for sam9x7 is added
>  - Support for basic peripherals is added
>  - Target board SAM9X75 Curiosity is added
> 
>  Changes in v4:
>  --------------
> 
> [...]

Applied to i2c/i2c-host on

git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git

Thank you,
Andi

Patches applied
===============
[06/39] dt-bindings: i2c: at91: Add sam9x7 compatible string
        commit: a856c9e6104f7b4619f09e19ab95903c7888da96


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 00/39] Add support for sam9x7 SoC family
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (40 preceding siblings ...)
  2024-02-27  1:21 ` Andi Shyti
@ 2024-02-27  3:20 ` patchwork-bot+netdevbpf
  2024-02-28 15:53 ` (subset) " Mark Brown
  2024-03-01 10:51 ` Herbert Xu
  43 siblings, 0 replies; 92+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-02-27  3:20 UTC (permalink / raw)
  To: Varshini Rajendran
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, mturquette, sboyd, herbert,
	davem, andi.shyti, tglx, tudor.ambarus, miquel.raynal, richard,
	vigneshr, edumazet, kuba, pabeni, linus.walleij, sre,
	u.kleine-koenig, p.zabel, olivia, radu_nicolae.pirea,
	richard.genoud, gregkh, jirislaby, lgirdwood, broonie, wim,
	linux, linux, andrei.simion, mihai.sain, andre.przywara,
	neil.armstrong, tony, durai.manickamkr, geert+renesas, arnd,
	Jason, rdunlap, rientjes, vbabka, mripard, codrin.ciubotariu,
	eugen.hristev, devicetree, linux-arm-kernel, linux-kernel,
	linux-clk, linux-crypto, linux-i2c, linux-mtd, netdev,
	linux-gpio, linux-pm, linux-pwm, linux-rtc, linux-spi,
	linux-serial, alsa-devel, linux-sound, linux-watchdog

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 23 Feb 2024 22:43:42 +0530 you wrote:
> This patch series adds support for the new SoC family - sam9x7.
>  - The device tree, configs and drivers are added
>  - Clock driver for sam9x7 is added
>  - Support for basic peripherals is added
>  - Target board SAM9X75 Curiosity is added
> 
>  Changes in v4:
> 
> [...]

Here is the summary with links:
  - [v4,01/39] dt-bindings: net: cdns,macb: add sam9x7 ethernet interface
    https://git.kernel.org/netdev/net-next/c/5c237967e632

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 12/39] dt-bindings: serial: atmel,at91-usart: add compatible for sam9x7.
  2024-02-24 20:02   ` Conor Dooley
@ 2024-02-28  7:03     ` Varshini.Rajendran
  2024-02-28 11:49       ` Conor Dooley
  0 siblings, 1 reply; 92+ messages in thread
From: Varshini.Rajendran @ 2024-02-28  7:03 UTC (permalink / raw)
  To: conor
  Cc: radu_nicolae.pirea, richard.genoud, gregkh, jirislaby, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, Nicolas.Ferre,
	alexandre.belloni, claudiu.beznea, linux-kernel, linux-spi,
	linux-serial, devicetree, linux-arm-kernel

Hi Conor,

On 25/02/24 1:32 am, Conor Dooley wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> On Fri, Feb 23, 2024 at 10:55:59PM +0530, Varshini Rajendran wrote:
>> Add sam9x7 compatible to DT bindings documentation.
>>
>> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
>> ---
>> Changes in v4:
>> - Fixed the wrong addition of compatible
>> - Added further compatibles that are possible correct (as per DT)
>> ---
>>  .../devicetree/bindings/serial/atmel,at91-usart.yaml | 12 +++++++++---
>>  1 file changed, 9 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml b/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
>> index 65cb2e5c5eee..30af537e8e81 100644
>> --- a/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
>> +++ b/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
>> @@ -23,11 +23,17 @@ properties:
>>            - const: atmel,at91sam9260-dbgu
>>            - const: atmel,at91sam9260-usart
>>        - items:
>> -          - const: microchip,sam9x60-usart
>> +          - enum:
>> +              - microchip,sam9x60-usart
>> +              - microchip,sam9x7-usart
>>            - const: atmel,at91sam9260-usart
>>        - items:
>> -          - const: microchip,sam9x60-dbgu
>> -          - const: microchip,sam9x60-usart
>> +          - enum:
>> +              - microchip,sam9x60-dbgu
>> +              - microchip,sam9x7-dbgu
> 
>> +          - enum:
>> +              - microchip,sam9x60-usart
>> +              - microchip,sam9x7-usart
> 
> This doesn't make sense - this enum should be a const.
> I don't really understand the idea behind of the original binding here that
> allowed:
> "microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"
> 
> Specifically, I don't get the purpose of the "microchip,sam9x60-usart".
> Either make it
>       - items:
>           - enum:
>               - microchip,sam9x60-dbgu
>               - microchip,sam9x7-dbgu
>           - const: microchip,sam9x60-usart
>           - const: atmel,at91sam9260-dbgu
>           - const: atmel,at91sam9260-usart
> or add
>       - items:
>           - const: microchip,sam9x60-dbgu
>           - const: atmel,at91sam9260-dbgu
>           - const: atmel,at91sam9260-usart
> or explain exactly why this needs to be
> "chipa-dgbu", "chipa-usart", "chipb-dbgu", "chipb-dbgu"
The compatible has to be "chipa-usart", "chipb-usart", "chipa-dbgu", 
"chipb-dbgu" for the device to work as a debug console over UART
wher the chipa-<periph> is the device specific compatible
and the chipb-<periph> is the fallback compatible that the driver 
actually uses.

Maybe putting the 2 compatibles as 2 enums is not right. I will rephrase 
it as below.

       - items:
           - const: microchip,sam9x60-dbgu
           - const: microchip,sam9x60-usart
           - const: atmel,at91sam9260-dbgu
           - const: atmel,at91sam9260-usart
       - items:
           - const: microchip,sam9x7-dbgu
           - const: microchip,sam9x7-usart
           - const: atmel,at91sam9260-dbgu
           - const: atmel,at91sam9260-usart

Hope this is fine.
> 
> Thanks,
> Conor.
> 

-- 
Thanks and Regards,
Varshini Rajendran.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 16/39] spi: dt-bindings: atmel,at91rm9200-spi: remove 9x60 compatible from list
  2024-02-26  9:09   ` Tudor Ambarus
@ 2024-02-28  9:28     ` Varshini.Rajendran
  2024-02-28  9:38       ` Tudor Ambarus
  0 siblings, 1 reply; 92+ messages in thread
From: Varshini.Rajendran @ 2024-02-28  9:28 UTC (permalink / raw)
  To: tudor.ambarus, broonie, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, Nicolas.Ferre, alexandre.belloni, claudiu.beznea,
	linux-spi, devicetree, linux-arm-kernel, linux-kernel

Hi Tudor,

On 26/02/24 2:39 pm, Tudor Ambarus wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On 23.02.2024 19:26, Varshini Rajendran wrote:
>> Remove microchip,sam9x60-spi compatible from the list as the driver used
>> has the compatible atmel,at91rm9200-spi and sam9x60 devices also use the
>> same compatible as fallback. So removing the microchip,sam9x60-spi
>> compatible from the list since it is not needed.
>>
> 
> I find this wrong. I though we shall add compatibles for each SoC. Are
> the registers and fields the same for the SPI IPs in these 2 SoCs? Even
> if they are the same, are you sure the IPs are integrated in the same way?

Which two SoCs are you referring to ?
I am not removing the device specific compatible. I am only removing the 
additional fallback compatible.

As in,

compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";

instead of,

compatible = "microchip,sam9x7-spi", "microchip,sam9x60-spi", 
"atmel,at91rm9200-spi";

for the sam9x7 devices.

Hope this is clear. If I have it wrong please let me know.

> 
>> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
>> ---
>> Changes in v4:
>> - Elaborated the explanation in the commit message to justify the patch
>> ---
>>   Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml b/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml
>> index 58367587bfbc..32e7c14033c2 100644
>> --- a/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml
>> +++ b/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml
>> @@ -22,7 +22,6 @@ properties:
>>             - const: atmel,at91rm9200-spi
>>         - items:
>>             - const: microchip,sam9x7-spi
>> -          - const: microchip,sam9x60-spi
>>             - const: atmel,at91rm9200-spi
>>
>>     reg:

-- 
Thanks and Regards,
Varshini Rajendran.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 16/39] spi: dt-bindings: atmel,at91rm9200-spi: remove 9x60 compatible from list
  2024-02-28  9:28     ` Varshini.Rajendran
@ 2024-02-28  9:38       ` Tudor Ambarus
  0 siblings, 0 replies; 92+ messages in thread
From: Tudor Ambarus @ 2024-02-28  9:38 UTC (permalink / raw)
  To: Varshini.Rajendran, broonie, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, Nicolas.Ferre, alexandre.belloni, claudiu.beznea,
	linux-spi, devicetree, linux-arm-kernel, linux-kernel



On 2/28/24 09:28, Varshini.Rajendran@microchip.com wrote:
> Hi Tudor,
> 
> On 26/02/24 2:39 pm, Tudor Ambarus wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>
>> On 23.02.2024 19:26, Varshini Rajendran wrote:
>>> Remove microchip,sam9x60-spi compatible from the list as the driver used
>>> has the compatible atmel,at91rm9200-spi and sam9x60 devices also use the
>>> same compatible as fallback. So removing the microchip,sam9x60-spi
>>> compatible from the list since it is not needed.
>>>
>>
>> I find this wrong. I though we shall add compatibles for each SoC. Are
>> the registers and fields the same for the SPI IPs in these 2 SoCs? Even
>> if they are the same, are you sure the IPs are integrated in the same way?
> 
> Which two SoCs are you referring to ?
> I am not removing the device specific compatible. I am only removing the 
> additional fallback compatible.
> 

ah, I read it wrong, sorry
> As in,
> 
> compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
> 
> instead of,
> 
> compatible = "microchip,sam9x7-spi", "microchip,sam9x60-spi", 
> "atmel,at91rm9200-spi";
> 
> for the sam9x7 devices.
> 
> Hope this is clear. If I have it wrong please let me know.

it's clear now, thanks.

I see in the driver that microchip,sam9x60-spi compatible is not yet
used, thus removing the fallback to "microchip,sam9x60-spi" brings no
functional change. Would have made a difference if sam9x60-spi
implemented additional support that sam9x7-spi could have used as a
fallback. If you think that sam9x7-spi will not fallback to sam9x60-spi
in the future then:

Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>

> 
>>
>>> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
>>> ---
>>> Changes in v4:
>>> - Elaborated the explanation in the commit message to justify the patch
>>> ---
>>>   Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml | 1 -
>>>   1 file changed, 1 deletion(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml b/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml
>>> index 58367587bfbc..32e7c14033c2 100644
>>> --- a/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml
>>> +++ b/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml
>>> @@ -22,7 +22,6 @@ properties:
>>>             - const: atmel,at91rm9200-spi
>>>         - items:
>>>             - const: microchip,sam9x7-spi
>>> -          - const: microchip,sam9x60-spi
>>>             - const: atmel,at91rm9200-spi
>>>
>>>     reg:
> 

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 12/39] dt-bindings: serial: atmel,at91-usart: add compatible for sam9x7.
  2024-02-28  7:03     ` Varshini.Rajendran
@ 2024-02-28 11:49       ` Conor Dooley
  2024-02-29  8:55         ` Varshini.Rajendran
  0 siblings, 1 reply; 92+ messages in thread
From: Conor Dooley @ 2024-02-28 11:49 UTC (permalink / raw)
  To: Varshini.Rajendran
  Cc: radu_nicolae.pirea, richard.genoud, gregkh, jirislaby, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, Nicolas.Ferre,
	alexandre.belloni, claudiu.beznea, linux-kernel, linux-spi,
	linux-serial, devicetree, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 3562 bytes --]

On Wed, Feb 28, 2024 at 07:03:01AM +0000, Varshini.Rajendran@microchip.com wrote:
> Hi Conor,
> 
> On 25/02/24 1:32 am, Conor Dooley wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> > On Fri, Feb 23, 2024 at 10:55:59PM +0530, Varshini Rajendran wrote:
> >> Add sam9x7 compatible to DT bindings documentation.
> >>
> >> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> >> ---
> >> Changes in v4:
> >> - Fixed the wrong addition of compatible
> >> - Added further compatibles that are possible correct (as per DT)
> >> ---
> >>  .../devicetree/bindings/serial/atmel,at91-usart.yaml | 12 +++++++++---
> >>  1 file changed, 9 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml b/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
> >> index 65cb2e5c5eee..30af537e8e81 100644
> >> --- a/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
> >> +++ b/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
> >> @@ -23,11 +23,17 @@ properties:
> >>            - const: atmel,at91sam9260-dbgu
> >>            - const: atmel,at91sam9260-usart
> >>        - items:
> >> -          - const: microchip,sam9x60-usart
> >> +          - enum:
> >> +              - microchip,sam9x60-usart
> >> +              - microchip,sam9x7-usart
> >>            - const: atmel,at91sam9260-usart
> >>        - items:
> >> -          - const: microchip,sam9x60-dbgu
> >> -          - const: microchip,sam9x60-usart
> >> +          - enum:
> >> +              - microchip,sam9x60-dbgu
> >> +              - microchip,sam9x7-dbgu
> > 
> >> +          - enum:
> >> +              - microchip,sam9x60-usart
> >> +              - microchip,sam9x7-usart
> > 
> > This doesn't make sense - this enum should be a const.
> > I don't really understand the idea behind of the original binding here that
> > allowed:
> > "microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"
> > 
> > Specifically, I don't get the purpose of the "microchip,sam9x60-usart".
> > Either make it
> >       - items:
> >           - enum:
> >               - microchip,sam9x60-dbgu
> >               - microchip,sam9x7-dbgu
> >           - const: microchip,sam9x60-usart
> >           - const: atmel,at91sam9260-dbgu
> >           - const: atmel,at91sam9260-usart
> > or add
> >       - items:
> >           - const: microchip,sam9x60-dbgu
> >           - const: atmel,at91sam9260-dbgu
> >           - const: atmel,at91sam9260-usart
> > or explain exactly why this needs to be
> > "chipa-dgbu", "chipa-usart", "chipb-dbgu", "chipb-dbgu"
> The compatible has to be "chipa-usart", "chipb-usart", "chipa-dbgu", 
> "chipb-dbgu" for the device to work as a debug console over UART
> wher the chipa-<periph> is the device specific compatible
> and the chipb-<periph> is the fallback compatible that the driver 
> actually uses.

This examples why you have "microchip,sam9x60-dbgu", "atmel,at91sam9260-dbgu"
and "atmel,at91sam9260-usart".
It does not explain "microchip,sam9x60-usart" though, I don't see what
purpose that serves. If used as a debug uart, you fall back to the
sam9260 debug uart compatible and if not you fall back to the sam9260
usart compatible.

In addition, the current setup implies that sam9x60 usart supports all
the features that the sam9260 debug usart does. I doubt that that is
true.

Thanks,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: (subset) [PATCH v4 00/39] Add support for sam9x7 SoC family
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (41 preceding siblings ...)
  2024-02-27  3:20 ` patchwork-bot+netdevbpf
@ 2024-02-28 15:53 ` Mark Brown
  2024-03-01 10:51 ` Herbert Xu
  43 siblings, 0 replies; 92+ messages in thread
From: Mark Brown @ 2024-02-28 15:53 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, mturquette, sboyd, herbert,
	davem, andi.shyti, tglx, tudor.ambarus, miquel.raynal, richard,
	vigneshr, edumazet, kuba, pabeni, linus.walleij, sre,
	u.kleine-koenig, p.zabel, olivia, radu_nicolae.pirea,
	richard.genoud, gregkh, jirislaby, lgirdwood, wim, linux, linux,
	andrei.simion, mihai.sain, andre.przywara, neil.armstrong, tony,
	durai.manickamkr, geert+renesas, arnd, Jason, rdunlap, rientjes,
	vbabka, mripard, codrin.ciubotariu, eugen.hristev, devicetree,
	linux-arm-kernel, linux-kernel, linux-clk, linux-crypto,
	linux-i2c, linux-mtd, netdev, linux-gpio, linux-pm, linux-pwm,
	linux-rtc, linux-spi, linux-serial, alsa-devel, linux-sound,
	linux-watchdog, Varshini Rajendran

On Fri, 23 Feb 2024 22:43:42 +0530, Varshini Rajendran wrote:
> This patch series adds support for the new SoC family - sam9x7.
>  - The device tree, configs and drivers are added
>  - Clock driver for sam9x7 is added
>  - Support for basic peripherals is added
>  - Target board SAM9X75 Curiosity is added
> 
>  Changes in v4:
>  --------------
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[16/39] spi: dt-bindings: atmel,at91rm9200-spi: remove 9x60 compatible from list
        commit: 666db8fd4265f938795004838d2a9335ce7b9da1

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 12/39] dt-bindings: serial: atmel,at91-usart: add compatible for sam9x7.
  2024-02-28 11:49       ` Conor Dooley
@ 2024-02-29  8:55         ` Varshini.Rajendran
  2024-02-29 18:26           ` Conor Dooley
  0 siblings, 1 reply; 92+ messages in thread
From: Varshini.Rajendran @ 2024-02-29  8:55 UTC (permalink / raw)
  To: conor
  Cc: radu_nicolae.pirea, richard.genoud, gregkh, jirislaby, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, Nicolas.Ferre,
	alexandre.belloni, claudiu.beznea, linux-kernel, linux-spi,
	linux-serial, devicetree, linux-arm-kernel

Hi Conor,

On 28/02/24 5:19 pm, Conor Dooley wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> On Wed, Feb 28, 2024 at 07:03:01AM +0000, Varshini.Rajendran@microchip.com wrote:
>> Hi Conor,
>>
>> On 25/02/24 1:32 am, Conor Dooley wrote:
>>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>> On Fri, Feb 23, 2024 at 10:55:59PM +0530, Varshini Rajendran wrote:
>>>> Add sam9x7 compatible to DT bindings documentation.
>>>>
>>>> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
>>>> ---
>>>> Changes in v4:
>>>> - Fixed the wrong addition of compatible
>>>> - Added further compatibles that are possible correct (as per DT)
>>>> ---
>>>>  .../devicetree/bindings/serial/atmel,at91-usart.yaml | 12 +++++++++---
>>>>  1 file changed, 9 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml b/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
>>>> index 65cb2e5c5eee..30af537e8e81 100644
>>>> --- a/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
>>>> +++ b/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
>>>> @@ -23,11 +23,17 @@ properties:
>>>>            - const: atmel,at91sam9260-dbgu
>>>>            - const: atmel,at91sam9260-usart
>>>>        - items:
>>>> -          - const: microchip,sam9x60-usart
>>>> +          - enum:
>>>> +              - microchip,sam9x60-usart
>>>> +              - microchip,sam9x7-usart
>>>>            - const: atmel,at91sam9260-usart
>>>>        - items:
>>>> -          - const: microchip,sam9x60-dbgu
>>>> -          - const: microchip,sam9x60-usart
>>>> +          - enum:
>>>> +              - microchip,sam9x60-dbgu
>>>> +              - microchip,sam9x7-dbgu
>>>
>>>> +          - enum:
>>>> +              - microchip,sam9x60-usart
>>>> +              - microchip,sam9x7-usart
>>>
>>> This doesn't make sense - this enum should be a const.
>>> I don't really understand the idea behind of the original binding here that
>>> allowed:
>>> "microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"
>>>
>>> Specifically, I don't get the purpose of the "microchip,sam9x60-usart".
>>> Either make it
>>>       - items:
>>>           - enum:
>>>               - microchip,sam9x60-dbgu
>>>               - microchip,sam9x7-dbgu
>>>           - const: microchip,sam9x60-usart
>>>           - const: atmel,at91sam9260-dbgu
>>>           - const: atmel,at91sam9260-usart
>>> or add
>>>       - items:
>>>           - const: microchip,sam9x60-dbgu
>>>           - const: atmel,at91sam9260-dbgu
>>>           - const: atmel,at91sam9260-usart
>>> or explain exactly why this needs to be
>>> "chipa-dgbu", "chipa-usart", "chipb-dbgu", "chipb-dbgu"
>> The compatible has to be "chipa-usart", "chipb-usart", "chipa-dbgu", 
>> "chipb-dbgu" for the device to work as a debug console over UART
>> wher the chipa-<periph> is the device specific compatible
>> and the chipb-<periph> is the fallback compatible that the driver 
>> actually uses.
> 
> This examples why you have "microchip,sam9x60-dbgu", "atmel,at91sam9260-dbgu"
> and "atmel,at91sam9260-usart".
> It does not explain "microchip,sam9x60-usart" though, I don't see what
> purpose that serves. If used as a debug uart, you fall back to the
> sam9260 debug uart compatible and if not you fall back to the sam9260
> usart compatible.
> 
Here, if it is not used as debug uart it has to fallback to the default 
usart compatible which in this case should have a device specific 
compatible too right?

The common usart compatible looks as follows,

     compatible = "microchip,sam9x60-usart", "atmel,at91sam9260-usart";

meaning the 1st one is the device specific usart compatible and the 2nd 
one is the fallback compatible which the driver actually supports.

The debug uart looks as follows,

compatible = "microchip,sam9x60-dbgu", "atmel,at91sam9260-dbgu", 
"microchip,sam9x60-usart", "atmel,at91sam9260-usart";

In this case, there is a device specific debug uart compatible, a 
fallback tot he debug uart compatible and as you said if not used as a 
debug uart it should fallback and work as a normal uart device which has 
both a device specific compatible and a fallback to work.

In case the device specific compatible is supported with some other 
features in the driver in the future, the debug uart also should get its 
perk. Does this make sense?


> In addition, the current setup implies that sam9x60 usart supports all
> the features that the sam9260 debug usart does. I doubt that that is
> true.
> 
> Thanks,
> Conor.

-- 
Thanks and Regards,
Varshini Rajendran.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 09/39] dt-bindings: pinctrl: at91: add sam9x7
  2024-02-23 17:25 ` [PATCH v4 09/39] dt-bindings: pinctrl: at91: add sam9x7 Varshini Rajendran
@ 2024-02-29 13:41   ` Linus Walleij
  0 siblings, 0 replies; 92+ messages in thread
From: Linus Walleij @ 2024-02-29 13:41 UTC (permalink / raw)
  To: Varshini Rajendran
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, linux-gpio, devicetree,
	linux-arm-kernel, linux-kernel, Krzysztof Kozlowski

On Fri, Feb 23, 2024 at 6:25 PM Varshini Rajendran
<varshini.rajendran@microchip.com> wrote:

> Add device tree binding for SAM9X7 pin controller.
>
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

This one patch applied to the pinctrl tree.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 12/39] dt-bindings: serial: atmel,at91-usart: add compatible for sam9x7.
  2024-02-29  8:55         ` Varshini.Rajendran
@ 2024-02-29 18:26           ` Conor Dooley
  0 siblings, 0 replies; 92+ messages in thread
From: Conor Dooley @ 2024-02-29 18:26 UTC (permalink / raw)
  To: Varshini.Rajendran
  Cc: radu_nicolae.pirea, richard.genoud, gregkh, jirislaby, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, Nicolas.Ferre,
	alexandre.belloni, claudiu.beznea, linux-kernel, linux-spi,
	linux-serial, devicetree, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 5229 bytes --]

On Thu, Feb 29, 2024 at 08:55:11AM +0000, Varshini.Rajendran@microchip.com wrote:
> Hi Conor,
> 
> On 28/02/24 5:19 pm, Conor Dooley wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> > On Wed, Feb 28, 2024 at 07:03:01AM +0000, Varshini.Rajendran@microchip.com wrote:
> >> Hi Conor,
> >>
> >> On 25/02/24 1:32 am, Conor Dooley wrote:
> >>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> >>> On Fri, Feb 23, 2024 at 10:55:59PM +0530, Varshini Rajendran wrote:
> >>>> Add sam9x7 compatible to DT bindings documentation.
> >>>>
> >>>> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> >>>> ---
> >>>> Changes in v4:
> >>>> - Fixed the wrong addition of compatible
> >>>> - Added further compatibles that are possible correct (as per DT)
> >>>> ---
> >>>>  .../devicetree/bindings/serial/atmel,at91-usart.yaml | 12 +++++++++---
> >>>>  1 file changed, 9 insertions(+), 3 deletions(-)
> >>>>
> >>>> diff --git a/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml b/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
> >>>> index 65cb2e5c5eee..30af537e8e81 100644
> >>>> --- a/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
> >>>> +++ b/Documentation/devicetree/bindings/serial/atmel,at91-usart.yaml
> >>>> @@ -23,11 +23,17 @@ properties:
> >>>>            - const: atmel,at91sam9260-dbgu
> >>>>            - const: atmel,at91sam9260-usart
> >>>>        - items:
> >>>> -          - const: microchip,sam9x60-usart
> >>>> +          - enum:
> >>>> +              - microchip,sam9x60-usart
> >>>> +              - microchip,sam9x7-usart
> >>>>            - const: atmel,at91sam9260-usart
> >>>>        - items:
> >>>> -          - const: microchip,sam9x60-dbgu
> >>>> -          - const: microchip,sam9x60-usart
> >>>> +          - enum:
> >>>> +              - microchip,sam9x60-dbgu
> >>>> +              - microchip,sam9x7-dbgu
> >>>
> >>>> +          - enum:
> >>>> +              - microchip,sam9x60-usart
> >>>> +              - microchip,sam9x7-usart
> >>>
> >>> This doesn't make sense - this enum should be a const.
> >>> I don't really understand the idea behind of the original binding here that
> >>> allowed:
> >>> "microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"
> >>>
> >>> Specifically, I don't get the purpose of the "microchip,sam9x60-usart".
> >>> Either make it
> >>>       - items:
> >>>           - enum:
> >>>               - microchip,sam9x60-dbgu
> >>>               - microchip,sam9x7-dbgu
> >>>           - const: microchip,sam9x60-usart
> >>>           - const: atmel,at91sam9260-dbgu
> >>>           - const: atmel,at91sam9260-usart
> >>> or add
> >>>       - items:
> >>>           - const: microchip,sam9x60-dbgu
> >>>           - const: atmel,at91sam9260-dbgu
> >>>           - const: atmel,at91sam9260-usart
> >>> or explain exactly why this needs to be
> >>> "chipa-dgbu", "chipa-usart", "chipb-dbgu", "chipb-dbgu"
> >> The compatible has to be "chipa-usart", "chipb-usart", "chipa-dbgu", 
> >> "chipb-dbgu" for the device to work as a debug console over UART
> >> wher the chipa-<periph> is the device specific compatible
> >> and the chipb-<periph> is the fallback compatible that the driver 
> >> actually uses.
> > 
> > This examples why you have "microchip,sam9x60-dbgu", "atmel,at91sam9260-dbgu"
> > and "atmel,at91sam9260-usart".
> > It does not explain "microchip,sam9x60-usart" though, I don't see what
> > purpose that serves. If used as a debug uart, you fall back to the
> > sam9260 debug uart compatible and if not you fall back to the sam9260
> > usart compatible.
> > 
> Here, if it is not used as debug uart it has to fallback to the default 
> usart compatible which in this case should have a device specific 
> compatible too right?
> 
> The common usart compatible looks as follows,
> 
>      compatible = "microchip,sam9x60-usart", "atmel,at91sam9260-usart";
> 
> meaning the 1st one is the device specific usart compatible and the 2nd 
> one is the fallback compatible which the driver actually supports.
> 
> The debug uart looks as follows,
> 
> compatible = "microchip,sam9x60-dbgu", "atmel,at91sam9260-dbgu", 
> "microchip,sam9x60-usart", "atmel,at91sam9260-usart";

This version here makes a lot more sense than what is currently in use
and what is being added in your original patch. I wouldn't object to
this being used.

> In this case, there is a device specific debug uart compatible, a 
> fallback tot he debug uart compatible and as you said if not used as a 
> debug uart it should fallback and work as a normal uart device which has 
> both a device specific compatible and a fallback to work.
> 
> In case the device specific compatible is supported with some other 
> features in the driver in the future, the debug uart also should get its 
> perk. Does this make sense?
> 
> 
> > In addition, the current setup implies that sam9x60 usart supports all
> > the features that the sam9260 debug usart does. I doubt that that is
> > true.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: (subset) [PATCH v4 11/39] dt-bindings: rtt: at91rm9260: add sam9x7 compatible
  2024-02-23 17:25 ` [PATCH v4 11/39] dt-bindings: rtt: at91rm9260: add sam9x7 compatible Varshini Rajendran
  2024-02-24 19:51   ` Conor Dooley
@ 2024-02-29 21:27   ` Alexandre Belloni
  1 sibling, 0 replies; 92+ messages in thread
From: Alexandre Belloni @ 2024-02-29 21:27 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	claudiu.beznea, linux-rtc, devicetree, linux-arm-kernel,
	linux-kernel, Varshini Rajendran

On Fri, 23 Feb 2024 22:55:52 +0530, Varshini Rajendran wrote:
> Add compatible for SAM9X7 RTT.
> 
> 

Applied, thanks!

[11/39] dt-bindings: rtt: at91rm9260: add sam9x7 compatible
        https://git.kernel.org/abelloni/c/16816e6a3693

Best regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 00/39] Add support for sam9x7 SoC family
  2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
                   ` (42 preceding siblings ...)
  2024-02-28 15:53 ` (subset) " Mark Brown
@ 2024-03-01 10:51 ` Herbert Xu
  43 siblings, 0 replies; 92+ messages in thread
From: Herbert Xu @ 2024-03-01 10:51 UTC (permalink / raw)
  To: Varshini Rajendran
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, claudiu.beznea, mturquette, sboyd, davem,
	andi.shyti, tglx, tudor.ambarus, miquel.raynal, richard,
	vigneshr, edumazet, kuba, pabeni, linus.walleij, sre,
	u.kleine-koenig, p.zabel, olivia, radu_nicolae.pirea,
	richard.genoud, gregkh, jirislaby, lgirdwood, broonie, wim,
	linux, linux, andrei.simion, mihai.sain, andre.przywara,
	neil.armstrong, tony, durai.manickamkr, geert+renesas, arnd,
	Jason, rdunlap, rientjes, vbabka, mripard, codrin.ciubotariu,
	eugen.hristev, devicetree, linux-arm-kernel, linux-kernel,
	linux-clk, linux-crypto, linux-i2c, linux-mtd, netdev,
	linux-gpio, linux-pm, linux-pwm, linux-rtc, linux-spi,
	linux-serial, alsa-devel, linux-sound, linux-watchdog

On Fri, Feb 23, 2024 at 10:43:42PM +0530, Varshini Rajendran wrote:
> This patch series adds support for the new SoC family - sam9x7.
>  - The device tree, configs and drivers are added
>  - Clock driver for sam9x7 is added
>  - Support for basic peripherals is added
>  - Target board SAM9X75 Curiosity is added
> 
>  Changes in v4:
>  --------------
> 
>  - Addressed all the review comments in the patches
>  - Picked up all Acked-by and Reviewed-by tags
>  - Dropped applied patches from the series
>  - Added pwm node and related dt binding documentation
>  - Added support for exporting some clocks to DT
>  - Dropped USB related patches and changes. See NOTE.
>  - All the specific changes are captured in the corresponding patches
> 
>  NOTE: Owing to the discussion here
>  https://lore.kernel.org/linux-devicetree/CAL_JsqJ9PrX6fj-EbffeJce09MXs=B7t+KS_kOinxaRx38=WxA@mail.gmail.com/
>  the USB related changes are dropped from this series in order to enable
>  us to work on the mentioned issues before adding new compatibles as
>  said. The issues/warnings will be addressed in subsequent patches.
>  After which the USB related support for sam9x7 SoCs will be added. Hope
>  this works out fine.
> 
>  Changes in v3:
>  --------------
> 
>  - Fixed the DT documentation errors pointed out in v2.
>  - Dropped Acked-by tag in tcb DT doc patch as it had to be adapted
>    according to sam9x7 correctly.
>  - Picked by the previously missed tags.
>  - Dropped this patch "dt-bindings: usb: generic-ehci: Document clock-names
>    property" as the warning was not found while validating DT-schema for
>    at91-sam9x75_curiosity.dtb.
>  - Dropped redundant words in the commit message.
>  - Fixed the CHECK_DTBS warnings validated against
>    at91-sam9x75_curiosity.dtb.
>  - Renamed dt nodes according to naming convention.
>  - Dropped unwanted status property in dts.
>  - Removed nodes that are not in use from the board dts.
>  - Removed spi DT doc patch from the series as it was already applied
>    and a fix patch was applied subsequently. Added a patch to remove the
>    compatible to adapt sam9x7.
>  - Added sam9x7 compatibles in usb dt documentation.
> 
> 
>  Changes in v2:
>  --------------
> 
>  - Added sam9x7 specific compatibles in DT with fallbacks
>  - Documented all the newly added DT compatible strings
>  - Added device tree for the target board sam9x75 curiosity and
>    documented the same in the DT bindings documentation
>  - Removed the dt nodes that are not supported at the moment
>  - Removed the configs added by previous version that are not supported
>    at the moment
>  - Fixed all the corrections in the commit message
>  - Changed all the instances of copyright year to 2023
>  - Added sam9x7 flag in PIT64B configuration
>  - Moved macro definitions to header file
>  - Added another divider in mck characteristics in the pmc driver
>  - Fixed the memory leak in the pmc driver
>  - Dropped patches that are no longer needed
>  - Picked up Acked-by and Reviewed-by tags
> 
> 
> Varshini Rajendran (39):
>   dt-bindings: net: cdns,macb: add sam9x7 ethernet interface
>   dt-bindings: atmel-sysreg: add sam9x7
>   dt-bindings: crypto: add sam9x7 in Atmel AES
>   dt-bindings: crypto: add sam9x7 in Atmel SHA
>   dt-bindings: crypto: add sam9x7 in Atmel TDES
>   dt-bindings: i2c: at91: Add sam9x7 compatible string
>   dt-bindings: atmel-ssc: add microchip,sam9x7-ssc
>   dt-bindings: atmel-nand: add microchip,sam9x7-pmecc
>   dt-bindings: pinctrl: at91: add sam9x7
>   dt-bindings: rng: atmel,at91-trng: add sam9x7 TRNG
>   dt-bindings: rtt: at91rm9260: add sam9x7 compatible
>   dt-bindings: serial: atmel,at91-usart: add compatible for sam9x7.
>   ASoC: dt-bindings: atmel-classd: add sam9x7 compatible
>   dt-bindings: pwm: at91: Add sam9x7 compatible strings list
>   dt-bindings: watchdog: sama5d4-wdt: add compatible for sam9x7-wdt
>   spi: dt-bindings: atmel,at91rm9200-spi: remove 9x60 compatible from
>     list
>   ASoC: dt-bindings: microchip: add sam9x7
>   ARM: at91: pm: add support for sam9x7 SoC family
>   ARM: at91: pm: add sam9x7 SoC init config
>   ARM: at91: add support in SoC driver for new sam9x7
>   dt-bindings: clk: at91: add sam9x7
>   dt-bindings: clk: at91: add sam9x7 clock controller
>   clk: at91: clk-sam9x60-pll: re-factor to support individual core freq
>     outputs
>   clk: at91: sam9x7: add support for HW PLL freq dividers
>   clk: at91: sama7g5: move mux table macros to header file
>   dt-bindings: clock: at91: Allow PLLs to be exported and referenced in
>     DT
>   clk: at91: sam9x7: add sam9x7 pmc driver
>   dt-bindings: irqchip/atmel-aic5: Add support for sam9x7 aic
>   irqchip/atmel-aic5: Add support to get nirqs from DT for sam9x60 &
>     sam9x7
>   power: reset: at91-poweroff: lookup for proper pmc dt node for sam9x7
>   power: reset: at91-reset: add reset support for sam9x7 SoC
>   power: reset: at91-reset: add sdhwc support for sam9x7 SoC
>   dt-bindings: reset: atmel,at91sam9260-reset: add sam9x7
>   dt-bindings: power: reset: atmel,sama5d2-shdwc: add sam9x7
>   ARM: at91: Kconfig: add config flag for SAM9X7 SoC
>   ARM: configs: at91: enable config flags for sam9x7 SoC family
>   ARM: dts: at91: sam9x7: add device tree for SoC
>   dt-bindings: arm: add sam9x75 curiosity board
>   ARM: dts: at91: sam9x75_curiosity: add sam9x75 curiosity board
> 
>  .../devicetree/bindings/arm/atmel-at91.yaml   |    6 +
>  .../devicetree/bindings/arm/atmel-sysregs.txt |    7 +-
>  .../bindings/clock/atmel,at91rm9200-pmc.yaml  |    2 +
>  .../bindings/clock/atmel,at91sam9x5-sckc.yaml |    4 +-
>  .../crypto/atmel,at91sam9g46-aes.yaml         |    6 +-
>  .../crypto/atmel,at91sam9g46-sha.yaml         |    6 +-
>  .../crypto/atmel,at91sam9g46-tdes.yaml        |    6 +-
>  .../bindings/i2c/atmel,at91sam-i2c.yaml       |    4 +-
>  .../interrupt-controller/atmel,aic.txt        |    2 +-
>  .../devicetree/bindings/misc/atmel-ssc.txt    |    1 +
>  .../devicetree/bindings/mtd/atmel-nand.txt    |    1 +
>  .../devicetree/bindings/net/cdns,macb.yaml    |    5 +
>  .../bindings/pinctrl/atmel,at91-pinctrl.txt   |    2 +
>  .../power/reset/atmel,sama5d2-shdwc.yaml      |    3 +
>  .../bindings/pwm/atmel,at91sam-pwm.yaml       |    3 +
>  .../reset/atmel,at91sam9260-reset.yaml        |    4 +
>  .../bindings/rng/atmel,at91-trng.yaml         |    4 +
>  .../bindings/rtc/atmel,at91sam9260-rtt.yaml   |    4 +-
>  .../bindings/serial/atmel,at91-usart.yaml     |   12 +-
>  .../bindings/sound/atmel,sama5d2-classd.yaml  |    7 +-
>  .../sound/microchip,sama7g5-i2smcc.yaml       |   11 +-
>  .../bindings/spi/atmel,at91rm9200-spi.yaml    |    1 -
>  .../bindings/watchdog/atmel,sama5d4-wdt.yaml  |   12 +-
>  arch/arm/boot/dts/microchip/Makefile          |    3 +
>  .../dts/microchip/at91-sam9x75_curiosity.dts  |  309 +++++
>  arch/arm/boot/dts/microchip/sam9x60.dtsi      |    1 +
>  arch/arm/boot/dts/microchip/sam9x7.dtsi       | 1214 +++++++++++++++++
>  arch/arm/configs/at91_dt_defconfig            |    1 +
>  arch/arm/mach-at91/Kconfig                    |   23 +-
>  arch/arm/mach-at91/Makefile                   |    1 +
>  arch/arm/mach-at91/generic.h                  |    2 +
>  arch/arm/mach-at91/pm.c                       |   35 +
>  arch/arm/mach-at91/sam9x7.c                   |   34 +
>  drivers/clk/at91/Makefile                     |    1 +
>  drivers/clk/at91/clk-sam9x60-pll.c            |   50 +-
>  drivers/clk/at91/pmc.h                        |   18 +
>  drivers/clk/at91/sam9x60.c                    |    7 +
>  drivers/clk/at91/sam9x7.c                     |  946 +++++++++++++
>  drivers/clk/at91/sama7g5.c                    |   42 +-
>  drivers/irqchip/irq-atmel-aic5.c              |   12 +-
>  drivers/power/reset/Kconfig                   |    4 +-
>  drivers/power/reset/at91-sama5d2_shdwc.c      |    1 +
>  drivers/soc/atmel/soc.c                       |   23 +
>  drivers/soc/atmel/soc.h                       |    9 +
>  include/dt-bindings/clock/at91.h              |    4 +
>  45 files changed, 2788 insertions(+), 65 deletions(-)
>  create mode 100644 arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts
>  create mode 100644 arch/arm/boot/dts/microchip/sam9x7.dtsi
>  create mode 100644 arch/arm/mach-at91/sam9x7.c
>  create mode 100644 drivers/clk/at91/sam9x7.c
> 
> -- 
> 2.25.1

Patches 3-5 and 10 applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 26/39] dt-bindings: clock: at91: Allow PLLs to be exported and referenced in DT
  2024-02-23 17:28 ` [PATCH v4 26/39] dt-bindings: clock: at91: Allow PLLs to be exported and referenced in DT Varshini Rajendran
@ 2024-03-01 21:26   ` Rob Herring
  0 siblings, 0 replies; 92+ messages in thread
From: Rob Herring @ 2024-03-01 21:26 UTC (permalink / raw)
  To: Varshini Rajendran
  Cc: linux-arm-kernel, devicetree, mturquette, claudiu.beznea,
	krzysztof.kozlowski+dt, alexandre.belloni, linux-clk,
	linux-kernel, robh+dt, nicolas.ferre, conor+dt, sboyd


On Fri, 23 Feb 2024 22:58:22 +0530, Varshini Rajendran wrote:
> Allow PLLADIV2 and LVDSPLL to be referenced as a PMC_TYPE_CORE
> clock from phandle in DT for sam9x7 SoC family.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> ---
>  include/dt-bindings/clock/at91.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 38/39] dt-bindings: arm: add sam9x75 curiosity board
  2024-02-23 17:31 ` [PATCH v4 38/39] dt-bindings: arm: add sam9x75 curiosity board Varshini Rajendran
@ 2024-03-01 21:26   ` Rob Herring
  0 siblings, 0 replies; 92+ messages in thread
From: Rob Herring @ 2024-03-01 21:26 UTC (permalink / raw)
  To: Varshini Rajendran
  Cc: alexandre.belloni, krzysztof.kozlowski+dt, conor+dt,
	andrei.simion, robh+dt, nicolas.ferre, linux-arm-kernel,
	claudiu.beznea, devicetree, mihai.sain, linux-kernel


On Fri, 23 Feb 2024 23:01:00 +0530, Varshini Rajendran wrote:
> Add documentation for SAM9X75 Curiosity board.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> ---
>  Documentation/devicetree/bindings/arm/atmel-at91.yaml | 6 ++++++
>  1 file changed, 6 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 39/39] ARM: dts: at91: sam9x75_curiosity: add sam9x75 curiosity board
  2024-02-23 17:31 ` [PATCH v4 39/39] ARM: dts: at91: sam9x75_curiosity: " Varshini Rajendran
@ 2024-03-03 12:19   ` claudiu beznea
  2024-03-08  9:48     ` Varshini.Rajendran
  0 siblings, 1 reply; 92+ messages in thread
From: claudiu beznea @ 2024-03-03 12:19 UTC (permalink / raw)
  To: Varshini Rajendran, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, andre.przywara,
	gregory.clement, linus.walleij, baruch, mihai.sain, devicetree,
	linux-kernel, linux-arm-kernel

s/ARM: dts: at91/ARM: dts: microchip

in title.

On 23.02.2024 19:31, Varshini Rajendran wrote:
> Add device tree file for sam9x75 curiosity board.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> ---
> Changes in v4:
> - Removed full node paths
> - Renamed Leds with color names
> - Corrected regulator node names
> - Added support for classd and i2s nodes and their corresponding
>   pinctrl nodes
> - Dropped USB nodes owing to the discussion here
> https://lore.kernel.org/linux-devicetree/CAL_JsqJ9PrX6fj-EbffeJce09MXs=B7t+KS_kOinxaRx38=WxA@mail.gmail.com/
> (Explained elaborately in the cover letter)
> - Updated the linux,code property with the necessary value
> ---
>  arch/arm/boot/dts/microchip/Makefile          |   3 +
>  .../dts/microchip/at91-sam9x75_curiosity.dts  | 309 ++++++++++++++++++
>  2 files changed, 312 insertions(+)
>  create mode 100644 arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts
> 
> diff --git a/arch/arm/boot/dts/microchip/Makefile b/arch/arm/boot/dts/microchip/Makefile
> index efde9546c8f4..5b3d518da319 100644
> --- a/arch/arm/boot/dts/microchip/Makefile
> +++ b/arch/arm/boot/dts/microchip/Makefile
> @@ -12,6 +12,7 @@ DTC_FLAGS_at91-sama5d3_eds := -@
>  DTC_FLAGS_at91-sama5d3_xplained := -@
>  DTC_FLAGS_at91-sama5d4_xplained := -@
>  DTC_FLAGS_at91-sama7g5ek := -@
> +DTC_FLAGS_at91-sam9x75_curiosity := -@

Keep it alphanumerically sorted, thus after sam9x60 entry.

>  dtb-$(CONFIG_SOC_AT91RM9200) += \
>  	at91rm9200ek.dtb \
>  	mpa1600.dtb
> @@ -59,6 +60,8 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \
>  dtb-$(CONFIG_SOC_SAM9X60) += \
>  	at91-sam9x60_curiosity.dtb \
>  	at91-sam9x60ek.dtb
> +dtb-$(CONFIG_SOC_SAM9X7) += \
> +	at91-sam9x75_curiosity.dtb
>  dtb-$(CONFIG_SOC_SAM_V7) += \
>  	at91-kizbox2-2.dtb \
>  	at91-kizbox3-hs.dtb \
> diff --git a/arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts b/arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts
> new file mode 100644
> index 000000000000..be37022d3d05
> --- /dev/null
> +++ b/arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts
> @@ -0,0 +1,309 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +/*
> + * at91-sam9x75_curiosity.dts - Device Tree file for Microchip SAM9X75 Curiosity board
> + *
> + * Copyright (C) 2023 Microchip Technology Inc. and its subsidiaries
> + *
> + * Author: Varshini Rajendran <varshini.rajendran@microchip.com>
> + */
> +/dts-v1/;
> +#include "sam9x7.dtsi"
> +#include <dt-bindings/input/input.h>
> +
> +/ {
> +	model = "Microchip SAM9X75 Curiosity";
> +	compatible = "microchip,sam9x75-curiosity", "microchip,sam9x7", "atmel,at91sam9";
> +
> +	aliases {
> +		i2c0 = &i2c6;
> +	};
> +
> +	chosen {
> +		stdout-path = "serial0:115200n8";
> +	};
> +
> +	gpio-keys {
> +		compatible = "gpio-keys";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&pinctrl_key_gpio_default>;
> +
> +		button-user {
> +			label = "USER";
> +			gpios = <&pioC 9 GPIO_ACTIVE_LOW>;
> +			linux,code = <KEY_0>;
> +			wakeup-source;
> +		};
> +	};
> +
> +	leds {
> +		compatible = "gpio-leds";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&pinctrl_led_gpio_default>;
> +
> +		led-red {
> +			label = "red";
> +			gpios = <&pioC 19 GPIO_ACTIVE_HIGH>;
> +		};
> +
> +		led-green {
> +			label = "green";
> +			gpios = <&pioC 21 GPIO_ACTIVE_HIGH>;
> +		};
> +
> +		led-blue {
> +			label = "blue";
> +			gpios = <&pioC 20 GPIO_ACTIVE_HIGH>;
> +			linux,default-trigger = "heartbeat";
> +		};
> +	};
> +
> +	memory@20000000 {
> +		device_type = "memory";
> +		reg = <0x20000000 0x10000000>;
> +	};
> +};
> +
> +&classd {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_classd>;
> +	atmel,pwm-type = "diff";
> +	atmel,non-overlap-time = <10>;
> +	status = "okay";
> +};
> +
> +&dbgu {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_dbgu>;
> +	status = "okay";
> +};
> +
> +&dma0 {
> +	status = "okay";
> +};
> +
> +&flx6 {
> +	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
> +	status = "okay";
> +};
> +
> +&i2c6 {

I don't know if you got any review comments w/ regards to this in the
previous email but having flexcoms and inner node grouped together is
easier to follow (at least to me). e.g.:

> +	#address-cells = <1>;
> +	#size-cells = <0>;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_flx6_default>;
> +	i2c-analog-filter;
> +	i2c-digital-filter;
> +	i2c-digital-filter-width-ns = <35>;
> +	status = "okay";
> +
> +	pmic@5b {
> +		compatible = "microchip,mcp16502";
> +		reg = <0x5b>;
> +
> +		regulators {
> +			vdd_3v3: VDD_IO {
> +				regulator-name = "VDD_IO";
> +				regulator-min-microvolt = <3000000>;
> +				regulator-max-microvolt = <3600000>;

I can't find the schematics for this but these values here should reflect
the voltage that the board support not the ones that the PMIC itself
supports. Valid for all the other regulators.


> +				regulator-initial-mode = <2>;
> +				regulator-allowed-modes = <2>, <4>;
> +				regulator-always-on;
> +
> +				regulator-state-standby {
> +					regulator-on-in-suspend;
> +					regulator-mode = <4>;
> +				};
> +
> +				regulator-state-mem {
> +					regulator-mode = <4>;
> +				};
> +			};
> +
> +			vddioddr: VDD_DDR {
> +				regulator-name = "VDD_DDR";
> +				regulator-min-microvolt = <1283000>;
> +				regulator-max-microvolt = <1450000>;
> +				regulator-initial-mode = <2>;
> +				regulator-allowed-modes = <2>, <4>;
> +				regulator-always-on;
> +
> +				regulator-state-standby {
> +					regulator-on-in-suspend;
> +					regulator-mode = <4>;
> +				};
> +
> +				regulator-state-mem {
> +					regulator-on-in-suspend;
> +					regulator-mode = <4>;
> +				};
> +			};
> +
> +			vddcore: VDD_CORE {
> +				regulator-name = "VDD_CORE";
> +				regulator-min-microvolt = <500000>;
> +				regulator-max-microvolt = <1210000>;
> +				regulator-initial-mode = <2>;
> +				regulator-allowed-modes = <2>, <4>;
> +				regulator-always-on;
> +
> +				regulator-state-standby {
> +					regulator-on-in-suspend;
> +					regulator-mode = <4>;
> +				};
> +
> +				regulator-state-mem {
> +					regulator-mode = <4>;
> +				};
> +			};
> +
> +			vddcpu: VDD_OTHER {
> +				regulator-name = "VDD_OTHER";
> +				regulator-min-microvolt = <1700000>;
> +				regulator-max-microvolt = <3600000>;
> +				regulator-initial-mode = <2>;
> +				regulator-allowed-modes = <2>, <4>;
> +				regulator-ramp-delay = <3125>;
> +				regulator-always-on;
> +
> +				regulator-state-standby {
> +					regulator-on-in-suspend;
> +					regulator-mode = <4>;
> +				};
> +
> +				regulator-state-mem {
> +					regulator-mode = <4>;
> +				};
> +			};
> +
> +			vldo1: LDO1 {
> +				regulator-name = "LDO1";
> +				regulator-min-microvolt = <1200000>;
> +				regulator-max-microvolt = <3700000>;
> +				regulator-always-on;
> +
> +				regulator-state-standby {
> +					regulator-on-in-suspend;
> +				};
> +			};
> +
> +			vldo2: LDO2 {
> +				regulator-name = "LDO2";
> +				regulator-min-microvolt = <1200000>;
> +				regulator-max-microvolt = <3700000>;
> +
> +				regulator-state-standby {
> +					regulator-on-in-suspend;
> +				};
> +			};
> +		};
> +	};
> +};
> +
> +&i2s {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_i2s_default>;
> +	#sound-dai-cells = <0>;
> +	status = "disabled";

Any reason this is disabled?

> +};
> +
> +&main_xtal {
> +	clock-frequency = <24000000>;
> +};
> +
> +&pinctrl {
> +

This line could be removed.

> +	classd {
> +		pinctrl_classd: classd {
> +			atmel,pins =
> +				<AT91_PIOA 18 AT91_PERIPH_C AT91_PINCTRL_PULL_UP

Try to be compliant with coding style from here (valid everywhere):
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/dts-coding-style.rst#n167

> +				 AT91_PIOA 19 AT91_PERIPH_C AT91_PINCTRL_PULL_DOWN>;
> +		};
> +	};
> +
> +	dbgu {
> +		pinctrl_dbgu: dbgu-0 {

usually pinctrl label is something like the following in Microchip AT91 DTSes:
pinctrl_<ip-name>_default and node name is <ip-name>-default.

Please use the same rule everywhere.

> +			atmel,pins = <AT91_PIOA 26 AT91_PERIPH_A AT91_PINCTRL_PULL_UP
> +				      AT91_PIOA 27 AT91_PERIPH_A AT91_PINCTRL_NONE>;
> +		};
> +	};
> +
> +	flexcom {
> +		pinctrl_flx6_default: flx6-twi {
> +			atmel,pins =
> +				<AT91_PIOA 24 AT91_PERIPH_A AT91_PINCTRL_PULL_UP
> +				 AT91_PIOA 25 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
> +		};
> +	};
> +
> +	gpio-keys {
> +		pinctrl_key_gpio_default: key-gpio-default {
> +			atmel,pins = <AT91_PIOC 9 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
> +		};
> +	};
> +
> +	i2s {
> +		pinctrl_i2s_default: i2s {
> +			atmel,pins =
> +				<AT91_PIOB 26 AT91_PERIPH_D AT91_PINCTRL_NONE		/* I2SCK */
> +				 AT91_PIOB 15 AT91_PERIPH_D AT91_PINCTRL_NONE		/* I2SWS */
> +				 AT91_PIOB 16 AT91_PERIPH_D AT91_PINCTRL_NONE		/* I2SDIN */
> +				 AT91_PIOB 17 AT91_PERIPH_D AT91_PINCTRL_NONE		/* I2SDOUT */
> +				 AT91_PIOB 25 AT91_PERIPH_D AT91_PINCTRL_NONE>;		/* I2SMCK */
> +		};
> +	};
> +
> +	leds {
> +		pinctrl_led_gpio_default: led-gpio-default {
> +			atmel,pins = <AT91_PIOC 19 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
> +				      AT91_PIOC 21 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
> +				      AT91_PIOC 20 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
> +		};
> +	};
> +
> +	sdmmc0 {
> +		pinctrl_sdmmc0_default: sdmmc0 {
> +			atmel,pins =
> +				<AT91_PIOA 2 AT91_PERIPH_A (AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)					/* PA2 CK  periph A with pullup */
> +				 AT91_PIOA 1 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)		/* PA1 CMD periph A with pullup */
> +				 AT91_PIOA 0 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)		/* PA0 DAT0 periph A */
> +				 AT91_PIOA 3 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)		/* PA3 DAT1 periph A with pullup */
> +				 AT91_PIOA 4 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)		/* PA4 DAT2 periph A with pullup */
> +				 AT91_PIOA 5 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)>;	/* PA5 DAT3 periph A with pullup */
> +		};
> +	};
> +

You can remove this line

> +}; /* pinctrl */
> +
> +&rtt {
> +	atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
> +};
> +
> +&sdmmc0 {
> +	bus-width = <4>;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_sdmmc0_default>;
> +	cd-gpios = <&pioA 23 GPIO_ACTIVE_LOW>;
> +	disable-wp;
> +	status = "okay";
> +};
> +
> +&slow_xtal {
> +	clock-frequency = <32768>;
> +};
> +
> +&power_management {
> +	debounce-delay-us = <976>;
> +	status = "okay";
> +
> +	input@0 {
> +		reg = <0>;
> +	};
> +};
> +
> +&trng {
> +	status = "okay";
> +};
> +
> +&watchdog {
> +	status = "okay";
> +};

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 18/39] ARM: at91: pm: add support for sam9x7 SoC family
  2024-02-23 17:27 ` [PATCH v4 18/39] ARM: at91: pm: add support for sam9x7 SoC family Varshini Rajendran
@ 2024-03-03 12:20   ` claudiu beznea
  0 siblings, 0 replies; 92+ messages in thread
From: claudiu beznea @ 2024-03-03 12:20 UTC (permalink / raw)
  To: Varshini Rajendran, linux, nicolas.ferre, alexandre.belloni,
	linux-arm-kernel, linux-kernel
  Cc: Claudiu Beznea

Hi, Varshini,

On 23.02.2024 19:27, Varshini Rajendran wrote:
> Add support and pm init config for sam9x7 SoC.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> ---
>  arch/arm/mach-at91/generic.h |  2 ++
>  arch/arm/mach-at91/pm.c      | 35 +++++++++++++++++++++++++++++++++++
>  2 files changed, 37 insertions(+)
> 
> diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
> index 0c3960a8b3eb..acf0b3c82a30 100644
> --- a/arch/arm/mach-at91/generic.h
> +++ b/arch/arm/mach-at91/generic.h
> @@ -12,6 +12,7 @@
>  extern void __init at91rm9200_pm_init(void);
>  extern void __init at91sam9_pm_init(void);
>  extern void __init sam9x60_pm_init(void);
> +extern void __init sam9x7_pm_init(void);
>  extern void __init sama5_pm_init(void);
>  extern void __init sama5d2_pm_init(void);
>  extern void __init sama7_pm_init(void);
> @@ -19,6 +20,7 @@ extern void __init sama7_pm_init(void);
>  static inline void __init at91rm9200_pm_init(void) { }
>  static inline void __init at91sam9_pm_init(void) { }
>  static inline void __init sam9x60_pm_init(void) { }
> +static inline void __init sam9x7_pm_init(void) { }
>  static inline void __init sama5_pm_init(void) { }
>  static inline void __init sama5d2_pm_init(void) { }
>  static inline void __init sama7_pm_init(void) { }
> diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
> index 345b91dc6627..b81556387aa3 100644
> --- a/arch/arm/mach-at91/pm.c
> +++ b/arch/arm/mach-at91/pm.c
> @@ -233,6 +233,17 @@ static const struct of_device_id sama7g5_ws_ids[] = {
>  	{ /* sentinel */ }
>  };
>  
> +static const struct of_device_id sam9x7_ws_ids[] = {
> +	{ .compatible = "microchip,sam9x60-rtc",	.data = &ws_info[1] },

microchip,sam9x7-rtc

> +	{ .compatible = "atmel,at91rm9200-ohci",	.data = &ws_info[2] },
> +	{ .compatible = "usb-ohci",			.data = &ws_info[2] },
> +	{ .compatible = "atmel,at91sam9g45-ehci",	.data = &ws_info[2] },
> +	{ .compatible = "usb-ehci",			.data = &ws_info[2] },

These 4 are not present in the sam9x7 dtsi.

> +	{ .compatible = "microchip,sam9x60-rtt",	.data = &ws_info[4] },

microchip,sam9x7-rtt

> +	{ .compatible = "microchip,sam9x7-gem",		.data = &ws_info[5] },
> +	{ /* sentinel */ }
> +};
> +
>  static int at91_pm_config_ws(unsigned int pm_mode, bool set)
>  {
>  	const struct wakeup_source_info *wsi;
> @@ -1135,6 +1146,7 @@ static const struct of_device_id gmac_ids[] __initconst = {
>  	{ .compatible = "atmel,sama5d2-gem" },
>  	{ .compatible = "atmel,sama5d29-gem" },
>  	{ .compatible = "microchip,sama7g5-gem" },
> +	{ .compatible = "microchip,sam9x7-gem" },

AT91_PM_IOMAP(ETHC) is not in the list of any PM mode iomaps, thus, this is
not used at the moment. You can remove it and add (proper compatibles)
when needed, if any.

>  	{ },
>  };
>  
> @@ -1362,6 +1374,7 @@ static const struct of_device_id atmel_pmc_ids[] __initconst = {
>  	{ .compatible = "atmel,sama5d2-pmc", .data = &pmc_infos[1] },
>  	{ .compatible = "microchip,sam9x60-pmc", .data = &pmc_infos[4] },
>  	{ .compatible = "microchip,sama7g5-pmc", .data = &pmc_infos[5] },
> +	{ .compatible = "microchip,sam9x7-pmc", .data = &pmc_infos[4] },
>  	{ /* sentinel */ },
>  };
>  
> @@ -1499,6 +1512,28 @@ void __init sam9x60_pm_init(void)
>  	soc_pm.config_pmc_ws = at91_sam9x60_config_pmc_ws;
>  }
>  
> +void __init sam9x7_pm_init(void)
> +{
> +	static const int modes[] __initconst = {
> +		AT91_PM_STANDBY, AT91_PM_ULP0,
> +	};
> +

You can remove this blank line.

> +	int ret;
> +
> +	if (!IS_ENABLED(CONFIG_SOC_SAM9X7))
> +		return;
> +
> +	at91_pm_modes_validate(modes, ARRAY_SIZE(modes));
> +	ret = at91_dt_ramc(false);
> +	if (ret)
> +		return;
> +
> +	at91_pm_init(NULL);
> +
> +	soc_pm.ws_ids = sam9x7_ws_ids;
> +	soc_pm.config_pmc_ws = at91_sam9x60_config_pmc_ws;
> +}
> +
>  void __init at91sam9_pm_init(void)
>  {
>  	int ret;

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 19/39] ARM: at91: pm: add sam9x7 SoC init config
  2024-02-23 17:27 ` [PATCH v4 19/39] ARM: at91: pm: add sam9x7 SoC init config Varshini Rajendran
@ 2024-03-03 12:20   ` claudiu beznea
  0 siblings, 0 replies; 92+ messages in thread
From: claudiu beznea @ 2024-03-03 12:20 UTC (permalink / raw)
  To: Varshini Rajendran, linux, nicolas.ferre, alexandre.belloni,
	linux-arm-kernel, linux-kernel



On 23.02.2024 19:27, Varshini Rajendran wrote:
> Add SoC init config for sam9x7 family.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> ---
>  arch/arm/mach-at91/Makefile |  1 +
>  arch/arm/mach-at91/sam9x7.c | 34 ++++++++++++++++++++++++++++++++++
>  2 files changed, 35 insertions(+)
>  create mode 100644 arch/arm/mach-at91/sam9x7.c
> 
> diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
> index 794bd12ab0a8..7d8a7bc44e65 100644
> --- a/arch/arm/mach-at91/Makefile
> +++ b/arch/arm/mach-at91/Makefile
> @@ -7,6 +7,7 @@
>  obj-$(CONFIG_SOC_AT91RM9200)	+= at91rm9200.o
>  obj-$(CONFIG_SOC_AT91SAM9)	+= at91sam9.o
>  obj-$(CONFIG_SOC_SAM9X60)	+= sam9x60.o
> +obj-$(CONFIG_SOC_SAM9X7)	+= sam9x7.o
>  obj-$(CONFIG_SOC_SAMA5)		+= sama5.o sam_secure.o
>  obj-$(CONFIG_SOC_SAMA7)		+= sama7.o
>  obj-$(CONFIG_SOC_SAMV7)		+= samv7.o
> diff --git a/arch/arm/mach-at91/sam9x7.c b/arch/arm/mach-at91/sam9x7.c
> new file mode 100644
> index 000000000000..d998fb327860
> --- /dev/null
> +++ b/arch/arm/mach-at91/sam9x7.c
> @@ -0,0 +1,34 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Setup code for SAM9X7.
> + *
> + * Copyright (C) 2023 Microchip Technology Inc. and its subsidiaries
> + *
> + * Author: Varshini Rajendran <varshini.rajendran@microchip.com>
> + */
> +
> +#include <linux/of.h>
> +#include <linux/of_platform.h>
> +
> +#include <asm/mach/arch.h>
> +#include <asm/system_misc.h>

This one could be removed.

> +
> +#include "generic.h"
> +
> +static void __init sam9x7_init(void)
> +{
> +	of_platform_default_populate(NULL, NULL, NULL);
> +
> +	sam9x7_pm_init();
> +}
> +
> +static const char *const sam9x7_dt_board_compat[] __initconst = {

you can add a space after * for clarity, e.g.:

static const char * const sam9x7_dt_board_compat[] __initconst = {

> +	"microchip,sam9x7",
> +	NULL
> +};
> +
> +DT_MACHINE_START(sam9x7_dt, "Microchip SAM9X7")
> +	/* Maintainer: Microchip */
> +	.init_machine	= sam9x7_init,
> +	.dt_compat	= sam9x7_dt_board_compat,
> +MACHINE_END

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 20/39] ARM: at91: add support in SoC driver for new sam9x7
  2024-02-23 17:27 ` [PATCH v4 20/39] ARM: at91: add support in SoC driver for new sam9x7 Varshini Rajendran
  2024-02-26 17:01   ` Nicolas Ferre
@ 2024-03-03 12:21   ` claudiu beznea
  1 sibling, 0 replies; 92+ messages in thread
From: claudiu beznea @ 2024-03-03 12:21 UTC (permalink / raw)
  To: Varshini Rajendran, nicolas.ferre, alexandre.belloni,
	linux-arm-kernel, linux-kernel
  Cc: Claudiu Beznea



On 23.02.2024 19:27, Varshini Rajendran wrote:
> Add support for SAM9X7 SoC in the SoC driver.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> ---
> Changes in v4:
> - Sorted the entries alphabetically as per comment from Claudiu
> - Updated EXID
> Note: Did not remove the Reviewed-by tag since the changes were only
> cosmetic and did not affect functionality
> ---
>  drivers/soc/atmel/soc.c | 23 +++++++++++++++++++++++
>  drivers/soc/atmel/soc.h |  9 +++++++++
>  2 files changed, 32 insertions(+)
> 
> diff --git a/drivers/soc/atmel/soc.c b/drivers/soc/atmel/soc.c
> index cc9a3e107479..cae3452cbc60 100644
> --- a/drivers/soc/atmel/soc.c
> +++ b/drivers/soc/atmel/soc.c
> @@ -101,6 +101,29 @@ static const struct at91_soc socs[] __initconst = {
>  		 AT91_CIDR_VERSION_MASK, SAM9X60_D6K_EXID_MATCH,
>  		 "sam9x60 8MiB SDRAM SiP", "sam9x60"),
>  #endif
> +#ifdef CONFIG_SOC_SAM9X7
> +	AT91_SOC(SAM9X7_CIDR_MATCH, AT91_CIDR_MATCH_MASK,
> +		 AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
> +		 "sam9x75", "sam9x7"),
> +	AT91_SOC(SAM9X7_CIDR_MATCH, AT91_CIDR_MATCH_MASK,
> +		 AT91_CIDR_VERSION_MASK, SAM9X72_EXID_MATCH,
> +		 "sam9x72", "sam9x7"),
> +	AT91_SOC(SAM9X7_CIDR_MATCH, AT91_CIDR_MATCH_MASK,
> +		 AT91_CIDR_VERSION_MASK, SAM9X70_EXID_MATCH,
> +		 "sam9x70", "sam9x7"),
> +	AT91_SOC(SAM9X7_CIDR_MATCH, SAM9X75_D1G_EXID_MATCH,
> +		 AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
> +		 "sam9x75 1Gb DDR3L SiP ", "sam9x7"),
> +	AT91_SOC(SAM9X7_CIDR_MATCH, SAM9X75_D5M_EXID_MATCH,
> +		 AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
> +		 "sam9x75 512Mb DDR2 SiP", "sam9x7"),
> +	AT91_SOC(SAM9X7_CIDR_MATCH, SAM9X75_D1M_EXID_MATCH,
> +		 AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
> +		 "sam9x75 128Mb DDR2 SiP", "sam9x7"),
> +	AT91_SOC(SAM9X7_CIDR_MATCH, SAM9X75_D2G_EXID_MATCH,
> +		 AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
> +		 "sam9x75 2Gb DDR3L SiP", "sam9x7"),

Could you keep these sorted after SoC name and memory size? E.g. see
sama7g5 entries, sama5dX entries.

> +#endif
>  #ifdef CONFIG_SOC_SAMA5
>  	AT91_SOC(SAMA5D2_CIDR_MATCH, AT91_CIDR_MATCH_MASK,
>  		 AT91_CIDR_VERSION_MASK, SAMA5D21CU_EXID_MATCH,
> diff --git a/drivers/soc/atmel/soc.h b/drivers/soc/atmel/soc.h
> index 7a9f47ce85fb..fc4157c5f6e3 100644
> --- a/drivers/soc/atmel/soc.h
> +++ b/drivers/soc/atmel/soc.h
> @@ -44,6 +44,7 @@ at91_soc_init(const struct at91_soc *socs);
>  #define AT91SAM9X5_CIDR_MATCH		0x019a05a0
>  #define AT91SAM9N12_CIDR_MATCH		0x019a07a0
>  #define SAM9X60_CIDR_MATCH		0x019b35a0
> +#define SAM9X7_CIDR_MATCH		0x09750020
>  #define SAMA7G5_CIDR_MATCH		0x00162100
>  
>  #define AT91SAM9M11_EXID_MATCH		0x00000001
> @@ -74,6 +75,14 @@ at91_soc_init(const struct at91_soc *socs);
>  #define SAMA7G54_D2G_EXID_MATCH		0x00000020
>  #define SAMA7G54_D4G_EXID_MATCH		0x00000028
>  
> +#define SAM9X70_EXID_MATCH		0x00000005
> +#define SAM9X72_EXID_MATCH		0x00000004
> +#define SAM9X75_D1G_EXID_MATCH		0x00000018
> +#define SAM9X75_D2G_EXID_MATCH		0x00000020
> +#define SAM9X75_D1M_EXID_MATCH		0x00000003
> +#define SAM9X75_D5M_EXID_MATCH		0x00000010
> +#define SAM9X75_EXID_MATCH		0x00000000

Could you keep this chunk after SAM9X60_* one to have some kind of
alphanumerical sort?

> +
>  #define AT91SAM9XE128_CIDR_MATCH	0x329973a0
>  #define AT91SAM9XE256_CIDR_MATCH	0x329a93a0
>  #define AT91SAM9XE512_CIDR_MATCH	0x329aa3a0

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 29/39] irqchip/atmel-aic5: Add support to get nirqs from DT for sam9x60 & sam9x7
  2024-02-23 17:29 ` [PATCH v4 29/39] irqchip/atmel-aic5: Add support to get nirqs from DT for sam9x60 & sam9x7 Varshini Rajendran
@ 2024-03-03 12:21   ` claudiu beznea
  2024-03-08  8:50     ` Varshini.Rajendran
  0 siblings, 1 reply; 92+ messages in thread
From: claudiu beznea @ 2024-03-03 12:21 UTC (permalink / raw)
  To: Varshini Rajendran, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	tglx, nicolas.ferre, alexandre.belloni, andre.przywara, mani,
	shawnguo, durai.manickamkr, devicetree, linux-kernel,
	linux-arm-kernel



On 23.02.2024 19:29, Varshini Rajendran wrote:
> Add support to get number of IRQs from the respective DT node for sam9x60
> and sam9x7 devices. Since only this factor differs between the two SoCs,
> this patch adds support for the same. Adapt the sam9x60 dtsi
> accordingly.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> ---
> Changes in v4:
> - Changed the implementation to fetch the NIRQs from DT as per the
>   comment to avoid introducing a new compatible when this is the only
>   difference between the SoCs related to this IP.
> ---
>  arch/arm/boot/dts/microchip/sam9x60.dtsi |  1 +
>  drivers/irqchip/irq-atmel-aic5.c         | 11 ++++++++---
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/microchip/sam9x60.dtsi b/arch/arm/boot/dts/microchip/sam9x60.dtsi
> index 73d570a17269..e405f68c9f54 100644
> --- a/arch/arm/boot/dts/microchip/sam9x60.dtsi
> +++ b/arch/arm/boot/dts/microchip/sam9x60.dtsi
> @@ -1201,6 +1201,7 @@ aic: interrupt-controller@fffff100 {
>  				interrupt-controller;
>  				reg = <0xfffff100 0x100>;
>  				atmel,external-irqs = <31>;
> +				microchip,nr-irqs = <50>;
>  			};
>  
>  			dbgu: serial@fffff200 {
> diff --git a/drivers/irqchip/irq-atmel-aic5.c b/drivers/irqchip/irq-atmel-aic5.c
> index 145535bd7560..5d96ad8860d3 100644
> --- a/drivers/irqchip/irq-atmel-aic5.c
> +++ b/drivers/irqchip/irq-atmel-aic5.c
> @@ -398,11 +398,16 @@ static int __init sama5d4_aic5_of_init(struct device_node *node,
>  }
>  IRQCHIP_DECLARE(sama5d4_aic5, "atmel,sama5d4-aic", sama5d4_aic5_of_init);
>  
> -#define NR_SAM9X60_IRQS		50
> -
>  static int __init sam9x60_aic5_of_init(struct device_node *node,
>  				       struct device_node *parent)
>  {
> -	return aic5_of_init(node, parent, NR_SAM9X60_IRQS);
> +	int ret, nr_irqs;
> +
> +	ret = of_property_read_u32(node, "microchip,nr-irqs", &nr_irqs);
> +	if (ret) {
> +		pr_err("Not found microchip,nr-irqs property\n");

This breaks the ABI. You should ensure old device trees are still working
with this patch.

> +		return ret;
> +	}
> +	return aic5_of_init(node, parent, nr_irqs);
>  }
>  IRQCHIP_DECLARE(sam9x60_aic5, "microchip,sam9x60-aic", sam9x60_aic5_of_init);

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 30/39] power: reset: at91-poweroff: lookup for proper pmc dt node for sam9x7
  2024-02-23 17:29 ` [PATCH v4 30/39] power: reset: at91-poweroff: lookup for proper pmc dt node for sam9x7 Varshini Rajendran
@ 2024-03-03 12:22   ` claudiu beznea
  0 siblings, 0 replies; 92+ messages in thread
From: claudiu beznea @ 2024-03-03 12:22 UTC (permalink / raw)
  To: Varshini Rajendran, sre, nicolas.ferre, alexandre.belloni,
	linux-pm, linux-arm-kernel, linux-kernel
  Cc: Sebastian Reichel



On 23.02.2024 19:29, Varshini Rajendran wrote:
> Use sam9x7 pmc's compatible to lookup for in the SHDWC driver.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
> Changes in v4:
> - Updated Acked-by tag
> ---
>  drivers/power/reset/at91-sama5d2_shdwc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/power/reset/at91-sama5d2_shdwc.c b/drivers/power/reset/at91-sama5d2_shdwc.c
> index 959ce0dbe91d..2121d7e74e12 100644
> --- a/drivers/power/reset/at91-sama5d2_shdwc.c
> +++ b/drivers/power/reset/at91-sama5d2_shdwc.c
> @@ -326,6 +326,7 @@ static const struct of_device_id at91_pmc_ids[] = {
>  	{ .compatible = "atmel,sama5d2-pmc" },
>  	{ .compatible = "microchip,sam9x60-pmc" },
>  	{ .compatible = "microchip,sama7g5-pmc" },
> +	{ .compatible = "microchip,sam9x7-pmc" },

Maybe would be better to add a phandle in DT instead of continuing
populating this array. But then the backward compatibility should be
preserved. I leave this to Sebastian.

>  	{ /* Sentinel. */ }
>  };
>  

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 35/39] ARM: at91: Kconfig: add config flag for SAM9X7 SoC
  2024-02-23 17:30 ` [PATCH v4 35/39] ARM: at91: Kconfig: add config flag for SAM9X7 SoC Varshini Rajendran
@ 2024-03-03 12:22   ` claudiu beznea
  0 siblings, 0 replies; 92+ messages in thread
From: claudiu beznea @ 2024-03-03 12:22 UTC (permalink / raw)
  To: Varshini Rajendran, linux, nicolas.ferre, alexandre.belloni,
	linux-arm-kernel, linux-kernel



On 23.02.2024 19:30, Varshini Rajendran wrote:
> Add config flag for sam9x7 SoC.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
> ---
> Changes in v4:
> - Updated Reviewed-by tag
> ---
>  arch/arm/mach-at91/Kconfig | 23 ++++++++++++++++++++---
>  1 file changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
> index a8c022b4c053..49d38a3a47de 100644
> --- a/arch/arm/mach-at91/Kconfig
> +++ b/arch/arm/mach-at91/Kconfig
> @@ -141,11 +141,28 @@ config SOC_SAM9X60
>  	help
>  	  Select this if you are using Microchip's SAM9X60 SoC
>  
> +config SOC_SAM9X7
> +	bool "SAM9X7"
> +	depends on ARCH_MULTI_V5
> +	select ATMEL_AIC5_IRQ
> +	select ATMEL_PM if PM
> +	select ATMEL_SDRAMC

This flag doesn't exist anymore.

> +	select CPU_ARM926T
> +	select HAVE_AT91_USB_CLK
> +	select HAVE_AT91_GENERATED_CLK
> +	select HAVE_AT91_SAM9X60_PLL
> +	select MEMORY
> +	select PINCTRL_AT91
> +	select SOC_SAM_V4_V5
> +	select SRAM if PM
> +	help
> +	  Select this if you are using Microchip's SAM9X7 SoC
> +
>  comment "Clocksource driver selection"
>  
>  config ATMEL_CLOCKSOURCE_PIT
>  	bool "Periodic Interval Timer (PIT) support"
> -	depends on SOC_AT91SAM9 || SOC_SAM9X60 || SOC_SAMA5
> +	depends on SOC_AT91SAM9 || SOC_SAM9X60 || SOC_SAM9X7 || SOC_SAMA5
>  	default SOC_AT91SAM9 || SOC_SAMA5
>  	select ATMEL_PIT
>  	help
> @@ -155,7 +172,7 @@ config ATMEL_CLOCKSOURCE_PIT
>  
>  config ATMEL_CLOCKSOURCE_TCB
>  	bool "Timer Counter Blocks (TCB) support"
> -	default SOC_AT91RM9200 || SOC_AT91SAM9 || SOC_SAM9X60 || SOC_SAMA5
> +	default SOC_AT91RM9200 || SOC_AT91SAM9 || SOC_SAM9X60 || SOC_SAM9X7 || SOC_SAMA5
>  	select ATMEL_TCB_CLKSRC
>  	help
>  	  Select this to get a high precision clocksource based on a
> @@ -166,7 +183,7 @@ config ATMEL_CLOCKSOURCE_TCB
>  
>  config MICROCHIP_CLOCKSOURCE_PIT64B
>  	bool "64-bit Periodic Interval Timer (PIT64B) support"
> -	default SOC_SAM9X60 || SOC_SAMA7
> +	default SOC_SAM9X60 || SOC_SAM9X7 || SOC_SAMA7
>  	select MICROCHIP_PIT64B
>  	help
>  	  Select this to get a high resolution clockevent (SAM9X60) or

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 37/39] ARM: dts: at91: sam9x7: add device tree for SoC
  2024-02-23 17:30 ` [PATCH v4 37/39] ARM: dts: at91: sam9x7: add device tree for SoC Varshini Rajendran
@ 2024-03-03 12:24   ` claudiu beznea
  2024-03-04 16:33     ` Varshini.Rajendran
  0 siblings, 1 reply; 92+ messages in thread
From: claudiu beznea @ 2024-03-03 12:24 UTC (permalink / raw)
  To: Varshini Rajendran, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, devicetree, linux-kernel



On 23.02.2024 19:30, Varshini Rajendran wrote:
> Add device tree file for SAM9X7 SoC family.
> 
> Co-developed-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> ---
> Changes in v4:
> - Added pwm node support
> - Added microchip,nr-irqs to the interrupt-controller node for the
>   driver to fetch the NIRQs
> - Dropped USB nodes owing to the discussion here
>  https://lore.kernel.org/linux-devicetree/CAL_JsqJ9PrX6fj-EbffeJce09MXs=B7t+KS_kOinxaRx38=WxA@mail.gmail.com/
> (Explained elaborartely in the cover letter)
> ---
>  arch/arm/boot/dts/microchip/sam9x7.dtsi | 1214 +++++++++++++++++++++++
>  1 file changed, 1214 insertions(+)
>  create mode 100644 arch/arm/boot/dts/microchip/sam9x7.dtsi
> 
> diff --git a/arch/arm/boot/dts/microchip/sam9x7.dtsi b/arch/arm/boot/dts/microchip/sam9x7.dtsi
> new file mode 100644
> index 000000000000..ddbeb456bb59
> --- /dev/null
> +++ b/arch/arm/boot/dts/microchip/sam9x7.dtsi
> @@ -0,0 +1,1214 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +/*
> + * sam9x7.dtsi - Device Tree Include file for Microchip SAM9X7 SoC family
> + *
> + * Copyright (C) 2023 Microchip Technology Inc. and its subsidiaries
> + *
> + * Author: Varshini Rajendran <varshini.rajendran@microchip.com>
> + */
> +
> +#include <dt-bindings/clock/at91.h>
> +#include <dt-bindings/dma/at91.h>
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/interrupt-controller/arm-gic.h>
> +#include <dt-bindings/interrupt-controller/irq.h>
> +#include <dt-bindings/mfd/at91-usart.h>
> +#include <dt-bindings/mfd/atmel-flexcom.h>
> +#include <dt-bindings/pinctrl/at91.h>
> +
> +/ {
> +	#address-cells = <1>;
> +	#size-cells = <1>;
> +	model = "Microchip SAM9X7 SoC";
> +	compatible = "microchip,sam9x7";
> +	interrupt-parent = <&aic>;
> +
> +	aliases {
> +		serial0 = &dbgu;
> +		gpio0 = &pioA;
> +		gpio1 = &pioB;
> +		gpio2 = &pioC;
> +		gpio3 = &pioD;
> +	};
> +
> +	cpus {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		cpu@0 {
> +			compatible = "arm,arm926ej-s";
> +			device_type = "cpu";
> +			reg = <0>;
> +		};
> +	};
> +
> +	clocks {
> +		slow_xtal: clock-slowxtal {
> +			compatible = "fixed-clock";
> +			#clock-cells = <0>;
> +		};
> +
> +		main_xtal: clock-mainxtal {
> +			compatible = "fixed-clock";
> +			#clock-cells = <0>;
> +		};
> +	};
> +
> +	sram: sram@300000 {
> +		compatible = "mmio-sram";
> +		reg = <0x300000 0x10000>;
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		ranges = <0 0x300000 0x10000>;

As of [1] the order should be something like:
1/ compatible
2/ reg
3/ ranges
4/ #address-cells
   #size-cells

Please check the rest of the file to comply with this [1]

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/dts-coding-style.rst#n115

> +	};
> +
> +	ahb {
> +		compatible = "simple-bus";
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		ranges;
> +
> +		sdmmc0: mmc@80000000 {
> +			compatible = "microchip,sam9x7-sdhci", "microchip,sam9x60-sdhci";
> +			reg = <0x80000000 0x300>;
> +			interrupts = <12 IRQ_TYPE_LEVEL_HIGH 0>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 12>, <&pmc PMC_TYPE_GCK 12>;
> +			clock-names = "hclock", "multclk";
> +			assigned-clocks = <&pmc PMC_TYPE_GCK 12>;
> +			assigned-clock-rates = <100000000>;
> +			status = "disabled";
> +		};
> +
> +		sdmmc1: mmc@90000000 {
> +			compatible = "microchip,sam9x7-sdhci", "microchip,sam9x60-sdhci";
> +			reg = <0x90000000 0x300>;
> +			interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 26>, <&pmc PMC_TYPE_GCK 26>;
> +			clock-names = "hclock", "multclk";
> +			assigned-clocks = <&pmc PMC_TYPE_GCK 26>;
> +			assigned-clock-rates = <100000000>;
> +			status = "disabled";
> +		};
> +	};
> +
> +	apb {
> +		compatible = "simple-bus";
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		ranges;
> +
> +		flx4: flexcom@f0000000 {
> +			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
> +			reg = <0xf0000000 0x200>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 13>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			ranges = <0x0 0xf0000000 0x800>;
> +			status = "disabled";
> +
> +			uart4: serial@200 {
> +				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
> +				reg = <0x200 0x200>;
> +				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 7>;
> +				dmas = <&dma0

This one                               ^

> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(8))>,
> +					<&dma0

and this one                            ^ should be alligned as of coding
style (see [1] above). Same for the rest of occurencies I will not comment on.

> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(9))>;
> +				dma-names = "tx", "rx";
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 13>;
> +				clock-names = "usart";
> +				atmel,use-dma-rx;
> +				atmel,use-dma-tx;
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			spi4: spi@400 {
> +				compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
> +				reg = <0x400 0x200>;
> +				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 13>;
> +				clock-names = "spi_clk";
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(8))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(9))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			i2c4: i2c@600 {
> +				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
> +				reg = <0x600 0x200>;
> +				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 13>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(8))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(9))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +		};
> +
> +		flx5: flexcom@f0004000 {
> +			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
> +			reg = <0xf0004000 0x200>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 14>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			ranges = <0x0 0xf0004000 0x800>;
> +			status = "disabled";
> +
> +			uart5: serial@200 {
> +				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
> +				reg = <0x200 0x200>;
> +				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 7>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(10))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(11))>;
> +				dma-names = "tx", "rx";
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 14>;
> +				clock-names = "usart";
> +				atmel,use-dma-rx;
> +				atmel,use-dma-tx;
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			spi5: spi@400 {
> +				compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
> +				reg = <0x400 0x200>;
> +				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 14>;
> +				clock-names = "spi_clk";
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(10))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(11))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			i2c5: i2c@600 {
> +				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
> +				reg = <0x600 0x200>;
> +				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 14>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(10))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(11))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +		};
> +
> +		dma0: dma-controller@f0008000 {
> +			compatible = "microchip,sam9x7-dma", "atmel,sama5d4-dma";
> +			reg = <0xf0008000 0x1000>;
> +			interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>;
> +			#dma-cells = <1>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 20>;
> +			clock-names = "dma_clk";
> +			status = "disabled";
> +		};
> +
> +		ssc: ssc@f0010000 {
> +			compatible = "microchip,sam9x7-ssc", "atmel,at91sam9g45-ssc";
> +			reg = <0xf0010000 0x4000>;
> +			interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>;
> +			dmas = <&dma0
> +				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
> +				 AT91_XDMAC_DT_PERID(38))>,
> +			       <&dma0
> +				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
> +				 AT91_XDMAC_DT_PERID(39))>;
> +			dma-names = "tx", "rx";
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 28>;
> +			clock-names = "pclk";
> +			status = "disabled";
> +		};
> +
> +		i2s: i2s@f001c000 {
> +			compatible = "microchip,sam9x7-i2smcc", "microchip,sam9x60-i2smcc";
> +			reg = <0xf001c000 0x100>;
> +			interrupts = <34 IRQ_TYPE_LEVEL_HIGH 7>;
> +			dmas = <&dma0
> +				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
> +				 AT91_XDMAC_DT_PERID(36))>,
> +			       <&dma0
> +				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
> +				 AT91_XDMAC_DT_PERID(37))>;
> +			dma-names = "tx", "rx";
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 34>, <&pmc PMC_TYPE_GCK 34>;
> +			clock-names = "pclk", "gclk";
> +			status = "disabled";
> +		};
> +
> +		flx11: flexcom@f0020000 {
> +			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
> +			reg = <0xf0020000 0x200>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 32>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			ranges = <0x0 0xf0020000 0x800>;
> +			status = "disabled";
> +
> +			uart11: serial@200 {
> +				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
> +				reg = <0x200 0x200>;
> +				interrupts = <32 IRQ_TYPE_LEVEL_HIGH 7>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(22))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(23))>;
> +				dma-names = "tx", "rx";
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 32>;
> +				clock-names = "usart";
> +				atmel,use-dma-rx;
> +				atmel,use-dma-tx;
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			i2c11: i2c@600 {
> +				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
> +				reg = <0x600 0x200>;
> +				interrupts = <32 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 32>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(22))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(23))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +		};
> +
> +		flx12: flexcom@f0024000 {
> +			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
> +			reg = <0xf0024000 0x200>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 33>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			ranges = <0x0 0xf0024000 0x800>;
> +			status = "disabled";
> +
> +			uart12: serial@200 {
> +				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
> +				reg = <0x200 0x200>;
> +				interrupts = <33 IRQ_TYPE_LEVEL_HIGH 7>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(24))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(25))>;
> +				dma-names = "tx", "rx";
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 33>;
> +				clock-names = "usart";
> +				atmel,use-dma-rx;
> +				atmel,use-dma-tx;
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			i2c12: i2c@600 {
> +				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
> +				reg = <0x600 0x200>;
> +				interrupts = <33 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 33>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(24))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(25))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +		};
> +
> +		pit64b0: timer@f0028000 {
> +			compatible = "microchip,sam9x7-pit64b", "microchip,sam9x60-pit64b";
> +			reg = <0xf0028000 0x100>;
> +			interrupts = <37 IRQ_TYPE_LEVEL_HIGH 7>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 37>, <&pmc PMC_TYPE_GCK 37>;
> +			clock-names = "pclk", "gclk";
> +		};
> +
> +		sha: crypto@f002c000 {
> +			compatible = "microchip,sam9x7-sha", "atmel,at91sam9g46-sha";
> +			reg = <0xf002c000 0x100>;
> +			interrupts = <41 IRQ_TYPE_LEVEL_HIGH 0>;
> +			dmas = <&dma0
> +				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
> +				 AT91_XDMAC_DT_PERID(34))>;
> +			dma-names = "tx";
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 41>;
> +			clock-names = "sha_clk";
> +		};
> +
> +		trng: rng@f0030000 {
> +			compatible = "microchip,sam9x7-trng", "microchip,sam9x60-trng";
> +			reg = <0xf0030000 0x100>;
> +			interrupts = <38 IRQ_TYPE_LEVEL_HIGH 0>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 38>;
> +			status = "disabled";
> +		};
> +
> +		aes: crypto@f0034000 {
> +			compatible = "microchip,sam9x7-aes", "atmel,at91sam9g46-aes";
> +			reg = <0xf0034000 0x100>;
> +			interrupts = <39 IRQ_TYPE_LEVEL_HIGH 0>;
> +			dmas = <&dma0
> +				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
> +				 AT91_XDMAC_DT_PERID(32))>,
> +			       <&dma0
> +				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
> +				 AT91_XDMAC_DT_PERID(33))>;
> +			dma-names = "tx", "rx";
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 39>;
> +			clock-names = "aes_clk";
> +		};
> +
> +		tdes: crypto@f0038000 {
> +			compatible = "microchip,sam9x7-tdes", "atmel,at91sam9g46-tdes";
> +			reg = <0xf0038000 0x100>;
> +			interrupts = <40 IRQ_TYPE_LEVEL_HIGH 0>;
> +			dmas = <&dma0
> +				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
> +				 AT91_XDMAC_DT_PERID(31))>,
> +			       <&dma0
> +				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
> +				 AT91_XDMAC_DT_PERID(30))>;
> +			dma-names = "tx", "rx";
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 40>;
> +			clock-names = "tdes_clk";
> +		};
> +
> +		classd: classd@f003c000 {

From documentation I get that node name should be sound

> +			compatible = "microchip,sam9x7-classd", "atmel,sama5d2-classd";
> +			reg = <0xf003c000 0x100>;
> +			interrupts = <42 IRQ_TYPE_LEVEL_HIGH 7>;
> +			dmas = <&dma0
> +				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
> +				 AT91_XDMAC_DT_PERID(35))>;
> +			dma-names = "tx";
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 42>, <&pmc PMC_TYPE_GCK 42>;
> +			clock-names = "pclk", "gclk";
> +			status = "disabled";
> +		};
> +
> +		pit64b1: timer@f0040000 {
> +			compatible = "microchip,sam9x7-pit64b", "microchip,sam9x60-pit64b";
> +			reg = <0xf0040000 0x100>;
> +			interrupts = <58 IRQ_TYPE_LEVEL_HIGH 7>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 58>, <&pmc PMC_TYPE_GCK 58>;
> +			clock-names = "pclk", "gclk";
> +		};
> +
> +		can0: can@f8000000 {
> +			compatible = "bosch,m_can";
> +			reg = <0xf8000000 0x100>, <0x300000 0x7800>;
> +			reg-names = "m_can", "message_ram";
> +			interrupts = <29 IRQ_TYPE_LEVEL_HIGH 0
> +				      68 IRQ_TYPE_LEVEL_HIGH 0>;

From [1]: Each entry in arrays with multiple cells, e.g. "reg" with two IO
addresses, shall be enclosed in <>.

> +			interrupt-names = "int0", "int1";
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 29>, <&pmc PMC_TYPE_GCK 29>;
> +			clock-names = "hclk", "cclk";
> +			assigned-clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_GCK 29>;
> +			assigned-clock-rates = <480000000>, <40000000>;
> +			assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_CORE PMC_UTMI>;
> +			bosch,mram-cfg = <0x3400 0 0 64 0 0 32 32>;
> +			status = "disabled";
> +		};
> +
> +		can1: can@f8004000 {
> +			compatible = "bosch,m_can";
> +			reg = <0xf8004000 0x100>, <0x300000 0xbc00>;
> +			reg-names = "m_can", "message_ram";
> +			interrupts = <30 IRQ_TYPE_LEVEL_HIGH 0
> +				      69 IRQ_TYPE_LEVEL_HIGH 0>;
> +			interrupt-names = "int0", "int1";
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 30>, <&pmc PMC_TYPE_GCK 30>;
> +			clock-names = "hclk", "cclk";
> +			assigned-clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_GCK 30>;
> +			assigned-clock-rates = <480000000>, <40000000>;
> +			assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_CORE PMC_UTMI>;
> +			bosch,mram-cfg = <0x7800 0 0 64 0 0 32 32>;
> +			status = "disabled";
> +		};
> +
> +		tcb: timer@f8008000 {
> +			compatible = "microchip,sam9x7-tcb","atmel,sama5d2-tcb", "simple-mfd", "syscon";
> +			reg = <0xf8008000 0x100>;
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +			interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 17>, <&pmc PMC_TYPE_GCK 17>, <&clk32k 0>;
> +			clock-names = "t0_clk", "gclk", "slow_clk";
> +			status = "disabled";
> +		};
> +
> +		flx6: flexcom@f8010000 {
> +			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
> +			reg = <0xf8010000 0x200>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 9>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			ranges = <0x0 0xf8010000 0x800>;
> +			status = "disabled";
> +
> +			uart6: serial@200 {
> +				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
> +				reg = <0x200 0x200>;
> +				interrupts = <9 IRQ_TYPE_LEVEL_HIGH 7>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(12))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(13))>;
> +				dma-names = "tx", "rx";
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 9>;
> +				clock-names = "usart";
> +				atmel,use-dma-rx;
> +				atmel,use-dma-tx;
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			i2c6: i2c@600 {
> +				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
> +				reg = <0x600 0x200>;
> +				interrupts = <9 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 9>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(12))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(13))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +		};
> +
> +		flx7: flexcom@f8014000 {
> +			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
> +			reg = <0xf8014000 0x200>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 10>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			ranges = <0x0 0xf8014000 0x800>;
> +			status = "disabled";
> +
> +			uart7: serial@200 {
> +				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
> +				reg = <0x200 0x200>;
> +				interrupts = <10 IRQ_TYPE_LEVEL_HIGH 7>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(14))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(15))>;
> +				dma-names = "tx", "rx";
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 10>;
> +				clock-names = "usart";
> +				atmel,use-dma-rx;
> +				atmel,use-dma-tx;
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			i2c7: i2c@600 {
> +				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
> +				reg = <0x600 0x200>;
> +				interrupts = <10 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 10>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(14))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(15))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +		};
> +
> +		flx8: flexcom@f8018000 {
> +			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
> +			reg = <0xf8018000 0x200>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 11>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			ranges = <0x0 0xf8018000 0x800>;
> +			status = "disabled";
> +
> +			uart8: serial@200 {
> +				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
> +				reg = <0x200 0x200>;
> +				interrupts = <11 IRQ_TYPE_LEVEL_HIGH 7>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(16))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(17))>;
> +				dma-names = "tx", "rx";
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 11>;
> +				clock-names = "usart";
> +				atmel,use-dma-rx;
> +				atmel,use-dma-tx;
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			i2c8: i2c@600 {
> +				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
> +				reg = <0x600 0x200>;
> +				interrupts = <11 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 11>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(16))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(17))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +		};
> +
> +		flx0: flexcom@f801c000 {
> +			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
> +			reg = <0xf801c000 0x200>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			ranges = <0x0 0xf801c000 0x800>;
> +			status = "disabled";
> +
> +			uart0: serial@200 {
> +				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
> +				reg = <0x200 0x200>;
> +				interrupts = <5 IRQ_TYPE_LEVEL_HIGH 7>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(0))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(1))>;
> +				dma-names = "tx", "rx";
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
> +				clock-names = "usart";
> +				atmel,use-dma-rx;
> +				atmel,use-dma-tx;
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			spi0: spi@400 {
> +				compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
> +				reg = <0x400 0x200>;
> +				interrupts = <5 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
> +				clock-names = "spi_clk";
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(0))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(1))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			i2c0: i2c@600 {
> +				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
> +				reg = <0x600 0x200>;
> +				interrupts = <5 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(0))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(1))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +		};
> +
> +		flx1: flexcom@f8020000 {
> +			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
> +			reg = <0xf8020000 0x200>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 6>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			ranges = <0x0 0xf8020000 0x800>;
> +			status = "disabled";
> +
> +			uart1: serial@200 {
> +				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
> +				reg = <0x200 0x200>;
> +				interrupts = <6 IRQ_TYPE_LEVEL_HIGH 7>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(2))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(3))>;
> +				dma-names = "tx", "rx";
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 6>;
> +				clock-names = "usart";
> +				atmel,use-dma-rx;
> +				atmel,use-dma-tx;
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			spi1: spi@400 {
> +				compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
> +				reg = <0x400 0x200>;
> +				interrupts = <6 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 6>;
> +				clock-names = "spi_clk";
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(2))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(3))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			i2c1: i2c@600 {
> +				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
> +				reg = <0x600 0x200>;
> +				interrupts = <6 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 6>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(2))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(3))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +		};
> +
> +		flx2: flexcom@f8024000 {
> +			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
> +			reg = <0xf8024000 0x200>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 7>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			ranges = <0x0 0xf8024000 0x800>;
> +			status = "disabled";
> +
> +			uart2: serial@200 {
> +				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
> +				reg = <0x200 0x200>;
> +				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 7>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(4))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(5))>;
> +				dma-names = "tx", "rx";
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 7>;
> +				clock-names = "usart";
> +				atmel,use-dma-rx;
> +				atmel,use-dma-tx;
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			spi2: spi@400 {
> +				compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
> +				reg = <0x400 0x200>;
> +				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 7>;
> +				clock-names = "spi_clk";
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(4))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(5))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			i2c2: i2c@600 {
> +				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
> +				reg = <0x600 0x200>;
> +				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 7>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(4))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(5))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +		};
> +
> +		flx3: flexcom@f8028000 {
> +			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
> +			reg = <0xf8028000 0x200>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 8>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			ranges = <0x0 0xf8028000 0x800>;
> +			status = "disabled";
> +
> +			uart3: serial@200 {
> +				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
> +				reg = <0x200 0x200>;
> +				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 7>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(6))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(7))>;
> +				dma-names = "tx", "rx";
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 8>;
> +				clock-names = "usart";
> +				atmel,use-dma-rx;
> +				atmel,use-dma-tx;
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			spi3: spi@400 {
> +				compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
> +				reg = <0x400 0x200>;
> +				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 8>;
> +				clock-names = "spi_clk";
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(6))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(7))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			i2c3: i2c@600 {
> +				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
> +				reg = <0x600 0x200>;
> +				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 8>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(6))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(7))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +		};
> +
> +		gmac: ethernet@f802c000 {
> +			compatible = "microchip,sam9x7-gem", "microchip,sama7g5-gem" ;

There is a space at the end of the line.

> +			reg = <0xf802c000 0x1000>;
> +			interrupts = <24 IRQ_TYPE_LEVEL_HIGH 3		/* Queue 0 */

Same here: add array entry with <>

> +				      60 IRQ_TYPE_LEVEL_HIGH 3          /* Queue 1 */
> +				      61 IRQ_TYPE_LEVEL_HIGH 3          /* Queue 2 */
> +				      62 IRQ_TYPE_LEVEL_HIGH 3          /* Queue 3 */
> +				      63 IRQ_TYPE_LEVEL_HIGH 3          /* Queue 4 */
> +				      64 IRQ_TYPE_LEVEL_HIGH 3>;        /* Queue 5 */

You have spaces here                                              ^
for queue1..5 but not for q0

> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 24>, <&pmc PMC_TYPE_PERIPHERAL 24>, <&pmc PMC_TYPE_GCK 24>, <&pmc PMC_TYPE_GCK 67>;
> +			clock-names = "hclk", "pclk", "tx_clk", "tsu_clk";
> +			assigned-clocks = <&pmc PMC_TYPE_GCK 67>;
> +			status = "disabled";
> +		};
> +
> +		pwm0: pwm@f8034000 {
> +			compatible = "microchip,sam9x7-pwm", "microchip,sam9x60-pwm";
> +			reg = <0xf8034000 0x300>;
> +			interrupts = <18 IRQ_TYPE_LEVEL_HIGH 4>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 18>;
> +			#pwm-cells = <3>;
> +			status= "disabled";

space after status

> +		};
> +
> +		flx9: flexcom@f8040000 {
> +			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
> +			reg = <0xf8040000 0x200>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 15>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			ranges = <0x0 0xf8040000 0x800>;
> +			status = "disabled";
> +
> +			uart9: serial@200 {
> +				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
> +				reg = <0x200 0x200>;
> +				interrupts = <15 IRQ_TYPE_LEVEL_HIGH 7>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(18))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(19))>;
> +				dma-names = "tx", "rx";
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 15>;
> +				clock-names = "usart";
> +				atmel,use-dma-rx;
> +				atmel,use-dma-tx;
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			i2c9: i2c@600 {
> +				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
> +				reg = <0x600 0x200>;
> +				interrupts = <15 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 15>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(18))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(19))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +		};
> +
> +		flx10: flexcom@f8044000 {
> +			compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
> +			reg = <0xf8044000 0x200>;
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 16>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			ranges = <0x0 0xf8044000 0x800>;
> +			status = "disabled";
> +
> +			uart10: serial@200 {
> +				compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
> +				reg = <0x200 0x200>;
> +				interrupts = <16 IRQ_TYPE_LEVEL_HIGH 7>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(20))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(21))>;
> +				dma-names = "tx", "rx";
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 16>;
> +				clock-names = "usart";
> +				atmel,use-dma-rx;
> +				atmel,use-dma-tx;
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +
> +			i2c10: i2c@600 {
> +				compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
> +				reg = <0x600 0x200>;
> +				interrupts = <16 IRQ_TYPE_LEVEL_HIGH 7>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 16>;
> +				dmas = <&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(20))>,
> +					<&dma0
> +					(AT91_XDMAC_DT_MEM_IF(0) |
> +					 AT91_XDMAC_DT_PER_IF(1) |
> +					 AT91_XDMAC_DT_PERID(21))>;
> +				dma-names = "tx", "rx";
> +				atmel,fifo-size = <16>;
> +				status = "disabled";
> +			};
> +		};
> +
> +		sfr: sfr@f8050000 {
> +			compatible = "microchip,sam9x7-sfr", "microchip,sam9x60-sfr", "syscon";
> +			reg = <0xf8050000 0x100>;
> +		};
> +
> +		matrix: matrix@ffffde00 {
> +			compatible = "microchip,sam9x7-matrix", "atmel,at91sam9x5-matrix", "syscon";
> +			reg = <0xffffde00 0x200>;
> +		};
> +
> +		pmecc: ecc-engine@ffffe000 {
> +			compatible = "microchip,sam9x7-pmecc", "atmel,at91sam9g45-pmecc";
> +			reg = <0xffffe000 0x300>,
> +			      <0xffffe600 0x100>;

These may fit on a single line.

> +		};
> +
> +		mpddrc: mpddrc@ffffe800 {
> +			compatible = "microchip,sam9x7-ddramc", "atmel,sama5d3-ddramc";
> +			reg = <0xffffe800 0x200>;
> +			clocks = <&pmc PMC_TYPE_SYSTEM 2>, <&pmc PMC_TYPE_CORE PMC_MCK>;
> +			clock-names = "ddrck", "mpddr";
> +		};
> +
> +		smc: smc@ffffea00 {
> +			compatible = "microchip,sam9x7-smc", "atmel,at91sam9260-smc", "syscon";
> +			reg = <0xffffea00 0x100>;
> +		};
> +
> +		aic: interrupt-controller@fffff100 {
> +			compatible = "microchip,sam9x7-aic", "microchip,sam9x60-aic";

microchip,sam9x7-aic looks undocumented

> +			reg = <0xfffff100 0x100>;
> +			#interrupt-cells = <3>;
> +			interrupt-controller;
> +			atmel,external-irqs = <31>;
> +			microchip,nr-irqs = <70>;
> +		};
> +
> +		dbgu: serial@fffff200 {
> +			compatible = "microchip,sam9x7-dbgu", "microchip,sam9x7-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart";
> +			reg = <0xfffff200 0x200>;
> +			atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
> +			interrupts = <47 IRQ_TYPE_LEVEL_HIGH 7>;
> +			dmas = <&dma0
> +				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
> +				 AT91_XDMAC_DT_PERID(28))>,
> +			       <&dma0
> +				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
> +				 AT91_XDMAC_DT_PERID(29))>;
> +			dma-names = "tx", "rx";
> +			clocks = <&pmc PMC_TYPE_PERIPHERAL 47>;
> +			clock-names = "usart";
> +			status = "disabled";
> +		};
> +
> +		pinctrl: pinctrl@fffff400 {
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			compatible = "microchip,sam9x7-pinctrl", "microchip,sam9x60-pinctrl", "simple-mfd";
> +			ranges = <0xfffff400 0xfffff400 0x800>;
> +
> +			/* mux-mask corresponding to sam9x7 SoC in TFBGA228L package */
> +			atmel,mux-mask = <
> +					 /*  A		B	   C	      D	  */
> +					 0xffffffff 0xffffefc0 0xc0ffd000 0x00000000	/* pioA */
> +					 0x07ffffff 0x0805fe7f 0x01ff9f80 0x06078000	/* pioB */
> +					 0xffffffff 0x07dfffff 0xfa3fffff 0x00000000	/* pioC */
> +					 0x00003fff 0x00003fe0 0x0000003f 0x00000000	/* pioD */
> +					 >;
> +
> +			pioA: gpio@fffff400 {
> +				compatible = "microchip,sam9x7-gpio", "microchip,sam9x60-gpio", "atmel,at91rm9200-gpio";
> +				reg = <0xfffff400 0x200>;
> +				interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
> +				#gpio-cells = <2>;
> +				gpio-controller;
> +				interrupt-controller;
> +				#interrupt-cells = <2>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 2>;
> +			};
> +
> +			pioB: gpio@fffff600 {
> +				compatible = "microchip,sam9x7-gpio", "microchip,sam9x60-gpio", "atmel,at91rm9200-gpio";
> +				reg = <0xfffff600 0x200>;
> +				interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
> +				#gpio-cells = <2>;
> +				gpio-controller;
> +				#gpio-lines = <26>;
> +				interrupt-controller;
> +				#interrupt-cells = <2>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 3>;
> +			};
> +
> +			pioC: gpio@fffff800 {
> +				compatible = "microchip,sam9x7-gpio", "microchip,sam9x60-gpio", "atmel,at91rm9200-gpio";
> +				reg = <0xfffff800 0x200>;
> +				interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
> +				#gpio-cells = <2>;
> +				gpio-controller;
> +				interrupt-controller;
> +				#interrupt-cells = <2>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 4>;
> +			};
> +
> +			pioD: gpio@fffffa00 {
> +				compatible = "microchip,sam9x7-gpio", "microchip,sam9x60-gpio", "atmel,at91rm9200-gpio";
> +				reg = <0xfffffa00 0x200>;
> +				interrupts = <44 IRQ_TYPE_LEVEL_HIGH 1>;
> +				#gpio-cells = <2>;
> +				gpio-controller;
> +				#gpio-lines = <22>;
> +				interrupt-controller;
> +				#interrupt-cells = <2>;
> +				clocks = <&pmc PMC_TYPE_PERIPHERAL 44>;
> +			};
> +		};
> +
> +		pmc: clock-controller@fffffc00 {
> +			compatible = "microchip,sam9x7-pmc", "syscon";
> +			reg = <0xfffffc00 0x200>;
> +			interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
> +			#clock-cells = <2>;
> +			clocks = <&clk32k 1>, <&clk32k 0>, <&main_xtal>;
> +			clock-names = "td_slck", "md_slck", "main_xtal";
> +		};
> +
> +		reset_controller: reset-controller@fffffe00 {
> +			compatible = "microchip,sam9x7-rstc", "microchip,sam9x60-rstc";
> +			reg = <0xfffffe00 0x10>;
> +			clocks = <&clk32k 0>;
> +		};
> +
> +		power_management: power-management@fffffe10 {

Usually the node name for this is poweroff. Any reason you changed it like
this?

> +			compatible = "microchip,sam9x7-shdwc", "microchip,sam9x60-shdwc";
> +			reg = <0xfffffe10 0x10>;
> +			clocks = <&clk32k 0>;
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +			atmel,wakeup-rtc-timer;
> +			atmel,wakeup-rtt-timer;
> +			status = "disabled";
> +		};
> +
> +		rtt: rtc@fffffe20 {
> +			compatible = "microchip,sam9x7-rtt", "atmel,at91sam9260-rtt";
> +			reg = <0xfffffe20 0x20>;
> +			interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
> +			clocks = <&clk32k 0>;
> +		};
> +
> +		clk32k: sckc@fffffe50 {

Node name should be generic, e.g. clock-controller

> +			compatible = "microchip,sam9x7-sckc", "microchip,sam9x60-sckc";
> +			reg = <0xfffffe50 0x4>;
> +			clocks = <&slow_xtal>;
> +			#clock-cells = <1>;
> +		};
> +
> +		gpbr: syscon@fffffe60 {
> +			compatible = "microchip,sam9x7-gbpr", "atmel,at91sam9260-gpbr", "syscon";

microchip,sam9x7-gbpr seems undocummented.

> +			reg = <0xfffffe60 0x10>;
> +		};
> +
> +		rtc: rtc@fffffea8 {
> +			compatible = "microchip,sam9x7-rtc", "microchip,sam9x60-rtc";
> +			reg = <0xfffffea8 0x100>;
> +			interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
> +			clocks = <&clk32k 0>;
> +		};
> +
> +		watchdog: watchdog@ffffff80 {
> +			compatible = "microchip,sam9x7-wdt", "microchip,sam9x60-wdt";
> +			reg = <0xffffff80 0x24>;
> +			interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
> +			status = "disabled";
> +		};
> +	};
> +};

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 37/39] ARM: dts: at91: sam9x7: add device tree for SoC
  2024-03-03 12:24   ` claudiu beznea
@ 2024-03-04 16:33     ` Varshini.Rajendran
  2024-03-06  8:38       ` claudiu beznea
  0 siblings, 1 reply; 92+ messages in thread
From: Varshini.Rajendran @ 2024-03-04 16:33 UTC (permalink / raw)
  To: claudiu.beznea, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	Nicolas.Ferre, devicetree, linux-kernel

Hi Claudiu,

Thanks for your time in reviewing this patch. I will address all your 
comments in the next version. There are some clarifications provided 
inline below.

On 03/03/24 5:54 pm, claudiu beznea wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On 23.02.2024 19:30, Varshini Rajendran wrote:
>> Add device tree file for SAM9X7 SoC family.
>>
>> Co-developed-by: Nicolas Ferre <nicolas.ferre@microchip.com>
>> Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
>> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
>> ---
>> Changes in v4:
>> - Added pwm node support
>> - Added microchip,nr-irqs to the interrupt-controller node for the
>>    driver to fetch the NIRQs
>> - Dropped USB nodes owing to the discussion here
>>   https://lore.kernel.org/linux-devicetree/CAL_JsqJ9PrX6fj-EbffeJce09MXs=B7t+KS_kOinxaRx38=WxA@mail.gmail.com/
>> (Explained elaborartely in the cover letter)
>> ---
>>   arch/arm/boot/dts/microchip/sam9x7.dtsi | 1214 +++++++++++++++++++++++
>>   1 file changed, 1214 insertions(+)
>>   create mode 100644 arch/arm/boot/dts/microchip/sam9x7.dtsi
>>
>> diff --git a/arch/arm/boot/dts/microchip/sam9x7.dtsi b/arch/arm/boot/dts/microchip/sam9x7.dtsi
>> new file mode 100644
>> index 000000000000..ddbeb456bb59
>> --- /dev/null
>> +++ b/arch/arm/boot/dts/microchip/sam9x7.dtsi
>> @@ -0,0 +1,1214 @@
>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>> +/*
>> + * sam9x7.dtsi - Device Tree Include file for Microchip SAM9X7 SoC family
>> + *
>> + * Copyright (C) 2023 Microchip Technology Inc. and its subsidiaries
>> + *
>> + * Author: Varshini Rajendran <varshini.rajendran@microchip.com>
>> + */
>> +
>> +#include <dt-bindings/clock/at91.h>
>> +#include <dt-bindings/dma/at91.h>
>> +#include <dt-bindings/gpio/gpio.h>
>> +#include <dt-bindings/interrupt-controller/arm-gic.h>
>> +#include <dt-bindings/interrupt-controller/irq.h>
>> +#include <dt-bindings/mfd/at91-usart.h>
>> +#include <dt-bindings/mfd/atmel-flexcom.h>
>> +#include <dt-bindings/pinctrl/at91.h>
>> +
>> +/ {
>> +     #address-cells = <1>;
>> +     #size-cells = <1>;
>> +     model = "Microchip SAM9X7 SoC";
>> +     compatible = "microchip,sam9x7";
>> +     interrupt-parent = <&aic>;
>> +
>> +     aliases {
>> +             serial0 = &dbgu;
>> +             gpio0 = &pioA;
>> +             gpio1 = &pioB;
>> +             gpio2 = &pioC;
>> +             gpio3 = &pioD;
>> +     };
>> +
>> +     cpus {
>> +             #address-cells = <1>;
>> +             #size-cells = <0>;
>> +
>> +             cpu@0 {
>> +                     compatible = "arm,arm926ej-s";
>> +                     device_type = "cpu";
>> +                     reg = <0>;
>> +             };
>> +     };
>> +
>> +     clocks {
>> +             slow_xtal: clock-slowxtal {
>> +                     compatible = "fixed-clock";
>> +                     #clock-cells = <0>;
>> +             };
>> +
>> +             main_xtal: clock-mainxtal {
>> +                     compatible = "fixed-clock";
>> +                     #clock-cells = <0>;
>> +             };
>> +     };
>> +
>> +     sram: sram@300000 {
>> +             compatible = "mmio-sram";
>> +             reg = <0x300000 0x10000>;
>> +             #address-cells = <1>;
>> +             #size-cells = <1>;
>> +             ranges = <0 0x300000 0x10000>;
> 
> As of [1] the order should be something like:
> 1/ compatible
> 2/ reg
> 3/ ranges
> 4/ #address-cells
>     #size-cells
> 
> Please check the rest of the file to comply with this [1]
> 
> [1]
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/dts-coding-style.rst#n115
> 
>> +     };
>> +
>> +     ahb {
>> +             compatible = "simple-bus";
>> +             #address-cells = <1>;
>> +             #size-cells = <1>;
>> +             ranges;
>> +
>> +             sdmmc0: mmc@80000000 {
>> +                     compatible = "microchip,sam9x7-sdhci", "microchip,sam9x60-sdhci";
>> +                     reg = <0x80000000 0x300>;
>> +                     interrupts = <12 IRQ_TYPE_LEVEL_HIGH 0>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 12>, <&pmc PMC_TYPE_GCK 12>;
>> +                     clock-names = "hclock", "multclk";
>> +                     assigned-clocks = <&pmc PMC_TYPE_GCK 12>;
>> +                     assigned-clock-rates = <100000000>;
>> +                     status = "disabled";
>> +             };
>> +
>> +             sdmmc1: mmc@90000000 {
>> +                     compatible = "microchip,sam9x7-sdhci", "microchip,sam9x60-sdhci";
>> +                     reg = <0x90000000 0x300>;
>> +                     interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 26>, <&pmc PMC_TYPE_GCK 26>;
>> +                     clock-names = "hclock", "multclk";
>> +                     assigned-clocks = <&pmc PMC_TYPE_GCK 26>;
>> +                     assigned-clock-rates = <100000000>;
>> +                     status = "disabled";
>> +             };
>> +     };
>> +
>> +     apb {
>> +             compatible = "simple-bus";
>> +             #address-cells = <1>;
>> +             #size-cells = <1>;
>> +             ranges;
>> +
>> +             flx4: flexcom@f0000000 {
>> +                     compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
>> +                     reg = <0xf0000000 0x200>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 13>;
>> +                     #address-cells = <1>;
>> +                     #size-cells = <1>;
>> +                     ranges = <0x0 0xf0000000 0x800>;
>> +                     status = "disabled";
>> +
>> +                     uart4: serial@200 {
>> +                             compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
>> +                             reg = <0x200 0x200>;
>> +                             interrupts = <13 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             dmas = <&dma0
> 
> This one                               ^
> 
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(8))>,
>> +                                     <&dma0
> 
> and this one                            ^ should be alligned as of coding
> style (see [1] above). Same for the rest of occurencies I will not comment on.
> 
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(9))>;
>> +                             dma-names = "tx", "rx";
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 13>;
>> +                             clock-names = "usart";
>> +                             atmel,use-dma-rx;
>> +                             atmel,use-dma-tx;
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     spi4: spi@400 {
>> +                             compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
>> +                             reg = <0x400 0x200>;
>> +                             interrupts = <13 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 13>;
>> +                             clock-names = "spi_clk";
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(8))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(9))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     i2c4: i2c@600 {
>> +                             compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
>> +                             reg = <0x600 0x200>;
>> +                             interrupts = <13 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 13>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(8))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(9))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +             };
>> +
>> +             flx5: flexcom@f0004000 {
>> +                     compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
>> +                     reg = <0xf0004000 0x200>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 14>;
>> +                     #address-cells = <1>;
>> +                     #size-cells = <1>;
>> +                     ranges = <0x0 0xf0004000 0x800>;
>> +                     status = "disabled";
>> +
>> +                     uart5: serial@200 {
>> +                             compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
>> +                             reg = <0x200 0x200>;
>> +                             interrupts = <14 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(10))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(11))>;
>> +                             dma-names = "tx", "rx";
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 14>;
>> +                             clock-names = "usart";
>> +                             atmel,use-dma-rx;
>> +                             atmel,use-dma-tx;
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     spi5: spi@400 {
>> +                             compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
>> +                             reg = <0x400 0x200>;
>> +                             interrupts = <14 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 14>;
>> +                             clock-names = "spi_clk";
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(10))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(11))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     i2c5: i2c@600 {
>> +                             compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
>> +                             reg = <0x600 0x200>;
>> +                             interrupts = <14 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 14>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(10))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(11))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +             };
>> +
>> +             dma0: dma-controller@f0008000 {
>> +                     compatible = "microchip,sam9x7-dma", "atmel,sama5d4-dma";
>> +                     reg = <0xf0008000 0x1000>;
>> +                     interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>;
>> +                     #dma-cells = <1>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 20>;
>> +                     clock-names = "dma_clk";
>> +                     status = "disabled";
>> +             };
>> +
>> +             ssc: ssc@f0010000 {
>> +                     compatible = "microchip,sam9x7-ssc", "atmel,at91sam9g45-ssc";
>> +                     reg = <0xf0010000 0x4000>;
>> +                     interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>;
>> +                     dmas = <&dma0
>> +                             (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
>> +                              AT91_XDMAC_DT_PERID(38))>,
>> +                            <&dma0
>> +                             (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
>> +                              AT91_XDMAC_DT_PERID(39))>;
>> +                     dma-names = "tx", "rx";
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 28>;
>> +                     clock-names = "pclk";
>> +                     status = "disabled";
>> +             };
>> +
>> +             i2s: i2s@f001c000 {
>> +                     compatible = "microchip,sam9x7-i2smcc", "microchip,sam9x60-i2smcc";
>> +                     reg = <0xf001c000 0x100>;
>> +                     interrupts = <34 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                     dmas = <&dma0
>> +                             (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
>> +                              AT91_XDMAC_DT_PERID(36))>,
>> +                            <&dma0
>> +                             (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
>> +                              AT91_XDMAC_DT_PERID(37))>;
>> +                     dma-names = "tx", "rx";
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 34>, <&pmc PMC_TYPE_GCK 34>;
>> +                     clock-names = "pclk", "gclk";
>> +                     status = "disabled";
>> +             };
>> +
>> +             flx11: flexcom@f0020000 {
>> +                     compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
>> +                     reg = <0xf0020000 0x200>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 32>;
>> +                     #address-cells = <1>;
>> +                     #size-cells = <1>;
>> +                     ranges = <0x0 0xf0020000 0x800>;
>> +                     status = "disabled";
>> +
>> +                     uart11: serial@200 {
>> +                             compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
>> +                             reg = <0x200 0x200>;
>> +                             interrupts = <32 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(22))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(23))>;
>> +                             dma-names = "tx", "rx";
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 32>;
>> +                             clock-names = "usart";
>> +                             atmel,use-dma-rx;
>> +                             atmel,use-dma-tx;
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     i2c11: i2c@600 {
>> +                             compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
>> +                             reg = <0x600 0x200>;
>> +                             interrupts = <32 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 32>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(22))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(23))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +             };
>> +
>> +             flx12: flexcom@f0024000 {
>> +                     compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
>> +                     reg = <0xf0024000 0x200>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 33>;
>> +                     #address-cells = <1>;
>> +                     #size-cells = <1>;
>> +                     ranges = <0x0 0xf0024000 0x800>;
>> +                     status = "disabled";
>> +
>> +                     uart12: serial@200 {
>> +                             compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
>> +                             reg = <0x200 0x200>;
>> +                             interrupts = <33 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(24))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(25))>;
>> +                             dma-names = "tx", "rx";
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 33>;
>> +                             clock-names = "usart";
>> +                             atmel,use-dma-rx;
>> +                             atmel,use-dma-tx;
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     i2c12: i2c@600 {
>> +                             compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
>> +                             reg = <0x600 0x200>;
>> +                             interrupts = <33 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 33>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(24))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(25))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +             };
>> +
>> +             pit64b0: timer@f0028000 {
>> +                     compatible = "microchip,sam9x7-pit64b", "microchip,sam9x60-pit64b";
>> +                     reg = <0xf0028000 0x100>;
>> +                     interrupts = <37 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 37>, <&pmc PMC_TYPE_GCK 37>;
>> +                     clock-names = "pclk", "gclk";
>> +             };
>> +
>> +             sha: crypto@f002c000 {
>> +                     compatible = "microchip,sam9x7-sha", "atmel,at91sam9g46-sha";
>> +                     reg = <0xf002c000 0x100>;
>> +                     interrupts = <41 IRQ_TYPE_LEVEL_HIGH 0>;
>> +                     dmas = <&dma0
>> +                             (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
>> +                              AT91_XDMAC_DT_PERID(34))>;
>> +                     dma-names = "tx";
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 41>;
>> +                     clock-names = "sha_clk";
>> +             };
>> +
>> +             trng: rng@f0030000 {
>> +                     compatible = "microchip,sam9x7-trng", "microchip,sam9x60-trng";
>> +                     reg = <0xf0030000 0x100>;
>> +                     interrupts = <38 IRQ_TYPE_LEVEL_HIGH 0>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 38>;
>> +                     status = "disabled";
>> +             };
>> +
>> +             aes: crypto@f0034000 {
>> +                     compatible = "microchip,sam9x7-aes", "atmel,at91sam9g46-aes";
>> +                     reg = <0xf0034000 0x100>;
>> +                     interrupts = <39 IRQ_TYPE_LEVEL_HIGH 0>;
>> +                     dmas = <&dma0
>> +                             (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
>> +                              AT91_XDMAC_DT_PERID(32))>,
>> +                            <&dma0
>> +                             (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
>> +                              AT91_XDMAC_DT_PERID(33))>;
>> +                     dma-names = "tx", "rx";
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 39>;
>> +                     clock-names = "aes_clk";
>> +             };
>> +
>> +             tdes: crypto@f0038000 {
>> +                     compatible = "microchip,sam9x7-tdes", "atmel,at91sam9g46-tdes";
>> +                     reg = <0xf0038000 0x100>;
>> +                     interrupts = <40 IRQ_TYPE_LEVEL_HIGH 0>;
>> +                     dmas = <&dma0
>> +                             (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
>> +                              AT91_XDMAC_DT_PERID(31))>,
>> +                            <&dma0
>> +                             (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
>> +                              AT91_XDMAC_DT_PERID(30))>;
>> +                     dma-names = "tx", "rx";
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 40>;
>> +                     clock-names = "tdes_clk";
>> +             };
>> +
>> +             classd: classd@f003c000 {
> 
>  From documentation I get that node name should be sound
> 
>> +                     compatible = "microchip,sam9x7-classd", "atmel,sama5d2-classd";
>> +                     reg = <0xf003c000 0x100>;
>> +                     interrupts = <42 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                     dmas = <&dma0
>> +                             (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
>> +                              AT91_XDMAC_DT_PERID(35))>;
>> +                     dma-names = "tx";
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 42>, <&pmc PMC_TYPE_GCK 42>;
>> +                     clock-names = "pclk", "gclk";
>> +                     status = "disabled";
>> +             };
>> +
>> +             pit64b1: timer@f0040000 {
>> +                     compatible = "microchip,sam9x7-pit64b", "microchip,sam9x60-pit64b";
>> +                     reg = <0xf0040000 0x100>;
>> +                     interrupts = <58 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 58>, <&pmc PMC_TYPE_GCK 58>;
>> +                     clock-names = "pclk", "gclk";
>> +             };
>> +
>> +             can0: can@f8000000 {
>> +                     compatible = "bosch,m_can";
>> +                     reg = <0xf8000000 0x100>, <0x300000 0x7800>;
>> +                     reg-names = "m_can", "message_ram";
>> +                     interrupts = <29 IRQ_TYPE_LEVEL_HIGH 0
>> +                                   68 IRQ_TYPE_LEVEL_HIGH 0>;
> 
>  From [1]: Each entry in arrays with multiple cells, e.g. "reg" with two IO
> addresses, shall be enclosed in <>.
> 
>> +                     interrupt-names = "int0", "int1";
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 29>, <&pmc PMC_TYPE_GCK 29>;
>> +                     clock-names = "hclk", "cclk";
>> +                     assigned-clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_GCK 29>;
>> +                     assigned-clock-rates = <480000000>, <40000000>;
>> +                     assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_CORE PMC_UTMI>;
>> +                     bosch,mram-cfg = <0x3400 0 0 64 0 0 32 32>;
>> +                     status = "disabled";
>> +             };
>> +
>> +             can1: can@f8004000 {
>> +                     compatible = "bosch,m_can";
>> +                     reg = <0xf8004000 0x100>, <0x300000 0xbc00>;
>> +                     reg-names = "m_can", "message_ram";
>> +                     interrupts = <30 IRQ_TYPE_LEVEL_HIGH 0
>> +                                   69 IRQ_TYPE_LEVEL_HIGH 0>;
>> +                     interrupt-names = "int0", "int1";
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 30>, <&pmc PMC_TYPE_GCK 30>;
>> +                     clock-names = "hclk", "cclk";
>> +                     assigned-clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_GCK 30>;
>> +                     assigned-clock-rates = <480000000>, <40000000>;
>> +                     assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_UTMI>, <&pmc PMC_TYPE_CORE PMC_UTMI>;
>> +                     bosch,mram-cfg = <0x7800 0 0 64 0 0 32 32>;
>> +                     status = "disabled";
>> +             };
>> +
>> +             tcb: timer@f8008000 {
>> +                     compatible = "microchip,sam9x7-tcb","atmel,sama5d2-tcb", "simple-mfd", "syscon";
>> +                     reg = <0xf8008000 0x100>;
>> +                     #address-cells = <1>;
>> +                     #size-cells = <0>;
>> +                     interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 17>, <&pmc PMC_TYPE_GCK 17>, <&clk32k 0>;
>> +                     clock-names = "t0_clk", "gclk", "slow_clk";
>> +                     status = "disabled";
>> +             };
>> +
>> +             flx6: flexcom@f8010000 {
>> +                     compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
>> +                     reg = <0xf8010000 0x200>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 9>;
>> +                     #address-cells = <1>;
>> +                     #size-cells = <1>;
>> +                     ranges = <0x0 0xf8010000 0x800>;
>> +                     status = "disabled";
>> +
>> +                     uart6: serial@200 {
>> +                             compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
>> +                             reg = <0x200 0x200>;
>> +                             interrupts = <9 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(12))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(13))>;
>> +                             dma-names = "tx", "rx";
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 9>;
>> +                             clock-names = "usart";
>> +                             atmel,use-dma-rx;
>> +                             atmel,use-dma-tx;
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     i2c6: i2c@600 {
>> +                             compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
>> +                             reg = <0x600 0x200>;
>> +                             interrupts = <9 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 9>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(12))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(13))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +             };
>> +
>> +             flx7: flexcom@f8014000 {
>> +                     compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
>> +                     reg = <0xf8014000 0x200>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 10>;
>> +                     #address-cells = <1>;
>> +                     #size-cells = <1>;
>> +                     ranges = <0x0 0xf8014000 0x800>;
>> +                     status = "disabled";
>> +
>> +                     uart7: serial@200 {
>> +                             compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
>> +                             reg = <0x200 0x200>;
>> +                             interrupts = <10 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(14))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(15))>;
>> +                             dma-names = "tx", "rx";
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 10>;
>> +                             clock-names = "usart";
>> +                             atmel,use-dma-rx;
>> +                             atmel,use-dma-tx;
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     i2c7: i2c@600 {
>> +                             compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
>> +                             reg = <0x600 0x200>;
>> +                             interrupts = <10 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 10>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(14))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(15))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +             };
>> +
>> +             flx8: flexcom@f8018000 {
>> +                     compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
>> +                     reg = <0xf8018000 0x200>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 11>;
>> +                     #address-cells = <1>;
>> +                     #size-cells = <1>;
>> +                     ranges = <0x0 0xf8018000 0x800>;
>> +                     status = "disabled";
>> +
>> +                     uart8: serial@200 {
>> +                             compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
>> +                             reg = <0x200 0x200>;
>> +                             interrupts = <11 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(16))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(17))>;
>> +                             dma-names = "tx", "rx";
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 11>;
>> +                             clock-names = "usart";
>> +                             atmel,use-dma-rx;
>> +                             atmel,use-dma-tx;
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     i2c8: i2c@600 {
>> +                             compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
>> +                             reg = <0x600 0x200>;
>> +                             interrupts = <11 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 11>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(16))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(17))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +             };
>> +
>> +             flx0: flexcom@f801c000 {
>> +                     compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
>> +                     reg = <0xf801c000 0x200>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
>> +                     #address-cells = <1>;
>> +                     #size-cells = <1>;
>> +                     ranges = <0x0 0xf801c000 0x800>;
>> +                     status = "disabled";
>> +
>> +                     uart0: serial@200 {
>> +                             compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
>> +                             reg = <0x200 0x200>;
>> +                             interrupts = <5 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(0))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(1))>;
>> +                             dma-names = "tx", "rx";
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
>> +                             clock-names = "usart";
>> +                             atmel,use-dma-rx;
>> +                             atmel,use-dma-tx;
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     spi0: spi@400 {
>> +                             compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
>> +                             reg = <0x400 0x200>;
>> +                             interrupts = <5 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
>> +                             clock-names = "spi_clk";
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(0))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(1))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     i2c0: i2c@600 {
>> +                             compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
>> +                             reg = <0x600 0x200>;
>> +                             interrupts = <5 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(0))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(1))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +             };
>> +
>> +             flx1: flexcom@f8020000 {
>> +                     compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
>> +                     reg = <0xf8020000 0x200>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 6>;
>> +                     #address-cells = <1>;
>> +                     #size-cells = <1>;
>> +                     ranges = <0x0 0xf8020000 0x800>;
>> +                     status = "disabled";
>> +
>> +                     uart1: serial@200 {
>> +                             compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
>> +                             reg = <0x200 0x200>;
>> +                             interrupts = <6 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(2))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(3))>;
>> +                             dma-names = "tx", "rx";
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 6>;
>> +                             clock-names = "usart";
>> +                             atmel,use-dma-rx;
>> +                             atmel,use-dma-tx;
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     spi1: spi@400 {
>> +                             compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
>> +                             reg = <0x400 0x200>;
>> +                             interrupts = <6 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 6>;
>> +                             clock-names = "spi_clk";
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(2))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(3))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     i2c1: i2c@600 {
>> +                             compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
>> +                             reg = <0x600 0x200>;
>> +                             interrupts = <6 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 6>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(2))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(3))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +             };
>> +
>> +             flx2: flexcom@f8024000 {
>> +                     compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
>> +                     reg = <0xf8024000 0x200>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 7>;
>> +                     #address-cells = <1>;
>> +                     #size-cells = <1>;
>> +                     ranges = <0x0 0xf8024000 0x800>;
>> +                     status = "disabled";
>> +
>> +                     uart2: serial@200 {
>> +                             compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
>> +                             reg = <0x200 0x200>;
>> +                             interrupts = <7 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(4))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(5))>;
>> +                             dma-names = "tx", "rx";
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 7>;
>> +                             clock-names = "usart";
>> +                             atmel,use-dma-rx;
>> +                             atmel,use-dma-tx;
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     spi2: spi@400 {
>> +                             compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
>> +                             reg = <0x400 0x200>;
>> +                             interrupts = <7 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 7>;
>> +                             clock-names = "spi_clk";
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(4))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(5))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     i2c2: i2c@600 {
>> +                             compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
>> +                             reg = <0x600 0x200>;
>> +                             interrupts = <7 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 7>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(4))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(5))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +             };
>> +
>> +             flx3: flexcom@f8028000 {
>> +                     compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
>> +                     reg = <0xf8028000 0x200>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 8>;
>> +                     #address-cells = <1>;
>> +                     #size-cells = <1>;
>> +                     ranges = <0x0 0xf8028000 0x800>;
>> +                     status = "disabled";
>> +
>> +                     uart3: serial@200 {
>> +                             compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
>> +                             reg = <0x200 0x200>;
>> +                             interrupts = <8 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(6))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(7))>;
>> +                             dma-names = "tx", "rx";
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 8>;
>> +                             clock-names = "usart";
>> +                             atmel,use-dma-rx;
>> +                             atmel,use-dma-tx;
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     spi3: spi@400 {
>> +                             compatible = "microchip,sam9x7-spi", "atmel,at91rm9200-spi";
>> +                             reg = <0x400 0x200>;
>> +                             interrupts = <8 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 8>;
>> +                             clock-names = "spi_clk";
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(6))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(7))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     i2c3: i2c@600 {
>> +                             compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
>> +                             reg = <0x600 0x200>;
>> +                             interrupts = <8 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 8>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(6))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(7))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +             };
>> +
>> +             gmac: ethernet@f802c000 {
>> +                     compatible = "microchip,sam9x7-gem", "microchip,sama7g5-gem" ;
> 
> There is a space at the end of the line.
> 
>> +                     reg = <0xf802c000 0x1000>;
>> +                     interrupts = <24 IRQ_TYPE_LEVEL_HIGH 3          /* Queue 0 */
> 
> Same here: add array entry with <>
> 
>> +                                   60 IRQ_TYPE_LEVEL_HIGH 3          /* Queue 1 */
>> +                                   61 IRQ_TYPE_LEVEL_HIGH 3          /* Queue 2 */
>> +                                   62 IRQ_TYPE_LEVEL_HIGH 3          /* Queue 3 */
>> +                                   63 IRQ_TYPE_LEVEL_HIGH 3          /* Queue 4 */
>> +                                   64 IRQ_TYPE_LEVEL_HIGH 3>;        /* Queue 5 */
> 
> You have spaces here                                              ^
> for queue1..5 but not for q0
> 
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 24>, <&pmc PMC_TYPE_PERIPHERAL 24>, <&pmc PMC_TYPE_GCK 24>, <&pmc PMC_TYPE_GCK 67>;
>> +                     clock-names = "hclk", "pclk", "tx_clk", "tsu_clk";
>> +                     assigned-clocks = <&pmc PMC_TYPE_GCK 67>;
>> +                     status = "disabled";
>> +             };
>> +
>> +             pwm0: pwm@f8034000 {
>> +                     compatible = "microchip,sam9x7-pwm", "microchip,sam9x60-pwm";
>> +                     reg = <0xf8034000 0x300>;
>> +                     interrupts = <18 IRQ_TYPE_LEVEL_HIGH 4>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 18>;
>> +                     #pwm-cells = <3>;
>> +                     status= "disabled";
> 
> space after status
> 
>> +             };
>> +
>> +             flx9: flexcom@f8040000 {
>> +                     compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
>> +                     reg = <0xf8040000 0x200>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 15>;
>> +                     #address-cells = <1>;
>> +                     #size-cells = <1>;
>> +                     ranges = <0x0 0xf8040000 0x800>;
>> +                     status = "disabled";
>> +
>> +                     uart9: serial@200 {
>> +                             compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
>> +                             reg = <0x200 0x200>;
>> +                             interrupts = <15 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(18))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(19))>;
>> +                             dma-names = "tx", "rx";
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 15>;
>> +                             clock-names = "usart";
>> +                             atmel,use-dma-rx;
>> +                             atmel,use-dma-tx;
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     i2c9: i2c@600 {
>> +                             compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
>> +                             reg = <0x600 0x200>;
>> +                             interrupts = <15 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 15>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(18))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(19))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +             };
>> +
>> +             flx10: flexcom@f8044000 {
>> +                     compatible = "microchip,sam9x7-flexcom", "atmel,sama5d2-flexcom";
>> +                     reg = <0xf8044000 0x200>;
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 16>;
>> +                     #address-cells = <1>;
>> +                     #size-cells = <1>;
>> +                     ranges = <0x0 0xf8044000 0x800>;
>> +                     status = "disabled";
>> +
>> +                     uart10: serial@200 {
>> +                             compatible = "microchip,sam9x7-usart", "atmel,at91sam9260-usart";
>> +                             reg = <0x200 0x200>;
>> +                             interrupts = <16 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(20))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(21))>;
>> +                             dma-names = "tx", "rx";
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 16>;
>> +                             clock-names = "usart";
>> +                             atmel,use-dma-rx;
>> +                             atmel,use-dma-tx;
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +
>> +                     i2c10: i2c@600 {
>> +                             compatible = "microchip,sam9x7-i2c", "microchip,sam9x60-i2c";
>> +                             reg = <0x600 0x200>;
>> +                             interrupts = <16 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 16>;
>> +                             dmas = <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(20))>,
>> +                                     <&dma0
>> +                                     (AT91_XDMAC_DT_MEM_IF(0) |
>> +                                      AT91_XDMAC_DT_PER_IF(1) |
>> +                                      AT91_XDMAC_DT_PERID(21))>;
>> +                             dma-names = "tx", "rx";
>> +                             atmel,fifo-size = <16>;
>> +                             status = "disabled";
>> +                     };
>> +             };
>> +
>> +             sfr: sfr@f8050000 {
>> +                     compatible = "microchip,sam9x7-sfr", "microchip,sam9x60-sfr", "syscon";
>> +                     reg = <0xf8050000 0x100>;
>> +             };
>> +
>> +             matrix: matrix@ffffde00 {
>> +                     compatible = "microchip,sam9x7-matrix", "atmel,at91sam9x5-matrix", "syscon";
>> +                     reg = <0xffffde00 0x200>;
>> +             };
>> +
>> +             pmecc: ecc-engine@ffffe000 {
>> +                     compatible = "microchip,sam9x7-pmecc", "atmel,at91sam9g45-pmecc";
>> +                     reg = <0xffffe000 0x300>,
>> +                           <0xffffe600 0x100>;
> 
> These may fit on a single line.
> 
>> +             };
>> +
>> +             mpddrc: mpddrc@ffffe800 {
>> +                     compatible = "microchip,sam9x7-ddramc", "atmel,sama5d3-ddramc";
>> +                     reg = <0xffffe800 0x200>;
>> +                     clocks = <&pmc PMC_TYPE_SYSTEM 2>, <&pmc PMC_TYPE_CORE PMC_MCK>;
>> +                     clock-names = "ddrck", "mpddr";
>> +             };
>> +
>> +             smc: smc@ffffea00 {
>> +                     compatible = "microchip,sam9x7-smc", "atmel,at91sam9260-smc", "syscon";
>> +                     reg = <0xffffea00 0x100>;
>> +             };
>> +
>> +             aic: interrupt-controller@fffff100 {
>> +                     compatible = "microchip,sam9x7-aic", "microchip,sam9x60-aic";
> 
> microchip,sam9x7-aic looks undocumented
This is documented in patch 28 [1] of this series. But double checking 
now, I have missed to update it according to the new implementation. If 
patch 29 [1] gets a green signal, then I'll correct the same in the next 
version

[1] 
https://lore.kernel.org/linux-arm-kernel/20240223172855.673003-1-varshini.rajendran@microchip.com/
[2] 
https://lore.kernel.org/linux-arm-kernel/20240223172905.673053-1-varshini.rajendran@microchip.com/
> 
>> +                     reg = <0xfffff100 0x100>;
>> +                     #interrupt-cells = <3>;
>> +                     interrupt-controller;
>> +                     atmel,external-irqs = <31>;
>> +                     microchip,nr-irqs = <70>;
>> +             };
>> +
>> +             dbgu: serial@fffff200 {
>> +                     compatible = "microchip,sam9x7-dbgu", "microchip,sam9x7-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart";
>> +                     reg = <0xfffff200 0x200>;
>> +                     atmel,usart-mode = <AT91_USART_MODE_SERIAL>;
>> +                     interrupts = <47 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                     dmas = <&dma0
>> +                             (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
>> +                              AT91_XDMAC_DT_PERID(28))>,
>> +                            <&dma0
>> +                             (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
>> +                              AT91_XDMAC_DT_PERID(29))>;
>> +                     dma-names = "tx", "rx";
>> +                     clocks = <&pmc PMC_TYPE_PERIPHERAL 47>;
>> +                     clock-names = "usart";
>> +                     status = "disabled";
>> +             };
>> +
>> +             pinctrl: pinctrl@fffff400 {
>> +                     #address-cells = <1>;
>> +                     #size-cells = <1>;
>> +                     compatible = "microchip,sam9x7-pinctrl", "microchip,sam9x60-pinctrl", "simple-mfd";
>> +                     ranges = <0xfffff400 0xfffff400 0x800>;
>> +
>> +                     /* mux-mask corresponding to sam9x7 SoC in TFBGA228L package */
>> +                     atmel,mux-mask = <
>> +                                      /*  A          B          C          D   */
>> +                                      0xffffffff 0xffffefc0 0xc0ffd000 0x00000000    /* pioA */
>> +                                      0x07ffffff 0x0805fe7f 0x01ff9f80 0x06078000    /* pioB */
>> +                                      0xffffffff 0x07dfffff 0xfa3fffff 0x00000000    /* pioC */
>> +                                      0x00003fff 0x00003fe0 0x0000003f 0x00000000    /* pioD */
>> +                                      >;
>> +
>> +                     pioA: gpio@fffff400 {
>> +                             compatible = "microchip,sam9x7-gpio", "microchip,sam9x60-gpio", "atmel,at91rm9200-gpio";
>> +                             reg = <0xfffff400 0x200>;
>> +                             interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
>> +                             #gpio-cells = <2>;
>> +                             gpio-controller;
>> +                             interrupt-controller;
>> +                             #interrupt-cells = <2>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 2>;
>> +                     };
>> +
>> +                     pioB: gpio@fffff600 {
>> +                             compatible = "microchip,sam9x7-gpio", "microchip,sam9x60-gpio", "atmel,at91rm9200-gpio";
>> +                             reg = <0xfffff600 0x200>;
>> +                             interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
>> +                             #gpio-cells = <2>;
>> +                             gpio-controller;
>> +                             #gpio-lines = <26>;
>> +                             interrupt-controller;
>> +                             #interrupt-cells = <2>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 3>;
>> +                     };
>> +
>> +                     pioC: gpio@fffff800 {
>> +                             compatible = "microchip,sam9x7-gpio", "microchip,sam9x60-gpio", "atmel,at91rm9200-gpio";
>> +                             reg = <0xfffff800 0x200>;
>> +                             interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
>> +                             #gpio-cells = <2>;
>> +                             gpio-controller;
>> +                             interrupt-controller;
>> +                             #interrupt-cells = <2>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 4>;
>> +                     };
>> +
>> +                     pioD: gpio@fffffa00 {
>> +                             compatible = "microchip,sam9x7-gpio", "microchip,sam9x60-gpio", "atmel,at91rm9200-gpio";
>> +                             reg = <0xfffffa00 0x200>;
>> +                             interrupts = <44 IRQ_TYPE_LEVEL_HIGH 1>;
>> +                             #gpio-cells = <2>;
>> +                             gpio-controller;
>> +                             #gpio-lines = <22>;
>> +                             interrupt-controller;
>> +                             #interrupt-cells = <2>;
>> +                             clocks = <&pmc PMC_TYPE_PERIPHERAL 44>;
>> +                     };
>> +             };
>> +
>> +             pmc: clock-controller@fffffc00 {
>> +                     compatible = "microchip,sam9x7-pmc", "syscon";
>> +                     reg = <0xfffffc00 0x200>;
>> +                     interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                     #clock-cells = <2>;
>> +                     clocks = <&clk32k 1>, <&clk32k 0>, <&main_xtal>;
>> +                     clock-names = "td_slck", "md_slck", "main_xtal";
>> +             };
>> +
>> +             reset_controller: reset-controller@fffffe00 {
>> +                     compatible = "microchip,sam9x7-rstc", "microchip,sam9x60-rstc";
>> +                     reg = <0xfffffe00 0x10>;
>> +                     clocks = <&clk32k 0>;
>> +             };
>> +
>> +             power_management: power-management@fffffe10 {
> 
> Usually the node name for this is poweroff. Any reason you changed it like
> this?
> 
Yes Claudiu. Based on the comment given for the version 2.

https://patches.linaro.org/project/linux-mmc/patch/20230623203056.689705-44-varshini.rajendran@microchip.com/#:~:text=Usually%20power%2Dmanagement%20or%20reset%2Dcontroller%20or%20something%20like%20this.

>> +                     compatible = "microchip,sam9x7-shdwc", "microchip,sam9x60-shdwc";
>> +                     reg = <0xfffffe10 0x10>;
>> +                     clocks = <&clk32k 0>;
>> +                     #address-cells = <1>;
>> +                     #size-cells = <0>;
>> +                     atmel,wakeup-rtc-timer;
>> +                     atmel,wakeup-rtt-timer;
>> +                     status = "disabled";
>> +             };
>> +
>> +             rtt: rtc@fffffe20 {
>> +                     compatible = "microchip,sam9x7-rtt", "atmel,at91sam9260-rtt";
>> +                     reg = <0xfffffe20 0x20>;
>> +                     interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                     clocks = <&clk32k 0>;
>> +             };
>> +
>> +             clk32k: sckc@fffffe50 {
> 
> Node name should be generic, e.g. clock-controller
> 
>> +                     compatible = "microchip,sam9x7-sckc", "microchip,sam9x60-sckc";
>> +                     reg = <0xfffffe50 0x4>;
>> +                     clocks = <&slow_xtal>;
>> +                     #clock-cells = <1>;
>> +             };
>> +
>> +             gpbr: syscon@fffffe60 {
>> +                     compatible = "microchip,sam9x7-gbpr", "atmel,at91sam9260-gpbr", "syscon";
> 
> microchip,sam9x7-gbpr seems undocummented.

The patch that adds support is already applied.
https://lore.kernel.org/linux-arm-kernel/169226306696.928678.2345448260460546641.b4-ty@kernel.org/
> 
>> +                     reg = <0xfffffe60 0x10>;
>> +             };
>> +
>> +             rtc: rtc@fffffea8 {
>> +                     compatible = "microchip,sam9x7-rtc", "microchip,sam9x60-rtc";
>> +                     reg = <0xfffffea8 0x100>;
>> +                     interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                     clocks = <&clk32k 0>;
>> +             };
>> +
>> +             watchdog: watchdog@ffffff80 {
>> +                     compatible = "microchip,sam9x7-wdt", "microchip,sam9x60-wdt";
>> +                     reg = <0xffffff80 0x24>;
>> +                     interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
>> +                     status = "disabled";
>> +             };
>> +     };
>> +};
> 

-- 
Thanks and Regards,
Varshini Rajendran.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 37/39] ARM: dts: at91: sam9x7: add device tree for SoC
  2024-03-04 16:33     ` Varshini.Rajendran
@ 2024-03-06  8:38       ` claudiu beznea
  0 siblings, 0 replies; 92+ messages in thread
From: claudiu beznea @ 2024-03-06  8:38 UTC (permalink / raw)
  To: Varshini.Rajendran, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	Nicolas.Ferre, devicetree, linux-kernel



On 04.03.2024 18:33, Varshini.Rajendran@microchip.com wrote:
> Hi Claudiu,
> 
> Thanks for your time in reviewing this patch. I will address all your 
> comments in the next version. There are some clarifications provided 
> inline below.
> 
> On 03/03/24 5:54 pm, claudiu beznea wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>
>> On 23.02.2024 19:30, Varshini Rajendran wrote:
>>> Add device tree file for SAM9X7 SoC family.
>>>
>>> Co-developed-by: Nicolas Ferre <nicolas.ferre@microchip.com>
>>> Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
>>> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
>>> ---
>>> Changes in v4:
>>> - Added pwm node support
>>> - Added microchip,nr-irqs to the interrupt-controller node for the
>>>    driver to fetch the NIRQs
>>> - Dropped USB nodes owing to the discussion here
>>>   https://lore.kernel.org/linux-devicetree/CAL_JsqJ9PrX6fj-EbffeJce09MXs=B7t+KS_kOinxaRx38=WxA@mail.gmail.com/
>>> (Explained elaborartely in the cover letter)
>>> ---
>>>   arch/arm/boot/dts/microchip/sam9x7.dtsi | 1214 +++++++++++++++++++++++
>>>   1 file changed, 1214 insertions(+)
>>>   create mode 100644 arch/arm/boot/dts/microchip/sam9x7.dtsi
>>>
>>> diff --git a/arch/arm/boot/dts/microchip/sam9x7.dtsi b/arch/arm/boot/dts/microchip

[ ... ]

>>> +             reset_controller: reset-controller@fffffe00 {
>>> +                     compatible = "microchip,sam9x7-rstc", "microchip,sam9x60-rstc";
>>> +                     reg = <0xfffffe00 0x10>;
>>> +                     clocks = <&clk32k 0>;
>>> +             };
>>> +
>>> +             power_management: power-management@fffffe10 {
>>
>> Usually the node name for this is poweroff. Any reason you changed it like
>> this?
>>
> Yes Claudiu. Based on the comment given for the version 2.

I think poweroff fits better. Documentation is also using poweroff for node
name. The rest of at91 device uses it. And poweroff is what this controller
does (it is named shutdown controller).

> 
> https://patches.linaro.org/project/linux-mmc/patch/20230623203056.689705-44-varshini.rajendran@microchip.com/#:~:text=Usually%20power%2Dmanagement%20or%20reset%2Dcontroller%20or%20something%20like%20this.
> 
>>> +                     compatible = "microchip,sam9x7-shdwc", "microchip,sam9x60-shdwc";
>>> +                     reg = <0xfffffe10 0x10>;
>>> +                     clocks = <&clk32k 0>;
>>> +                     #address-cells = <1>;
>>> +                     #size-cells = <0>;
>>> +                     atmel,wakeup-rtc-timer;
>>> +                     atmel,wakeup-rtt-timer;
>>> +                     status = "disabled";
>>> +             };
>>> +
>>> +             rtt: rtc@fffffe20 {
>>> +                     compatible = "microchip,sam9x7-rtt", "atmel,at91sam9260-rtt";
>>> +                     reg = <0xfffffe20 0x20>;
>>> +                     interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
>>> +                     clocks = <&clk32k 0>;
>>> +             };
>>> +
>>> +             clk32k: sckc@fffffe50 {
>>
>> Node name should be generic, e.g. clock-controller
>>
>>> +                     compatible = "microchip,sam9x7-sckc", "microchip,sam9x60-sckc";
>>> +                     reg = <0xfffffe50 0x4>;
>>> +                     clocks = <&slow_xtal>;
>>> +                     #clock-cells = <1>;
>>> +             };
>>> +
>>> +             gpbr: syscon@fffffe60 {
>>> +                     compatible = "microchip,sam9x7-gbpr", "atmel,at91sam9260-gpbr", "syscon";
>>
>> microchip,sam9x7-gbpr seems undocummented.
> 
> The patch that adds support is already applied.
> https://lore.kernel.org/linux-arm-kernel/169226306696.928678.2345448260460546641.b4-ty@kernel.org/

Ok, then there is a typo in this patch:
s/microchip,sam9x7-gbpr/microchip,sam9x7-gpbr

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 29/39] irqchip/atmel-aic5: Add support to get nirqs from DT for sam9x60 & sam9x7
  2024-03-03 12:21   ` claudiu beznea
@ 2024-03-08  8:50     ` Varshini.Rajendran
  2024-03-08 10:15       ` Conor Dooley
  2024-03-09 13:13       ` claudiu beznea
  0 siblings, 2 replies; 92+ messages in thread
From: Varshini.Rajendran @ 2024-03-08  8:50 UTC (permalink / raw)
  To: claudiu.beznea, robh+dt, krzysztof.kozlowski+dt, conor+dt, tglx,
	Nicolas.Ferre, alexandre.belloni, andre.przywara, mani, shawnguo,
	Durai.ManickamKR, devicetree, linux-kernel, linux-arm-kernel

On 03/03/24 5:51 pm, claudiu beznea wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On 23.02.2024 19:29, Varshini Rajendran wrote:
>> Add support to get number of IRQs from the respective DT node for sam9x60
>> and sam9x7 devices. Since only this factor differs between the two SoCs,
>> this patch adds support for the same. Adapt the sam9x60 dtsi
>> accordingly.
>>
>> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
>> ---
>> Changes in v4:
>> - Changed the implementation to fetch the NIRQs from DT as per the
>>    comment to avoid introducing a new compatible when this is the only
>>    difference between the SoCs related to this IP.
>> ---
>>   arch/arm/boot/dts/microchip/sam9x60.dtsi |  1 +
>>   drivers/irqchip/irq-atmel-aic5.c         | 11 ++++++++---
>>   2 files changed, 9 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/microchip/sam9x60.dtsi b/arch/arm/boot/dts/microchip/sam9x60.dtsi
>> index 73d570a17269..e405f68c9f54 100644
>> --- a/arch/arm/boot/dts/microchip/sam9x60.dtsi
>> +++ b/arch/arm/boot/dts/microchip/sam9x60.dtsi
>> @@ -1201,6 +1201,7 @@ aic: interrupt-controller@fffff100 {
>>                                interrupt-controller;
>>                                reg = <0xfffff100 0x100>;
>>                                atmel,external-irqs = <31>;
>> +                             microchip,nr-irqs = <50>;
>>                        };
>>
>>                        dbgu: serial@fffff200 {
>> diff --git a/drivers/irqchip/irq-atmel-aic5.c b/drivers/irqchip/irq-atmel-aic5.c
>> index 145535bd7560..5d96ad8860d3 100644
>> --- a/drivers/irqchip/irq-atmel-aic5.c
>> +++ b/drivers/irqchip/irq-atmel-aic5.c
>> @@ -398,11 +398,16 @@ static int __init sama5d4_aic5_of_init(struct device_node *node,
>>   }
>>   IRQCHIP_DECLARE(sama5d4_aic5, "atmel,sama5d4-aic", sama5d4_aic5_of_init);
>>
>> -#define NR_SAM9X60_IRQS              50
>> -
>>   static int __init sam9x60_aic5_of_init(struct device_node *node,
>>                                       struct device_node *parent)
>>   {
>> -     return aic5_of_init(node, parent, NR_SAM9X60_IRQS);
>> +     int ret, nr_irqs;
>> +
>> +     ret = of_property_read_u32(node, "microchip,nr-irqs", &nr_irqs);
>> +     if (ret) {
>> +             pr_err("Not found microchip,nr-irqs property\n");
> 
> This breaks the ABI. You should ensure old device trees are still working
> with this patch.

The only older device that uses this API is sam9x60 and the newly added 
sam9x7. This change has been tested to be working fine in both the 
devices. If you still want me to use the macros as a fallback in the 
failure case I can do it. But this change was proposed to avoid adding 
macros in the first place. I can remove the error check just like they 
do while getting other device tree properties. Or if this is just a 
concern of the old devices working with the new change, then sam9x60 
works. Please let me know how to proceed.
> 
>> +             return ret;
>> +     }
>> +     return aic5_of_init(node, parent, nr_irqs);
>>   }
>>   IRQCHIP_DECLARE(sam9x60_aic5, "microchip,sam9x60-aic", sam9x60_aic5_of_init);

-- 
Thanks and Regards,
Varshini Rajendran.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 39/39] ARM: dts: at91: sam9x75_curiosity: add sam9x75 curiosity board
  2024-03-03 12:19   ` claudiu beznea
@ 2024-03-08  9:48     ` Varshini.Rajendran
  0 siblings, 0 replies; 92+ messages in thread
From: Varshini.Rajendran @ 2024-03-08  9:48 UTC (permalink / raw)
  To: claudiu.beznea, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	Nicolas.Ferre, alexandre.belloni, andre.przywara,
	gregory.clement, linus.walleij, baruch, Mihai.Sain, devicetree,
	linux-kernel, linux-arm-kernel

Hi Claudiu,

On 03/03/24 5:49 pm, claudiu beznea wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> s/ARM: dts: at91/ARM: dts: microchip
> 
> in title.
> 
> On 23.02.2024 19:31, Varshini Rajendran wrote:
>> Add device tree file for sam9x75 curiosity board.
>>
>> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
>> ---
>> Changes in v4:
>> - Removed full node paths
>> - Renamed Leds with color names
>> - Corrected regulator node names
>> - Added support for classd and i2s nodes and their corresponding
>>    pinctrl nodes
>> - Dropped USB nodes owing to the discussion here
>> https://lore.kernel.org/linux-devicetree/CAL_JsqJ9PrX6fj-EbffeJce09MXs=B7t+KS_kOinxaRx38=WxA@mail.gmail.com/
>> (Explained elaborately in the cover letter)
>> - Updated the linux,code property with the necessary value
>> ---
>>   arch/arm/boot/dts/microchip/Makefile          |   3 +
>>   .../dts/microchip/at91-sam9x75_curiosity.dts  | 309 ++++++++++++++++++
>>   2 files changed, 312 insertions(+)
>>   create mode 100644 arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts
>>
>> diff --git a/arch/arm/boot/dts/microchip/Makefile b/arch/arm/boot/dts/microchip/Makefile
>> index efde9546c8f4..5b3d518da319 100644
>> --- a/arch/arm/boot/dts/microchip/Makefile
>> +++ b/arch/arm/boot/dts/microchip/Makefile
>> @@ -12,6 +12,7 @@ DTC_FLAGS_at91-sama5d3_eds := -@
>>   DTC_FLAGS_at91-sama5d3_xplained := -@
>>   DTC_FLAGS_at91-sama5d4_xplained := -@
>>   DTC_FLAGS_at91-sama7g5ek := -@
>> +DTC_FLAGS_at91-sam9x75_curiosity := -@
> 
> Keep it alphanumerically sorted, thus after sam9x60 entry.
> 
>>   dtb-$(CONFIG_SOC_AT91RM9200) += \
>>        at91rm9200ek.dtb \
>>        mpa1600.dtb
>> @@ -59,6 +60,8 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \
>>   dtb-$(CONFIG_SOC_SAM9X60) += \
>>        at91-sam9x60_curiosity.dtb \
>>        at91-sam9x60ek.dtb
>> +dtb-$(CONFIG_SOC_SAM9X7) += \
>> +     at91-sam9x75_curiosity.dtb
>>   dtb-$(CONFIG_SOC_SAM_V7) += \
>>        at91-kizbox2-2.dtb \
>>        at91-kizbox3-hs.dtb \
>> diff --git a/arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts b/arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts
>> new file mode 100644
>> index 000000000000..be37022d3d05
>> --- /dev/null
>> +++ b/arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts
>> @@ -0,0 +1,309 @@
>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>> +/*
>> + * at91-sam9x75_curiosity.dts - Device Tree file for Microchip SAM9X75 Curiosity board
>> + *
>> + * Copyright (C) 2023 Microchip Technology Inc. and its subsidiaries
>> + *
>> + * Author: Varshini Rajendran <varshini.rajendran@microchip.com>
>> + */
>> +/dts-v1/;
>> +#include "sam9x7.dtsi"
>> +#include <dt-bindings/input/input.h>
>> +
>> +/ {
>> +     model = "Microchip SAM9X75 Curiosity";
>> +     compatible = "microchip,sam9x75-curiosity", "microchip,sam9x7", "atmel,at91sam9";
>> +
>> +     aliases {
>> +             i2c0 = &i2c6;
>> +     };
>> +
>> +     chosen {
>> +             stdout-path = "serial0:115200n8";
>> +     };
>> +
>> +     gpio-keys {
>> +             compatible = "gpio-keys";
>> +             pinctrl-names = "default";
>> +             pinctrl-0 = <&pinctrl_key_gpio_default>;
>> +
>> +             button-user {
>> +                     label = "USER";
>> +                     gpios = <&pioC 9 GPIO_ACTIVE_LOW>;
>> +                     linux,code = <KEY_0>;
>> +                     wakeup-source;
>> +             };
>> +     };
>> +
>> +     leds {
>> +             compatible = "gpio-leds";
>> +             pinctrl-names = "default";
>> +             pinctrl-0 = <&pinctrl_led_gpio_default>;
>> +
>> +             led-red {
>> +                     label = "red";
>> +                     gpios = <&pioC 19 GPIO_ACTIVE_HIGH>;
>> +             };
>> +
>> +             led-green {
>> +                     label = "green";
>> +                     gpios = <&pioC 21 GPIO_ACTIVE_HIGH>;
>> +             };
>> +
>> +             led-blue {
>> +                     label = "blue";
>> +                     gpios = <&pioC 20 GPIO_ACTIVE_HIGH>;
>> +                     linux,default-trigger = "heartbeat";
>> +             };
>> +     };
>> +
>> +     memory@20000000 {
>> +             device_type = "memory";
>> +             reg = <0x20000000 0x10000000>;
>> +     };
>> +};
>> +
>> +&classd {
>> +     pinctrl-names = "default";
>> +     pinctrl-0 = <&pinctrl_classd>;
>> +     atmel,pwm-type = "diff";
>> +     atmel,non-overlap-time = <10>;
>> +     status = "okay";
>> +};
>> +
>> +&dbgu {
>> +     pinctrl-names = "default";
>> +     pinctrl-0 = <&pinctrl_dbgu>;
>> +     status = "okay";
>> +};
>> +
>> +&dma0 {
>> +     status = "okay";
>> +};
>> +
>> +&flx6 {
>> +     atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
>> +     status = "okay";
>> +};
>> +
>> +&i2c6 {
> 
> I don't know if you got any review comments w/ regards to this in the
> previous email but having flexcoms and inner node grouped together is
> easier to follow (at least to me). e.g.:
> 
Yes, I received a comment not to duplicate nodes. 
https://patchwork.kernel.org/project/linux-mmc/patch/20230623203056.689705-46-varshini.rajendran@microchip.com/

>> +     #address-cells = <1>;
>> +     #size-cells = <0>;
>> +     pinctrl-names = "default";
>> +     pinctrl-0 = <&pinctrl_flx6_default>;
>> +     i2c-analog-filter;
>> +     i2c-digital-filter;
>> +     i2c-digital-filter-width-ns = <35>;
>> +     status = "okay";
>> +
>> +     pmic@5b {
>> +             compatible = "microchip,mcp16502";
>> +             reg = <0x5b>;
>> +
>> +             regulators {
>> +                     vdd_3v3: VDD_IO {
>> +                             regulator-name = "VDD_IO";
>> +                             regulator-min-microvolt = <3000000>;
>> +                             regulator-max-microvolt = <3600000>;
> 
> I can't find the schematics for this but these values here should reflect
> the voltage that the board support not the ones that the PMIC itself
> supports. Valid for all the other regulators.
> 
Okay. I will double check this with hardware experts as well.
> 
>> +                             regulator-initial-mode = <2>;
>> +                             regulator-allowed-modes = <2>, <4>;
>> +                             regulator-always-on;
>> +
>> +                             regulator-state-standby {
>> +                                     regulator-on-in-suspend;
>> +                                     regulator-mode = <4>;
>> +                             };
>> +
>> +                             regulator-state-mem {
>> +                                     regulator-mode = <4>;
>> +                             };
>> +                     };
>> +
>> +                     vddioddr: VDD_DDR {
>> +                             regulator-name = "VDD_DDR";
>> +                             regulator-min-microvolt = <1283000>;
>> +                             regulator-max-microvolt = <1450000>;
>> +                             regulator-initial-mode = <2>;
>> +                             regulator-allowed-modes = <2>, <4>;
>> +                             regulator-always-on;
>> +
>> +                             regulator-state-standby {
>> +                                     regulator-on-in-suspend;
>> +                                     regulator-mode = <4>;
>> +                             };
>> +
>> +                             regulator-state-mem {
>> +                                     regulator-on-in-suspend;
>> +                                     regulator-mode = <4>;
>> +                             };
>> +                     };
>> +
>> +                     vddcore: VDD_CORE {
>> +                             regulator-name = "VDD_CORE";
>> +                             regulator-min-microvolt = <500000>;
>> +                             regulator-max-microvolt = <1210000>;
>> +                             regulator-initial-mode = <2>;
>> +                             regulator-allowed-modes = <2>, <4>;
>> +                             regulator-always-on;
>> +
>> +                             regulator-state-standby {
>> +                                     regulator-on-in-suspend;
>> +                                     regulator-mode = <4>;
>> +                             };
>> +
>> +                             regulator-state-mem {
>> +                                     regulator-mode = <4>;
>> +                             };
>> +                     };
>> +
>> +                     vddcpu: VDD_OTHER {
>> +                             regulator-name = "VDD_OTHER";
>> +                             regulator-min-microvolt = <1700000>;
>> +                             regulator-max-microvolt = <3600000>;
>> +                             regulator-initial-mode = <2>;
>> +                             regulator-allowed-modes = <2>, <4>;
>> +                             regulator-ramp-delay = <3125>;
>> +                             regulator-always-on;
>> +
>> +                             regulator-state-standby {
>> +                                     regulator-on-in-suspend;
>> +                                     regulator-mode = <4>;
>> +                             };
>> +
>> +                             regulator-state-mem {
>> +                                     regulator-mode = <4>;
>> +                             };
>> +                     };
>> +
>> +                     vldo1: LDO1 {
>> +                             regulator-name = "LDO1";
>> +                             regulator-min-microvolt = <1200000>;
>> +                             regulator-max-microvolt = <3700000>;
>> +                             regulator-always-on;
>> +
>> +                             regulator-state-standby {
>> +                                     regulator-on-in-suspend;
>> +                             };
>> +                     };
>> +
>> +                     vldo2: LDO2 {
>> +                             regulator-name = "LDO2";
>> +                             regulator-min-microvolt = <1200000>;
>> +                             regulator-max-microvolt = <3700000>;
>> +
>> +                             regulator-state-standby {
>> +                                     regulator-on-in-suspend;
>> +                             };
>> +                     };
>> +             };
>> +     };
>> +};
>> +
>> +&i2s {
>> +     pinctrl-names = "default";
>> +     pinctrl-0 = <&pinctrl_i2s_default>;
>> +     #sound-dai-cells = <0>;
>> +     status = "disabled";
> 
> Any reason this is disabled?
There is a conflict. My bad, I missed mentioning it since the other node 
support is not added yet. I will add it in the next version.
> 
>> +};
>> +
>> +&main_xtal {
>> +     clock-frequency = <24000000>;
>> +};
>> +
>> +&pinctrl {
>> +
> 
> This line could be removed.
> 
>> +     classd {
>> +             pinctrl_classd: classd {
>> +                     atmel,pins =
>> +                             <AT91_PIOA 18 AT91_PERIPH_C AT91_PINCTRL_PULL_UP
> 
> Try to be compliant with coding style from here (valid everywhere):
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/dts-coding-style.rst#n167
> 
>> +                              AT91_PIOA 19 AT91_PERIPH_C AT91_PINCTRL_PULL_DOWN>;
>> +             };
>> +     };
>> +
>> +     dbgu {
>> +             pinctrl_dbgu: dbgu-0 {
> 
> usually pinctrl label is something like the following in Microchip AT91 DTSes:
> pinctrl_<ip-name>_default and node name is <ip-name>-default.
> 
> Please use the same rule everywhere.
> 
>> +                     atmel,pins = <AT91_PIOA 26 AT91_PERIPH_A AT91_PINCTRL_PULL_UP
>> +                                   AT91_PIOA 27 AT91_PERIPH_A AT91_PINCTRL_NONE>;
>> +             };
>> +     };
>> +
>> +     flexcom {
>> +             pinctrl_flx6_default: flx6-twi {
>> +                     atmel,pins =
>> +                             <AT91_PIOA 24 AT91_PERIPH_A AT91_PINCTRL_PULL_UP
>> +                              AT91_PIOA 25 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
>> +             };
>> +     };
>> +
>> +     gpio-keys {
>> +             pinctrl_key_gpio_default: key-gpio-default {
>> +                     atmel,pins = <AT91_PIOC 9 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
>> +             };
>> +     };
>> +
>> +     i2s {
>> +             pinctrl_i2s_default: i2s {
>> +                     atmel,pins =
>> +                             <AT91_PIOB 26 AT91_PERIPH_D AT91_PINCTRL_NONE           /* I2SCK */
>> +                              AT91_PIOB 15 AT91_PERIPH_D AT91_PINCTRL_NONE           /* I2SWS */
>> +                              AT91_PIOB 16 AT91_PERIPH_D AT91_PINCTRL_NONE           /* I2SDIN */
>> +                              AT91_PIOB 17 AT91_PERIPH_D AT91_PINCTRL_NONE           /* I2SDOUT */
>> +                              AT91_PIOB 25 AT91_PERIPH_D AT91_PINCTRL_NONE>;         /* I2SMCK */
>> +             };
>> +     };
>> +
>> +     leds {
>> +             pinctrl_led_gpio_default: led-gpio-default {
>> +                     atmel,pins = <AT91_PIOC 19 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
>> +                                   AT91_PIOC 21 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
>> +                                   AT91_PIOC 20 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
>> +             };
>> +     };
>> +
>> +     sdmmc0 {
>> +             pinctrl_sdmmc0_default: sdmmc0 {
>> +                     atmel,pins =
>> +                             <AT91_PIOA 2 AT91_PERIPH_A (AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)                                 /* PA2 CK  periph A with pullup */
>> +                              AT91_PIOA 1 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)          /* PA1 CMD periph A with pullup */
>> +                              AT91_PIOA 0 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)          /* PA0 DAT0 periph A */
>> +                              AT91_PIOA 3 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)          /* PA3 DAT1 periph A with pullup */
>> +                              AT91_PIOA 4 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)          /* PA4 DAT2 periph A with pullup */
>> +                              AT91_PIOA 5 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_DIS)>;        /* PA5 DAT3 periph A with pullup */
>> +             };
>> +     };
>> +
> 
> You can remove this line
> 
>> +}; /* pinctrl */
>> +
>> +&rtt {
>> +     atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
>> +};
>> +
>> +&sdmmc0 {
>> +     bus-width = <4>;
>> +     pinctrl-names = "default";
>> +     pinctrl-0 = <&pinctrl_sdmmc0_default>;
>> +     cd-gpios = <&pioA 23 GPIO_ACTIVE_LOW>;
>> +     disable-wp;
>> +     status = "okay";
>> +};
>> +
>> +&slow_xtal {
>> +     clock-frequency = <32768>;
>> +};
>> +
>> +&power_management {
>> +     debounce-delay-us = <976>;
>> +     status = "okay";
>> +
>> +     input@0 {
>> +             reg = <0>;
>> +     };
>> +};
>> +
>> +&trng {
>> +     status = "okay";
>> +};
>> +
>> +&watchdog {
>> +     status = "okay";
>> +};

-- 
Thanks and Regards,
Varshini Rajendran.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 29/39] irqchip/atmel-aic5: Add support to get nirqs from DT for sam9x60 & sam9x7
  2024-03-08  8:50     ` Varshini.Rajendran
@ 2024-03-08 10:15       ` Conor Dooley
  2024-03-09 13:13       ` claudiu beznea
  1 sibling, 0 replies; 92+ messages in thread
From: Conor Dooley @ 2024-03-08 10:15 UTC (permalink / raw)
  To: Varshini.Rajendran
  Cc: claudiu.beznea, robh+dt, krzysztof.kozlowski+dt, conor+dt, tglx,
	Nicolas.Ferre, alexandre.belloni, andre.przywara, mani, shawnguo,
	Durai.ManickamKR, devicetree, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 4399 bytes --]

On Fri, Mar 08, 2024 at 08:50:43AM +0000, Varshini.Rajendran@microchip.com wrote:
> On 03/03/24 5:51 pm, claudiu beznea wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> > 
> > On 23.02.2024 19:29, Varshini Rajendran wrote:
> >> Add support to get number of IRQs from the respective DT node for sam9x60
> >> and sam9x7 devices. Since only this factor differs between the two SoCs,
> >> this patch adds support for the same. Adapt the sam9x60 dtsi
> >> accordingly.
> >>
> >> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> >> ---
> >> Changes in v4:
> >> - Changed the implementation to fetch the NIRQs from DT as per the
> >>    comment to avoid introducing a new compatible when this is the only
> >>    difference between the SoCs related to this IP.
> >> ---
> >>   arch/arm/boot/dts/microchip/sam9x60.dtsi |  1 +
> >>   drivers/irqchip/irq-atmel-aic5.c         | 11 ++++++++---

Driver and binding changes should be in different patches. Having them
in the same patch is usually a red flag for ABI breakage.

> >>   2 files changed, 9 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/arch/arm/boot/dts/microchip/sam9x60.dtsi b/arch/arm/boot/dts/microchip/sam9x60.dtsi
> >> index 73d570a17269..e405f68c9f54 100644
> >> --- a/arch/arm/boot/dts/microchip/sam9x60.dtsi
> >> +++ b/arch/arm/boot/dts/microchip/sam9x60.dtsi
> >> @@ -1201,6 +1201,7 @@ aic: interrupt-controller@fffff100 {
> >>                                interrupt-controller;
> >>                                reg = <0xfffff100 0x100>;
> >>                                atmel,external-irqs = <31>;
> >> +                             microchip,nr-irqs = <50>;
> >>                        };
> >>
> >>                        dbgu: serial@fffff200 {
> >> diff --git a/drivers/irqchip/irq-atmel-aic5.c b/drivers/irqchip/irq-atmel-aic5.c
> >> index 145535bd7560..5d96ad8860d3 100644
> >> --- a/drivers/irqchip/irq-atmel-aic5.c
> >> +++ b/drivers/irqchip/irq-atmel-aic5.c
> >> @@ -398,11 +398,16 @@ static int __init sama5d4_aic5_of_init(struct device_node *node,
> >>   }
> >>   IRQCHIP_DECLARE(sama5d4_aic5, "atmel,sama5d4-aic", sama5d4_aic5_of_init);
> >>
> >> -#define NR_SAM9X60_IRQS              50
> >> -
> >>   static int __init sam9x60_aic5_of_init(struct device_node *node,
> >>                                       struct device_node *parent)
> >>   {
> >> -     return aic5_of_init(node, parent, NR_SAM9X60_IRQS);
> >> +     int ret, nr_irqs;
> >> +
> >> +     ret = of_property_read_u32(node, "microchip,nr-irqs", &nr_irqs);
> >> +     if (ret) {
> >> +             pr_err("Not found microchip,nr-irqs property\n");
> > 
> > This breaks the ABI. You should ensure old device trees are still working
> > with this patch.
> 
> The only older device that uses this API is sam9x60 and the newly added 
> sam9x7. This change has been tested to be working fine in both the 
> devices.

Does it still work for a sam9x60 that does not have "microchip,nr-irqs"?
I can't see how it would, because you remove the define and return an
error. That's a pretty clear ABI breakage to me and I don't think it is
justified.

> If you still want me to use the macros as a fallback in the 
> failure case I can do it. But this change was proposed to avoid adding 
> macros in the first place. I can remove the error check just like they 
> do while getting other device tree properties. Or if this is just a 
> concern of the old devices working with the new change, then sam9x60 
> works. Please let me know how to proceed.

I just noticed that this property is not documented in a binding. The
first thing you would will be asked when trying to add that is "why can
this not be determined based on the compatible", which means back to
having a define in the driver.
That said, having specific $soc_aic5_of_init() functions for each SoC
seems silly when usually only the number of interrupts changes. The
number of IRQs could be in the match data and you could use
aic5_of_init in your IRQCHIP_DECLARE directly.

> >> +             return ret;
> >> +     }
> >> +     return aic5_of_init(node, parent, nr_irqs);
> >>   }
> >>   IRQCHIP_DECLARE(sam9x60_aic5, "microchip,sam9x60-aic", sam9x60_aic5_of_init);
> 
> -- 
> Thanks and Regards,
> Varshini Rajendran.
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 29/39] irqchip/atmel-aic5: Add support to get nirqs from DT for sam9x60 & sam9x7
  2024-03-08  8:50     ` Varshini.Rajendran
  2024-03-08 10:15       ` Conor Dooley
@ 2024-03-09 13:13       ` claudiu beznea
  1 sibling, 0 replies; 92+ messages in thread
From: claudiu beznea @ 2024-03-09 13:13 UTC (permalink / raw)
  To: Varshini.Rajendran, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	tglx, Nicolas.Ferre, alexandre.belloni, andre.przywara, mani,
	shawnguo, Durai.ManickamKR, devicetree, linux-kernel,
	linux-arm-kernel



On 08.03.2024 10:50, Varshini.Rajendran@microchip.com wrote:
> On 03/03/24 5:51 pm, claudiu beznea wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>
>> On 23.02.2024 19:29, Varshini Rajendran wrote:
>>> Add support to get number of IRQs from the respective DT node for sam9x60
>>> and sam9x7 devices. Since only this factor differs between the two SoCs,
>>> this patch adds support for the same. Adapt the sam9x60 dtsi
>>> accordingly.
>>>
>>> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
>>> ---
>>> Changes in v4:
>>> - Changed the implementation to fetch the NIRQs from DT as per the
>>>    comment to avoid introducing a new compatible when this is the only
>>>    difference between the SoCs related to this IP.
>>> ---
>>>   arch/arm/boot/dts/microchip/sam9x60.dtsi |  1 +
>>>   drivers/irqchip/irq-atmel-aic5.c         | 11 ++++++++---
>>>   2 files changed, 9 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/arch/arm/boot/dts/microchip/sam9x60.dtsi b/arch/arm/boot/dts/microchip/sam9x60.dtsi
>>> index 73d570a17269..e405f68c9f54 100644
>>> --- a/arch/arm/boot/dts/microchip/sam9x60.dtsi
>>> +++ b/arch/arm/boot/dts/microchip/sam9x60.dtsi
>>> @@ -1201,6 +1201,7 @@ aic: interrupt-controller@fffff100 {
>>>                                interrupt-controller;
>>>                                reg = <0xfffff100 0x100>;
>>>                                atmel,external-irqs = <31>;
>>> +                             microchip,nr-irqs = <50>;
>>>                        };
>>>
>>>                        dbgu: serial@fffff200 {
>>> diff --git a/drivers/irqchip/irq-atmel-aic5.c b/drivers/irqchip/irq-atmel-aic5.c
>>> index 145535bd7560..5d96ad8860d3 100644
>>> --- a/drivers/irqchip/irq-atmel-aic5.c
>>> +++ b/drivers/irqchip/irq-atmel-aic5.c
>>> @@ -398,11 +398,16 @@ static int __init sama5d4_aic5_of_init(struct device_node *node,
>>>   }
>>>   IRQCHIP_DECLARE(sama5d4_aic5, "atmel,sama5d4-aic", sama5d4_aic5_of_init);
>>>
>>> -#define NR_SAM9X60_IRQS              50
>>> -
>>>   static int __init sam9x60_aic5_of_init(struct device_node *node,
>>>                                       struct device_node *parent)
>>>   {
>>> -     return aic5_of_init(node, parent, NR_SAM9X60_IRQS);
>>> +     int ret, nr_irqs;
>>> +
>>> +     ret = of_property_read_u32(node, "microchip,nr-irqs", &nr_irqs);
>>> +     if (ret) {
>>> +             pr_err("Not found microchip,nr-irqs property\n");
>>
>> This breaks the ABI. You should ensure old device trees are still working
>> with this patch.
> 
> The only older device that uses this API is sam9x60 and the newly added 
> sam9x7. This change has been tested to be working fine in both the 
> devices.

As Conor explained, the code in this patch should work with device trees
from previous kernel releases (thus not having microchip,nr-irqs DT binding).

> If you still want me to use the macros as a fallback in the 
> failure case I can do it. But this change was proposed to avoid adding 
> macros in the first place. I can remove the error check just like they 
> do while getting other device tree properties. Or if this is just a 
> concern of the old devices working with the new change, then sam9x60 
> works. Please let me know how to proceed.
>>
>>> +             return ret;
>>> +     }
>>> +     return aic5_of_init(node, parent, nr_irqs);
>>>   }
>>>   IRQCHIP_DECLARE(sam9x60_aic5, "microchip,sam9x60-aic", sam9x60_aic5_of_init);
> 

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 21/39] dt-bindings: clk: at91: add sam9x7
  2024-02-23 17:27 ` [PATCH v4 21/39] dt-bindings: clk: at91: add sam9x7 Varshini Rajendran
  2024-02-24 20:05   ` Conor Dooley
@ 2024-03-11  5:32   ` claudiu beznea
  1 sibling, 0 replies; 92+ messages in thread
From: claudiu beznea @ 2024-03-11  5:32 UTC (permalink / raw)
  To: Varshini Rajendran, mturquette, sboyd, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, linux-clk, devicetree, linux-arm-kernel,
	linux-kernel

s/dt-bindings: clk: at91/dt-bindings: clocks: at91sam9x5-sckc

or

s/dt-bindings: clk: at91/dt-bindings: clocks:  atmel,at91sam9x5-sckc

in patch title

On 23.02.2024 19:27, Varshini Rajendran wrote:
> Add bindings for SAM9X7's slow clock controller.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> ---
> Changes in v4:
> - Added sam9x7 compatible as an enum with sama7g5 compatible as per the
>   review comment
> ---
>  .../devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml      | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml b/Documentation/devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml
> index 7be29877e6d2..ab81f0b55ad5 100644
> --- a/Documentation/devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml
> +++ b/Documentation/devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml
> @@ -18,7 +18,9 @@ properties:
>            - atmel,sama5d4-sckc
>            - microchip,sam9x60-sckc
>        - items:
> -          - const: microchip,sama7g5-sckc
> +          - enum:
> +              - microchip,sama7g5-sckc
> +              - microchip,sam9x7-sckc

Alphanumerically sorted?

>            - const: microchip,sam9x60-sckc
>  
>    reg:

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 22/39] dt-bindings: clk: at91: add sam9x7 clock controller
  2024-02-23 17:27 ` [PATCH v4 22/39] dt-bindings: clk: at91: add sam9x7 clock controller Varshini Rajendran
  2024-02-24 20:06   ` Conor Dooley
@ 2024-03-11  5:33   ` claudiu beznea
  1 sibling, 0 replies; 92+ messages in thread
From: claudiu beznea @ 2024-03-11  5:33 UTC (permalink / raw)
  To: Varshini Rajendran, mturquette, sboyd, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, linux-clk, devicetree, linux-arm-kernel,
	linux-kernel

s/dt-bindings: clocks: at91/dt-bindings: clocks: atmel,at91rm9200-pmc

in patch title.

On 23.02.2024 19:27, Varshini Rajendran wrote:
> Add bindings for SAM9X7's pmc.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> ---
> Changes in v4:
> - Added the sam9x7 compatible in the allOf section
> ---
>  .../devicetree/bindings/clock/atmel,at91rm9200-pmc.yaml         | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/clock/atmel,at91rm9200-pmc.yaml b/Documentation/devicetree/bindings/clock/atmel,at91rm9200-pmc.yaml
> index c1bdcd9058ed..eb5cd33ea9aa 100644
> --- a/Documentation/devicetree/bindings/clock/atmel,at91rm9200-pmc.yaml
> +++ b/Documentation/devicetree/bindings/clock/atmel,at91rm9200-pmc.yaml
> @@ -43,6 +43,7 @@ properties:
>                - atmel,sama5d4-pmc
>                - microchip,sam9x60-pmc
>                - microchip,sama7g5-pmc
> +              - microchip,sam9x7-pmc

These used to be alphanumerically sorted

>            - const: syscon
>  
>    reg:
> @@ -89,6 +90,7 @@ allOf:
>              enum:
>                - microchip,sam9x60-pmc
>                - microchip,sama7g5-pmc
> +              - microchip,sam9x7-pmc

Same here.

>      then:
>        properties:
>          clocks:

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 24/39] clk: at91: sam9x7: add support for HW PLL freq dividers
  2024-02-23 17:27 ` [PATCH v4 24/39] clk: at91: sam9x7: add support for HW PLL freq dividers Varshini Rajendran
@ 2024-03-11  5:34   ` claudiu beznea
  0 siblings, 0 replies; 92+ messages in thread
From: claudiu beznea @ 2024-03-11  5:34 UTC (permalink / raw)
  To: Varshini Rajendran, mturquette, sboyd, nicolas.ferre,
	alexandre.belloni, mripard, linux-clk, linux-arm-kernel,
	linux-kernel



On 23.02.2024 19:27, Varshini Rajendran wrote:
> Add support for hardware dividers for PLL IDs in sam9x7 SoC. The system
> PLL - PLLA and the system PLL divided by 2 - PLLADIV2 with PLL ID 0 and
> 4 respectively, both have a hardware divider /2. This has to taken into

to be taken

> account in the software to obtain the right frequencies. Support for the
> same is added in the PLL driver.
> 
> fcorepllack -----> HW Div = 2 -+--> fpllack
>                                |
>                                +--> HW Div = 2 ---> fplladiv2ck
> 
> In this case the corepll freq is 1600 MHz. So, the plla freq is 800 MHz
> after the hardware divider and the plladiv2 freq is 400 MHz after the
> hardware divider (Given that the DIVPMC is 0).

s/Given/given

> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> ---
>  drivers/clk/at91/clk-sam9x60-pll.c | 38 ++++++++++++++++++++++++++----
>  drivers/clk/at91/pmc.h             |  1 +
>  2 files changed, 34 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/clk/at91/clk-sam9x60-pll.c b/drivers/clk/at91/clk-sam9x60-pll.c
> index b0314dfd7393..1f80759309c0 100644
> --- a/drivers/clk/at91/clk-sam9x60-pll.c
> +++ b/drivers/clk/at91/clk-sam9x60-pll.c
> @@ -73,9 +73,15 @@ static unsigned long sam9x60_frac_pll_recalc_rate(struct clk_hw *hw,
>  {
>  	struct sam9x60_pll_core *core = to_sam9x60_pll_core(hw);
>  	struct sam9x60_frac *frac = to_sam9x60_frac(core);
> +	unsigned long freq;
>  
> -	return parent_rate * (frac->mul + 1) +
> +	freq = parent_rate * (frac->mul + 1) +
>  		DIV_ROUND_CLOSEST_ULL((u64)parent_rate * frac->frac, (1 << 22));
> +
> +	if (core->layout->div2)
> +		freq >>= 1;
> +
> +	return freq;
>  }
>  
>  static int sam9x60_frac_pll_set(struct sam9x60_pll_core *core)
> @@ -432,6 +438,12 @@ static unsigned long sam9x60_div_pll_recalc_rate(struct clk_hw *hw,
>  	return DIV_ROUND_CLOSEST_ULL(parent_rate, (div->div + 1));
>  }
>  
> +static unsigned long sam9x60_fixed_div_pll_recalc_rate(struct clk_hw *hw,
> +						       unsigned long parent_rate)
> +{
> +	return parent_rate >> 1;
> +}
> +
>  static long sam9x60_div_pll_compute_div(struct sam9x60_pll_core *core,
>  					unsigned long *parent_rate,
>  					unsigned long rate)
> @@ -606,6 +618,16 @@ static const struct clk_ops sam9x60_div_pll_ops_chg = {
>  	.restore_context = sam9x60_div_pll_restore_context,
>  };
>  
> +static const struct clk_ops sam9x60_fixed_div_pll_ops = {
> +	.prepare = sam9x60_div_pll_prepare,
> +	.unprepare = sam9x60_div_pll_unprepare,
> +	.is_prepared = sam9x60_div_pll_is_prepared,
> +	.recalc_rate = sam9x60_fixed_div_pll_recalc_rate,
> +	.round_rate = sam9x60_div_pll_round_rate,
> +	.save_context = sam9x60_div_pll_save_context,
> +	.restore_context = sam9x60_div_pll_restore_context,
> +};
> +
>  struct clk_hw * __init
>  sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock,
>  			      const char *name, const char *parent_name,
> @@ -725,10 +747,16 @@ sam9x60_clk_register_div_pll(struct regmap *regmap, spinlock_t *lock,
>  	else
>  		init.parent_names = &parent_name;
>  	init.num_parents = 1;
> -	if (flags & CLK_SET_RATE_GATE)
> -		init.ops = &sam9x60_div_pll_ops;
> -	else
> -		init.ops = &sam9x60_div_pll_ops_chg;
> +
> +	if (layout->div2) {
> +		init.ops = &sam9x60_fixed_div_pll_ops;
> +	} else {
> +		if (flags & CLK_SET_RATE_GATE)
> +			init.ops = &sam9x60_div_pll_ops;
> +		else
> +			init.ops = &sam9x60_div_pll_ops_chg;
> +	}
> +

can't it be something like:

	if (layout->div2)
		// ...
	else if (flags & CLK_SET_RATE_GATE)
		// ...
	else
		//

?
>  	init.flags = flags;
>  
>  	div->core.id = id;
> diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h
> index bb9da35198d9..91d1c6305d95 100644
> --- a/drivers/clk/at91/pmc.h
> +++ b/drivers/clk/at91/pmc.h
> @@ -64,6 +64,7 @@ struct clk_pll_layout {
>  	u8 frac_shift;
>  	u8 div_shift;
>  	u8 endiv_shift;
> +	u8 div2;
>  };
>  
>  extern const struct clk_pll_layout at91rm9200_pll_layout;

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 27/39] clk: at91: sam9x7: add sam9x7 pmc driver
  2024-02-23 17:28 ` [PATCH v4 27/39] clk: at91: sam9x7: add sam9x7 pmc driver Varshini Rajendran
@ 2024-03-11  5:58   ` claudiu beznea
  2024-03-18  9:25     ` Varshini.Rajendran
  0 siblings, 1 reply; 92+ messages in thread
From: claudiu beznea @ 2024-03-11  5:58 UTC (permalink / raw)
  To: Varshini Rajendran, mturquette, sboyd, nicolas.ferre,
	alexandre.belloni, linux-kernel, linux-clk, linux-arm-kernel



On 23.02.2024 19:28, Varshini Rajendran wrote:
> Add a driver for the PMC clocks of sam9x7 Soc family.
> 
> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
> ---
> Changes in v4:
> - Changed variable name alloc_mem to clk_mux_buffer to be more
>   suggestive
> - Changed description of @f structure member appropriately
> ---
>  drivers/clk/at91/Makefile |   1 +
>  drivers/clk/at91/sam9x7.c | 946 ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 947 insertions(+)
>  create mode 100644 drivers/clk/at91/sam9x7.c
> 
> diff --git a/drivers/clk/at91/Makefile b/drivers/clk/at91/Makefile
> index 89061b85e7d2..8e3684ba2c74 100644
> --- a/drivers/clk/at91/Makefile
> +++ b/drivers/clk/at91/Makefile
> @@ -20,6 +20,7 @@ obj-$(CONFIG_SOC_AT91SAM9) += at91sam9260.o at91sam9rl.o at91sam9x5.o dt-compat.
>  obj-$(CONFIG_SOC_AT91SAM9) += at91sam9g45.o dt-compat.o
>  obj-$(CONFIG_SOC_AT91SAM9) += at91sam9n12.o at91sam9x5.o dt-compat.o
>  obj-$(CONFIG_SOC_SAM9X60) += sam9x60.o
> +obj-$(CONFIG_SOC_SAM9X7) += sam9x7.o
>  obj-$(CONFIG_SOC_SAMA5D3) += sama5d3.o dt-compat.o
>  obj-$(CONFIG_SOC_SAMA5D4) += sama5d4.o dt-compat.o
>  obj-$(CONFIG_SOC_SAMA5D2) += sama5d2.o dt-compat.o
> diff --git a/drivers/clk/at91/sam9x7.c b/drivers/clk/at91/sam9x7.c
> new file mode 100644
> index 000000000000..d03387d2e35a
> --- /dev/null
> +++ b/drivers/clk/at91/sam9x7.c
> @@ -0,0 +1,946 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * SAM9X7 PMC code.
> + *
> + * Copyright (C) 2023 Microchip Technology Inc. and its subsidiaries
> + *
> + * Author: Varshini Rajendran <varshini.rajendran@microchip.com>
> + *
> + */
> +#include <linux/clk.h>
> +#include <linux/clk-provider.h>
> +#include <linux/mfd/syscon.h>
> +#include <linux/slab.h>
> +
> +#include <dt-bindings/clock/at91.h>
> +
> +#include "pmc.h"
> +
> +static DEFINE_SPINLOCK(pmc_pll_lock);
> +static DEFINE_SPINLOCK(mck_lock);
> +
> +/**
> + * enum pll_ids - PLL clocks identifiers
> + * @PLL_ID_PLLA:	PLLA identifier
> + * @PLL_ID_UPLL:	UPLL identifier
> + * @PLL_ID_AUDIO:	Audio PLL identifier
> + * @PLL_ID_LVDS:	LVDS PLL identifier
> + * @PLL_ID_PLLA_DIV2:	PLLA DIV2 identifier
> + * @PLL_ID_MAX:		Max PLL Identifier
> + */
> +enum pll_ids {
> +	PLL_ID_PLLA,
> +	PLL_ID_UPLL,
> +	PLL_ID_AUDIO,
> +	PLL_ID_LVDS,
> +	PLL_ID_PLLA_DIV2,
> +	PLL_ID_MAX,
> +};
> +
> +/**
> + * enum pll_type - PLL type identifiers
> + * @PLL_TYPE_FRAC:	fractional PLL identifier
> + * @PLL_TYPE_DIV:	divider PLL identifier
> + */
> +enum pll_type {
> +	PLL_TYPE_FRAC,
> +	PLL_TYPE_DIV,
> +};
> +
> +static const struct clk_master_characteristics mck_characteristics = {
> +	.output = { .min = 32000000, .max = 266666667 },
> +	.divisors = { 1, 2, 4, 3, 5},
> +	.have_div3_pres = 1,
> +};
> +
> +static const struct clk_master_layout sam9x7_master_layout = {
> +	.mask = 0x373,
> +	.pres_shift = 4,
> +	.offset = 0x28,
> +};
> +
> +/* Fractional PLL core output range. */
> +static const struct clk_range plla_core_outputs[] = {
> +	{ .min = 375000000, .max = 1600000000 },
> +};
> +
> +static const struct clk_range upll_core_outputs[] = {
> +	{ .min = 600000000, .max = 1200000000 },
> +};
> +
> +static const struct clk_range lvdspll_core_outputs[] = {
> +	{ .min = 400000000, .max = 800000000 },
> +};
> +
> +static const struct clk_range audiopll_core_outputs[] = {
> +	{ .min = 400000000, .max = 800000000 },
> +};
> +
> +static const struct clk_range plladiv2_core_outputs[] = {
> +	{ .min = 375000000, .max = 1600000000 },
> +};
> +
> +/* Fractional PLL output range. */
> +static const struct clk_range plla_outputs[] = {
> +	{ .min = 732421, .max = 800000000 },
> +};
> +
> +static const struct clk_range upll_outputs[] = {
> +	{ .min = 300000000, .max = 600000000 },
> +};
> +
> +static const struct clk_range lvdspll_outputs[] = {
> +	{ .min = 10000000, .max = 800000000 },
> +};
> +
> +static const struct clk_range audiopll_outputs[] = {
> +	{ .min = 10000000, .max = 800000000 },
> +};
> +
> +static const struct clk_range plladiv2_outputs[] = {
> +	{ .min = 366210, .max = 400000000 },
> +};
> +
> +/* PLL characteristics. */
> +static const struct clk_pll_characteristics plla_characteristics = {
> +	.input = { .min = 20000000, .max = 50000000 },
> +	.num_output = ARRAY_SIZE(plla_outputs),
> +	.output = plla_outputs,
> +	.core_output = plla_core_outputs,
> +};
> +
> +static const struct clk_pll_characteristics upll_characteristics = {
> +	.input = { .min = 20000000, .max = 50000000 },
> +	.num_output = ARRAY_SIZE(upll_outputs),
> +	.output = upll_outputs,
> +	.core_output = upll_core_outputs,
> +	.upll = true,
> +};
> +
> +static const struct clk_pll_characteristics lvdspll_characteristics = {
> +	.input = { .min = 20000000, .max = 50000000 },
> +	.num_output = ARRAY_SIZE(lvdspll_outputs),
> +	.output = lvdspll_outputs,
> +	.core_output = lvdspll_core_outputs,
> +};
> +
> +static const struct clk_pll_characteristics audiopll_characteristics = {
> +	.input = { .min = 20000000, .max = 50000000 },
> +	.num_output = ARRAY_SIZE(audiopll_outputs),
> +	.output = audiopll_outputs,
> +	.core_output = audiopll_core_outputs,
> +};
> +
> +static const struct clk_pll_characteristics plladiv2_characteristics = {
> +	.input = { .min = 20000000, .max = 50000000 },
> +	.num_output = ARRAY_SIZE(plladiv2_outputs),
> +	.output = plladiv2_outputs,
> +	.core_output = plladiv2_core_outputs,
> +};
> +
> +/* Layout for fractional PLL ID PLLA. */
> +static const struct clk_pll_layout plla_frac_layout = {
> +	.mul_mask = GENMASK(31, 24),
> +	.frac_mask = GENMASK(21, 0),
> +	.mul_shift = 24,
> +	.frac_shift = 0,
> +	.div2 = 1,

It seems to me that this is not taken into account (see below).

> +};
> +
> +/* Layout for fractional PLLs. */
> +static const struct clk_pll_layout pll_frac_layout = {
> +	.mul_mask = GENMASK(31, 24),
> +	.frac_mask = GENMASK(21, 0),
> +	.mul_shift = 24,
> +	.frac_shift = 0,
> +};
> +
> +/* Layout for DIV PLLs. */
> +static const struct clk_pll_layout pll_divpmc_layout = {
> +	.div_mask = GENMASK(7, 0),
> +	.endiv_mask = BIT(29),
> +	.div_shift = 0,
> +	.endiv_shift = 29,
> +};
> +
> +/* Layout for DIV PLL ID PLLADIV2. */
> +static const struct clk_pll_layout plladiv2_divpmc_layout = {
> +	.div_mask = GENMASK(7, 0),
> +	.endiv_mask = BIT(29),
> +	.div_shift = 0,
> +	.endiv_shift = 29,
> +	.div2 = 1,
> +};
> +
> +/* Layout for DIVIO dividers. */
> +static const struct clk_pll_layout pll_divio_layout = {
> +	.div_mask	= GENMASK(19, 12),
> +	.endiv_mask	= BIT(30),
> +	.div_shift	= 12,
> +	.endiv_shift	= 30,
> +};
> +
> +/*
> + * PLL clocks description
> + * @n:		clock name
> + * @p:		clock parent
> + * @l:		clock layout
> + * @t:		clock type
> + * @c:		pll characteristics
> + * @f:		clock flags
> + * @eid:	export index in sam9x7->chws[] array
> + */
> +static const struct {
> +	const char *n;
> +	const char *p;
> +	const struct clk_pll_layout *l;
> +	u8 t;
> +	const struct clk_pll_characteristics *c;
> +	unsigned long f;
> +	u8 eid;
> +} sam9x7_plls[][PLL_ID_MAX] = {
> +	[PLL_ID_PLLA] = {
> +		{
> +			.n = "plla_fracck",
> +			.p = "mainck",
> +			.l = &plla_frac_layout,
> +			.t = PLL_TYPE_FRAC,
> +			/*
> +			 * This feeds plla_divpmcck which feeds CPU. It should
> +			 * not be disabled.
> +			 */
> +			.f = CLK_IS_CRITICAL | CLK_SET_RATE_GATE,
> +			.c = &plla_characteristics,
> +		},
> +
> +		{
> +			.n = "plla_divpmcck",
> +			.p = "plla_fracck",
> +			.l = &pll_divpmc_layout,

You mentioned in "[PATCH v4 24/39] clk: at91: sam9x7: add support for HW
PLL freq dividers" that this has div2 but it is registered w/ a layout that
has .div2 = 0.



^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 14/39] dt-bindings: pwm: at91: Add sam9x7 compatible strings list
       [not found]   ` <igmm3npqcnjuhhncfd22pjhjuzbtsl25jfzbpcsyx5bu2xbbto@ynp7psnpldxr>
@ 2024-03-18  8:55     ` Uwe Kleine-König
  0 siblings, 0 replies; 92+ messages in thread
From: Uwe Kleine-König @ 2024-03-18  8:55 UTC (permalink / raw)
  To: Varshini Rajendran
  Cc: claudiu.beznea, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	nicolas.ferre, alexandre.belloni, linux-arm-kernel, linux-pwm,
	devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 779 bytes --]

Hello,

On Fri, Feb 23, 2024 at 11:42:57PM +0100, Uwe Kleine-König wrote:
> What is the merge plan for this series? I'd expect it to go in
> completely via arm-soc. If you want me to pick up this patch, please
> tell me.

Other maintainers picked some patches from this thread and I didn't get
an answer to my question. To be able to close this thread on my side I
applied this patch now to my for-nexxt branch

	https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git for-nexxt

. This is expected to be rebased once v6.9-rc1 is available, but it
won't get lost this way.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 27/39] clk: at91: sam9x7: add sam9x7 pmc driver
  2024-03-11  5:58   ` claudiu beznea
@ 2024-03-18  9:25     ` Varshini.Rajendran
  2024-03-18 20:17       ` claudiu beznea
  0 siblings, 1 reply; 92+ messages in thread
From: Varshini.Rajendran @ 2024-03-18  9:25 UTC (permalink / raw)
  To: claudiu.beznea, mturquette, sboyd, Nicolas.Ferre,
	alexandre.belloni, linux-kernel, linux-clk, linux-arm-kernel

Hi Claudiu,

On 11/03/24 11:28 am, claudiu beznea wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On 23.02.2024 19:28, Varshini Rajendran wrote:
>> Add a driver for the PMC clocks of sam9x7 Soc family.
>>
>> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
>> ---
>> Changes in v4:
>> - Changed variable name alloc_mem to clk_mux_buffer to be more
>>    suggestive
>> - Changed description of @f structure member appropriately
>> ---
>>   drivers/clk/at91/Makefile |   1 +
>>   drivers/clk/at91/sam9x7.c | 946 ++++++++++++++++++++++++++++++++++++++
>>   2 files changed, 947 insertions(+)
>>   create mode 100644 drivers/clk/at91/sam9x7.c
>>
>> diff --git a/drivers/clk/at91/Makefile b/drivers/clk/at91/Makefile
>> index 89061b85e7d2..8e3684ba2c74 100644
>> --- a/drivers/clk/at91/Makefile
>> +++ b/drivers/clk/at91/Makefile
>> @@ -20,6 +20,7 @@ obj-$(CONFIG_SOC_AT91SAM9) += at91sam9260.o at91sam9rl.o at91sam9x5.o dt-compat.
>>   obj-$(CONFIG_SOC_AT91SAM9) += at91sam9g45.o dt-compat.o
>>   obj-$(CONFIG_SOC_AT91SAM9) += at91sam9n12.o at91sam9x5.o dt-compat.o
>>   obj-$(CONFIG_SOC_SAM9X60) += sam9x60.o
>> +obj-$(CONFIG_SOC_SAM9X7) += sam9x7.o
>>   obj-$(CONFIG_SOC_SAMA5D3) += sama5d3.o dt-compat.o
>>   obj-$(CONFIG_SOC_SAMA5D4) += sama5d4.o dt-compat.o
>>   obj-$(CONFIG_SOC_SAMA5D2) += sama5d2.o dt-compat.o
>> diff --git a/drivers/clk/at91/sam9x7.c b/drivers/clk/at91/sam9x7.c
>> new file mode 100644
>> index 000000000000..d03387d2e35a
>> --- /dev/null
>> +++ b/drivers/clk/at91/sam9x7.c
>> @@ -0,0 +1,946 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/*
>> + * SAM9X7 PMC code.
>> + *
>> + * Copyright (C) 2023 Microchip Technology Inc. and its subsidiaries
>> + *
>> + * Author: Varshini Rajendran <varshini.rajendran@microchip.com>
>> + *
>> + */
>> +#include <linux/clk.h>
>> +#include <linux/clk-provider.h>
>> +#include <linux/mfd/syscon.h>
>> +#include <linux/slab.h>
>> +
>> +#include <dt-bindings/clock/at91.h>
>> +
>> +#include "pmc.h"
>> +
>> +static DEFINE_SPINLOCK(pmc_pll_lock);
>> +static DEFINE_SPINLOCK(mck_lock);
>> +
>> +/**
>> + * enum pll_ids - PLL clocks identifiers
>> + * @PLL_ID_PLLA:     PLLA identifier
>> + * @PLL_ID_UPLL:     UPLL identifier
>> + * @PLL_ID_AUDIO:    Audio PLL identifier
>> + * @PLL_ID_LVDS:     LVDS PLL identifier
>> + * @PLL_ID_PLLA_DIV2:        PLLA DIV2 identifier
>> + * @PLL_ID_MAX:              Max PLL Identifier
>> + */
>> +enum pll_ids {
>> +     PLL_ID_PLLA,
>> +     PLL_ID_UPLL,
>> +     PLL_ID_AUDIO,
>> +     PLL_ID_LVDS,
>> +     PLL_ID_PLLA_DIV2,
>> +     PLL_ID_MAX,
>> +};
>> +
>> +/**
>> + * enum pll_type - PLL type identifiers
>> + * @PLL_TYPE_FRAC:   fractional PLL identifier
>> + * @PLL_TYPE_DIV:    divider PLL identifier
>> + */
>> +enum pll_type {
>> +     PLL_TYPE_FRAC,
>> +     PLL_TYPE_DIV,
>> +};
>> +
>> +static const struct clk_master_characteristics mck_characteristics = {
>> +     .output = { .min = 32000000, .max = 266666667 },
>> +     .divisors = { 1, 2, 4, 3, 5},
>> +     .have_div3_pres = 1,
>> +};
>> +
>> +static const struct clk_master_layout sam9x7_master_layout = {
>> +     .mask = 0x373,
>> +     .pres_shift = 4,
>> +     .offset = 0x28,
>> +};
>> +
>> +/* Fractional PLL core output range. */
>> +static const struct clk_range plla_core_outputs[] = {
>> +     { .min = 375000000, .max = 1600000000 },
>> +};
>> +
>> +static const struct clk_range upll_core_outputs[] = {
>> +     { .min = 600000000, .max = 1200000000 },
>> +};
>> +
>> +static const struct clk_range lvdspll_core_outputs[] = {
>> +     { .min = 400000000, .max = 800000000 },
>> +};
>> +
>> +static const struct clk_range audiopll_core_outputs[] = {
>> +     { .min = 400000000, .max = 800000000 },
>> +};
>> +
>> +static const struct clk_range plladiv2_core_outputs[] = {
>> +     { .min = 375000000, .max = 1600000000 },
>> +};
>> +
>> +/* Fractional PLL output range. */
>> +static const struct clk_range plla_outputs[] = {
>> +     { .min = 732421, .max = 800000000 },
>> +};
>> +
>> +static const struct clk_range upll_outputs[] = {
>> +     { .min = 300000000, .max = 600000000 },
>> +};
>> +
>> +static const struct clk_range lvdspll_outputs[] = {
>> +     { .min = 10000000, .max = 800000000 },
>> +};
>> +
>> +static const struct clk_range audiopll_outputs[] = {
>> +     { .min = 10000000, .max = 800000000 },
>> +};
>> +
>> +static const struct clk_range plladiv2_outputs[] = {
>> +     { .min = 366210, .max = 400000000 },
>> +};
>> +
>> +/* PLL characteristics. */
>> +static const struct clk_pll_characteristics plla_characteristics = {
>> +     .input = { .min = 20000000, .max = 50000000 },
>> +     .num_output = ARRAY_SIZE(plla_outputs),
>> +     .output = plla_outputs,
>> +     .core_output = plla_core_outputs,
>> +};
>> +
>> +static const struct clk_pll_characteristics upll_characteristics = {
>> +     .input = { .min = 20000000, .max = 50000000 },
>> +     .num_output = ARRAY_SIZE(upll_outputs),
>> +     .output = upll_outputs,
>> +     .core_output = upll_core_outputs,
>> +     .upll = true,
>> +};
>> +
>> +static const struct clk_pll_characteristics lvdspll_characteristics = {
>> +     .input = { .min = 20000000, .max = 50000000 },
>> +     .num_output = ARRAY_SIZE(lvdspll_outputs),
>> +     .output = lvdspll_outputs,
>> +     .core_output = lvdspll_core_outputs,
>> +};
>> +
>> +static const struct clk_pll_characteristics audiopll_characteristics = {
>> +     .input = { .min = 20000000, .max = 50000000 },
>> +     .num_output = ARRAY_SIZE(audiopll_outputs),
>> +     .output = audiopll_outputs,
>> +     .core_output = audiopll_core_outputs,
>> +};
>> +
>> +static const struct clk_pll_characteristics plladiv2_characteristics = {
>> +     .input = { .min = 20000000, .max = 50000000 },
>> +     .num_output = ARRAY_SIZE(plladiv2_outputs),
>> +     .output = plladiv2_outputs,
>> +     .core_output = plladiv2_core_outputs,
>> +};
>> +
>> +/* Layout for fractional PLL ID PLLA. */
>> +static const struct clk_pll_layout plla_frac_layout = {
>> +     .mul_mask = GENMASK(31, 24),
>> +     .frac_mask = GENMASK(21, 0),
>> +     .mul_shift = 24,
>> +     .frac_shift = 0,
>> +     .div2 = 1,
> 
> It seems to me that this is not taken into account (see below).
> 
>> +};
>> +
>> +/* Layout for fractional PLLs. */
>> +static const struct clk_pll_layout pll_frac_layout = {
>> +     .mul_mask = GENMASK(31, 24),
>> +     .frac_mask = GENMASK(21, 0),
>> +     .mul_shift = 24,
>> +     .frac_shift = 0,
>> +};
>> +
>> +/* Layout for DIV PLLs. */
>> +static const struct clk_pll_layout pll_divpmc_layout = {
>> +     .div_mask = GENMASK(7, 0),
>> +     .endiv_mask = BIT(29),
>> +     .div_shift = 0,
>> +     .endiv_shift = 29,
>> +};
>> +
>> +/* Layout for DIV PLL ID PLLADIV2. */
>> +static const struct clk_pll_layout plladiv2_divpmc_layout = {
>> +     .div_mask = GENMASK(7, 0),
>> +     .endiv_mask = BIT(29),
>> +     .div_shift = 0,
>> +     .endiv_shift = 29,
>> +     .div2 = 1,
>> +};
>> +
>> +/* Layout for DIVIO dividers. */
>> +static const struct clk_pll_layout pll_divio_layout = {
>> +     .div_mask       = GENMASK(19, 12),
>> +     .endiv_mask     = BIT(30),
>> +     .div_shift      = 12,
>> +     .endiv_shift    = 30,
>> +};
>> +
>> +/*
>> + * PLL clocks description
>> + * @n:               clock name
>> + * @p:               clock parent
>> + * @l:               clock layout
>> + * @t:               clock type
>> + * @c:               pll characteristics
>> + * @f:               clock flags
>> + * @eid:     export index in sam9x7->chws[] array
>> + */
>> +static const struct {
>> +     const char *n;
>> +     const char *p;
>> +     const struct clk_pll_layout *l;
>> +     u8 t;
>> +     const struct clk_pll_characteristics *c;
>> +     unsigned long f;
>> +     u8 eid;
>> +} sam9x7_plls[][PLL_ID_MAX] = {
>> +     [PLL_ID_PLLA] = {
>> +             {
>> +                     .n = "plla_fracck",
>> +                     .p = "mainck",
>> +                     .l = &plla_frac_layout,
>> +                     .t = PLL_TYPE_FRAC,
>> +                     /*
>> +                      * This feeds plla_divpmcck which feeds CPU. It should
>> +                      * not be disabled.
>> +                      */
>> +                     .f = CLK_IS_CRITICAL | CLK_SET_RATE_GATE,
>> +                     .c = &plla_characteristics,
>> +             },
>> +
>> +             {
>> +                     .n = "plla_divpmcck",
>> +                     .p = "plla_fracck",
>> +                     .l = &pll_divpmc_layout,
> 
> You mentioned in "[PATCH v4 24/39] clk: at91: sam9x7: add support for HW
> PLL freq dividers" that this has div2 but it is registered w/ a layout that
> has .div2 = 0.

This is handled in the above plla_fracck fractional part as defined in 
the plla_frac_layout.
> 
> 

-- 
Thanks and Regards,
Varshini Rajendran.


^ permalink raw reply	[flat|nested] 92+ messages in thread

* Re: [PATCH v4 27/39] clk: at91: sam9x7: add sam9x7 pmc driver
  2024-03-18  9:25     ` Varshini.Rajendran
@ 2024-03-18 20:17       ` claudiu beznea
  0 siblings, 0 replies; 92+ messages in thread
From: claudiu beznea @ 2024-03-18 20:17 UTC (permalink / raw)
  To: Varshini.Rajendran, mturquette, sboyd, Nicolas.Ferre,
	alexandre.belloni, linux-kernel, linux-clk, linux-arm-kernel



On 18.03.2024 11:25, Varshini.Rajendran@microchip.com wrote:
> Hi Claudiu,
> 
> On 11/03/24 11:28 am, claudiu beznea wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>
>> On 23.02.2024 19:28, Varshini Rajendran wrote:
>>> Add a driver for the PMC clocks of sam9x7 Soc family.
>>>
>>> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
>>> ---
>>> Changes in v4:
>>> - Changed variable name alloc_mem to clk_mux_buffer to be more
>>>    suggestive
>>> - Changed description of @f structure member appropriately
>>> ---
>>>   drivers/clk/at91/Makefile |   1 +
>>>   drivers/clk/at91/sam9x7.c | 946 ++++++++++++++++++++++++++++++++++++++
>>>   2 files changed, 947 insertions(+)
>>>   create mode 100644 drivers/clk/at91/sam9x7.c
>>>
>>> diff --git a/drivers/clk/at91/Makefile b/drivers/clk/at91/Makefile
>>> index 89061b85e7d2..8e3684ba2c74 100644
>>> --- a/drivers/clk/at91/Makefile
>>> +++ b/drivers/clk/at91/Makefile
[ ... ]

>>> +static const struct {
>>> +     const char *n;
>>> +     const char *p;
>>> +     const struct clk_pll_layout *l;
>>> +     u8 t;
>>> +     const struct clk_pll_characteristics *c;
>>> +     unsigned long f;
>>> +     u8 eid;
>>> +} sam9x7_plls[][PLL_ID_MAX] = {
>>> +     [PLL_ID_PLLA] = {
>>> +             {
>>> +                     .n = "plla_fracck",
>>> +                     .p = "mainck",
>>> +                     .l = &plla_frac_layout,
>>> +                     .t = PLL_TYPE_FRAC,
>>> +                     /*
>>> +                      * This feeds plla_divpmcck which feeds CPU. It should
>>> +                      * not be disabled.
>>> +                      */
>>> +                     .f = CLK_IS_CRITICAL | CLK_SET_RATE_GATE,
>>> +                     .c = &plla_characteristics,
>>> +             },
>>> +
>>> +             {
>>> +                     .n = "plla_divpmcck",
>>> +                     .p = "plla_fracck",
>>> +                     .l = &pll_divpmc_layout,
>>
>> You mentioned in "[PATCH v4 24/39] clk: at91: sam9x7: add support for HW
>> PLL freq dividers" that this has div2 but it is registered w/ a layout that
>> has .div2 = 0.
> 
> This is handled in the above plla_fracck fractional part as defined in 
> the plla_frac_layout.

Ah, right. I missed the changes in sam9x60_frac_pll_recalc_rate().


^ permalink raw reply	[flat|nested] 92+ messages in thread

end of thread, other threads:[~2024-03-18 20:17 UTC | newest]

Thread overview: 92+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-23 17:13 [PATCH v4 00/39] Add support for sam9x7 SoC family Varshini Rajendran
2024-02-23 17:22 ` [PATCH v4 01/39] dt-bindings: net: cdns,macb: add sam9x7 ethernet interface Varshini Rajendran
2024-02-23 17:22 ` [PATCH v4 02/39] dt-bindings: atmel-sysreg: add sam9x7 Varshini Rajendran
2024-02-23 17:23 ` [PATCH v4 03/39] dt-bindings: crypto: add sam9x7 in Atmel AES Varshini Rajendran
2024-02-26  9:18   ` Tudor Ambarus
2024-02-23 17:23 ` [PATCH v4 04/39] dt-bindings: crypto: add sam9x7 in Atmel SHA Varshini Rajendran
2024-02-26  9:23   ` Tudor Ambarus
2024-02-23 17:24 ` [PATCH v4 05/39] dt-bindings: crypto: add sam9x7 in Atmel TDES Varshini Rajendran
2024-02-24 19:50   ` Conor Dooley
2024-02-26  9:24   ` Tudor Ambarus
2024-02-23 17:24 ` [PATCH v4 06/39] dt-bindings: i2c: at91: Add sam9x7 compatible string Varshini Rajendran
2024-02-24 19:49   ` Conor Dooley
2024-02-23 17:25 ` [PATCH v4 07/39] dt-bindings: atmel-ssc: add microchip,sam9x7-ssc Varshini Rajendran
2024-02-23 17:25 ` [PATCH v4 08/39] dt-bindings: atmel-nand: add microchip,sam9x7-pmecc Varshini Rajendran
2024-02-24 19:50   ` Conor Dooley
2024-02-26 10:43   ` Miquel Raynal
2024-02-23 17:25 ` [PATCH v4 09/39] dt-bindings: pinctrl: at91: add sam9x7 Varshini Rajendran
2024-02-29 13:41   ` Linus Walleij
2024-02-23 17:25 ` [PATCH v4 10/39] dt-bindings: rng: atmel,at91-trng: add sam9x7 TRNG Varshini Rajendran
2024-02-23 17:25 ` [PATCH v4 11/39] dt-bindings: rtt: at91rm9260: add sam9x7 compatible Varshini Rajendran
2024-02-24 19:51   ` Conor Dooley
2024-02-29 21:27   ` (subset) " Alexandre Belloni
2024-02-23 17:25 ` [PATCH v4 12/39] dt-bindings: serial: atmel,at91-usart: add compatible for sam9x7 Varshini Rajendran
2024-02-24 20:02   ` Conor Dooley
2024-02-28  7:03     ` Varshini.Rajendran
2024-02-28 11:49       ` Conor Dooley
2024-02-29  8:55         ` Varshini.Rajendran
2024-02-29 18:26           ` Conor Dooley
2024-02-23 17:26 ` [PATCH v4 13/39] ASoC: dt-bindings: atmel-classd: add sam9x7 compatible Varshini Rajendran
2024-02-24 19:48   ` Conor Dooley
2024-02-23 17:26 ` [PATCH v4 14/39] dt-bindings: pwm: at91: Add sam9x7 compatible strings list Varshini Rajendran
2024-02-24 20:03   ` Conor Dooley
     [not found]   ` <igmm3npqcnjuhhncfd22pjhjuzbtsl25jfzbpcsyx5bu2xbbto@ynp7psnpldxr>
2024-03-18  8:55     ` Uwe Kleine-König
2024-02-23 17:26 ` [PATCH v4 15/39] dt-bindings: watchdog: sama5d4-wdt: add compatible for sam9x7-wdt Varshini Rajendran
2024-02-24 20:04   ` Conor Dooley
2024-02-23 17:26 ` [PATCH v4 16/39] spi: dt-bindings: atmel,at91rm9200-spi: remove 9x60 compatible from list Varshini Rajendran
2024-02-26  9:09   ` Tudor Ambarus
2024-02-28  9:28     ` Varshini.Rajendran
2024-02-28  9:38       ` Tudor Ambarus
2024-02-23 17:26 ` [PATCH v4 17/39] ASoC: dt-bindings: microchip: add sam9x7 Varshini Rajendran
2024-02-23 17:27 ` [PATCH v4 18/39] ARM: at91: pm: add support for sam9x7 SoC family Varshini Rajendran
2024-03-03 12:20   ` claudiu beznea
2024-02-23 17:27 ` [PATCH v4 19/39] ARM: at91: pm: add sam9x7 SoC init config Varshini Rajendran
2024-03-03 12:20   ` claudiu beznea
2024-02-23 17:27 ` [PATCH v4 20/39] ARM: at91: add support in SoC driver for new sam9x7 Varshini Rajendran
2024-02-26 17:01   ` Nicolas Ferre
2024-03-03 12:21   ` claudiu beznea
2024-02-23 17:27 ` [PATCH v4 21/39] dt-bindings: clk: at91: add sam9x7 Varshini Rajendran
2024-02-24 20:05   ` Conor Dooley
2024-03-11  5:32   ` claudiu beznea
2024-02-23 17:27 ` [PATCH v4 22/39] dt-bindings: clk: at91: add sam9x7 clock controller Varshini Rajendran
2024-02-24 20:06   ` Conor Dooley
2024-03-11  5:33   ` claudiu beznea
2024-02-23 17:27 ` [PATCH v4 23/39] clk: at91: clk-sam9x60-pll: re-factor to support individual core freq outputs Varshini Rajendran
2024-02-23 17:27 ` [PATCH v4 24/39] clk: at91: sam9x7: add support for HW PLL freq dividers Varshini Rajendran
2024-03-11  5:34   ` claudiu beznea
2024-02-23 17:28 ` [PATCH v4 25/39] clk: at91: sama7g5: move mux table macros to header file Varshini Rajendran
2024-02-23 17:28 ` [PATCH v4 26/39] dt-bindings: clock: at91: Allow PLLs to be exported and referenced in DT Varshini Rajendran
2024-03-01 21:26   ` Rob Herring
2024-02-23 17:28 ` [PATCH v4 27/39] clk: at91: sam9x7: add sam9x7 pmc driver Varshini Rajendran
2024-03-11  5:58   ` claudiu beznea
2024-03-18  9:25     ` Varshini.Rajendran
2024-03-18 20:17       ` claudiu beznea
2024-02-23 17:28 ` [PATCH v4 28/39] dt-bindings: irqchip/atmel-aic5: Add support for sam9x7 aic Varshini Rajendran
2024-02-23 17:29 ` [PATCH v4 29/39] irqchip/atmel-aic5: Add support to get nirqs from DT for sam9x60 & sam9x7 Varshini Rajendran
2024-03-03 12:21   ` claudiu beznea
2024-03-08  8:50     ` Varshini.Rajendran
2024-03-08 10:15       ` Conor Dooley
2024-03-09 13:13       ` claudiu beznea
2024-02-23 17:29 ` [PATCH v4 30/39] power: reset: at91-poweroff: lookup for proper pmc dt node for sam9x7 Varshini Rajendran
2024-03-03 12:22   ` claudiu beznea
2024-02-23 17:29 ` [PATCH v4 31/39] power: reset: at91-reset: add reset support for sam9x7 SoC Varshini Rajendran
2024-02-23 17:30 ` [PATCH v4 32/39] power: reset: at91-reset: add sdhwc " Varshini Rajendran
2024-02-23 17:30 ` [PATCH v4 33/39] dt-bindings: reset: atmel,at91sam9260-reset: add sam9x7 Varshini Rajendran
2024-02-23 17:30 ` [PATCH v4 34/39] dt-bindings: power: reset: atmel,sama5d2-shdwc: " Varshini Rajendran
2024-02-23 17:30 ` [PATCH v4 35/39] ARM: at91: Kconfig: add config flag for SAM9X7 SoC Varshini Rajendran
2024-03-03 12:22   ` claudiu beznea
2024-02-23 17:30 ` [PATCH v4 36/39] ARM: configs: at91: enable config flags for sam9x7 SoC family Varshini Rajendran
2024-02-23 17:30 ` [PATCH v4 37/39] ARM: dts: at91: sam9x7: add device tree for SoC Varshini Rajendran
2024-03-03 12:24   ` claudiu beznea
2024-03-04 16:33     ` Varshini.Rajendran
2024-03-06  8:38       ` claudiu beznea
2024-02-23 17:31 ` [PATCH v4 38/39] dt-bindings: arm: add sam9x75 curiosity board Varshini Rajendran
2024-03-01 21:26   ` Rob Herring
2024-02-23 17:31 ` [PATCH v4 39/39] ARM: dts: at91: sam9x75_curiosity: " Varshini Rajendran
2024-03-03 12:19   ` claudiu beznea
2024-03-08  9:48     ` Varshini.Rajendran
2024-02-24  1:18 ` (subset) [PATCH v4 00/39] Add support for sam9x7 SoC family Mark Brown
2024-02-27  1:21 ` Andi Shyti
2024-02-27  3:20 ` patchwork-bot+netdevbpf
2024-02-28 15:53 ` (subset) " Mark Brown
2024-03-01 10:51 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).