Skip to contentSkip to conversation

Add support for sama7d65 SoC and sama7d65 curiosity board

PATCH In review Varshini Rajendran 2 participants 8 messages Jul 7, 2025 – Jul 28, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover Add support for sama7d65 SoC and sama7d65 curiosity board

This patch series adds support for the new SoC sama7d65.
- sama7d65 SoC is added
- Clock driver for sama7d65 is added
- Target board SAMA7D65 Curiosity is added with its differences in DT and MMC config support

Ryan Wanner (6):
clk: at91: Update MAX PLL and master clk ID
clk: at91: sama7d65: add clock support
ARM: mach-at91: add support for new SoC sama7d65
ARM: dts: at91: sama7d65-curiosity: Add DT tweaks for
sama7d65-curiosity board
board: sama7d65_curiosity: Add support for sama7d65_curiosity
configs: sama7d65_curiosity: Add defconfig for sama7d65_curiosity

 .../dts/at91-sama7d65_curiosity-u-boot.dtsi   |   80 +
 arch/arm/mach-at91/Kconfig                    |   13 +
 arch/arm/mach-at91/armv7/Makefile             |    1 +
 arch/arm/mach-at91/armv7/sama7d65_devices.c   |   31 +
 arch/arm/mach-at91/include/mach/hardware.h    |    2 +
 arch/arm/mach-at91/include/mach/sama7d65.h    |  107 ++
 board/atmel/sama7d65_curiosity/Kconfig        |   15 +
 board/atmel/sama7d65_curiosity/MAINTAINERS    |    6 +
 board/atmel/sama7d65_curiosity/Makefile       |    7 +
 .../sama7d65_curiosity/sama7d65_curiosity.c   |   75 +
 configs/sama7d65_curiosity_mmc1_defconfig     |  108 ++
 drivers/clk/at91/Makefile                     |    1 +
 drivers/clk/at91/clk-master.c                 |    2 +-
 drivers/clk/at91/clk-sam9x60-pll.c            |    2 +-
 drivers/clk/at91/sama7d65.c                   | 1451 +++++++++++++++++
 include/configs/sama7d65_curiosity.h          |   20 +
 16 files changed, 1919 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/at91-sama7d65_curiosity-u-boot.dtsi
 create mode 100644 arch/arm/mach-at91/armv7/sama7d65_devices.c
 create mode 100644 arch/arm/mach-at91/include/mach/sama7d65.h
 create mode 100644 board/atmel/sama7d65_curiosity/Kconfig
 create mode 100644 board/atmel/sama7d65_curiosity/MAINTAINERS
 create mode 100644 board/atmel/sama7d65_curiosity/Makefile
 create mode 100644 board/atmel/sama7d65_curiosity/sama7d65_curiosity.c
 create mode 100644 configs/sama7d65_curiosity_mmc1_defconfig
 create mode 100644 drivers/clk/at91/sama7d65.c
 create mode 100644 include/configs/sama7d65_curiosity.h
Signature · 1 line
2.45.2
#1 lore raw

PATCH 1/6 clk: at91: Update MAX PLL and master clk ID

From: Ryan Wanner <[email protected]>

Update the MAX PLL and master CLK ID to support sama7d65 SoC family.

---
 drivers/clk/at91/clk-master.c      | 2 +-
 drivers/clk/at91/clk-sam9x60-pll.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/clk/at91/clk-master.c +1 -1
index d28775d64d3..cdc5271fa83 100644
@@ -37,7 +37,7 @@
 
 #define PMC_MCR_ID(x)		((x) & PMC_MCR_ID_MSK)
 
-#define MASTER_MAX_ID		4
+#define MASTER_MAX_ID		10
 
 struct clk_master {
 	void __iomem *base;
drivers/clk/at91/clk-sam9x60-pll.c +1 -1
index df8172bccac..65be2775ac3 100644
@@ -32,7 +32,7 @@
 #define UPLL_DIV		2
 #define PLL_MUL_MAX		(FIELD_GET(PMC_PLL_CTRL1_MUL_MSK, UINT_MAX) + 1)
 
-#define PLL_MAX_ID		7
+#define PLL_MAX_ID		8
 
 struct sam9x60_pll {
 	void __iomem *base;
Signature · 1 line
2.45.2
#2 lore raw

PATCH 2/6 clk: at91: sama7d65: add clock support

In reply to Varshini Rajendran

From: Ryan Wanner <[email protected]>

Add clock support for SAMA7D65

[[email protected]: add Fractional PLL core output range]

---
 drivers/clk/at91/Makefile   |    1 +
 drivers/clk/at91/sama7d65.c | 1451 +++++++++++++++++++++++++++++++++++
 2 files changed, 1452 insertions(+)
 create mode 100644 drivers/clk/at91/sama7d65.c
drivers/clk/at91/Makefile +1 -0
index 6cca861f81c..96cc2bc3abc 100644
@@ -11,6 +11,7 @@ obj-$(CONFIG_AT91_UTMI)		+= clk-utmi.o
 obj-$(CONFIG_AT91_SAM9X60_PLL)	+= clk-sam9x60-pll.o
 obj-$(CONFIG_AT91_SAM9X60_USB)	+= clk-sam9x60-usb.o
 obj-$(CONFIG_SAMA7G5)		+= sama7g5.o
+obj-$(CONFIG_SAMA7D65)		+= sama7d65.o
 obj-$(CONFIG_SAM9X60)		+= sam9x60.o
 obj-$(CONFIG_SAM9X7)		+= sam9x7.o
 else
drivers/clk/at91/sama7d65.c new file +1451 -0

1,451 lines not on this page · raw message

Signature · 1 line
2.45.2
#3 lore raw

PATCH 3/6 ARM: mach-at91: add support for new SoC sama7d65

In reply to Varshini Rajendran

From: Ryan Wanner <[email protected]>

Add support for new SoC sama7d65.

---
 arch/arm/mach-at91/Kconfig                  |   5 +
 arch/arm/mach-at91/armv7/Makefile           |   1 +
 arch/arm/mach-at91/armv7/sama7d65_devices.c |  31 ++++++
 arch/arm/mach-at91/include/mach/hardware.h  |   2 +
 arch/arm/mach-at91/include/mach/sama7d65.h  | 107 ++++++++++++++++++++
 5 files changed, 146 insertions(+)
 create mode 100644 arch/arm/mach-at91/armv7/sama7d65_devices.c
 create mode 100644 arch/arm/mach-at91/include/mach/sama7d65.h
arch/arm/mach-at91/Kconfig +5 -0
index d21534ce883..cc9ed89e544 100644
@@ -52,6 +52,11 @@ config SAMA7G5
 	select CPU_V7A
 	select AT91RESET_EXTRST
 
+config SAMA7D65
+	bool
+	select CPU_V7A
+	select AT91RESET_EXTRST
+
 config SAMA5D2
 	bool
 	select CPU_V7A
arch/arm/mach-at91/armv7/Makefile +1 -0
index 6da1cdffef6..4303a60e0e3 100644
@@ -10,6 +10,7 @@ obj-$(CONFIG_SAMA5D2)	+= sama5d2_devices.o clock.o
 obj-$(CONFIG_SAMA5D3)	+= sama5d3_devices.o clock.o
 obj-$(CONFIG_SAMA5D4)	+= sama5d4_devices.o clock.o
 obj-$(CONFIG_SAMA7G5)	+= sama7g5_devices.o
+obj-$(CONFIG_SAMA7D65)	+= sama7d65_devices.o
 obj-y += cpu.o
 ifneq ($(CONFIG_ATMEL_TCB_TIMER),y)
 ifneq ($(CONFIG_ATMEL_PIT_TIMER),y)
arch/arm/mach-at91/armv7/sama7d65_devices.c new file +31 -0
new file mode 100644
index 00000000000..6c6ae751b1a
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2024 Microchip Technology, Inc.
+ */
+
+#include <asm/arch/sama7d65.h>
+
+char *get_cpu_name(void)
+{
+	unsigned int extension_id = get_extension_chip_id();
+
+	if (cpu_is_sama7d65())
+		switch (extension_id) {
+		case ARCH_EXID_SAMA7D65:
+			return "SAMA7D65";
+		case ARCH_EXID_SAMA7D65_DD2:
+			return "SAMA7D65 DDR2";
+		case ARCH_EXID_SAMA7D65_D1G:
+			return "SAMA7D65 1Gb DDR3L SiP";
+		case ARCH_EXID_SAMA7D65_D2G:
+			return "SAMA7D65 2Gb DDR3L SiP";
+		case ARCH_EXID_SAMA7D65_D4G:
+			return "SAMA7D65 4Gb DDR3L SiP";
+		case ARCH_EXID_SAMA7D65_TA:
+			return "SAMA7D65 TA1000 SiP";
+		default:
+			return "Unknown CPU type";
+		}
+	else
+		return "Unknown CPU type10";
+}
arch/arm/mach-at91/include/mach/hardware.h +2 -0
index de89714b097..0b2ddbab3be 100644
@@ -27,6 +27,8 @@
 # include <asm/arch/sam9x7.h>
 #elif defined(CONFIG_SAMA7G5)
 # include <asm/arch/sama7g5.h>
+#elif defined(CONFIG_SAMA7D65)
+# include <asm/arch/sama7d65.h>
 #elif defined(CONFIG_SAMA5D2)
 # include <asm/arch/sama5d2.h>
 #elif defined(CONFIG_SAMA5D3)
arch/arm/mach-at91/include/mach/sama7d65.h new file +107 -0

107 lines not on this page · raw message

Signature · 1 line
2.45.2
#4 lore raw

PATCH 4/6 ARM: dts: at91: sama7d65-curiosity: Add DT tweaks for sama7d65-curiosity board

In reply to Varshini Rajendran

From: Ryan Wanner <[email protected]>

Add u-boot device tree and tweaks for sama7d65-curiosity board on top of the upstream DTS files in dts/upstream.

[[email protected]: align with Linux DT and add tweaks]
---
 .../dts/at91-sama7d65_curiosity-u-boot.dtsi   | 80 +++++++++++++++++++
 1 file changed, 80 insertions(+)
 create mode 100644 arch/arm/dts/at91-sama7d65_curiosity-u-boot.dtsi
arch/arm/dts/at91-sama7d65_curiosity-u-boot.dtsi new file +80 -0
new file mode 100644
index 00000000000..343f10cdf9a
@@ -0,0 +1,80 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ *  at91-sama7d65_curiosity-u-boot.dtsi - Device Tree Include file for
+ *  SAMA7D65 CURIOSITY.
+ *
+ *  Copyright (c) 2023 Microchip Technology Inc. and its subsidiaries
+ *
+ *  Author: Ryan Wanner <[email protected]>
+ */
+
+/{
+	aliases {
+		serial0 = &uart6;
+	};
+
+	chosen {
+		bootph-all;
+	};
+
+	clocks {
+		slow_rc_osc: slow_rc_osc {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <32000>;
+		};
+	};
+
+	cpus {
+		cpu@0 {
+			clocks = <&pmc PMC_TYPE_CORE 8>, <&pmc PMC_TYPE_CORE 26>, <&main_xtal>;
+			clock-names = "cpu", "master", "xtal";
+		};
+	};
+
+	soc {
+		bootph-all;
+	};
+};
+
+&clk32k {
+	clocks = <&slow_rc_osc>, <&slow_xtal>;
+};
+
+&main_xtal {
+	bootph-all;
+};
+
+&pioa {
+	bootph-all;
+};
+
+&pinctrl_uart6_default {
+	bootph-all;
+};
+
+&pit64b0 {
+	bootph-all;
+};
+
+&pmc {
+	bootph-all;
+};
+
+&sdmmc1 {
+	assigned-clock-parents = <&pmc PMC_TYPE_CORE 27>; /* MCK1 div */
+	microchip,sdcal-inverted;
+	no-1-8-v;
+};
+
+&slow_rc_osc {
+	bootph-all;
+};
+
+&slow_xtal {
+	bootph-all;
+};
+
+&uart6 {
+	bootph-all;
+};
Signature · 1 line
2.45.2
#5 lore raw

PATCH 5/6 board: sama7d65_curiosity: Add support for sama7d65_curiosity

In reply to Varshini Rajendran

From: Ryan Wanner <[email protected]>

Add board specific functions for sama7d65_curiosity.

---
 arch/arm/mach-at91/Kconfig                    |  8 ++
 board/atmel/sama7d65_curiosity/Kconfig        | 15 ++++
 board/atmel/sama7d65_curiosity/MAINTAINERS    |  5 ++
 board/atmel/sama7d65_curiosity/Makefile       |  7 ++
 .../sama7d65_curiosity/sama7d65_curiosity.c   | 75 +++++++++++++++++++
 include/configs/sama7d65_curiosity.h          | 20 +++++
 6 files changed, 130 insertions(+)
 create mode 100644 board/atmel/sama7d65_curiosity/Kconfig
 create mode 100644 board/atmel/sama7d65_curiosity/MAINTAINERS
 create mode 100644 board/atmel/sama7d65_curiosity/Makefile
 create mode 100644 board/atmel/sama7d65_curiosity/sama7d65_curiosity.c
 create mode 100644 include/configs/sama7d65_curiosity.h
arch/arm/mach-at91/Kconfig +8 -0
index cc9ed89e544..7d00f1650b4 100644
@@ -304,6 +304,13 @@ config TARGET_SAMA7G54_CURIOSITY
 	  4Gbit SLC nand-flash, MCP16502 PMIC, 2 x Mikrobus connectors,
 	  1 x SD-Card connector, 1 x M.2 slot, 3 x USB
 
+config TARGET_SAMA7D65_CURIOSITY
+	bool "SAMA7D65 CURIOSITY board"
+	select SAMA7D65
+	select BOARD_EARLY_INIT_F
+	select BOARD_LATE_INIT
+	imply OF_UPSTREAM
+
 config TARGET_TAURUS
 	bool "Support taurus"
 	select AT91SAM9G20
@@ -370,6 +377,7 @@ source "board/atmel/sam9x60_curiosity/Kconfig"
 source "board/atmel/sam9x75_curiosity/Kconfig"
 source "board/atmel/sama7g5ek/Kconfig"
 source "board/atmel/sama7g54_curiosity/Kconfig"
+source "board/atmel/sama7d65_curiosity/Kconfig"
 source "board/atmel/sama5d2_ptc_ek/Kconfig"
 source "board/atmel/sama5d2_xplained/Kconfig"
 source "board/atmel/sama5d27_som1_ek/Kconfig"
board/atmel/sama7d65_curiosity/Kconfig new file +15 -0
new file mode 100644
index 00000000000..21ff432f2c1
@@ -0,0 +1,15 @@
+if TARGET_SAMA7D65_CURIOSITY
+
+config SYS_BOARD
+	default "sama7d65_curiosity"
+
+config SYS_VENDOR
+	default "atmel"
+
+config SYS_SOC
+	default "at91"
+
+config SYS_CONFIG_NAME
+	default "sama7d65_curiosity"
+
+endif
board/atmel/sama7d65_curiosity/MAINTAINERS new file +5 -0
new file mode 100644
index 00000000000..be67d56dc5b
@@ -0,0 +1,5 @@
+SAMA7D65 CURIOSITY BOARD
+M:     Ryan Wanner <[email protected]>
+S:     Maintained
+F:     board/atmel/sama7d65_curiosity.c
+F:     include/configs/sama7d65_curiosity.h
board/atmel/sama7d65_curiosity/Makefile new file +7 -0
new file mode 100644
index 00000000000..56d011d1d81
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier:     GPL-2.0+
+#
+# Copyright (C) 2024 Microchip Technology Inc. and its subsidiaries
+#
+# Author: Ryan Wanner <[email protected]>
+
+obj-y += sama7d65_curiosity.o
board/atmel/sama7d65_curiosity/sama7d65_curiosity.c new file +75 -0

75 lines not on this page · raw message

include/configs/sama7d65_curiosity.h new file +20 -0
new file mode 100644
index 00000000000..9316b104ee3
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Configuration file for the SAMA7D65 Curiosity Board.
+ *
+ * Copyright (C) 2024 Microchip Technology Inc. and its subsidiaries
+ *
+ * Author: Ryan Wanner <[email protected]>
+ *
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define CFG_SYS_AT91_SLOW_CLOCK      32768
+#define CFG_SYS_AT91_MAIN_CLOCK      24000000 /* from 24 MHz crystal */
+/* SDRAM */
+#define CFG_SYS_SDRAM_BASE		0x60000000
+#define CFG_SYS_SDRAM_SIZE		0x40000000
+
+#endif
Signature · 1 line
2.45.2
#6 lore raw

PATCH 6/6 configs: sama7d65_curiosity: Add defconfig for sama7d65_curiosity

In reply to Varshini Rajendran

From: Ryan Wanner <[email protected]>

Add initial mmc defconfig to boot from SDMMC1.

---
 board/atmel/sama7d65_curiosity/MAINTAINERS |   1 +
 configs/sama7d65_curiosity_mmc1_defconfig  | 108 +++++++++++++++++++++
 2 files changed, 109 insertions(+)
 create mode 100644 configs/sama7d65_curiosity_mmc1_defconfig
board/atmel/sama7d65_curiosity/MAINTAINERS +1 -0
index be67d56dc5b..054af3c6541 100644
@@ -3,3 +3,4 @@ M:     Ryan Wanner <[email protected]>
 S:     Maintained
 F:     board/atmel/sama7d65_curiosity.c
 F:     include/configs/sama7d65_curiosity.h
+F:     configs/sama7d65_curiosity_mmc1_defconfig
configs/sama7d65_curiosity_mmc1_defconfig new file +108 -0

108 lines not on this page · raw message

Signature · 1 line
2.45.2
#7 lore raw
In reply to Varshini Rajendran
Quoted 34 lines · Varshini Rajendran

This patch series adds support for the new SoC sama7d65.
- sama7d65 SoC is added
- Clock driver for sama7d65 is added
- Target board SAMA7D65 Curiosity is added with its differences in DT and MMC config support

Ryan Wanner (6):
clk: at91: Update MAX PLL and master clk ID
clk: at91: sama7d65: add clock support
ARM: mach-at91: add support for new SoC sama7d65
ARM: dts: at91: sama7d65-curiosity: Add DT tweaks for
sama7d65-curiosity board
board: sama7d65_curiosity: Add support for sama7d65_curiosity
configs: sama7d65_curiosity: Add defconfig for sama7d65_curiosity

 .../dts/at91-sama7d65_curiosity-u-boot.dtsi   |   80 +
 arch/arm/mach-at91/Kconfig                    |   13 +
 arch/arm/mach-at91/armv7/Makefile             |    1 +
 arch/arm/mach-at91/armv7/sama7d65_devices.c   |   31 +
 arch/arm/mach-at91/include/mach/hardware.h    |    2 +
 arch/arm/mach-at91/include/mach/sama7d65.h    |  107 ++
 board/atmel/sama7d65_curiosity/Kconfig        |   15 +
 board/atmel/sama7d65_curiosity/MAINTAINERS    |    6 +
 board/atmel/sama7d65_curiosity/Makefile       |    7 +
 .../sama7d65_curiosity/sama7d65_curiosity.c   |   75 +
 configs/sama7d65_curiosity_mmc1_defconfig     |  108 ++
 drivers/clk/at91/Makefile                     |    1 +
 drivers/clk/at91/clk-master.c                 |    2 +-
 drivers/clk/at91/clk-sam9x60-pll.c            |    2 +-
 drivers/clk/at91/sama7d65.c                   | 1451 +++++++++++++++++
 include/configs/sama7d65_curiosity.h          |   20 +
 16 files changed, 1919 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/at91-sama7d65_curiosity-u-boot.dtsi
 create mode 100644 arch/arm/mach-at91/armv7/sama7d65_devices.c
Quoted 9 lines
 create mode 100644 arch/arm/mach-at91/include/mach/sama7d65.h
 create mode 100644 board/atmel/sama7d65_curiosity/Kconfig
 create mode 100644 board/atmel/sama7d65_curiosity/MAINTAINERS
 create mode 100644 board/atmel/sama7d65_curiosity/Makefile
 create mode 100644 board/atmel/sama7d65_curiosity/sama7d65_curiosity.c
 create mode 100644 configs/sama7d65_curiosity_mmc1_defconfig
 create mode 100644 drivers/clk/at91/sama7d65.c
 create mode 100644 include/configs/sama7d65_curiosity.h

Applied to u-boot-at91/master , thanks !