Add support for sam9x7 SoC and SAM9X75 Curiosity board
Subsystems (5)
v6 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 v6:
- 1/4 - New addition to this series
- 5/8 - Parse NULL in at91_clk_main_rc() call for parent_name
- 7/8 - Remove main_rc node from DT
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 (5):
dt-bindings: drop at91.h from clock includes
clk: at91: clk-main: drop parent_name check when registering main_rc
oscillator
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 | 95 ++ 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-main.c | 2 +- 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 - 21 files changed, 1669 insertions(+), 35 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
PATCH v6 1/9 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
@@ -468,7 +468,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
@@ -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
PATCH v6 2/9 clk: at91: sam9x60-pll: add support for core clock frequency inputs
In reply to Manikandan MuralidharanFrom: 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
@@ -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 7struct 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
@@ -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
@@ -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
@@ -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
PATCH v6 3/9 clk: at91: sam9x60-pll: add support for HW PLL freq dividers
In reply to Manikandan MuralidharanFrom: 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
@@ -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
@@ -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
PATCH v6 4/9 clk: at91: clk-main: drop parent_name check when registering main_rc oscillator
In reply to Manikandan MuralidharanThe clk_register function logs an error if parent_name is missing from the Device Tree.On the SAM9X7, the main_rc node is omitted to stay aligned with the Linux Device Tree.Remove the parent_name check in at91_clk_main_rc() to allow it to pass NULL when the parent is not specified.
--- drivers/clk/at91/clk-main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/at91/clk-main.c +1 -1
@@ -110,7 +110,7 @@ struct clk *at91_clk_main_rc(void __iomem *reg, const char *name,struct clk *clk;int ret; -if (!reg || !name || !parent_name) +if (!reg || !name)return ERR_PTR (-EINVAL ); main_rc =kzalloc (sizeof (*main_rc),GFP_KERNEL );
Signature · 1 line
2.25.1
Re: [PATCH v6 4/9] clk: at91: clk-main: drop parent_name check when registering main_rc oscillator
Quoted 4 lines · Manikandan Muralidharan
The
clk_registerfunction logs an error ifparent_nameis missing from the Device Tree.On the SAM9X7, themain_rcnode is omitted to stay aligned with the Linux Device Tree.Remove theparent_namecheck inat91_clk_main_rc()to allow it to pass NULL when the parent is not specified.
Hello Manikandan,
Can you explain a bit? parent_name is a field inside a struct, not in DT, so where is this parent_name taken from ?
If the main_rc is now gone, which clock fails without this patch ?
Eugen
Quoted 19 lines
Signed-off-by Manikandan Muralidharan <[email protected]>--- drivers/clk/at91/clk-main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/at91/clk-main.c +1
-1@@ -110,7 +110,7 @@ struct clk *at91_clk_main_rc(void __iomem *reg, const char *name,struct clk *clk;int ret; -if (!reg || !name || !parent_name) +if (!reg || !name)return ERR_PTR (-EINVAL ); main_rc =kzalloc (sizeof (*main_rc),GFP_KERNEL );
Re: [PATCH v6 4/9] clk: at91: clk-main: drop parent_name check when registering main_rc oscillator
Hi Eugen,
Quoted 8 lines · Eugen Hristev
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Quoted 4 lines · Manikandan Muralidharan
The
clk_registerfunction logs an error ifparent_nameis missing from the Device Tree.On the SAM9X7, themain_rcnode is omitted to stay aligned with the Linux Device Tree.Remove theparent_namecheck inat91_clk_main_rc()to allow it to pass NULL when the parent is not specified.
Quoted 6 lines
Hello Manikandan,
Can you explain a bit?
parent_nameis a field inside a struct, not in DT, so where is thisparent_nametaken from ?
If themain_rcis now gone, which clock fails without this patch ?
uclass_get_device_by_name() fails if the main_rc node is omitted from the Device Tree, resulting in an error message being printed to the console from clk_register(). This patch suppresses that message.
Quoted 21 lines
Eugen
Quoted 19 lines
Signed-off-by Manikandan Muralidharan <[email protected]>--- drivers/clk/at91/clk-main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/at91/clk-main.c +1
-1@@ -110,7 +110,7 @@ struct clk *at91_clk_main_rc(void __iomem *reg, const char *name,struct clk *clk;int ret; -if (!reg || !name || !parent_name) +if (!reg || !name)return ERR_PTR (-EINVAL ); main_rc =kzalloc (sizeof (*main_rc),GFP_KERNEL );
Signature · 2 lines
Thanks and Regards, Manikandan M.
Re: [PATCH v6 4/9] clk: at91: clk-main: drop parent_name check when registering main_rc oscillator
Quoted 13 lines · On 6/6/25 07:42, [email protected] wrote:
Hi Eugen,
Quoted 10 lines · Eugen Hristev
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Quoted 4 lines · Manikandan Muralidharan
The
clk_registerfunction logs an error ifparent_nameis missing from the Device Tree.On the SAM9X7, themain_rcnode is omitted to stay aligned with the Linux Device Tree.Remove theparent_namecheck inat91_clk_main_rc()to allow it to pass NULL when the parent is not specified.Hello Manikandan,
Quoted 8 lines
Quoted 4 lines
Can you explain a bit?
parent_nameis a field inside a struct, not in DT, so where is thisparent_nametaken from ?
If themain_rcis now gone, which clock fails without this patch ?
uclass_get_device_by_name()fails if themain_rcnode is omitted from the Device Tree, resulting in an error message being printed to the console fromclk_register(). This patch suppresses that message.
Which device is looked up ?
For which clock ?
Quoted 23 lines
Quoted 22 lines
Eugen
Quoted 19 lines
Signed-off-by Manikandan Muralidharan <[email protected]>--- drivers/clk/at91/clk-main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/at91/clk-main.c +1
-1@@ -110,7 +110,7 @@ struct clk *at91_clk_main_rc(void __iomem *reg, const char *name,struct clk *clk;int ret; -if (!reg || !name || !parent_name) +if (!reg || !name)return ERR_PTR (-EINVAL ); main_rc =kzalloc (sizeof (*main_rc),GFP_KERNEL );
Re: [PATCH v6 4/9] clk: at91: clk-main: drop parent_name check when registering main_rc oscillator
Quoted 21 lines · Eugen Hristev
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Quoted 18 lines · On 6/6/25 07:42, [email protected] wrote:
Hi Eugen,
Quoted 14 lines · Eugen Hristev
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Quoted 4 lines · Manikandan Muralidharan
The
clk_registerfunction logs an error ifparent_nameis missing from the Device Tree.On the SAM9X7, themain_rcnode is omitted to stay aligned with the Linux Device Tree.Remove theparent_namecheck inat91_clk_main_rc()to allow it to pass NULL when the parent is not specified.Hello Manikandan,
Can you explain a bit?
parent_nameis a field inside a struct, not in DT, so where is thisparent_nametaken from ?
If themain_rcis now gone, which clock fails without this patch ?
Quoted 6 lines
Quoted 3 lines
uclass_get_device_by_name()fails if themain_rcnode is omitted from the Device Tree, resulting in an error message being printed to the console fromclk_register(). This patch suppresses that message.Which device is looked up ?
For which clock ?
main_rc node is looked up which is removed from the DT. To register the main_rc_osc clock the main_rc is treated as a parent here in drivers/clk/at91/sam9x7.c using at91_clk_main_rc()
Quoted 25 lines
Quoted 24 lines
Quoted 23 lines
Eugen
Quoted 19 lines
Signed-off-by Manikandan Muralidharan <[email protected]>--- drivers/clk/at91/clk-main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/at91/clk-main.c +1
-1@@ -110,7 +110,7 @@ struct clk *at91_clk_main_rc(void __iomem *reg, const char *name,struct clk *clk;int ret; -if (!reg || !name || !parent_name) +if (!reg || !name)return ERR_PTR (-EINVAL ); main_rc =kzalloc (sizeof (*main_rc),GFP_KERNEL );
Signature · 2 lines
Thanks and Regards, Manikandan M.
PATCH v6 5/9 clk: at91: sam9x7: add pmc driver for sam9x7 SoC family
In reply to Manikandan MuralidharanFrom: 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
@@ -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
PATCH v6 6/9 ARM: at91: Add sam9x7 soc
In reply to Manikandan MuralidharanFrom: 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
@@ -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
@@ -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
@@ -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
PATCH v6 7/9 ARM: dts: at91: sam9x75_curiosity: add tweaks for sam9x75 curiosity board
In reply to Manikandan MuralidharanSince 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 | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi
arch/arm/dts/at91-sam9x75_curiosity-u-boot.dtsi new file +95 -0
@@ -0,0 +1,95 @@ +// 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>; + }; + }; + + 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_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
Re: [PATCH v6 7/9] ARM: dts: at91: sam9x75_curiosity: add tweaks for sam9x75 curiosity board
Quoted 5 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.dtsiSigned-off-by Manikandan Muralidharan <[email protected]>---
PATCH v6 8/9 board: sam9x75_curiosity: Add support for sam9x75 curiosity
In reply to Manikandan MuralidharanAdd 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
Re: [PATCH v6 8/9] board: sam9x75_curiosity: Add support for sam9x75 curiosity
Quoted 4 lines · Manikandan Muralidharan
Add board specific functions for sam9x75 curiosity
Signed-off-by Manikandan Muralidharan <[email protected]>---
PATCH v6 9/9 configs: sam9x75_curiosity: Add initial mmc default config
In reply to Manikandan MuralidharanAdd 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
@@ -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
Re: [PATCH v6 9/9] configs: sam9x75_curiosity: Add initial mmc default config
Quoted 4 lines · Manikandan Muralidharan
Add default configuration for sd-card to boot the linux kernel.
Signed-off-by Manikandan Muralidharan <[email protected]>---
Quoted 79 lines · Manikandan Muralidharan
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 v6:
- 1/4 - New addition to this series
- 5/8 - Parse NULL inat91_clk_main_rc()call forparent_name
- 7/8 - Removemain_rcnode from DTchanges in v5:
- 4/8 - DefineID_MAIN_RCname in sam9x7 clock driver thus dropping themain_rcclock from DT and Alinging it with Linux
- 6/8 - Dropmain_rcclock for pmc node in DTchanges in v4:
- 1/8 - Drop the local include fileclock/at91.hand the update theMAINTAINERSrespectively.changes in v3:
- 1/8 - renameat91.htoat91-pmc-status.h, update the SoC DTs andMAINTAINERSfile respectively
- 4/8 - update header fromclk/at91.htoclock/at91.hchanges 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 toat91-sam9x75_curiosity-u-boot.dtsi
- 7/8 - AddOF_UPSTREAMsupport for sam9x75 curiosity board
- 8/8 - update theDEFAULT_DEVICE_TREEconfig to <vendor/name>----
Manikandan Muralidharan (5):
dt-bindings: dropat91.hfrom clock includes
clk: at91: clk-main: dropparent_namecheck when registeringmain_rc
oscillator
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 configVarshini 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 socMAINTAINERS | 1 - .../dts/at91-sam9x75_curiosity-u-boot.dtsi | 95 ++ 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-main.c | 2 +- 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 - 21 files changed, 1669 insertions(+), 35 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
Quoted 9 lines
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
Even though I am not really happy with patch 4/9 , but because I haven't figured a better way to deal with it without some core rework, let's not delay this further, applied to u-boot-at91/next !
Eugen