Skip to contentSkip to conversation

Add support for sam9x7 SoC and SAM9X75 Curiosity board

PATCH Superseded Manikandan Muralidharan 2 participants 11 messages Mar 27, 2025

Subsystems (5)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v5 cover Add support for sam9x7 SoC and SAM9X75 Curiosity board

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

----
changes in v5:
- 4/8 - Define ID_MAIN_RC name in sam9x7 clock driver thus dropping the main_rc clock from DT and Alinging it with Linux
- 6/8 - Drop main_rc clock for pmc node in DT

changes in v4:
- 1/8 - Drop the local include file clock/at91.h and the update the MAINTAINERS respectively.

changes in v3:
- 1/8 - rename at91.h to at91-pmc-status.h, update the SoC DTs and MAINTAINERS file respectively
- 4/8 - update header from clk/at91.h to clock/at91.h

changes in v2:
- 1/8 - add additional PMC clock definition to support the sam9x7 upstream DT
- 6/8 - Remove support for SoC DT and board DTS as they are already available in dts/upstream
- add the differences in DT files between upstream Linux DT and U-Boot DT to at91-sam9x75_curiosity-u-boot.dtsi
- 7/8 - Add OF_UPSTREAM support for sam9x75 curiosity board
- 8/8 - update the DEFAULT_DEVICE_TREE config to <vendor/name>

----

Manikandan Muralidharan (4):
dt-bindings: drop at91.h from clock includes
ARM: dts: at91: sam9x75_curiosity: add tweaks for sam9x75 curiosity
board
board: sam9x75_curiosity: Add support for sam9x75 curiosity
configs: sam9x75_curiosity: Add initial mmc default config

Varshini Rajendran (4):
clk: at91: sam9x60-pll: add support for core clock frequency inputs
clk: at91: sam9x60-pll: add support for HW PLL freq dividers
clk: at91: sam9x7: add pmc driver for sam9x7 SoC family
ARM: at91: Add sam9x7 soc

 MAINTAINERS                                   |    1 -
 .../dts/at91-sam9x75_curiosity-u-boot.dtsi    |  105 ++
 arch/arm/mach-at91/Kconfig                    |   12 +
 arch/arm/mach-at91/arm926ejs/Makefile         |    1 +
 arch/arm/mach-at91/arm926ejs/sam9x7_devices.c |   49 +
 arch/arm/mach-at91/include/mach/hardware.h    |    2 +
 arch/arm/mach-at91/include/mach/sam9x7.h      |  172 +++
 board/atmel/sam9x75_curiosity/Kconfig         |   15 +
 board/atmel/sam9x75_curiosity/MAINTAINERS     |    7 +
 board/atmel/sam9x75_curiosity/Makefile        |    7 +
 .../sam9x75_curiosity/sam9x75_curiosity.c     |   66 +
 configs/sam9x75_curiosity_mmc_defconfig       |   73 ++
 drivers/clk/at91/Makefile                     |    1 +
 drivers/clk/at91/clk-sam9x60-pll.c            |   55 +-
 drivers/clk/at91/pmc.h                        |    2 +
 drivers/clk/at91/sam9x60.c                    |    7 +
 drivers/clk/at91/sam9x7.c                     | 1085 +++++++++++++++++
 drivers/clk/at91/sama7g5.c                    |    6 +
 include/configs/sam9x75_curiosity.h           |   23 +
 include/dt-bindings/clock/at91.h              |   23 -
 20 files changed, 1678 insertions(+), 34 deletions(-)
 create mode 100644 arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi
 create mode 100644 arch/arm/mach-at91/arm926ejs/sam9x7_devices.c
 create mode 100644 arch/arm/mach-at91/include/mach/sam9x7.h
 create mode 100644 board/atmel/sam9x75_curiosity/Kconfig
 create mode 100644 board/atmel/sam9x75_curiosity/MAINTAINERS
 create mode 100644 board/atmel/sam9x75_curiosity/Makefile
 create mode 100644 board/atmel/sam9x75_curiosity/sam9x75_curiosity.c
 create mode 100644 configs/sam9x75_curiosity_mmc_defconfig
 create mode 100644 drivers/clk/at91/sam9x7.c
 create mode 100644 include/configs/sam9x75_curiosity.h
 delete mode 100644 include/dt-bindings/clock/at91.h
Signature · 1 line
2.25.1
#1 lore raw

PATCH v5 1/8 dt-bindings: drop at91.h from clock includes

Remove clock/at91.h file as it is subset of dts/upstream/include/dt-bindings/clock/at91.h.
The constants defined in this header are being used only in dts

---
 MAINTAINERS                      |  1 -
 include/dt-bindings/clock/at91.h | 23 -----------------------
 2 files changed, 24 deletions(-)
 delete mode 100644 include/dt-bindings/clock/at91.h
MAINTAINERS +0 -1
index 10f7f1fd180..9322bc542e9 100644
@@ -464,7 +464,6 @@ F:	drivers/memory/atmel-ebi.c
 F:	drivers/misc/microchip_flexcom.c
 F:	drivers/timer/atmel_tcb_timer.c
 F:	include/dt-bindings/clk/at91.h
-F:	include/dt-bindings/clock/at91.h
 F:	include/dt-bindings/dma/at91.h
 F:	include/dt-bindings/mfd/at91-usart.h
 F:	include/dt-bindings/mfd/atmel-flexcom.h
include/dt-bindings/clock/at91.h deleted +0 -23
deleted file mode 100644
index ab3ee241d10..00000000000
@@ -1,23 +0,0 @@
-/*
- * This header provides constants for AT91 pmc status.
- *
- * The constants defined in this header are being used in dts.
- *
- * Licensed under GPLv2 or later.
- */
-
-#ifndef _DT_BINDINGS_CLK_AT91_H
-#define _DT_BINDINGS_CLK_AT91_H
-
-#define AT91_PMC_MOSCS		0		/* MOSCS Flag */
-#define AT91_PMC_LOCKA		1		/* PLLA Lock */
-#define AT91_PMC_LOCKB		2		/* PLLB Lock */
-#define AT91_PMC_MCKRDY		3		/* Master Clock */
-#define AT91_PMC_LOCKU		6		/* UPLL Lock */
-#define AT91_PMC_PCKRDY(id)	(8 + (id))	/* Programmable Clock */
-#define AT91_PMC_MOSCSELS	16		/* Main Oscillator Selection */
-#define AT91_PMC_MOSCRCS	17		/* Main On-Chip RC */
-#define AT91_PMC_CFDEV		18		/* Clock Failure Detector Event */
-#define AT91_PMC_GCKRDY		24		/* Generated Clocks */
-
-#endif
Signature · 1 line
2.25.1
#2 lore raw

PATCH v5 2/8 clk: at91: sam9x60-pll: add support for core clock frequency inputs

In reply to Manikandan Muralidharan

From: Varshini Rajendran <[email protected]>

Add support for different core clock frequency input ranges for different PLL IDs in the PLL driver and align sam9x60, sama7g5 SOC platforms.

---
 drivers/clk/at91/clk-sam9x60-pll.c | 17 ++++++++---------
 drivers/clk/at91/pmc.h             |  1 +
 drivers/clk/at91/sam9x60.c         |  7 +++++++
 drivers/clk/at91/sama7g5.c         |  6 ++++++
 4 files changed, 22 insertions(+), 9 deletions(-)
drivers/clk/at91/clk-sam9x60-pll.c +8 -9
index a30035eb8ce..676ad8294a6 100644
@@ -31,9 +31,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 {
@@ -55,14 +52,15 @@ static inline bool sam9x60_pll_ready(void __iomem *base, int id)
 	return !!(status & BIT(id));
 }
 
-static long sam9x60_frac_pll_compute_mul_frac(u32 *mul, u32 *frac, ulong rate,
+static long sam9x60_frac_pll_compute_mul_frac(const struct clk_range *core_clk,
+					      u32 *mul, u32 *frac, ulong rate,
 					      ulong parent_rate)
 {
 	unsigned long tmprate, remainder;
 	unsigned long nmul = 0;
 	unsigned long nfrac = 0;
 
-	if (rate < FCORE_MIN || rate > FCORE_MAX)
+	if (rate < core_clk->min || rate > core_clk->max)
 		return -ERANGE;
 
 	/*
@@ -82,7 +80,7 @@ static long sam9x60_frac_pll_compute_mul_frac(u32 *mul, u32 *frac, ulong rate,
 	}
 
 	/* Check if resulted rate is valid.  */
-	if (tmprate < FCORE_MIN || tmprate > FCORE_MAX)
+	if (tmprate < core_clk[0].min || tmprate > core_clk[0].max)
 		return -ERANGE;
 
 	*mul = nmul - 1;
@@ -103,8 +101,8 @@ static ulong sam9x60_frac_pll_set_rate(struct clk *clk, ulong rate)
 	if (!parent_rate)
 		return 0;
 
-	ret = sam9x60_frac_pll_compute_mul_frac(&nmul, &nfrac, rate,
-						parent_rate);
+	ret = sam9x60_frac_pll_compute_mul_frac(pll->characteristics->core_output,
+						&nmul, &nfrac, rate, parent_rate);
 	if (ret < 0)
 		return 0;
 
@@ -163,7 +161,8 @@ static int sam9x60_frac_pll_enable(struct clk *clk)
 	ulong crate;
 
 	crate = sam9x60_frac_pll_get_rate(clk);
-	if (crate < FCORE_MIN || crate > FCORE_MAX)
+	if (crate < pll->characteristics->core_output[0].min ||
+	    crate > pll->characteristics->core_output[0].max)
 		return -ERANGE;
 
 	pmc_update_bits(base, AT91_PMC_PLL_UPDT, AT91_PMC_PLL_UPDT_ID_MSK,
drivers/clk/at91/pmc.h +1 -0
index ff464522aa0..49134531564 100644
@@ -38,6 +38,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;
drivers/clk/at91/sam9x60.c +7 -0
index b7d64bdbb3d..e04266a2be2 100644
@@ -112,17 +112,24 @@ static const struct clk_range upll_outputs[] = {
 	{ .min = 300000000, .max = 500000000 },
 };
 
+/* Fractional PLL core output range. */
+static const struct clk_range core_outputs[] = {
+	{ .min = 600000000, .max = 1200000000 },
+};
+
 /* PLL characteristics. */
 static const struct clk_pll_characteristics apll_characteristics = {
 	.input = { .min = 12000000, .max = 48000000 },
 	.num_output = ARRAY_SIZE(plla_outputs),
 	.output = plla_outputs,
+	.core_output = core_outputs,
 };
 
 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,
 };
 
drivers/clk/at91/sama7g5.c +6 -0
index 63b2c647467..c0e27828b1a 100644
@@ -158,11 +158,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 },
+};
+
 /* PLL characteristics. */
 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,
 };
 
 /* Layout for fractional PLLs. */
Signature · 1 line
2.25.1
#3 lore raw

PATCH v5 3/8 clk: at91: sam9x60-pll: add support for HW PLL freq dividers

In reply to Manikandan Muralidharan

From: Varshini Rajendran <[email protected]>

Add support for hardware dividers for PLL IDs.In sam9x7 SoC, PLL_ID_PLLA and PLL_ID_PLLA_DIV2 has /2 hardware dividers each.

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

                               |
                               +--> HW Div = 2 ---> fplladiv2ck
---
 drivers/clk/at91/clk-sam9x60-pll.c | 38 +++++++++++++++++++++++++++++-
 drivers/clk/at91/pmc.h             |  1 +
 2 files changed, 38 insertions(+), 1 deletion(-)
drivers/clk/at91/clk-sam9x60-pll.c +37 -1
index 676ad8294a6..df8172bccac 100644
@@ -22,6 +22,7 @@
 
 #define UBOOT_DM_CLK_AT91_SAM9X60_DIV_PLL	"at91-sam9x60-div-pll-clk"
 #define UBOOT_DM_CLK_AT91_SAM9X60_FRAC_PLL	"at91-sam9x60-frac-pll-clk"
+#define UBOOT_DM_CLK_AT91_SAM9X60_FIXED_DIV_PLL	"at91-sam9x60-fixed-div-pll-clk"
 
 #define	PMC_PLL_CTRL0_DIV_MSK	GENMASK(7, 0)
 #define	PMC_PLL_CTRL1_MUL_MSK	GENMASK(31, 24)
@@ -140,6 +141,7 @@ static ulong sam9x60_frac_pll_get_rate(struct clk *clk)
 	void __iomem *base = pll->base;
 	ulong parent_rate = clk_get_parent_rate(clk);
 	u32 mul, frac, val;
+	ulong pll_rate;
 
 	if (!parent_rate)
 		return 0;
@@ -149,8 +151,12 @@ static ulong sam9x60_frac_pll_get_rate(struct clk *clk)
 	pmc_read(base, AT91_PMC_PLL_CTRL1, &val);
 	mul = (val & pll->layout->mul_mask) >> pll->layout->mul_shift;
 	frac = (val & pll->layout->frac_mask) >> pll->layout->frac_shift;
+	pll_rate = (parent_rate * (mul + 1) + ((u64)parent_rate * frac >> 22));
 
-	return (parent_rate * (mul + 1) + ((u64)parent_rate * frac >> 22));
+	if (pll->layout->div2)
+		pll_rate >>= 1;
+
+	return pll_rate;
 }
 
 static int sam9x60_frac_pll_enable(struct clk *clk)
@@ -359,6 +365,16 @@ static ulong sam9x60_div_pll_get_rate(struct clk *clk)
 	return parent_rate / (div + 1);
 }
 
+static ulong sam9x60_fixed_div_pll_get_rate(struct clk *clk)
+{
+	ulong parent_rate = clk_get_parent_rate(clk);
+
+	if (!parent_rate)
+		return 0;
+
+	return parent_rate >> 1;
+}
+
 static const struct clk_ops sam9x60_div_pll_ops = {
 	.enable = sam9x60_div_pll_enable,
 	.disable = sam9x60_div_pll_disable,
@@ -366,6 +382,12 @@ static const struct clk_ops sam9x60_div_pll_ops = {
 	.get_rate = sam9x60_div_pll_get_rate,
 };
 
+static const struct clk_ops sam9x60_fixed_div_pll_ops = {
+	.enable = sam9x60_div_pll_enable,
+	.disable = sam9x60_div_pll_disable,
+	.get_rate = sam9x60_fixed_div_pll_get_rate,
+};
+
 static struct clk *
 sam9x60_clk_register_pll(void __iomem *base, const char *type,
 			 const char *name, const char *parent_name, u8 id,
@@ -406,6 +428,13 @@ sam9x60_clk_register_div_pll(void __iomem *base, const char *name,
 			     const struct clk_pll_characteristics *characteristics,
 			     const struct clk_pll_layout *layout, bool critical)
 {
+	if (layout->div2) {
+		return sam9x60_clk_register_pll(base,
+			UBOOT_DM_CLK_AT91_SAM9X60_FIXED_DIV_PLL, name, parent_name,
+			id, characteristics, layout,
+			CLK_GET_RATE_NOCACHE | (critical ? CLK_IS_CRITICAL : 0));
+	}
+
 	return sam9x60_clk_register_pll(base,
 		UBOOT_DM_CLK_AT91_SAM9X60_DIV_PLL, name, parent_name, id,
 		characteristics, layout,
@@ -431,6 +460,13 @@ U_BOOT_DRIVER(at91_sam9x60_div_pll_clk) = {
 	.flags = DM_FLAG_PRE_RELOC,
 };
 
+U_BOOT_DRIVER(at91_sam9x60_fixed_div_pll_clk) = {
+	.name = UBOOT_DM_CLK_AT91_SAM9X60_FIXED_DIV_PLL,
+	.id = UCLASS_CLK,
+	.ops = &sam9x60_fixed_div_pll_ops,
+	.flags = DM_FLAG_PRE_RELOC,
+};
+
 U_BOOT_DRIVER(at91_sam9x60_frac_pll_clk) = {
 	.name = UBOOT_DM_CLK_AT91_SAM9X60_FRAC_PLL,
 	.id = UCLASS_CLK,
drivers/clk/at91/pmc.h +1 -0
index 49134531564..580c9964ff4 100644
@@ -54,6 +54,7 @@ struct clk_pll_layout {
 	u8 frac_shift;
 	u8 div_shift;
 	u8 endiv_shift;
+	u8 div2;
 };
 
 struct clk_programmable_layout {
Signature · 1 line
2.25.1
#4 lore raw

PATCH v5 4/8 clk: at91: sam9x7: add pmc driver for sam9x7 SoC family

In reply to Manikandan Muralidharan

From: Varshini Rajendran <[email protected]>

Add PMC driver support for sam9x7 SoC family

---
 drivers/clk/at91/Makefile |    1 +
 drivers/clk/at91/sam9x7.c | 1085 +++++++++++++++++++++++++++++++++++++
 2 files changed, 1086 insertions(+)
 create mode 100644 drivers/clk/at91/sam9x7.c
drivers/clk/at91/Makefile +1 -0
index e53dcb4ca7a..6cca861f81c 100644
@@ -12,6 +12,7 @@ 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_SAM9X60)		+= sam9x60.o
+obj-$(CONFIG_SAM9X7)		+= sam9x7.o
 else
 obj-y += compat.o
 endif
drivers/clk/at91/sam9x7.c new file +1085 -0

1,085 lines not on this page · raw message

Signature · 1 line
2.25.1
#5 lore raw

PATCH v5 5/8 ARM: at91: Add sam9x7 soc

In reply to Manikandan Muralidharan

From: Varshini Rajendran <[email protected]>

Add new Microchip sam9x7 SoC based on an ARM926.

---
 arch/arm/mach-at91/Kconfig                    |   4 +
 arch/arm/mach-at91/arm926ejs/Makefile         |   1 +
 arch/arm/mach-at91/arm926ejs/sam9x7_devices.c |  49 +++++
 arch/arm/mach-at91/include/mach/hardware.h    |   2 +
 arch/arm/mach-at91/include/mach/sam9x7.h      | 172 ++++++++++++++++++
 5 files changed, 228 insertions(+)
 create mode 100644 arch/arm/mach-at91/arm926ejs/sam9x7_devices.c
 create mode 100644 arch/arm/mach-at91/include/mach/sam9x7.h
arch/arm/mach-at91/Kconfig +4 -0
index 7c4ccc427c8..5429257875d 100644
@@ -43,6 +43,10 @@ config SAM9X60
 	bool
 	select CPU_ARM926EJS
 
+config SAM9X7
+	bool
+	select CPU_ARM926EJS
+
 config SAMA7G5
 	bool
 	select CPU_V7A
arch/arm/mach-at91/arm926ejs/Makefile +1 -0
index 8f0bc5d997e..977299a5911 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_AT91SAM9G45)	+= at91sam9m10g45_devices.o
 obj-$(CONFIG_AT91SAM9N12)	+= at91sam9n12_devices.o
 obj-$(CONFIG_AT91SAM9X5)	+= at91sam9x5_devices.o
 obj-$(CONFIG_SAM9X60)		+= sam9x60_devices.o
+obj-$(CONFIG_SAM9X7)		+= sam9x7_devices.o
 obj-y += clock.o
 obj-y += cpu.o
 ifndef CONFIG_$(PHASE_)SYSRESET
arch/arm/mach-at91/arm926ejs/sam9x7_devices.c new file +49 -0

49 lines not on this page · raw message

arch/arm/mach-at91/include/mach/hardware.h +2 -0
index 988ef492b62..de89714b097 100644
@@ -23,6 +23,8 @@
 # include <asm/arch/at91sam9x5.h>
 #elif defined(CONFIG_SAM9X60)
 # include <asm/arch/sam9x60.h>
+#elif defined(CONFIG_SAM9X7)
+# include <asm/arch/sam9x7.h>
 #elif defined(CONFIG_SAMA7G5)
 # include <asm/arch/sama7g5.h>
 #elif defined(CONFIG_SAMA5D2)
arch/arm/mach-at91/include/mach/sam9x7.h new file +172 -0

172 lines not on this page · raw message

Signature · 1 line
2.25.1
#6 lore raw

PATCH v5 6/8 ARM: dts: at91: sam9x75_curiosity: add tweaks for sam9x75 curiosity board

In reply to Manikandan Muralidharan

Since the SoC and board DT are already available in dts/upstream, add the difference from upstream DTS to at91-sam9x75_curiosity-u-boot.dtsi

---
 .../dts/at91-sam9x75_curiosity-u-boot.dtsi    | 105 ++++++++++++++++++
 1 file changed, 105 insertions(+)
 create mode 100644 arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi
arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi new file +105 -0
new file mode 100644
index 00000000000..e25e3734eb1
@@ -0,0 +1,105 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * at91-sam9x75_curiosity-u-boot.dtsi - Device Tree file for SAM9X75
+ * CURIOSITY board.
+ *
+ * Copyright (C) 2025 Microchip Technology Inc. and its subsidiaries
+ *
+ * Author: Manikandan Muralidharan <[email protected]>
+ */
+
+/ {
+	cpus {
+		cpu@0 {
+			clocks = <&pmc PMC_TYPE_CORE 25>, <&pmc PMC_TYPE_CORE 17>, <&main_xtal>;
+			clock-names = "cpu", "master", "xtal";
+		};
+	};
+
+	clocks {
+		slow_rc_osc: slow_rc_osc {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <18500>;
+		};
+
+		main_rc: main_rc {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <12000000>;
+		};
+	};
+
+	ahb {
+		bootph-all;
+
+		apb {
+			bootph-all;
+
+			pinctrl {
+				bootph-all;
+			};
+		};
+	};
+
+	chosen {
+		bootph-all;
+	};
+};
+
+&clk32k {
+	bootph-all;
+	clocks = <&slow_rc_osc>, <&slow_xtal>;
+};
+
+&dbgu {
+	bootph-all;
+};
+
+&gmac {
+	compatible = "microchip,sam9x7-gem", "cdns,sama7g5-gem";
+};
+
+&main_rc {
+	bootph-all;
+};
+
+&main_xtal {
+	bootph-all;
+};
+
+&pinctrl_dbgu_default {
+	bootph-all;
+};
+
+&pinctrl_sdmmc0_default {
+	bootph-all;
+};
+
+&pioA {
+	bootph-all;
+};
+
+&pioB {
+	bootph-all;
+};
+
+&pit64b0 {
+	bootph-all;
+};
+
+&pmc {
+	bootph-all;
+};
+
+&sdmmc0 {
+	bootph-all;
+};
+
+&slow_xtal {
+	bootph-all;
+};
+
+&slow_rc_osc {
+	bootph-all;
+};
Signature · 1 line
2.25.1
#7 lore raw

Re: [PATCH v5 6/8] ARM: dts: at91: sam9x75_curiosity: add tweaks for sam9x75 curiosity board

Quoted 35 lines · Manikandan Muralidharan

Since the SoC and board DT are already available in dts/upstream, add the difference from upstream DTS to at91-sam9x75_curiosity-u-boot.dtsi

---
 .../dts/at91-sam9x75_curiosity-u-boot.dtsi    | 105 ++++++++++++++++++
 1 file changed, 105 insertions(+)
 create mode 100644 arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi
arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi new file +20 -0
new file mode 100644
index 00000000000..e25e3734eb1
@@ -0,0 +1,105 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * at91-sam9x75_curiosity-u-boot.dtsi - Device Tree file for SAM9X75
+ * CURIOSITY board.
+ *
+ * Copyright (C) 2025 Microchip Technology Inc. and its subsidiaries
+ *
+ * Author: Manikandan Muralidharan <[email protected]>
+ */
+
+/ {
+	cpus {
+		cpu@0 {
+			clocks = <&pmc PMC_TYPE_CORE 25>, <&pmc PMC_TYPE_CORE 17>, <&main_xtal>;
+			clock-names = "cpu", "master", "xtal";
+		};
+	};
+
+	clocks {
+		slow_rc_osc: slow_rc_osc {

arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi line 30

Quoted 10 lines
arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi new file +10 -0
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <18500>;
+		};
+
+		main_rc: main_rc {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <12000000>;
+		};

What is the purpose of main_rc ?
If you reworked the pmc driver and now it's no longer required, please remove it.

Quoted 75 lines
arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi new file +75 -0
+	};
+
+	ahb {
+		bootph-all;
+
+		apb {
+			bootph-all;
+
+			pinctrl {
+				bootph-all;
+			};
+		};
+	};
+
+	chosen {
+		bootph-all;
+	};
+};
+
+&clk32k {
+	bootph-all;
+	clocks = <&slow_rc_osc>, <&slow_xtal>;
+};
+
+&dbgu {
+	bootph-all;
+};
+
+&gmac {
+	compatible = "microchip,sam9x7-gem", "cdns,sama7g5-gem";
+};
+
+&main_rc {
+	bootph-all;
+};
+
+&main_xtal {
+	bootph-all;
+};
+
+&pinctrl_dbgu_default {
+	bootph-all;
+};
+
+&pinctrl_sdmmc0_default {
+	bootph-all;
+};
+
+&pioA {
+	bootph-all;
+};
+
+&pioB {
+	bootph-all;
+};
+
+&pit64b0 {
+	bootph-all;
+};
+
+&pmc {
+	bootph-all;
+};
+
+&sdmmc0 {
+	bootph-all;
+};
+
+&slow_xtal {
+	bootph-all;
+};
+
+&slow_rc_osc {
+	bootph-all;
+};
#8 lore raw

Re: [PATCH v5 6/8] ARM: dts: at91: sam9x75_curiosity: add tweaks for sam9x75 curiosity board

Quoted 44 lines · Eugen Hristev

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 41 lines · Manikandan Muralidharan

Since the SoC and board DT are already available in dts/upstream, add the difference from upstream DTS to at91-sam9x75_curiosity-u-boot.dtsi

---
  .../dts/at91-sam9x75_curiosity-u-boot.dtsi    | 105 ++++++++++++++++++
  1 file changed, 105 insertions(+)

create mode 100644 arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi

arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi new file +26 -0
new file mode 100644
index 00000000000..e25e3734eb1
@@ -0,0 +1,105 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * at91-sam9x75_curiosity-u-boot.dtsi - Device Tree file for SAM9X75
+ * CURIOSITY board.
+ *
+ * Copyright (C) 2025 Microchip Technology Inc. and its subsidiaries
+ *
+ * Author: Manikandan Muralidharan <[email protected]>
+ */
+
+/ {
+     cpus {
+             cpu@0 {
+                     clocks = <&pmc PMC_TYPE_CORE 25>, <&pmc PMC_TYPE_CORE 17>, <&main_xtal>;
+                     clock-names = "cpu", "master", "xtal";
+             };
+     };
+
+     clocks {
+             slow_rc_osc: slow_rc_osc {
+                     compatible = "fixed-clock";
+                     #clock-cells = <0>;
+                     clock-frequency = <18500>;
+             };
+
+             main_rc: main_rc {
Quoted 9 lines

arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi line 30

Quoted 4 lines
arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi new file +4 -0
+                     compatible = "fixed-clock";
+                     #clock-cells = <0>;
+                     clock-frequency = <12000000>;
+             };

What is the purpose of main_rc ?
If you reworked the pmc driver and now it's no longer required, please remove it.

Sorry my bad. I missed it, I will send another version for it.

Quoted 76 lines
Quoted 75 lines
arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi new file +75 -0
+     };
+
+     ahb {
+             bootph-all;
+
+             apb {
+                     bootph-all;
+
+                     pinctrl {
+                             bootph-all;
+                     };
+             };
+     };
+
+     chosen {
+             bootph-all;
+     };
+};
+
+&clk32k {
+     bootph-all;
+     clocks = <&slow_rc_osc>, <&slow_xtal>;
+};
+
+&dbgu {
+     bootph-all;
+};
+
+&gmac {
+     compatible = "microchip,sam9x7-gem", "cdns,sama7g5-gem";
+};
+
+&main_rc {
+     bootph-all;
+};
+
+&main_xtal {
+     bootph-all;
+};
+
+&pinctrl_dbgu_default {
+     bootph-all;
+};
+
+&pinctrl_sdmmc0_default {
+     bootph-all;
+};
+
+&pioA {
+     bootph-all;
+};
+
+&pioB {
+     bootph-all;
+};
+
+&pit64b0 {
+     bootph-all;
+};
+
+&pmc {
+     bootph-all;
+};
+
+&sdmmc0 {
+     bootph-all;
+};
+
+&slow_xtal {
+     bootph-all;
+};
+
+&slow_rc_osc {
+     bootph-all;
+};
Signature · 2 lines
Thanks and Regards,
Manikandan M.
#9 lore raw

PATCH v5 7/8 board: sam9x75_curiosity: Add support for sam9x75 curiosity

In reply to Manikandan Muralidharan

Add board specific functions for sam9x75 curiosity

---
 arch/arm/mach-at91/Kconfig                    |  8 +++
 board/atmel/sam9x75_curiosity/Kconfig         | 15 +++++
 board/atmel/sam9x75_curiosity/MAINTAINERS     |  6 ++
 board/atmel/sam9x75_curiosity/Makefile        |  7 ++
 .../sam9x75_curiosity/sam9x75_curiosity.c     | 66 +++++++++++++++++++
 include/configs/sam9x75_curiosity.h           | 23 +++++++
 6 files changed, 125 insertions(+)
 create mode 100644 board/atmel/sam9x75_curiosity/Kconfig
 create mode 100644 board/atmel/sam9x75_curiosity/MAINTAINERS
 create mode 100644 board/atmel/sam9x75_curiosity/Makefile
 create mode 100644 board/atmel/sam9x75_curiosity/sam9x75_curiosity.c
 create mode 100644 include/configs/sam9x75_curiosity.h
arch/arm/mach-at91/Kconfig +8 -0
index 5429257875d..d21534ce883 100644
@@ -158,6 +158,13 @@ config TARGET_SAM9X60_CURIOSITY
         select BOARD_EARLY_INIT_F
         select BOARD_LATE_INIT
 
+config TARGET_SAM9X75_CURIOSITY
+	bool "SAM9X75 CURIOSITY board"
+	select SAM9X7
+	select BOARD_EARLY_INIT_F
+	select BOARD_LATE_INIT
+	imply OF_UPSTREAM
+
 config TARGET_SAMA5D2_PTC_EK
 	bool "SAMA5D2 PTC EK board"
 	select BOARD_EARLY_INIT_F
@@ -355,6 +362,7 @@ source "board/atmel/at91sam9rlek/Kconfig"
 source "board/atmel/at91sam9x5ek/Kconfig"
 source "board/atmel/sam9x60ek/Kconfig"
 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/sama5d2_ptc_ek/Kconfig"
board/atmel/sam9x75_curiosity/Kconfig new file +15 -0
new file mode 100644
index 00000000000..8ea93a21aa3
@@ -0,0 +1,15 @@
+if TARGET_SAM9X75_CURIOSITY
+
+config SYS_BOARD
+	default "sam9x75_curiosity"
+
+config SYS_VENDOR
+	default "atmel"
+
+config SYS_SOC
+	default "at91"
+
+config SYS_CONFIG_NAME
+	default "sam9x75_curiosity"
+
+endif
board/atmel/sam9x75_curiosity/MAINTAINERS new file +6 -0
new file mode 100644
index 00000000000..a175053418f
@@ -0,0 +1,6 @@
+SAM9X75 CURIOSITY BOARD
+M:	Manikandan Muralidharan <[email protected]>
+S:	Maintained
+F:	board/atmel/sam9x75_curiosity/
+F:	include/configs/sam9x75_curiosity.h
+F:	arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi
board/atmel/sam9x75_curiosity/Makefile new file +7 -0
new file mode 100644
index 00000000000..1f36d613229
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2025 Microchip Technology Inc. and its subsidiaries
+#
+# Author: Manikandan Muralidharan <[email protected]>
+
+obj-y += sam9x75_curiosity.o
board/atmel/sam9x75_curiosity/sam9x75_curiosity.c new file +66 -0

66 lines not on this page · raw message

include/configs/sam9x75_curiosity.h new file +23 -0
new file mode 100644
index 00000000000..62a855d9f01
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Configuration settings for the SAM9X75 CURIOSITY board.
+ *
+ * Copyright (C) 2025 Microchip Technology Inc. and its subsidiaries
+ *
+ * Author: Manikandan Muralidharan <[email protected]>
+ */
+
+#ifndef __CONFIG_H__
+#define __CONFIG_H__
+
+#define CFG_SYS_AT91_SLOW_CLOCK	32768
+#define CFG_SYS_AT91_MAIN_CLOCK	24000000	/* 24 MHz crystal */
+
+#define CFG_USART_BASE   ATMEL_BASE_DBGU
+#define CFG_USART_ID     0 /* ignored in arm */
+
+/* SDRAM */
+#define CFG_SYS_SDRAM_BASE		0x20000000
+#define CFG_SYS_SDRAM_SIZE		0x10000000      /* 256 megs */
+
+#endif
Signature · 1 line
2.25.1
#10 lore raw

PATCH v5 8/8 configs: sam9x75_curiosity: Add initial mmc default config

In reply to Manikandan Muralidharan

Add default configuration for sd-card to boot the linux kernel.

---
 board/atmel/sam9x75_curiosity/MAINTAINERS |  1 +
 configs/sam9x75_curiosity_mmc_defconfig   | 73 +++++++++++++++++++++++
 2 files changed, 74 insertions(+)
 create mode 100644 configs/sam9x75_curiosity_mmc_defconfig
board/atmel/sam9x75_curiosity/MAINTAINERS +1 -0
index a175053418f..f0dfdbe8d5c 100644
@@ -4,3 +4,4 @@ S:	Maintained
 F:	board/atmel/sam9x75_curiosity/
 F:	include/configs/sam9x75_curiosity.h
 F:	arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi
+F:	configs/sam9x75_curiosity_mmc_defconfig
configs/sam9x75_curiosity_mmc_defconfig new file +73 -0

73 lines not on this page · raw message

Signature · 1 line
2.25.1