Unverified Commit 3b425306 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge tag 'at91-soc-6.12' of...

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: default avatarArnd Bergmann <arnd@arndb.de>
parents dc2b17fb 1a92f038
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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:
+19 −3
Original line number Diff line number Diff line
@@ -141,11 +141,27 @@ 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 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 +171,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 +182,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
+1 −0
Original line number Diff line number Diff line
@@ -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
+2 −0
Original line number Diff line number Diff line
@@ -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) { }
+29 −0
Original line number Diff line number Diff line
@@ -233,6 +233,13 @@ static const struct of_device_id sama7g5_ws_ids[] = {
	{ /* sentinel */ }
};

static const struct of_device_id sam9x7_ws_ids[] = {
	{ .compatible = "microchip,sam9x7-rtc",		.data = &ws_info[1] },
	{ .compatible = "microchip,sam9x7-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;
@@ -1361,6 +1368,7 @@ static const struct of_device_id atmel_pmc_ids[] __initconst = {
	{ .compatible = "atmel,sama5d4-pmc", .data = &pmc_infos[1] },
	{ .compatible = "atmel,sama5d2-pmc", .data = &pmc_infos[1] },
	{ .compatible = "microchip,sam9x60-pmc", .data = &pmc_infos[4] },
	{ .compatible = "microchip,sam9x7-pmc", .data = &pmc_infos[4] },
	{ .compatible = "microchip,sama7g5-pmc", .data = &pmc_infos[5] },
	{ /* sentinel */ },
};
@@ -1499,6 +1507,27 @@ 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;
Loading