lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230623203056.689705-6-varshini.rajendran@microchip.com>
Date: Sat, 24 Jun 2023 02:00:16 +0530
From: Varshini Rajendran <varshini.rajendran@...rochip.com>
To: <robh+dt@...nel.org>, <krzysztof.kozlowski+dt@...aro.org>,
	<conor+dt@...nel.org>, <nicolas.ferre@...rochip.com>,
	<alexandre.belloni@...tlin.com>, <claudiu.beznea@...rochip.com>,
	<mturquette@...libre.com>, <sboyd@...nel.org>, <herbert@...dor.apana.org.au>,
	<davem@...emloft.net>, <vkoul@...nel.org>, <tglx@...utronix.de>,
	<maz@...nel.org>, <lee@...nel.org>, <ulf.hansson@...aro.org>,
	<tudor.ambarus@...aro.org>, <miquel.raynal@...tlin.com>, <richard@....at>,
	<vigneshr@...com>, <edumazet@...gle.com>, <kuba@...nel.org>,
	<pabeni@...hat.com>, <linus.walleij@...aro.org>, <p.zabel@...gutronix.de>,
	<olivia@...enic.com>, <a.zummo@...ertech.it>, <radu_nicolae.pirea@....ro>,
	<richard.genoud@...il.com>, <gregkh@...uxfoundation.org>,
	<lgirdwood@...il.com>, <broonie@...nel.org>, <wim@...ux-watchdog.org>,
	<linux@...ck-us.net>, <arnd@...db.de>, <olof@...om.net>, <soc@...nel.org>,
	<linux@...linux.org.uk>, <sre@...nel.org>, <jerry.ray@...rochip.com>,
	<horatiu.vultur@...rochip.com>, <durai.manickamkr@...rochip.com>,
	<varshini.rajendran@...rochip.com>, <andrew@...n.ch>,
	<alain.volmat@...s.st.com>, <neil.armstrong@...aro.org>,
	<mihai.sain@...rochip.com>, <eugen.hristev@...labora.com>,
	<devicetree@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>, <linux-clk@...r.kernel.org>,
	<linux-crypto@...r.kernel.org>, <dmaengine@...r.kernel.org>,
	<linux-i2c@...r.kernel.org>, <linux-mmc@...r.kernel.org>,
	<linux-mtd@...ts.infradead.org>, <netdev@...r.kernel.org>,
	<linux-gpio@...r.kernel.org>, <linux-rtc@...r.kernel.org>,
	<linux-spi@...r.kernel.org>, <linux-serial@...r.kernel.org>,
	<alsa-devel@...a-project.org>, <linux-usb@...r.kernel.org>,
	<linux-watchdog@...r.kernel.org>, <linux-pm@...r.kernel.org>
CC: <Hari.PrasathGE@...rochip.com>, <cristian.birsan@...rochip.com>,
	<balamanikandan.gunasundar@...rochip.com>, <manikandan.m@...rochip.com>,
	<dharma.b@...rochip.com>, <nayabbasha.sayed@...rochip.com>,
	<balakrishnan.s@...rochip.com>
Subject: [PATCH v2 05/45] 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@...rochip.com>
---
 arch/arm/mach-at91/generic.h |  2 ++
 arch/arm/mach-at91/pm.c      | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 0c3960a8b3eb..acf0b3c82a30 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -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) { }
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 60dc56d8acfb..43a77ae0c38c 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -232,6 +232,17 @@ static const struct of_device_id sama7g5_ws_ids[] = {
 	{ /* sentinel */ }
 };
 
+static const struct of_device_id sam9x7_ws_ids[] = {
+	{ .compatible = "microchip,sam9x60-rtc",	.data = &ws_info[1] },
+	{ .compatible = "atmel,at91rm9200-ohci",	.data = &ws_info[2] },
+	{ .compatible = "usb-ohci",			.data = &ws_info[2] },
+	{ .compatible = "atmel,at91sam9g45-ehci",	.data = &ws_info[2] },
+	{ .compatible = "usb-ehci",			.data = &ws_info[2] },
+	{ .compatible = "microchip,sam9x60-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;
@@ -1133,6 +1144,7 @@ static const struct of_device_id gmac_ids[] __initconst = {
 	{ .compatible = "atmel,sama5d2-gem" },
 	{ .compatible = "atmel,sama5d29-gem" },
 	{ .compatible = "microchip,sama7g5-gem" },
+	{ .compatible = "microchip,sam9x7-gem" },
 	{ },
 };
 
@@ -1360,6 +1372,7 @@ static const struct of_device_id atmel_pmc_ids[] __initconst = {
 	{ .compatible = "atmel,sama5d2-pmc", .data = &pmc_infos[1] },
 	{ .compatible = "microchip,sam9x60-pmc", .data = &pmc_infos[4] },
 	{ .compatible = "microchip,sama7g5-pmc", .data = &pmc_infos[5] },
+	{ .compatible = "microchip,sam9x7-pmc", .data = &pmc_infos[4] },
 	{ /* sentinel */ },
 };
 
@@ -1497,6 +1510,28 @@ 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;
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ