* [PATCH v2 0/8] AT91 cleanup for 3.20 #2
@ 2015-01-15 14:59 Alexandre Belloni
2015-01-15 14:59 ` [PATCH v2 1/8] ARM: at91: pm: rework cpu detection Alexandre Belloni
` (8 more replies)
0 siblings, 9 replies; 16+ messages in thread
From: Alexandre Belloni @ 2015-01-15 14:59 UTC (permalink / raw)
To: Nicolas Ferre
Cc: Boris Brezillon, Jean-Christophe Plagniol-Villard,
linux-arm-kernel, linux-kernel, Arnd Bergmann, Alexandre Belloni
This patch sets is based on AT91 cleanup for 3.20 #1
and depends on AT91 DT for 3.20 #1 because it uses the added SRAM nodes.
The first two patches rework the pm code to get rid of cpu_is_xxx (they will be
dropped soon) and use the SRAM from the genpool instead of relying on the remap
done by at91_init_sram.
The 3rd and 4th patches a reworking the pm code further to move at91_pm_init in
the .init_machine of the SoCs instead of arch_initcall, to get ready for
multiplatform.
Then the following patches get rid of at91_init_sram, taking .map_io for almost
all SoCs but the sama5d4 (more cleanups coming soon for that part).
The final patch moves at91rm9200_idle to clk/at91/pmc.c and allows to almost
empty arch/arm/mach-at91/at91rm9200.c (It is actually empty once "Atmel System
Timer cleanups" is applied).
Changes in v2:
- added patch 3 and 4 to remove the calls to of_machine_is_compatible()
Alexandre Belloni (8):
ARM: at91: pm: rework cpu detection
ARM: at91: pm: use the mmio-sram pool to access SRAM
ARM: at91: pm: add UDP and UHP checks to newer SoCs
ARM: at91: pm: prepare for multiplatform
ARM: at91: remove useless map_io
ARM: at91: sama5d4: remove useless call to at91_init_sram
ARM: at91: remove unused at91_init_sram
ARM: at91: move at91rm9200_idle() to clk/at91/pmc.c
arch/arm/mach-at91/Kconfig | 1 +
arch/arm/mach-at91/at91rm9200.c | 15 -----
arch/arm/mach-at91/at91sam9260.c | 27 ---------
arch/arm/mach-at91/at91sam9261.c | 9 ---
arch/arm/mach-at91/at91sam9263.c | 7 ---
arch/arm/mach-at91/at91sam9g45.c | 7 ---
arch/arm/mach-at91/at91sam9n12.c | 6 --
arch/arm/mach-at91/at91sam9rl.c | 18 ------
arch/arm/mach-at91/at91sam9x5.c | 6 --
arch/arm/mach-at91/board-dt-rm9200.c | 11 ++++
arch/arm/mach-at91/board-dt-sam9.c | 27 +++++++++
arch/arm/mach-at91/board-dt-sama5.c | 1 +
arch/arm/mach-at91/generic.h | 15 ++++-
arch/arm/mach-at91/pm.c | 110 ++++++++++++++++++++++++++---------
arch/arm/mach-at91/sama5d3.c | 6 --
arch/arm/mach-at91/sama5d4.c | 1 -
arch/arm/mach-at91/setup.c | 20 -------
drivers/clk/at91/pmc.c | 9 +++
18 files changed, 146 insertions(+), 150 deletions(-)
--
2.1.0
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 1/8] ARM: at91: pm: rework cpu detection
2015-01-15 14:59 [PATCH v2 0/8] AT91 cleanup for 3.20 #2 Alexandre Belloni
@ 2015-01-15 14:59 ` Alexandre Belloni
2015-01-16 2:44 ` Yang, Wenyou
2015-01-15 14:59 ` [PATCH v2 2/8] ARM: at91: pm: use the mmio-sram pool to access SRAM Alexandre Belloni
` (7 subsequent siblings)
8 siblings, 1 reply; 16+ messages in thread
From: Alexandre Belloni @ 2015-01-15 14:59 UTC (permalink / raw)
To: Nicolas Ferre
Cc: Boris Brezillon, Jean-Christophe Plagniol-Villard,
linux-arm-kernel, linux-kernel, Arnd Bergmann, Alexandre Belloni
Store SoC differences in a struct to remove cpu_is_* usage.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
arch/arm/mach-at91/pm.c | 54 ++++++++++++++++++++++++++++++-------------------
1 file changed, 33 insertions(+), 21 deletions(-)
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 9b15169a1c62..79aa793d1f00 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -17,6 +17,7 @@
#include <linux/interrupt.h>
#include <linux/sysfs.h>
#include <linux/module.h>
+#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/clk/at91_pmc.h>
@@ -32,6 +33,11 @@
#include "generic.h"
#include "pm.h"
+static struct {
+ unsigned long uhp_udp_mask;
+ int memctrl;
+} at91_pm_data;
+
static void (*at91_pm_standby)(void);
static int at91_pm_valid_state(suspend_state_t state)
@@ -71,17 +77,9 @@ static int at91_pm_verify_clocks(void)
scsr = at91_pmc_read(AT91_PMC_SCSR);
/* USB must not be using PLLB */
- if (cpu_is_at91rm9200()) {
- if ((scsr & (AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP)) != 0) {
- pr_err("AT91: PM - Suspend-to-RAM with USB still active\n");
- return 0;
- }
- } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263()
- || cpu_is_at91sam9g20() || cpu_is_at91sam9g10()) {
- if ((scsr & (AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP)) != 0) {
- pr_err("AT91: PM - Suspend-to-RAM with USB still active\n");
- return 0;
- }
+ if ((scsr & at91_pm_data.uhp_udp_mask) != 0) {
+ pr_err("AT91: PM - Suspend-to-RAM with USB still active\n");
+ return 0;
}
/* PCK0..PCK3 must be disabled, or configured to use clk32k */
@@ -149,18 +147,13 @@ static int at91_pm_enter(suspend_state_t state)
* turning off the main oscillator; reverse on wakeup.
*/
if (slow_clock) {
- int memctrl = AT91_MEMCTRL_SDRAMC;
-
- if (cpu_is_at91rm9200())
- memctrl = AT91_MEMCTRL_MC;
- else if (cpu_is_at91sam9g45())
- memctrl = AT91_MEMCTRL_DDRSDR;
#ifdef CONFIG_AT91_SLOW_CLOCK
/* copy slow_clock handler to SRAM, and call it */
memcpy(slow_clock, at91_slow_clock, at91_slow_clock_sz);
#endif
slow_clock(at91_pmc_base, at91_ramc_base[0],
- at91_ramc_base[1], memctrl);
+ at91_ramc_base[1],
+ at91_pm_data.memctrl);
break;
} else {
pr_info("AT91: PM - no slow clock mode enabled ...\n");
@@ -237,10 +230,29 @@ static int __init at91_pm_init(void)
pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : ""));
- /* AT91RM9200 SDRAM low-power mode cannot be used with self-refresh. */
- if (cpu_is_at91rm9200())
+ at91_pm_data.memctrl = AT91_MEMCTRL_SDRAMC;
+
+ if (of_machine_is_compatible("atmel,at91rm9200")) {
+ /*
+ * AT91RM9200 SDRAM low-power mode cannot be used with
+ * self-refresh.
+ */
at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0);
-
+
+ at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP |
+ AT91RM9200_PMC_UDP;
+ at91_pm_data.memctrl = AT91_MEMCTRL_MC;
+ } else if (of_machine_is_compatible("atmel,at91sam9260") ||
+ of_machine_is_compatible("atmel,at91sam9g20") ||
+ of_machine_is_compatible("atmel,at91sam9261") ||
+ of_machine_is_compatible("atmel,at91sam9g10") ||
+ of_machine_is_compatible("atmel,at91sam9263")) {
+ at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP |
+ AT91SAM926x_PMC_UDP;
+ } else if (of_machine_is_compatible("atmel,at91sam9g45")) {
+ at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
+ }
+
if (at91_cpuidle_device.dev.platform_data)
platform_device_register(&at91_cpuidle_device);
--
2.1.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 2/8] ARM: at91: pm: use the mmio-sram pool to access SRAM
2015-01-15 14:59 [PATCH v2 0/8] AT91 cleanup for 3.20 #2 Alexandre Belloni
2015-01-15 14:59 ` [PATCH v2 1/8] ARM: at91: pm: rework cpu detection Alexandre Belloni
@ 2015-01-15 14:59 ` Alexandre Belloni
2015-01-15 14:59 ` [PATCH v2 3/8] ARM: at91: pm: add UDP and UHP checks to newer SoCs Alexandre Belloni
` (6 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: Alexandre Belloni @ 2015-01-15 14:59 UTC (permalink / raw)
To: Nicolas Ferre
Cc: Boris Brezillon, Jean-Christophe Plagniol-Villard,
linux-arm-kernel, linux-kernel, Arnd Bergmann, Alexandre Belloni
Now that the SRAM is part of a genpool, use it to allocate memory to use for the
slowclock implementation.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
arch/arm/mach-at91/Kconfig | 1 +
arch/arm/mach-at91/pm.c | 46 +++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index cec0fb5d621a..b7dcef50db23 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -178,6 +178,7 @@ comment "AT91 Feature Selections"
config AT91_SLOW_CLOCK
bool "Suspend-to-RAM disables main oscillator"
+ select SRAM
depends on SUSPEND
help
Select this if you want Suspend-to-RAM to save the most power
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 79aa793d1f00..515791edcc60 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -14,10 +14,12 @@
#include <linux/suspend.h>
#include <linux/sched.h>
#include <linux/proc_fs.h>
+#include <linux/genalloc.h>
#include <linux/interrupt.h>
#include <linux/sysfs.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/clk/at91_pmc.h>
@@ -222,10 +224,52 @@ void at91_pm_set_standby(void (*at91_standby)(void))
}
}
+#ifdef CONFIG_AT91_SLOW_CLOCK
+static void __init at91_pm_sram_init(void)
+{
+ struct gen_pool *sram_pool;
+ phys_addr_t sram_pbase;
+ unsigned long sram_base;
+ struct device_node *node;
+ struct platform_device *pdev;
+
+ node = of_find_compatible_node(NULL, NULL, "mmio-sram");
+ if (!node) {
+ pr_warn("%s: failed to find sram node!\n", __func__);
+ return;
+ }
+
+ pdev = of_find_device_by_node(node);
+ if (!pdev) {
+ pr_warn("%s: failed to find sram device!\n", __func__);
+ goto put_node;
+ }
+
+ sram_pool = dev_get_gen_pool(&pdev->dev);
+ if (!sram_pool) {
+ pr_warn("%s: sram pool unavailable!\n", __func__);
+ goto put_node;
+ }
+
+ sram_base = gen_pool_alloc(sram_pool, at91_slow_clock_sz);
+ if (!sram_base) {
+ pr_warn("%s: unable to alloc ocram!\n", __func__);
+ goto put_node;
+ }
+
+ sram_pbase = gen_pool_virt_to_phys(sram_pool, sram_base);
+ slow_clock = __arm_ioremap_exec(sram_pbase, at91_slow_clock_sz, false);
+
+put_node:
+ of_node_put(node);
+}
+#endif
+
+
static int __init at91_pm_init(void)
{
#ifdef CONFIG_AT91_SLOW_CLOCK
- slow_clock = (void *) (AT91_IO_VIRT_BASE - at91_slow_clock_sz);
+ at91_pm_sram_init();
#endif
pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : ""));
--
2.1.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 3/8] ARM: at91: pm: add UDP and UHP checks to newer SoCs
2015-01-15 14:59 [PATCH v2 0/8] AT91 cleanup for 3.20 #2 Alexandre Belloni
2015-01-15 14:59 ` [PATCH v2 1/8] ARM: at91: pm: rework cpu detection Alexandre Belloni
2015-01-15 14:59 ` [PATCH v2 2/8] ARM: at91: pm: use the mmio-sram pool to access SRAM Alexandre Belloni
@ 2015-01-15 14:59 ` Alexandre Belloni
2015-01-15 14:59 ` [PATCH v2 4/8] ARM: at91: pm: prepare for multiplatform Alexandre Belloni
` (5 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: Alexandre Belloni @ 2015-01-15 14:59 UTC (permalink / raw)
To: Nicolas Ferre
Cc: Boris Brezillon, Jean-Christophe Plagniol-Villard,
linux-arm-kernel, linux-kernel, Arnd Bergmann, Alexandre Belloni
Check UDP and UHP on sam9x5, sam9n12 and the sama5 series.
Check UHP on the sam9g45.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
arch/arm/mach-at91/pm.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 515791edcc60..71cc845263dc 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -275,6 +275,7 @@ static int __init at91_pm_init(void)
pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : ""));
at91_pm_data.memctrl = AT91_MEMCTRL_SDRAMC;
+ at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP;
if (of_machine_is_compatible("atmel,at91rm9200")) {
/*
@@ -286,14 +287,8 @@ static int __init at91_pm_init(void)
at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP |
AT91RM9200_PMC_UDP;
at91_pm_data.memctrl = AT91_MEMCTRL_MC;
- } else if (of_machine_is_compatible("atmel,at91sam9260") ||
- of_machine_is_compatible("atmel,at91sam9g20") ||
- of_machine_is_compatible("atmel,at91sam9261") ||
- of_machine_is_compatible("atmel,at91sam9g10") ||
- of_machine_is_compatible("atmel,at91sam9263")) {
- at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP |
- AT91SAM926x_PMC_UDP;
} else if (of_machine_is_compatible("atmel,at91sam9g45")) {
+ at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP;
at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
}
--
2.1.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 4/8] ARM: at91: pm: prepare for multiplatform
2015-01-15 14:59 [PATCH v2 0/8] AT91 cleanup for 3.20 #2 Alexandre Belloni
` (2 preceding siblings ...)
2015-01-15 14:59 ` [PATCH v2 3/8] ARM: at91: pm: add UDP and UHP checks to newer SoCs Alexandre Belloni
@ 2015-01-15 14:59 ` Alexandre Belloni
2015-01-22 16:03 ` [PATCH] ARM: at91: fix PM initialization for newer SoCs Nicolas Ferre
2015-01-15 14:59 ` [PATCH v2 5/8] ARM: at91: remove useless map_io Alexandre Belloni
` (4 subsequent siblings)
8 siblings, 1 reply; 16+ messages in thread
From: Alexandre Belloni @ 2015-01-15 14:59 UTC (permalink / raw)
To: Nicolas Ferre
Cc: Boris Brezillon, Jean-Christophe Plagniol-Villard,
linux-arm-kernel, linux-kernel, Arnd Bergmann, Alexandre Belloni
Split at91_pm_init() in three variants that are called by the respective SoCs
.init_machine. This allows to remove the of_machine_is_compatible() calls and
move at91_pm_init() out of arch_initcall() which is required for multiplatform.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
arch/arm/mach-at91/board-dt-rm9200.c | 11 ++++++++
arch/arm/mach-at91/board-dt-sam9.c | 27 ++++++++++++++++++++
arch/arm/mach-at91/board-dt-sama5.c | 1 +
arch/arm/mach-at91/generic.h | 12 +++++++++
arch/arm/mach-at91/pm.c | 49 ++++++++++++++++++++----------------
5 files changed, 79 insertions(+), 21 deletions(-)
diff --git a/arch/arm/mach-at91/board-dt-rm9200.c b/arch/arm/mach-at91/board-dt-rm9200.c
index a15ab6f8de00..5f82a65153e1 100644
--- a/arch/arm/mach-at91/board-dt-rm9200.c
+++ b/arch/arm/mach-at91/board-dt-rm9200.c
@@ -14,6 +14,7 @@
#include <linux/gpio.h>
#include <linux/of.h>
#include <linux/of_irq.h>
+#include <linux/of_platform.h>
#include <linux/clk-provider.h>
#include <asm/setup.h>
@@ -30,6 +31,15 @@ static void __init at91rm9200_dt_timer_init(void)
at91rm9200_timer_init();
}
+static void __init rm9200_dt_device_init(void)
+{
+ at91_rm9200_pm_init();
+
+ of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+
+
static const char *at91rm9200_dt_board_compat[] __initdata = {
"atmel,at91rm9200",
NULL
@@ -39,5 +49,6 @@ DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
.init_time = at91rm9200_dt_timer_init,
.map_io = at91_map_io,
.init_early = at91_dt_initialize,
+ .init_machine = rm9200_dt_device_init,
.dt_compat = at91rm9200_dt_board_compat,
MACHINE_END
diff --git a/arch/arm/mach-at91/board-dt-sam9.c b/arch/arm/mach-at91/board-dt-sam9.c
index f99246aa9b38..0fe1ced608c5 100644
--- a/arch/arm/mach-at91/board-dt-sam9.c
+++ b/arch/arm/mach-at91/board-dt-sam9.c
@@ -13,6 +13,7 @@
#include <linux/gpio.h>
#include <linux/of.h>
#include <linux/of_irq.h>
+#include <linux/of_platform.h>
#include <linux/clk-provider.h>
#include <asm/setup.h>
@@ -23,6 +24,12 @@
#include "generic.h"
+static void __init sam9_dt_device_init(void)
+{
+ at91_sam9260_pm_init();
+ of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
static const char *at91_dt_board_compat[] __initdata = {
"atmel,at91sam9",
NULL
@@ -32,5 +39,25 @@ DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
/* Maintainer: Atmel */
.map_io = at91_map_io,
.init_early = at91_dt_initialize,
+ .init_machine = sam9_dt_device_init,
.dt_compat = at91_dt_board_compat,
MACHINE_END
+
+static void __init sam9g45_dt_device_init(void)
+{
+ at91_sam9g45_pm_init();
+ of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char *at91_9g45_board_compat[] __initconst = {
+ "atmel,at91sam9g45",
+ NULL
+};
+
+DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45")
+ /* Maintainer: Atmel */
+ .map_io = at91_map_io,
+ .init_early = at91_dt_initialize,
+ .init_machine = sam9g45_dt_device_init,
+ .dt_compat = at91_9g45_board_compat,
+MACHINE_END
diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c
index 8fb9ef5333f1..44d372a22a29 100644
--- a/arch/arm/mach-at91/board-dt-sama5.c
+++ b/arch/arm/mach-at91/board-dt-sama5.c
@@ -28,6 +28,7 @@
static void __init sama5_dt_device_init(void)
{
+ at91_sam9260_pm_init();
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 54f3837a0a4d..fae7a703813c 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -31,4 +31,16 @@ extern void at91sam9_idle(void);
/* Matrix */
extern void at91_ioremap_matrix(u32 base_addr);
+
+
+#ifdef CONFIG_PM
+extern void __init at91_rm9200_pm_init(void);
+extern void __init at91_sam9260_pm_init(void);
+extern void __init at91_sam9g45_pm_init(void);
+#else
+void __init at91_rm9200_pm_init(void) { }
+void __init at91_sam9260_pm_init(void) { }
+void __init at91_sam9g45_pm_init(void) { }
+#endif
+
#endif /* _AT91_GENERIC_H */
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 71cc845263dc..778f11132b31 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -266,7 +266,7 @@ put_node:
#endif
-static int __init at91_pm_init(void)
+static void __init at91_pm_init(void)
{
#ifdef CONFIG_AT91_SLOW_CLOCK
at91_pm_sram_init();
@@ -274,29 +274,36 @@ static int __init at91_pm_init(void)
pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : ""));
- at91_pm_data.memctrl = AT91_MEMCTRL_SDRAMC;
- at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP;
-
- if (of_machine_is_compatible("atmel,at91rm9200")) {
- /*
- * AT91RM9200 SDRAM low-power mode cannot be used with
- * self-refresh.
- */
- at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0);
-
- at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP |
- AT91RM9200_PMC_UDP;
- at91_pm_data.memctrl = AT91_MEMCTRL_MC;
- } else if (of_machine_is_compatible("atmel,at91sam9g45")) {
- at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP;
- at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
- }
-
if (at91_cpuidle_device.dev.platform_data)
platform_device_register(&at91_cpuidle_device);
suspend_set_ops(&at91_pm_ops);
+}
- return 0;
+void __init at91_rm9200_pm_init(void)
+{
+ /*
+ * AT91RM9200 SDRAM low-power mode cannot be used with self-refresh.
+ */
+ at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0);
+
+ at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP;
+ at91_pm_data.memctrl = AT91_MEMCTRL_MC;
+
+ at91_pm_init();
+}
+
+void __init at91_sam9260_pm_init(void)
+{
+ at91_pm_data.memctrl = AT91_MEMCTRL_SDRAMC;
+ at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP;
+ return at91_pm_init();
}
-arch_initcall(at91_pm_init);
+
+void __init at91_sam9g45_pm_init(void)
+{
+ at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP;
+ at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
+ return at91_pm_init();
+}
+
--
2.1.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 5/8] ARM: at91: remove useless map_io
2015-01-15 14:59 [PATCH v2 0/8] AT91 cleanup for 3.20 #2 Alexandre Belloni
` (3 preceding siblings ...)
2015-01-15 14:59 ` [PATCH v2 4/8] ARM: at91: pm: prepare for multiplatform Alexandre Belloni
@ 2015-01-15 14:59 ` Alexandre Belloni
2015-01-15 14:59 ` [PATCH v2 6/8] ARM: at91: sama5d4: remove useless call to at91_init_sram Alexandre Belloni
` (3 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: Alexandre Belloni @ 2015-01-15 14:59 UTC (permalink / raw)
To: Nicolas Ferre
Cc: Boris Brezillon, Jean-Christophe Plagniol-Villard,
linux-arm-kernel, linux-kernel, Arnd Bergmann, Alexandre Belloni
Now that the SRAM is initialized by the mmio-sram driver, .map_io is useless.
remove it.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
arch/arm/mach-at91/at91rm9200.c | 6 ------
arch/arm/mach-at91/at91sam9260.c | 27 ---------------------------
arch/arm/mach-at91/at91sam9261.c | 9 ---------
arch/arm/mach-at91/at91sam9263.c | 7 -------
arch/arm/mach-at91/at91sam9g45.c | 7 -------
arch/arm/mach-at91/at91sam9n12.c | 6 ------
arch/arm/mach-at91/at91sam9rl.c | 18 ------------------
arch/arm/mach-at91/at91sam9x5.c | 6 ------
arch/arm/mach-at91/sama5d3.c | 6 ------
9 files changed, 92 deletions(-)
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index b52916947535..fc7c26138037 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -42,11 +42,6 @@ static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
/* --------------------------------------------------------------------
* AT91RM9200 processor initialization
* -------------------------------------------------------------------- */
-static void __init at91rm9200_map_io(void)
-{
- /* Map peripherals */
- at91_init_sram(0, AT91RM9200_SRAM_BASE, AT91RM9200_SRAM_SIZE);
-}
static void __init at91rm9200_initialize(void)
{
@@ -56,6 +51,5 @@ static void __init at91rm9200_initialize(void)
AT91_SOC_START(at91rm9200)
- .map_io = at91rm9200_map_io,
.init = at91rm9200_initialize,
AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 34e2abe82ae4..ab9841c8b0d5 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -22,38 +22,11 @@
* AT91SAM9260 processor initialization
* -------------------------------------------------------------------- */
-static void __init at91sam9xe_map_io(void)
-{
- unsigned long sram_size;
-
- switch (at91_soc_initdata.cidr & AT91_CIDR_SRAMSIZ) {
- case AT91_CIDR_SRAMSIZ_32K:
- sram_size = 2 * SZ_16K;
- break;
- case AT91_CIDR_SRAMSIZ_16K:
- default:
- sram_size = SZ_16K;
- }
-
- at91_init_sram(0, AT91SAM9XE_SRAM_BASE, sram_size);
-}
-
-static void __init at91sam9260_map_io(void)
-{
- if (cpu_is_at91sam9xe())
- at91sam9xe_map_io();
- else if (cpu_is_at91sam9g20())
- at91_init_sram(0, AT91SAM9G20_SRAM_BASE, AT91SAM9G20_SRAM_SIZE);
- else
- at91_init_sram(0, AT91SAM9260_SRAM_BASE, AT91SAM9260_SRAM_SIZE);
-}
-
static void __init at91sam9260_initialize(void)
{
arm_pm_idle = at91sam9_idle;
}
AT91_SOC_START(at91sam9260)
- .map_io = at91sam9260_map_io,
.init = at91sam9260_initialize,
AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 47878b849975..2029096b93fa 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -21,20 +21,11 @@
* AT91SAM9261 processor initialization
* -------------------------------------------------------------------- */
-static void __init at91sam9261_map_io(void)
-{
- if (cpu_is_at91sam9g10())
- at91_init_sram(0, AT91SAM9G10_SRAM_BASE, AT91SAM9G10_SRAM_SIZE);
- else
- at91_init_sram(0, AT91SAM9261_SRAM_BASE, AT91SAM9261_SRAM_SIZE);
-}
-
static void __init at91sam9261_initialize(void)
{
arm_pm_idle = at91sam9_idle;
}
AT91_SOC_START(at91sam9261)
- .map_io = at91sam9261_map_io,
.init = at91sam9261_initialize,
AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index aabcb66145d0..1fe672a05513 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -20,18 +20,11 @@
* AT91SAM9263 processor initialization
* -------------------------------------------------------------------- */
-static void __init at91sam9263_map_io(void)
-{
- at91_init_sram(0, AT91SAM9263_SRAM0_BASE, AT91SAM9263_SRAM0_SIZE);
- at91_init_sram(1, AT91SAM9263_SRAM1_BASE, AT91SAM9263_SRAM1_SIZE);
-}
-
static void __init at91sam9263_initialize(void)
{
arm_pm_idle = at91sam9_idle;
}
AT91_SOC_START(at91sam9263)
- .map_io = at91sam9263_map_io,
.init = at91sam9263_initialize,
AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index b044dbcc0dcc..f3130501fa75 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -20,18 +20,11 @@
/* --------------------------------------------------------------------
* AT91SAM9G45 processor initialization
* -------------------------------------------------------------------- */
-
-static void __init at91sam9g45_map_io(void)
-{
- at91_init_sram(0, AT91SAM9G45_SRAM_BASE, AT91SAM9G45_SRAM_SIZE);
-}
-
static void __init at91sam9g45_initialize(void)
{
arm_pm_idle = at91sam9_idle;
}
AT91_SOC_START(at91sam9g45)
- .map_io = at91sam9g45_map_io,
.init = at91sam9g45_initialize,
AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c
index 0135f868ea4f..b5ea69a3eaf6 100644
--- a/arch/arm/mach-at91/at91sam9n12.c
+++ b/arch/arm/mach-at91/at91sam9n12.c
@@ -16,11 +16,5 @@
* AT91SAM9N12 processor initialization
* -------------------------------------------------------------------- */
-static void __init at91sam9n12_map_io(void)
-{
- at91_init_sram(0, AT91SAM9N12_SRAM_BASE, AT91SAM9N12_SRAM_SIZE);
-}
-
AT91_SOC_START(at91sam9n12)
- .map_io = at91sam9n12_map_io,
AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index 7d303c132032..dab3c0d47f96 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -22,29 +22,11 @@
* AT91SAM9RL processor initialization
* -------------------------------------------------------------------- */
-static void __init at91sam9rl_map_io(void)
-{
- unsigned long sram_size;
-
- switch (at91_soc_initdata.cidr & AT91_CIDR_SRAMSIZ) {
- case AT91_CIDR_SRAMSIZ_32K:
- sram_size = 2 * SZ_16K;
- break;
- case AT91_CIDR_SRAMSIZ_16K:
- default:
- sram_size = SZ_16K;
- }
-
- /* Map SRAM */
- at91_init_sram(0, AT91SAM9RL_SRAM_BASE, sram_size);
-}
-
static void __init at91sam9rl_initialize(void)
{
arm_pm_idle = at91sam9_idle;
}
AT91_SOC_START(at91sam9rl)
- .map_io = at91sam9rl_map_io,
.init = at91sam9rl_initialize,
AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c
index aa17520ccb0a..7b60a529db01 100644
--- a/arch/arm/mach-at91/at91sam9x5.c
+++ b/arch/arm/mach-at91/at91sam9x5.c
@@ -16,11 +16,5 @@
* AT91SAM9x5 processor initialization
* -------------------------------------------------------------------- */
-static void __init at91sam9x5_map_io(void)
-{
- at91_init_sram(0, AT91SAM9X5_SRAM_BASE, AT91SAM9X5_SRAM_SIZE);
-}
-
AT91_SOC_START(at91sam9x5)
- .map_io = at91sam9x5_map_io,
AT91_SOC_END
diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c
index ae58feada72b..b7c64ca7107f 100644
--- a/arch/arm/mach-at91/sama5d3.c
+++ b/arch/arm/mach-at91/sama5d3.c
@@ -25,11 +25,5 @@
* AT91SAM9x5 processor initialization
* -------------------------------------------------------------------- */
-static void __init sama5d3_map_io(void)
-{
- at91_init_sram(0, SAMA5D3_SRAM_BASE, SAMA5D3_SRAM_SIZE);
-}
-
AT91_SOC_START(sama5d3)
- .map_io = sama5d3_map_io,
AT91_SOC_END
--
2.1.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 6/8] ARM: at91: sama5d4: remove useless call to at91_init_sram
2015-01-15 14:59 [PATCH v2 0/8] AT91 cleanup for 3.20 #2 Alexandre Belloni
` (4 preceding siblings ...)
2015-01-15 14:59 ` [PATCH v2 5/8] ARM: at91: remove useless map_io Alexandre Belloni
@ 2015-01-15 14:59 ` Alexandre Belloni
2015-01-15 14:59 ` [PATCH v2 7/8] ARM: at91: remove unused at91_init_sram Alexandre Belloni
` (2 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: Alexandre Belloni @ 2015-01-15 14:59 UTC (permalink / raw)
To: Nicolas Ferre
Cc: Boris Brezillon, Jean-Christophe Plagniol-Villard,
linux-arm-kernel, linux-kernel, Arnd Bergmann, Alexandre Belloni
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
arch/arm/mach-at91/sama5d4.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/arm/mach-at91/sama5d4.c b/arch/arm/mach-at91/sama5d4.c
index 7638509639f4..fa127fb79221 100644
--- a/arch/arm/mach-at91/sama5d4.c
+++ b/arch/arm/mach-at91/sama5d4.c
@@ -56,7 +56,6 @@ static struct map_desc at91_io_desc[] __initdata = {
static void __init sama5d4_map_io(void)
{
iotable_init(at91_io_desc, ARRAY_SIZE(at91_io_desc));
- at91_init_sram(0, SAMA5D4_NS_SRAM_BASE, SAMA5D4_NS_SRAM_SIZE);
}
AT91_SOC_START(sama5d4)
--
2.1.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 7/8] ARM: at91: remove unused at91_init_sram
2015-01-15 14:59 [PATCH v2 0/8] AT91 cleanup for 3.20 #2 Alexandre Belloni
` (5 preceding siblings ...)
2015-01-15 14:59 ` [PATCH v2 6/8] ARM: at91: sama5d4: remove useless call to at91_init_sram Alexandre Belloni
@ 2015-01-15 14:59 ` Alexandre Belloni
2015-01-15 14:59 ` [PATCH v2 8/8] ARM: at91: move at91rm9200_idle() to clk/at91/pmc.c Alexandre Belloni
2015-01-16 17:11 ` [PATCH v2 0/8] AT91 cleanup for 3.20 #2 Nicolas Ferre
8 siblings, 0 replies; 16+ messages in thread
From: Alexandre Belloni @ 2015-01-15 14:59 UTC (permalink / raw)
To: Nicolas Ferre
Cc: Boris Brezillon, Jean-Christophe Plagniol-Villard,
linux-arm-kernel, linux-kernel, Arnd Bergmann, Alexandre Belloni
SRAM initialization is now done through the mmio-sram driver and
at91_init_sram() is not called anymore, remove it.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
arch/arm/mach-at91/generic.h | 2 --
arch/arm/mach-at91/setup.c | 20 --------------------
2 files changed, 22 deletions(-)
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index fae7a703813c..1823a779182d 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -17,8 +17,6 @@
/* Map io */
extern void __init at91_map_io(void);
extern void __init at91_alt_map_io(void);
-extern void __init at91_init_sram(int bank, unsigned long base,
- unsigned int length);
/* Processors */
extern void __init at91_dt_initialize(void);
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index e3c21b458bb8..4c184285d38f 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -34,26 +34,6 @@ EXPORT_SYMBOL(at91_soc_initdata);
void __iomem *at91_ramc_base[2];
EXPORT_SYMBOL_GPL(at91_ramc_base);
-static struct map_desc sram_desc[2] __initdata;
-
-void __init at91_init_sram(int bank, unsigned long base, unsigned int length)
-{
- struct map_desc *desc = &sram_desc[bank];
-
- desc->virtual = (unsigned long)AT91_IO_VIRT_BASE - length;
- if (bank > 0)
- desc->virtual -= sram_desc[bank - 1].length;
-
- desc->pfn = __phys_to_pfn(base);
- desc->length = length;
- desc->type = MT_MEMORY_RWX_NONCACHED;
-
- pr_info("sram at 0x%lx of 0x%x mapped at 0x%lx\n",
- base, length, desc->virtual);
-
- iotable_init(desc, 1);
-}
-
static struct map_desc at91_io_desc __initdata __maybe_unused = {
.virtual = (unsigned long)AT91_VA_BASE_SYS,
.pfn = __phys_to_pfn(AT91_BASE_SYS),
--
2.1.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 8/8] ARM: at91: move at91rm9200_idle() to clk/at91/pmc.c
2015-01-15 14:59 [PATCH v2 0/8] AT91 cleanup for 3.20 #2 Alexandre Belloni
` (6 preceding siblings ...)
2015-01-15 14:59 ` [PATCH v2 7/8] ARM: at91: remove unused at91_init_sram Alexandre Belloni
@ 2015-01-15 14:59 ` Alexandre Belloni
2015-01-16 17:11 ` [PATCH v2 0/8] AT91 cleanup for 3.20 #2 Nicolas Ferre
8 siblings, 0 replies; 16+ messages in thread
From: Alexandre Belloni @ 2015-01-15 14:59 UTC (permalink / raw)
To: Nicolas Ferre
Cc: Boris Brezillon, Jean-Christophe Plagniol-Villard,
linux-arm-kernel, linux-kernel, Arnd Bergmann, Alexandre Belloni
Move at91rm9200_idle() along with at91sam9_idle() in clk/at91/pmc.c.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Michael Turquette <mturquette@linaro.org>
---
arch/arm/mach-at91/at91rm9200.c | 9 ---------
arch/arm/mach-at91/generic.h | 1 +
drivers/clk/at91/pmc.c | 9 +++++++++
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index fc7c26138037..3be1963f5c56 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -21,14 +21,6 @@
#include "soc.h"
#include "generic.h"
-static void at91rm9200_idle(void)
-{
- /*
- * Disable the processor clock. The processor will be automatically
- * re-enabled by an interrupt or by a reset.
- */
- at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK);
-}
static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
{
@@ -49,7 +41,6 @@ static void __init at91rm9200_initialize(void)
arm_pm_restart = at91rm9200_restart;
}
-
AT91_SOC_START(at91rm9200)
.init = at91rm9200_initialize,
AT91_SOC_END
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 1823a779182d..44fc725edcf1 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -25,6 +25,7 @@ extern void __init at91_dt_initialize(void);
extern void at91rm9200_timer_init(void);
/* idle */
+extern void at91rm9200_idle(void);
extern void at91sam9_idle(void);
/* Matrix */
diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c
index 386999b4f8eb..f07c8152e5cc 100644
--- a/drivers/clk/at91/pmc.c
+++ b/drivers/clk/at91/pmc.c
@@ -27,6 +27,15 @@
void __iomem *at91_pmc_base;
EXPORT_SYMBOL_GPL(at91_pmc_base);
+void at91rm9200_idle(void)
+{
+ /*
+ * Disable the processor clock. The processor will be automatically
+ * re-enabled by an interrupt or by a reset.
+ */
+ at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK);
+}
+
void at91sam9_idle(void)
{
at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK);
--
2.1.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* RE: [PATCH v2 1/8] ARM: at91: pm: rework cpu detection
2015-01-15 14:59 ` [PATCH v2 1/8] ARM: at91: pm: rework cpu detection Alexandre Belloni
@ 2015-01-16 2:44 ` Yang, Wenyou
2015-01-16 10:26 ` Alexandre Belloni
0 siblings, 1 reply; 16+ messages in thread
From: Yang, Wenyou @ 2015-01-16 2:44 UTC (permalink / raw)
To: Alexandre Belloni, Ferre, Nicolas
Cc: Boris Brezillon, Arnd Bergmann, linux-kernel,
Jean-Christophe Plagniol-Villard, linux-arm-kernel
Hi Alexandre,
> -----Original Message-----
> From: linux-arm-kernel [mailto:linux-arm-kernel-bounces@lists.infradead.org] On
> Behalf Of Alexandre Belloni
> Sent: Thursday, January 15, 2015 10:59 PM
> To: Ferre, Nicolas
> Cc: Boris Brezillon; Arnd Bergmann; linux-kernel@vger.kernel.org; Alexandre
> Belloni; Jean-Christophe Plagniol-Villard; linux-arm-kernel@lists.infradead.org
> Subject: [PATCH v2 1/8] ARM: at91: pm: rework cpu detection
>
> Store SoC differences in a struct to remove cpu_is_* usage.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
> arch/arm/mach-at91/pm.c | 54 ++++++++++++++++++++++++++++++-----------------
> --
> 1 file changed, 33 insertions(+), 21 deletions(-)
>
> diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index
> 9b15169a1c62..79aa793d1f00 100644
> --- a/arch/arm/mach-at91/pm.c
> +++ b/arch/arm/mach-at91/pm.c
> @@ -17,6 +17,7 @@
> #include <linux/interrupt.h>
> #include <linux/sysfs.h>
> #include <linux/module.h>
> +#include <linux/of.h>
> #include <linux/platform_device.h>
> #include <linux/io.h>
> #include <linux/clk/at91_pmc.h>
> @@ -32,6 +33,11 @@
> #include "generic.h"
> #include "pm.h"
>
> +static struct {
> + unsigned long uhp_udp_mask;
> + int memctrl;
> +} at91_pm_data;
> +
> static void (*at91_pm_standby)(void);
>
> static int at91_pm_valid_state(suspend_state_t state) @@ -71,17 +77,9 @@ static
> int at91_pm_verify_clocks(void)
> scsr = at91_pmc_read(AT91_PMC_SCSR);
>
> /* USB must not be using PLLB */
> - if (cpu_is_at91rm9200()) {
> - if ((scsr & (AT91RM9200_PMC_UHP |
> AT91RM9200_PMC_UDP)) != 0) {
> - pr_err("AT91: PM - Suspend-to-RAM with USB still
> active\n");
> - return 0;
> - }
> - } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() ||
> cpu_is_at91sam9263()
> - || cpu_is_at91sam9g20() || cpu_is_at91sam9g10()) {
> - if ((scsr & (AT91SAM926x_PMC_UHP |
> AT91SAM926x_PMC_UDP)) != 0) {
> - pr_err("AT91: PM - Suspend-to-RAM with USB still
> active\n");
> - return 0;
> - }
> + if ((scsr & at91_pm_data.uhp_udp_mask) != 0) {
> + pr_err("AT91: PM - Suspend-to-RAM with USB still active\n");
> + return 0;
> }
>
> /* PCK0..PCK3 must be disabled, or configured to use clk32k */ @@ -
> 149,18 +147,13 @@ static int at91_pm_enter(suspend_state_t state)
> * turning off the main oscillator; reverse on wakeup.
> */
> if (slow_clock) {
> - int memctrl = AT91_MEMCTRL_SDRAMC;
> -
> - if (cpu_is_at91rm9200())
> - memctrl = AT91_MEMCTRL_MC;
> - else if (cpu_is_at91sam9g45())
> - memctrl = AT91_MEMCTRL_DDRSDR;
> #ifdef CONFIG_AT91_SLOW_CLOCK
> /* copy slow_clock handler to SRAM, and call it */
> memcpy(slow_clock, at91_slow_clock,
> at91_slow_clock_sz); #endif
> slow_clock(at91_pmc_base, at91_ramc_base[0],
> - at91_ramc_base[1], memctrl);
> + at91_ramc_base[1],
> + at91_pm_data.memctrl);
> break;
> } else {
> pr_info("AT91: PM - no slow clock mode
> enabled ...\n"); @@ -237,10 +230,29 @@ static int __init at91_pm_init(void)
>
> pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock
> mode)" : ""));
>
> - /* AT91RM9200 SDRAM low-power mode cannot be used with self-refresh.
> */
> - if (cpu_is_at91rm9200())
> + at91_pm_data.memctrl = AT91_MEMCTRL_SDRAMC;
> +
> + if (of_machine_is_compatible("atmel,at91rm9200")) {
> + /*
> + * AT91RM9200 SDRAM low-power mode cannot be used with
> + * self-refresh.
> + */
> at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0);
> -
> +
> + at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP |
> + AT91RM9200_PMC_UDP;
> + at91_pm_data.memctrl = AT91_MEMCTRL_MC;
> + } else if (of_machine_is_compatible("atmel,at91sam9260") ||
> + of_machine_is_compatible("atmel,at91sam9g20") ||
> + of_machine_is_compatible("atmel,at91sam9261") ||
> + of_machine_is_compatible("atmel,at91sam9g10") ||
> + of_machine_is_compatible("atmel,at91sam9263")) {
> + at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP |
> + AT91SAM926x_PMC_UDP;
> + } else if (of_machine_is_compatible("atmel,at91sam9g45")) {
> + at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
> + }
> +
About the memory controller type, I prefer to get it during the memory controller initialization, from the sram_ids[].data which defined in the setup.c,
As this,
static const struct at91_ramc_of_data at91rm9200_ramc_of_data = {
.ramc_type = AT91_MEMCTRL_MC,
};
...
static struct of_device_id ramc_ids[] = {
{ .compatible = "atmel,at91rm9200-sdramc", .data = &at91rm9200_ramc_of_data},
... ...
{ /*sentinel*/ }
};
What about you?
> if (at91_cpuidle_device.dev.platform_data)
> platform_device_register(&at91_cpuidle_device);
>
> --
> 2.1.0
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Best Regards,
Wenyou Yang
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/8] ARM: at91: pm: rework cpu detection
2015-01-16 2:44 ` Yang, Wenyou
@ 2015-01-16 10:26 ` Alexandre Belloni
0 siblings, 0 replies; 16+ messages in thread
From: Alexandre Belloni @ 2015-01-16 10:26 UTC (permalink / raw)
To: Yang, Wenyou
Cc: Ferre, Nicolas, Boris Brezillon, Arnd Bergmann, linux-kernel,
Jean-Christophe Plagniol-Villard, linux-arm-kernel
Hi,
On 16/01/2015 at 02:44:39 +0000, Yang, Wenyou wrote :
> > - /* AT91RM9200 SDRAM low-power mode cannot be used with self-refresh.
> > */
> > - if (cpu_is_at91rm9200())
> > + at91_pm_data.memctrl = AT91_MEMCTRL_SDRAMC;
> > +
> > + if (of_machine_is_compatible("atmel,at91rm9200")) {
> > + /*
> > + * AT91RM9200 SDRAM low-power mode cannot be used with
> > + * self-refresh.
> > + */
> > at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0);
> > -
> > +
> > + at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP |
> > + AT91RM9200_PMC_UDP;
> > + at91_pm_data.memctrl = AT91_MEMCTRL_MC;
> > + } else if (of_machine_is_compatible("atmel,at91sam9260") ||
> > + of_machine_is_compatible("atmel,at91sam9g20") ||
> > + of_machine_is_compatible("atmel,at91sam9261") ||
> > + of_machine_is_compatible("atmel,at91sam9g10") ||
> > + of_machine_is_compatible("atmel,at91sam9263")) {
> > + at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP |
> > + AT91SAM926x_PMC_UDP;
> > + } else if (of_machine_is_compatible("atmel,at91sam9g45")) {
> > + at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
> > + }
> > +
> About the memory controller type, I prefer to get it during the memory controller initialization, from the sram_ids[].data which defined in the setup.c,
> As this,
> static const struct at91_ramc_of_data at91rm9200_ramc_of_data = {
> .ramc_type = AT91_MEMCTRL_MC,
> };
> ...
> static struct of_device_id ramc_ids[] = {
> { .compatible = "atmel,at91rm9200-sdramc", .data = &at91rm9200_ramc_of_data},
> ... ...
> { /*sentinel*/ }
> };
>
> What about you?
Yes, we agreed that using of_machine_is_compatible is not nice and that
is why I remove that usage in patch 4.
We still have to fill the uhp_udp_mask and that would mean adding a
match on the pmc compatible string. I would prefer not doing that. Or
maybe we can just remove the check, I don't think it it necessary
anymore.
At some point in time, I would like to be able to get rid of the
ramc_ids in mach-at91 but I'm not sure how yet.
Maybe we can do what you suggest after
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-January/316771.html
Because then, the ram detection is local to pm.c
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 0/8] AT91 cleanup for 3.20 #2
2015-01-15 14:59 [PATCH v2 0/8] AT91 cleanup for 3.20 #2 Alexandre Belloni
` (7 preceding siblings ...)
2015-01-15 14:59 ` [PATCH v2 8/8] ARM: at91: move at91rm9200_idle() to clk/at91/pmc.c Alexandre Belloni
@ 2015-01-16 17:11 ` Nicolas Ferre
8 siblings, 0 replies; 16+ messages in thread
From: Nicolas Ferre @ 2015-01-16 17:11 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Boris Brezillon, Jean-Christophe Plagniol-Villard,
linux-arm-kernel, linux-kernel, Arnd Bergmann
Le 15/01/2015 15:59, Alexandre Belloni a écrit :
> This patch sets is based on AT91 cleanup for 3.20 #1
> and depends on AT91 DT for 3.20 #1 because it uses the added SRAM nodes.
>
> The first two patches rework the pm code to get rid of cpu_is_xxx (they will be
> dropped soon) and use the SRAM from the genpool instead of relying on the remap
> done by at91_init_sram.
>
> The 3rd and 4th patches a reworking the pm code further to move at91_pm_init in
> the .init_machine of the SoCs instead of arch_initcall, to get ready for
> multiplatform.
>
> Then the following patches get rid of at91_init_sram, taking .map_io for almost
> all SoCs but the sama5d4 (more cleanups coming soon for that part).
>
> The final patch moves at91rm9200_idle to clk/at91/pmc.c and allows to almost
> empty arch/arm/mach-at91/at91rm9200.c (It is actually empty once "Atmel System
> Timer cleanups" is applied).
>
> Changes in v2:
> - added patch 3 and 4 to remove the calls to of_machine_is_compatible()
>
> Alexandre Belloni (8):
> ARM: at91: pm: rework cpu detection
> ARM: at91: pm: use the mmio-sram pool to access SRAM
> ARM: at91: pm: add UDP and UHP checks to newer SoCs
> ARM: at91: pm: prepare for multiplatform
> ARM: at91: remove useless map_io
> ARM: at91: sama5d4: remove useless call to at91_init_sram
> ARM: at91: remove unused at91_init_sram
> ARM: at91: move at91rm9200_idle() to clk/at91/pmc.c
Okay for the whole series. I'm looking forward including the upcoming
one as well.
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
All stacked on top of at91-3.20-cleanup.
Thanks, bye.
> arch/arm/mach-at91/Kconfig | 1 +
> arch/arm/mach-at91/at91rm9200.c | 15 -----
> arch/arm/mach-at91/at91sam9260.c | 27 ---------
> arch/arm/mach-at91/at91sam9261.c | 9 ---
> arch/arm/mach-at91/at91sam9263.c | 7 ---
> arch/arm/mach-at91/at91sam9g45.c | 7 ---
> arch/arm/mach-at91/at91sam9n12.c | 6 --
> arch/arm/mach-at91/at91sam9rl.c | 18 ------
> arch/arm/mach-at91/at91sam9x5.c | 6 --
> arch/arm/mach-at91/board-dt-rm9200.c | 11 ++++
> arch/arm/mach-at91/board-dt-sam9.c | 27 +++++++++
> arch/arm/mach-at91/board-dt-sama5.c | 1 +
> arch/arm/mach-at91/generic.h | 15 ++++-
> arch/arm/mach-at91/pm.c | 110 ++++++++++++++++++++++++++---------
> arch/arm/mach-at91/sama5d3.c | 6 --
> arch/arm/mach-at91/sama5d4.c | 1 -
> arch/arm/mach-at91/setup.c | 20 -------
> drivers/clk/at91/pmc.c | 9 +++
> 18 files changed, 146 insertions(+), 150 deletions(-)
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH] ARM: at91: fix PM initialization for newer SoCs
2015-01-15 14:59 ` [PATCH v2 4/8] ARM: at91: pm: prepare for multiplatform Alexandre Belloni
@ 2015-01-22 16:03 ` Nicolas Ferre
2015-01-22 16:07 ` [PATCH v2] " Nicolas Ferre
0 siblings, 1 reply; 16+ messages in thread
From: Nicolas Ferre @ 2015-01-22 16:03 UTC (permalink / raw)
To: Alexandre Belloni, Boris BREZILLON
Cc: Jean-Christophe PLAGNIOL-VILLARD, Ludovic Desroches,
linux-arm-kernel, linux-kernel, Nicolas Ferre
Newer SoCs: at91sam9x5, at91sam9n12, sama5d3 and sama5d4 embed a DDR controller
and have a different PMC status register layout than the at91sam9g45. Create
another at91_sam9x5_pm_init() function to match this compatibility.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
arch/arm/mach-at91/board-dt-sam9.c | 20 ++++++++++++++++++++
arch/arm/mach-at91/board-dt-sama5.c | 2 +-
arch/arm/mach-at91/pm.c | 7 +++++++
3 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-at91/board-dt-sam9.c b/arch/arm/mach-at91/board-dt-sam9.c
index 0fe1ced608c5..c8252ddac6f0 100644
--- a/arch/arm/mach-at91/board-dt-sam9.c
+++ b/arch/arm/mach-at91/board-dt-sam9.c
@@ -61,3 +61,23 @@ DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45")
.init_machine = sam9g45_dt_device_init,
.dt_compat = at91_9g45_board_compat,
MACHINE_END
+
+static void __init sam9x5_dt_device_init(void)
+{
+ at91_sam9x5_pm_init();
+ of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char *at91_9x5_board_compat[] __initconst = {
+ "atmel,at91sam9x5",
+ "atmel,at91sam9n12",
+ NULL
+};
+
+DT_MACHINE_START(at91sam9x5_dt, "Atmel AT91SAM9")
+ /* Maintainer: Atmel */
+ .map_io = at91_map_io,
+ .init_early = at91_dt_initialize,
+ .init_machine = sam9x5_dt_device_init,
+ .dt_compat = at91_9x5_board_compat,
+MACHINE_END
diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c
index 44d372a22a29..b7338966c8ab 100644
--- a/arch/arm/mach-at91/board-dt-sama5.c
+++ b/arch/arm/mach-at91/board-dt-sama5.c
@@ -28,7 +28,7 @@
static void __init sama5_dt_device_init(void)
{
- at91_sam9260_pm_init();
+ at91_sam9x5_pm_init();
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 81f2f12d3cc1..87c1fd8aa1b6 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -306,3 +306,10 @@ void __init at91_sam9g45_pm_init(void)
at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
return at91_pm_init();
}
+
+void __init at91_sam9x5_pm_init(void)
+{
+ at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP;
+ at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
+ return at91_pm_init();
+}
--
2.1.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2] ARM: at91: fix PM initialization for newer SoCs
2015-01-22 16:03 ` [PATCH] ARM: at91: fix PM initialization for newer SoCs Nicolas Ferre
@ 2015-01-22 16:07 ` Nicolas Ferre
2015-01-23 7:50 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 16+ messages in thread
From: Nicolas Ferre @ 2015-01-22 16:07 UTC (permalink / raw)
To: Alexandre Belloni, Boris BREZILLON
Cc: Jean-Christophe PLAGNIOL-VILLARD, Ludovic Desroches,
linux-arm-kernel, linux-kernel, Wenyou Yang, Nicolas Ferre
Newer SoCs: at91sam9x5, at91sam9n12, sama5d3 and sama5d4 embed a DDR controller
and have a different PMC status register layout than the at91sam9g45. Create
another at91_sam9x5_pm_init() function to match this compatibility.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
arch/arm/mach-at91/board-dt-sam9.c | 20 ++++++++++++++++++++
arch/arm/mach-at91/board-dt-sama5.c | 2 +-
arch/arm/mach-at91/generic.h | 2 ++
arch/arm/mach-at91/pm.c | 7 +++++++
4 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-at91/board-dt-sam9.c b/arch/arm/mach-at91/board-dt-sam9.c
index 0fe1ced608c5..c8252ddac6f0 100644
--- a/arch/arm/mach-at91/board-dt-sam9.c
+++ b/arch/arm/mach-at91/board-dt-sam9.c
@@ -61,3 +61,23 @@ DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45")
.init_machine = sam9g45_dt_device_init,
.dt_compat = at91_9g45_board_compat,
MACHINE_END
+
+static void __init sam9x5_dt_device_init(void)
+{
+ at91_sam9x5_pm_init();
+ of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char *at91_9x5_board_compat[] __initconst = {
+ "atmel,at91sam9x5",
+ "atmel,at91sam9n12",
+ NULL
+};
+
+DT_MACHINE_START(at91sam9x5_dt, "Atmel AT91SAM9")
+ /* Maintainer: Atmel */
+ .map_io = at91_map_io,
+ .init_early = at91_dt_initialize,
+ .init_machine = sam9x5_dt_device_init,
+ .dt_compat = at91_9x5_board_compat,
+MACHINE_END
diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c
index 44d372a22a29..b7338966c8ab 100644
--- a/arch/arm/mach-at91/board-dt-sama5.c
+++ b/arch/arm/mach-at91/board-dt-sama5.c
@@ -28,7 +28,7 @@
static void __init sama5_dt_device_init(void)
{
- at91_sam9260_pm_init();
+ at91_sam9x5_pm_init();
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 1e60faec2eba..709570cbef2b 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -32,10 +32,12 @@ extern void at91sam9_idle(void);
extern void __init at91_rm9200_pm_init(void);
extern void __init at91_sam9260_pm_init(void);
extern void __init at91_sam9g45_pm_init(void);
+extern void __init at91_sam9x5_pm_init(void);
#else
void __init at91_rm9200_pm_init(void) { }
void __init at91_sam9260_pm_init(void) { }
void __init at91_sam9g45_pm_init(void) { }
+void __init at91_sam9x5_pm_init(void) { }
#endif
#endif /* _AT91_GENERIC_H */
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 81f2f12d3cc1..87c1fd8aa1b6 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -306,3 +306,10 @@ void __init at91_sam9g45_pm_init(void)
at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
return at91_pm_init();
}
+
+void __init at91_sam9x5_pm_init(void)
+{
+ at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP;
+ at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
+ return at91_pm_init();
+}
--
2.1.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v2] ARM: at91: fix PM initialization for newer SoCs
2015-01-22 16:07 ` [PATCH v2] " Nicolas Ferre
@ 2015-01-23 7:50 ` Jean-Christophe PLAGNIOL-VILLARD
2015-01-23 10:11 ` Alexandre Belloni
0 siblings, 1 reply; 16+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2015-01-23 7:50 UTC (permalink / raw)
To: Nicolas FERRE
Cc: Jean-Christophe PLAGNIOL-VILLARD, Alexandre Belloni,
Boris BREZILLON, linux-kernel, Wenyou Yang, Ludovic Desroches,
linux-arm-kernel
> On Jan 23, 2015, at 12:07 AM, Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
>
> Newer SoCs: at91sam9x5, at91sam9n12, sama5d3 and sama5d4 embed a DDR controller
> and have a different PMC status register layout than the at91sam9g45. Create
> another at91_sam9x5_pm_init() function to match this compatibility.
>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> arch/arm/mach-at91/board-dt-sam9.c | 20 ++++++++++++++++++++
> arch/arm/mach-at91/board-dt-sama5.c | 2 +-
> arch/arm/mach-at91/generic.h | 2 ++
> arch/arm/mach-at91/pm.c | 7 +++++++
> 4 files changed, 30 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-at91/board-dt-sam9.c b/arch/arm/mach-at91/board-dt-sam9.c
> index 0fe1ced608c5..c8252ddac6f0 100644
> --- a/arch/arm/mach-at91/board-dt-sam9.c
> +++ b/arch/arm/mach-at91/board-dt-sam9.c
> @@ -61,3 +61,23 @@ DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45")
> .init_machine = sam9g45_dt_device_init,
> .dt_compat = at91_9g45_board_compat,
> MACHINE_END
> +
> +static void __init sam9x5_dt_device_init(void)
> +{
> + at91_sam9x5_pm_init();
> + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> +}
> +
> +static const char *at91_9x5_board_compat[] __initconst = {
> + "atmel,at91sam9x5",
> + "atmel,at91sam9n12",
> + NULL
> +};
> +
> +DT_MACHINE_START(at91sam9x5_dt, "Atmel AT91SAM9”)
sam9? sam9x5
> + /* Maintainer: Atmel */
> + .map_io = at91_map_io,
> + .init_early = at91_dt_initialize,
> + .init_machine = sam9x5_dt_device_init,
> + .dt_compat = at91_9x5_board_compat,
> +MACHINE_END
why a second START instead of a pdata?
and create a second dt compatible
e
Best Regards,
J.
> diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c
> index 44d372a22a29..b7338966c8ab 100644
> --- a/arch/arm/mach-at91/board-dt-sama5.c
> +++ b/arch/arm/mach-at91/board-dt-sama5.c
> @@ -28,7 +28,7 @@
>
> static void __init sama5_dt_device_init(void)
> {
> - at91_sam9260_pm_init();
> + at91_sam9x5_pm_init();
> of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> }
>
> diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
> index 1e60faec2eba..709570cbef2b 100644
> --- a/arch/arm/mach-at91/generic.h
> +++ b/arch/arm/mach-at91/generic.h
> @@ -32,10 +32,12 @@ extern void at91sam9_idle(void);
> extern void __init at91_rm9200_pm_init(void);
> extern void __init at91_sam9260_pm_init(void);
> extern void __init at91_sam9g45_pm_init(void);
> +extern void __init at91_sam9x5_pm_init(void);
> #else
> void __init at91_rm9200_pm_init(void) { }
> void __init at91_sam9260_pm_init(void) { }
> void __init at91_sam9g45_pm_init(void) { }
> +void __init at91_sam9x5_pm_init(void) { }
> #endif
>
> #endif /* _AT91_GENERIC_H */
> diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
> index 81f2f12d3cc1..87c1fd8aa1b6 100644
> --- a/arch/arm/mach-at91/pm.c
> +++ b/arch/arm/mach-at91/pm.c
> @@ -306,3 +306,10 @@ void __init at91_sam9g45_pm_init(void)
> at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
> return at91_pm_init();
> }
> +
> +void __init at91_sam9x5_pm_init(void)
> +{
> + at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP;
> + at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
> + return at91_pm_init();
> +}
> --
> 2.1.3
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] ARM: at91: fix PM initialization for newer SoCs
2015-01-23 7:50 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2015-01-23 10:11 ` Alexandre Belloni
0 siblings, 0 replies; 16+ messages in thread
From: Alexandre Belloni @ 2015-01-23 10:11 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: Nicolas FERRE, Boris BREZILLON, linux-kernel, Wenyou Yang,
Ludovic Desroches, linux-arm-kernel
On 23/01/2015 at 15:50:13 +0800, Jean-Christophe PLAGNIOL-VILLARD wrote :
>
> > On Jan 23, 2015, at 12:07 AM, Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
> >
> > Newer SoCs: at91sam9x5, at91sam9n12, sama5d3 and sama5d4 embed a DDR controller
> > and have a different PMC status register layout than the at91sam9g45. Create
> > another at91_sam9x5_pm_init() function to match this compatibility.
> >
> > Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> > ---
> > arch/arm/mach-at91/board-dt-sam9.c | 20 ++++++++++++++++++++
> > arch/arm/mach-at91/board-dt-sama5.c | 2 +-
> > arch/arm/mach-at91/generic.h | 2 ++
> > arch/arm/mach-at91/pm.c | 7 +++++++
> > 4 files changed, 30 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/mach-at91/board-dt-sam9.c b/arch/arm/mach-at91/board-dt-sam9.c
> > index 0fe1ced608c5..c8252ddac6f0 100644
> > --- a/arch/arm/mach-at91/board-dt-sam9.c
> > +++ b/arch/arm/mach-at91/board-dt-sam9.c
> > @@ -61,3 +61,23 @@ DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45")
> > .init_machine = sam9g45_dt_device_init,
> > .dt_compat = at91_9g45_board_compat,
> > MACHINE_END
> > +
> > +static void __init sam9x5_dt_device_init(void)
> > +{
> > + at91_sam9x5_pm_init();
> > + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> > +}
> > +
> > +static const char *at91_9x5_board_compat[] __initconst = {
> > + "atmel,at91sam9x5",
> > + "atmel,at91sam9n12",
> > + NULL
> > +};
> > +
> > +DT_MACHINE_START(at91sam9x5_dt, "Atmel AT91SAM9”)
> sam9? sam9x5
> > + /* Maintainer: Atmel */
> > + .map_io = at91_map_io,
> > + .init_early = at91_dt_initialize,
> > + .init_machine = sam9x5_dt_device_init,
> > + .dt_compat = at91_9x5_board_compat,
> > +MACHINE_END
>
> why a second START instead of a pdata?
>
> and create a second dt compatible
> e
The real solution to that is to match the pmc compatible in pm.c
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2015-01-23 10:11 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-15 14:59 [PATCH v2 0/8] AT91 cleanup for 3.20 #2 Alexandre Belloni
2015-01-15 14:59 ` [PATCH v2 1/8] ARM: at91: pm: rework cpu detection Alexandre Belloni
2015-01-16 2:44 ` Yang, Wenyou
2015-01-16 10:26 ` Alexandre Belloni
2015-01-15 14:59 ` [PATCH v2 2/8] ARM: at91: pm: use the mmio-sram pool to access SRAM Alexandre Belloni
2015-01-15 14:59 ` [PATCH v2 3/8] ARM: at91: pm: add UDP and UHP checks to newer SoCs Alexandre Belloni
2015-01-15 14:59 ` [PATCH v2 4/8] ARM: at91: pm: prepare for multiplatform Alexandre Belloni
2015-01-22 16:03 ` [PATCH] ARM: at91: fix PM initialization for newer SoCs Nicolas Ferre
2015-01-22 16:07 ` [PATCH v2] " Nicolas Ferre
2015-01-23 7:50 ` Jean-Christophe PLAGNIOL-VILLARD
2015-01-23 10:11 ` Alexandre Belloni
2015-01-15 14:59 ` [PATCH v2 5/8] ARM: at91: remove useless map_io Alexandre Belloni
2015-01-15 14:59 ` [PATCH v2 6/8] ARM: at91: sama5d4: remove useless call to at91_init_sram Alexandre Belloni
2015-01-15 14:59 ` [PATCH v2 7/8] ARM: at91: remove unused at91_init_sram Alexandre Belloni
2015-01-15 14:59 ` [PATCH v2 8/8] ARM: at91: move at91rm9200_idle() to clk/at91/pmc.c Alexandre Belloni
2015-01-16 17:11 ` [PATCH v2 0/8] AT91 cleanup for 3.20 #2 Nicolas Ferre
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).