Skip to content

Commit 3b42530

Browse files
committed
Merge tag 'at91-soc-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into soc/drivers
Microchip AT91 SoC updates for v6.12 It contains: - support for the Microchip SAM9X7 SoC: -- power management -- SoC identification -- sysreg documentation updates -- necessary Kconfig updates * tag 'at91-soc-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: at91: Kconfig: add config flag for SAM9X7 SoC ARM: at91: add support in SoC driver for new sam9x7 ARM: at91: pm: add sam9x7 SoC init config ARM: at91: pm: add support for sam9x7 SoC family dt-bindings: atmel-sysreg: add sam9x7 Link: https://lore.kernel.org/r/20240901133110.2038675-3-claudiu.beznea@tuxon.dev Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents dc2b17f + 1a92f03 commit 3b42530

8 files changed

Lines changed: 120 additions & 5 deletions

File tree

Documentation/devicetree/bindings/arm/atmel-sysregs.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ PIT Timer required properties:
1111
shared across all System Controller members.
1212

1313
PIT64B Timer required properties:
14-
- compatible: Should be "microchip,sam9x60-pit64b"
14+
- compatible: Should be "microchip,sam9x60-pit64b" or
15+
"microchip,sam9x7-pit64b", "microchip,sam9x60-pit64b"
1516
- reg: Should contain registers location and length
1617
- interrupts: Should contain interrupt for PIT64B timer
1718
- clocks: Should contain the available clock sources for PIT64B timer.
@@ -31,7 +32,8 @@ RAMC SDRAM/DDR Controller required properties:
3132
"atmel,at91sam9g45-ddramc",
3233
"atmel,sama5d3-ddramc",
3334
"microchip,sam9x60-ddramc",
34-
"microchip,sama7g5-uddrc"
35+
"microchip,sama7g5-uddrc",
36+
"microchip,sam9x7-ddramc", "atmel,sama5d3-ddramc".
3537
- reg: Should contain registers location and length
3638

3739
Examples:

arch/arm/mach-at91/Kconfig

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,27 @@ config SOC_SAM9X60
141141
help
142142
Select this if you are using Microchip's SAM9X60 SoC
143143

144+
config SOC_SAM9X7
145+
bool "SAM9X7"
146+
depends on ARCH_MULTI_V5
147+
select ATMEL_AIC5_IRQ
148+
select ATMEL_PM if PM
149+
select CPU_ARM926T
150+
select HAVE_AT91_USB_CLK
151+
select HAVE_AT91_GENERATED_CLK
152+
select HAVE_AT91_SAM9X60_PLL
153+
select MEMORY
154+
select PINCTRL_AT91
155+
select SOC_SAM_V4_V5
156+
select SRAM if PM
157+
help
158+
Select this if you are using Microchip's SAM9X7 SoC
159+
144160
comment "Clocksource driver selection"
145161

146162
config ATMEL_CLOCKSOURCE_PIT
147163
bool "Periodic Interval Timer (PIT) support"
148-
depends on SOC_AT91SAM9 || SOC_SAM9X60 || SOC_SAMA5
164+
depends on SOC_AT91SAM9 || SOC_SAM9X60 || SOC_SAM9X7 || SOC_SAMA5
149165
default SOC_AT91SAM9 || SOC_SAMA5
150166
select ATMEL_PIT
151167
help
@@ -155,7 +171,7 @@ config ATMEL_CLOCKSOURCE_PIT
155171

156172
config ATMEL_CLOCKSOURCE_TCB
157173
bool "Timer Counter Blocks (TCB) support"
158-
default SOC_AT91RM9200 || SOC_AT91SAM9 || SOC_SAM9X60 || SOC_SAMA5
174+
default SOC_AT91RM9200 || SOC_AT91SAM9 || SOC_SAM9X60 || SOC_SAM9X7 || SOC_SAMA5
159175
select ATMEL_TCB_CLKSRC
160176
help
161177
Select this to get a high precision clocksource based on a
@@ -166,7 +182,7 @@ config ATMEL_CLOCKSOURCE_TCB
166182

167183
config MICROCHIP_CLOCKSOURCE_PIT64B
168184
bool "64-bit Periodic Interval Timer (PIT64B) support"
169-
default SOC_SAM9X60 || SOC_SAMA7
185+
default SOC_SAM9X60 || SOC_SAM9X7 || SOC_SAMA7
170186
select MICROCHIP_PIT64B
171187
help
172188
Select this to get a high resolution clockevent (SAM9X60) or

arch/arm/mach-at91/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
obj-$(CONFIG_SOC_AT91RM9200) += at91rm9200.o
88
obj-$(CONFIG_SOC_AT91SAM9) += at91sam9.o
99
obj-$(CONFIG_SOC_SAM9X60) += sam9x60.o
10+
obj-$(CONFIG_SOC_SAM9X7) += sam9x7.o
1011
obj-$(CONFIG_SOC_SAMA5) += sama5.o sam_secure.o
1112
obj-$(CONFIG_SOC_SAMA7) += sama7.o
1213
obj-$(CONFIG_SOC_SAMV7) += samv7.o

arch/arm/mach-at91/generic.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
extern void __init at91rm9200_pm_init(void);
1313
extern void __init at91sam9_pm_init(void);
1414
extern void __init sam9x60_pm_init(void);
15+
extern void __init sam9x7_pm_init(void);
1516
extern void __init sama5_pm_init(void);
1617
extern void __init sama5d2_pm_init(void);
1718
extern void __init sama7_pm_init(void);
1819
#else
1920
static inline void __init at91rm9200_pm_init(void) { }
2021
static inline void __init at91sam9_pm_init(void) { }
2122
static inline void __init sam9x60_pm_init(void) { }
23+
static inline void __init sam9x7_pm_init(void) { }
2224
static inline void __init sama5_pm_init(void) { }
2325
static inline void __init sama5d2_pm_init(void) { }
2426
static inline void __init sama7_pm_init(void) { }

arch/arm/mach-at91/pm.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,13 @@ static const struct of_device_id sama7g5_ws_ids[] = {
233233
{ /* sentinel */ }
234234
};
235235

236+
static const struct of_device_id sam9x7_ws_ids[] = {
237+
{ .compatible = "microchip,sam9x7-rtc", .data = &ws_info[1] },
238+
{ .compatible = "microchip,sam9x7-rtt", .data = &ws_info[4] },
239+
{ .compatible = "microchip,sam9x7-gem", .data = &ws_info[5] },
240+
{ /* sentinel */ }
241+
};
242+
236243
static int at91_pm_config_ws(unsigned int pm_mode, bool set)
237244
{
238245
const struct wakeup_source_info *wsi;
@@ -1361,6 +1368,7 @@ static const struct of_device_id atmel_pmc_ids[] __initconst = {
13611368
{ .compatible = "atmel,sama5d4-pmc", .data = &pmc_infos[1] },
13621369
{ .compatible = "atmel,sama5d2-pmc", .data = &pmc_infos[1] },
13631370
{ .compatible = "microchip,sam9x60-pmc", .data = &pmc_infos[4] },
1371+
{ .compatible = "microchip,sam9x7-pmc", .data = &pmc_infos[4] },
13641372
{ .compatible = "microchip,sama7g5-pmc", .data = &pmc_infos[5] },
13651373
{ /* sentinel */ },
13661374
};
@@ -1499,6 +1507,27 @@ void __init sam9x60_pm_init(void)
14991507
soc_pm.config_pmc_ws = at91_sam9x60_config_pmc_ws;
15001508
}
15011509

1510+
void __init sam9x7_pm_init(void)
1511+
{
1512+
static const int modes[] __initconst = {
1513+
AT91_PM_STANDBY, AT91_PM_ULP0,
1514+
};
1515+
int ret;
1516+
1517+
if (!IS_ENABLED(CONFIG_SOC_SAM9X7))
1518+
return;
1519+
1520+
at91_pm_modes_validate(modes, ARRAY_SIZE(modes));
1521+
ret = at91_dt_ramc(false);
1522+
if (ret)
1523+
return;
1524+
1525+
at91_pm_init(NULL);
1526+
1527+
soc_pm.ws_ids = sam9x7_ws_ids;
1528+
soc_pm.config_pmc_ws = at91_sam9x60_config_pmc_ws;
1529+
}
1530+
15021531
void __init at91sam9_pm_init(void)
15031532
{
15041533
int ret;

arch/arm/mach-at91/sam9x7.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// SPDX-License-Identifier: GPL-2.0+
2+
/*
3+
* Setup code for SAM9X7.
4+
*
5+
* Copyright (C) 2023 Microchip Technology Inc. and its subsidiaries
6+
*
7+
* Author: Varshini Rajendran <varshini.rajendran@microchip.com>
8+
*/
9+
10+
#include <linux/of.h>
11+
#include <linux/of_platform.h>
12+
13+
#include <asm/mach/arch.h>
14+
15+
#include "generic.h"
16+
17+
static void __init sam9x7_init(void)
18+
{
19+
of_platform_default_populate(NULL, NULL, NULL);
20+
21+
sam9x7_pm_init();
22+
}
23+
24+
static const char * const sam9x7_dt_board_compat[] __initconst = {
25+
"microchip,sam9x7",
26+
NULL
27+
};
28+
29+
DT_MACHINE_START(sam9x7_dt, "Microchip SAM9X7")
30+
/* Maintainer: Microchip */
31+
.init_machine = sam9x7_init,
32+
.dt_compat = sam9x7_dt_board_compat,
33+
MACHINE_END

drivers/soc/atmel/soc.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,29 @@ static const struct at91_soc socs[] __initconst = {
101101
AT91_CIDR_VERSION_MASK, SAM9X60_D6K_EXID_MATCH,
102102
"sam9x60 8MiB SDRAM SiP", "sam9x60"),
103103
#endif
104+
#ifdef CONFIG_SOC_SAM9X7
105+
AT91_SOC(SAM9X7_CIDR_MATCH, AT91_CIDR_MATCH_MASK,
106+
AT91_CIDR_VERSION_MASK, SAM9X70_EXID_MATCH,
107+
"sam9x70", "sam9x7"),
108+
AT91_SOC(SAM9X7_CIDR_MATCH, AT91_CIDR_MATCH_MASK,
109+
AT91_CIDR_VERSION_MASK, SAM9X72_EXID_MATCH,
110+
"sam9x72", "sam9x7"),
111+
AT91_SOC(SAM9X7_CIDR_MATCH, AT91_CIDR_MATCH_MASK,
112+
AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
113+
"sam9x75", "sam9x7"),
114+
AT91_SOC(SAM9X7_CIDR_MATCH, SAM9X75_D1M_EXID_MATCH,
115+
AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
116+
"sam9x75 16MB DDR2 SiP", "sam9x7"),
117+
AT91_SOC(SAM9X7_CIDR_MATCH, SAM9X75_D5M_EXID_MATCH,
118+
AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
119+
"sam9x75 64MB DDR2 SiP", "sam9x7"),
120+
AT91_SOC(SAM9X7_CIDR_MATCH, SAM9X75_D1G_EXID_MATCH,
121+
AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
122+
"sam9x75 125MB DDR3L SiP ", "sam9x7"),
123+
AT91_SOC(SAM9X7_CIDR_MATCH, SAM9X75_D2G_EXID_MATCH,
124+
AT91_CIDR_VERSION_MASK, SAM9X75_EXID_MATCH,
125+
"sam9x75 250MB DDR3L SiP", "sam9x7"),
126+
#endif
104127
#ifdef CONFIG_SOC_SAMA5
105128
AT91_SOC(SAMA5D2_CIDR_MATCH, AT91_CIDR_MATCH_MASK,
106129
AT91_CIDR_VERSION_MASK, SAMA5D21CU_EXID_MATCH,

drivers/soc/atmel/soc.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ at91_soc_init(const struct at91_soc *socs);
4444
#define AT91SAM9X5_CIDR_MATCH 0x019a05a0
4545
#define AT91SAM9N12_CIDR_MATCH 0x019a07a0
4646
#define SAM9X60_CIDR_MATCH 0x019b35a0
47+
#define SAM9X7_CIDR_MATCH 0x09750020
4748
#define SAMA7G5_CIDR_MATCH 0x00162100
4849

4950
#define AT91SAM9M11_EXID_MATCH 0x00000001
@@ -66,6 +67,14 @@ at91_soc_init(const struct at91_soc *socs);
6667
#define SAM9X60_D1G_EXID_MATCH 0x00000010
6768
#define SAM9X60_D6K_EXID_MATCH 0x00000011
6869

70+
#define SAM9X70_EXID_MATCH 0x00000005
71+
#define SAM9X72_EXID_MATCH 0x00000004
72+
#define SAM9X75_D1G_EXID_MATCH 0x00000018
73+
#define SAM9X75_D2G_EXID_MATCH 0x00000020
74+
#define SAM9X75_D1M_EXID_MATCH 0x00000003
75+
#define SAM9X75_D5M_EXID_MATCH 0x00000010
76+
#define SAM9X75_EXID_MATCH 0x00000000
77+
6978
#define SAMA7G51_EXID_MATCH 0x3
7079
#define SAMA7G52_EXID_MATCH 0x2
7180
#define SAMA7G53_EXID_MATCH 0x1

0 commit comments

Comments
 (0)