Skip to content

Commit 13826ee

Browse files
ARM: at91: pm: add support for sam9x7 soc family
Add support and pm init config for sam9x7 soc Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
1 parent c52d82f commit 13826ee

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

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: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,17 @@ static const struct of_device_id sama7g5_ws_ids[] = {
235235
{ /* sentinel */ }
236236
};
237237

238+
static const struct of_device_id sam9x7_ws_ids[] = {
239+
{ .compatible = "microchip,sam9x60-rtc", .data = &ws_info[1] },
240+
{ .compatible = "atmel,at91rm9200-ohci", .data = &ws_info[2] },
241+
{ .compatible = "usb-ohci", .data = &ws_info[2] },
242+
{ .compatible = "atmel,at91sam9g45-ehci", .data = &ws_info[2] },
243+
{ .compatible = "usb-ehci", .data = &ws_info[2] },
244+
{ .compatible = "microchip,sam9x60-rtt", .data = &ws_info[4] },
245+
{ .compatible = "microchip,sam9x7-gem", .data = &ws_info[5] },
246+
{ /* sentinel */ }
247+
};
248+
238249
static int at91_pm_device_in_list(const struct platform_device *pdev,
239250
const struct of_device_id *ids)
240251
{
@@ -1219,6 +1230,7 @@ static const struct of_device_id gmac_ids[] __initconst = {
12191230
{ .compatible = "atmel,sama5d2-gem" },
12201231
{ .compatible = "atmel,sama5d29-gem" },
12211232
{ .compatible = "microchip,sama7g5-gem" },
1233+
{ .compatible = "microchip,sam9x7-gem" },
12221234
{ },
12231235
};
12241236

@@ -1450,6 +1462,7 @@ static const struct of_device_id atmel_pmc_ids[] __initconst = {
14501462
{ .compatible = "atmel,sama5d2-pmc", .data = &pmc_infos[1] },
14511463
{ .compatible = "microchip,sam9x60-pmc", .data = &pmc_infos[4] },
14521464
{ .compatible = "microchip,sama7g5-pmc", .data = &pmc_infos[5] },
1465+
{ .compatible = "microchip,sam9x7-pmc", .data = &pmc_infos[4] },
14531466
{ /* sentinel */ },
14541467
};
14551468

@@ -1587,6 +1600,28 @@ void __init sam9x60_pm_init(void)
15871600
soc_pm.config_pmc_ws = at91_sam9x60_config_pmc_ws;
15881601
}
15891602

1603+
void __init sam9x7_pm_init(void)
1604+
{
1605+
static const int modes[] __initconst = {
1606+
AT91_PM_STANDBY, AT91_PM_ULP0,
1607+
};
1608+
1609+
int ret;
1610+
1611+
if (!IS_ENABLED(CONFIG_SOC_SAM9X7))
1612+
return;
1613+
1614+
at91_pm_modes_validate(modes, ARRAY_SIZE(modes));
1615+
ret = at91_dt_ramc(false);
1616+
if (ret)
1617+
return;
1618+
1619+
at91_pm_init(NULL);
1620+
1621+
soc_pm.ws_ids = sam9x7_ws_ids;
1622+
soc_pm.config_pmc_ws = at91_sam9x60_config_pmc_ws;
1623+
}
1624+
15901625
void __init at91sam9_pm_init(void)
15911626
{
15921627
int ret;

0 commit comments

Comments
 (0)