linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2.0 0/3] ARM: AT91: pm cleanup for 4.1
@ 2015-03-09  3:43 Wenyou Yang
  2015-03-09  3:44 ` [PATCH v2.0 1/3] pm: at91: pm_slowclock: remove the unused code related with SLOWDOWN_MASTER_CLOCK Wenyou Yang
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Wenyou Yang @ 2015-03-09  3:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

The patch series purpose is to clean up the AT91 PM code.

It is based on the branch: at91-4.0-fixes
git://git.kernel.org/pub/scm/linux/kernel/git/nferre/linux-at91.git
	+ [PATCH] ARM: at91: pm: change at91_pm_set_standby() to static

Change log for v2.0
 - rebase on the branch: at91-4.0-fixes + the above patch. 

Wenyou Yang (3):
  pm: at91: pm_slowclock: remove the unused code related with
    SLOWDOWN_MASTER_CLOCK
  ARM: at91: move "select SRAM" under SOC_AT91SAM9 and SOC_SAMA5
  pm: at91: remove CONFIG_AT91_SLOW_CLOCK config option

 arch/arm/mach-at91/Kconfig        |   17 +++--------------
 arch/arm/mach-at91/Makefile       |    2 +-
 arch/arm/mach-at91/pm.c           |   12 +-----------
 arch/arm/mach-at91/pm_slowclock.S |   37 -------------------------------------
 4 files changed, 5 insertions(+), 63 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2.0 1/3] pm: at91: pm_slowclock: remove the unused code related with SLOWDOWN_MASTER_CLOCK
  2015-03-09  3:43 [PATCH v2.0 0/3] ARM: AT91: pm cleanup for 4.1 Wenyou Yang
@ 2015-03-09  3:44 ` Wenyou Yang
  2015-03-09  3:44 ` [PATCH v2.0 2/3] ARM: at91: move "select SRAM" under SOC_AT91SAM9 and SOC_SAMA5 Wenyou Yang
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Wenyou Yang @ 2015-03-09  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

The SLOWDOWN_MASTER_CLOCK definition is not used, remove the redundant code.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/pm_slowclock.S |   37 -------------------------------------
 1 file changed, 37 deletions(-)

diff --git a/arch/arm/mach-at91/pm_slowclock.S b/arch/arm/mach-at91/pm_slowclock.S
index 8ab80e5..ae86fca 100644
--- a/arch/arm/mach-at91/pm_slowclock.S
+++ b/arch/arm/mach-at91/pm_slowclock.S
@@ -11,20 +11,11 @@
  * published by the Free Software Foundation.
  *
  */
-
 #include <linux/linkage.h>
 #include <linux/clk/at91_pmc.h>
 #include <mach/hardware.h>
 #include <mach/at91_ramc.h>
 
-/*
- * When SLOWDOWN_MASTER_CLOCK is defined we will also slow down the Master
- * clock during suspend by adjusting its prescalar and divisor.
- * NOTE: This hasn't been shown to be stable on SAM9s; and on the RM9200 there
- *       are errata regarding adjusting the prescalar and divisor.
- */
-#undef SLOWDOWN_MASTER_CLOCK
-
 pmc	.req	r0
 sdramc	.req	r1
 ramc1	.req	r2
@@ -175,18 +166,6 @@ sdr_sr_done:
 
 	wait_mckrdy
 
-#ifdef SLOWDOWN_MASTER_CLOCK
-	/*
-	 * Set the Master Clock PRES and MDIV fields.
-	 *
-	 * See AT91RM9200 errata #27 and #28 for details.
-	 */
-	mov	tmp1, #0
-	str	tmp1, [pmc, #AT91_PMC_MCKR]
-
-	wait_mckrdy
-#endif
-
 	/* Save PLLA setting and disable it */
 	ldr	tmp1, [pmc, #AT91_CKGR_PLLAR]
 	str	tmp1, .saved_pllar
@@ -243,22 +222,6 @@ sdr_sr_done:
 	wait_pllalock
 4:
 
-#ifdef SLOWDOWN_MASTER_CLOCK
-	/*
-	 * First set PRES if it was not 0,
-	 * than set CSS and MDIV fields.
-	 *
-	 * See AT91RM9200 errata #27 and #28 for details.
-	 */
-	ldr	tmp1, .saved_mckr
-	tst	tmp1, #AT91_PMC_PRES
-	beq	2f
-	and	tmp1, tmp1, #AT91_PMC_PRES
-	str	tmp1, [pmc, #AT91_PMC_MCKR]
-
-	wait_mckrdy
-#endif
-
 	/*
 	 * Restore master clock setting
 	 */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2.0 2/3] ARM: at91: move "select SRAM" under SOC_AT91SAM9 and SOC_SAMA5
  2015-03-09  3:43 [PATCH v2.0 0/3] ARM: AT91: pm cleanup for 4.1 Wenyou Yang
  2015-03-09  3:44 ` [PATCH v2.0 1/3] pm: at91: pm_slowclock: remove the unused code related with SLOWDOWN_MASTER_CLOCK Wenyou Yang
@ 2015-03-09  3:44 ` Wenyou Yang
  2015-03-09  3:45 ` [PATCH v2.0 3/3] pm: at91: remove CONFIG_AT91_SLOW_CLOCK config option Wenyou Yang
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Wenyou Yang @ 2015-03-09  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

To simply the PM config the CONFIG_AT91_SLOW_CLOCK option will be removed,
so move "select SRAM" from under AT91_SLOW_CLOCK, add "select SRAM if PM"
under SOC_AT91SAM9 and SOC_SAMA5

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/Kconfig |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index c74a443..b1f9694 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -25,6 +25,7 @@ config SOC_SAMA5
 	select MEMORY
 	select ATMEL_SDRAMC
 	select PHYLIB if NETDEVICES
+	select SRAM if PM
 
 menu "Atmel AT91 System-on-Chip"
 
@@ -81,6 +82,7 @@ config SOC_AT91RM9200
 	select CPU_ARM920T
 	select GENERIC_CLOCKEVENTS
 	select HAVE_AT91_USB_CLK
+	select SRAM if PM
 
 config SOC_AT91SAM9
 	bool "AT91SAM9"
@@ -94,6 +96,7 @@ config SOC_AT91SAM9
 	select HAVE_AT91_UTMI
 	select HAVE_FB_ATMEL
 	select MEMORY
+	select SRAM if PM
 	help
 	  Select this if you are using one of those Atmel SoC:
 	    AT91SAM9260
@@ -118,7 +121,6 @@ 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
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2.0 3/3] pm: at91: remove CONFIG_AT91_SLOW_CLOCK config option
  2015-03-09  3:43 [PATCH v2.0 0/3] ARM: AT91: pm cleanup for 4.1 Wenyou Yang
  2015-03-09  3:44 ` [PATCH v2.0 1/3] pm: at91: pm_slowclock: remove the unused code related with SLOWDOWN_MASTER_CLOCK Wenyou Yang
  2015-03-09  3:44 ` [PATCH v2.0 2/3] ARM: at91: move "select SRAM" under SOC_AT91SAM9 and SOC_SAMA5 Wenyou Yang
@ 2015-03-09  3:45 ` Wenyou Yang
  2015-03-12 14:43 ` [PATCH v2.0 0/3] ARM: AT91: pm cleanup for 4.1 Nicolas Ferre
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Wenyou Yang @ 2015-03-09  3:45 UTC (permalink / raw)
  To: linux-arm-kernel

The slow clock always exists, selecting CONFIG_AT91_SLOW_CLOCK config
is unnecessary for the suspend to memory mode.
For this mode the master clock should always switch to the slow clock.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/Kconfig  |   13 -------------
 arch/arm/mach-at91/Makefile |    2 +-
 arch/arm/mach-at91/pm.c     |   12 +-----------
 3 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index b1f9694..7e431c6 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -119,19 +119,6 @@ endif # SOC_SAM_V4_V5
 
 comment "AT91 Feature Selections"
 
-config AT91_SLOW_CLOCK
-	bool "Suspend-to-RAM disables main oscillator"
-	depends on SUSPEND
-	help
-	  Select this if you want Suspend-to-RAM to save the most power
-	  possible (without powering off the CPU) by disabling the PLLs
-	  and main oscillator so that only the 32 KiHz clock is available.
-
-	  When only that slow-clock is available, some peripherals lose
-	  functionality.  Many can't issue wakeup events unless faster
-	  clocks are available.  Some lose their operating state and
-	  need to be completely re-initialized.
-
 config AT91_TIMER_HZ
        int "Kernel HZ (jiffies per second)"
        range 32 1024
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 827fdbc..103c256 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -13,7 +13,7 @@ obj-$(CONFIG_SOC_SAMA5)		+= sama5.o
 
 # Power Management
 obj-$(CONFIG_PM)		+= pm.o
-obj-$(CONFIG_AT91_SLOW_CLOCK)	+= pm_slowclock.o
+obj-$(CONFIG_PM)		+= pm_slowclock.o
 
 ifeq ($(CONFIG_PM_DEBUG),y)
 CFLAGS_pm.o += -DDEBUG
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index a4473dc..ea4d888 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -123,11 +123,9 @@ EXPORT_SYMBOL(at91_suspend_entering_slow_clock);
 static void (*slow_clock)(void __iomem *pmc, void __iomem *ramc0,
 			  void __iomem *ramc1, int memctrl);
 
-#ifdef CONFIG_AT91_SLOW_CLOCK
 extern void at91_slow_clock(void __iomem *pmc, void __iomem *ramc0,
 			    void __iomem *ramc1, int memctrl);
 extern u32 at91_slow_clock_sz;
-#endif
 
 static int at91_pm_enter(suspend_state_t state)
 {
@@ -151,10 +149,9 @@ static int at91_pm_enter(suspend_state_t state)
 			 * turning off the main oscillator; reverse on wakeup.
 			 */
 			if (slow_clock) {
-#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],
 					   at91_pm_data.memctrl);
@@ -263,7 +260,6 @@ static __init void at91_dt_ramc(void)
 	at91_pm_set_standby(standby);
 }
 
-#ifdef CONFIG_AT91_SLOW_CLOCK
 static void __init at91_pm_sram_init(void)
 {
 	struct gen_pool *sram_pool;
@@ -300,16 +296,10 @@ static void __init at91_pm_sram_init(void)
 	sram_pbase = gen_pool_virt_to_phys(sram_pool, sram_base);
 	slow_clock = __arm_ioremap_exec(sram_pbase, at91_slow_clock_sz, false);
 }
-#endif
-
 
 static void __init at91_pm_init(void)
 {
-#ifdef CONFIG_AT91_SLOW_CLOCK
 	at91_pm_sram_init();
-#endif
-
-	pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : ""));
 
 	if (at91_cpuidle_device.dev.platform_data)
 		platform_device_register(&at91_cpuidle_device);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2.0 0/3] ARM: AT91: pm cleanup for 4.1
  2015-03-09  3:43 [PATCH v2.0 0/3] ARM: AT91: pm cleanup for 4.1 Wenyou Yang
                   ` (2 preceding siblings ...)
  2015-03-09  3:45 ` [PATCH v2.0 3/3] pm: at91: remove CONFIG_AT91_SLOW_CLOCK config option Wenyou Yang
@ 2015-03-12 14:43 ` Nicolas Ferre
  2015-03-12 18:58 ` Sylvain Rochet
  2015-03-13 10:04 ` Nicolas Ferre
  5 siblings, 0 replies; 7+ messages in thread
From: Nicolas Ferre @ 2015-03-12 14:43 UTC (permalink / raw)
  To: linux-arm-kernel

Le 09/03/2015 04:43, Wenyou Yang a ?crit :
> Hi,
> 
> The patch series purpose is to clean up the AT91 PM code.
> 
> It is based on the branch: at91-4.0-fixes
> git://git.kernel.org/pub/scm/linux/kernel/git/nferre/linux-at91.git
> 	+ [PATCH] ARM: at91: pm: change at91_pm_set_standby() to static
> 
> Change log for v2.0
>  - rebase on the branch: at91-4.0-fixes + the above patch. 
> 
> Wenyou Yang (3):
>   pm: at91: pm_slowclock: remove the unused code related with
>     SLOWDOWN_MASTER_CLOCK
>   ARM: at91: move "select SRAM" under SOC_AT91SAM9 and SOC_SAMA5
>   pm: at91: remove CONFIG_AT91_SLOW_CLOCK config option

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Whole series stacked on at91-4.1-cleanup.

Thanks.


> 
>  arch/arm/mach-at91/Kconfig        |   17 +++--------------
>  arch/arm/mach-at91/Makefile       |    2 +-
>  arch/arm/mach-at91/pm.c           |   12 +-----------
>  arch/arm/mach-at91/pm_slowclock.S |   37 -------------------------------------
>  4 files changed, 5 insertions(+), 63 deletions(-)
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2.0 0/3] ARM: AT91: pm cleanup for 4.1
  2015-03-09  3:43 [PATCH v2.0 0/3] ARM: AT91: pm cleanup for 4.1 Wenyou Yang
                   ` (3 preceding siblings ...)
  2015-03-12 14:43 ` [PATCH v2.0 0/3] ARM: AT91: pm cleanup for 4.1 Nicolas Ferre
@ 2015-03-12 18:58 ` Sylvain Rochet
  2015-03-13 10:04 ` Nicolas Ferre
  5 siblings, 0 replies; 7+ messages in thread
From: Sylvain Rochet @ 2015-03-12 18:58 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Wenyou,

On Mon, Mar 09, 2015 at 11:43:01AM +0800, Wenyou Yang wrote:
> Hi,
> 
> The patch series purpose is to clean up the AT91 PM code.

To the whole series:

Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com>

Sylvain

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2.0 0/3] ARM: AT91: pm cleanup for 4.1
  2015-03-09  3:43 [PATCH v2.0 0/3] ARM: AT91: pm cleanup for 4.1 Wenyou Yang
                   ` (4 preceding siblings ...)
  2015-03-12 18:58 ` Sylvain Rochet
@ 2015-03-13 10:04 ` Nicolas Ferre
  5 siblings, 0 replies; 7+ messages in thread
From: Nicolas Ferre @ 2015-03-13 10:04 UTC (permalink / raw)
  To: linux-arm-kernel

Le 09/03/2015 04:43, Wenyou Yang a ?crit :
> Hi,
> 
> The patch series purpose is to clean up the AT91 PM code.
> 
> It is based on the branch: at91-4.0-fixes
> git://git.kernel.org/pub/scm/linux/kernel/git/nferre/linux-at91.git
> 	+ [PATCH] ARM: at91: pm: change at91_pm_set_standby() to static
> 
> Change log for v2.0
>  - rebase on the branch: at91-4.0-fixes + the above patch. 
> 
> Wenyou Yang (3):
>   pm: at91: pm_slowclock: remove the unused code related with
>     SLOWDOWN_MASTER_CLOCK
>   ARM: at91: move "select SRAM" under SOC_AT91SAM9 and SOC_SAMA5
>   pm: at91: remove CONFIG_AT91_SLOW_CLOCK config option

Whole series:
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

And stacked on top of at91-4.1-cleanup: thanks for your patience Wenyou ;-)

> 
>  arch/arm/mach-at91/Kconfig        |   17 +++--------------
>  arch/arm/mach-at91/Makefile       |    2 +-
>  arch/arm/mach-at91/pm.c           |   12 +-----------
>  arch/arm/mach-at91/pm_slowclock.S |   37 -------------------------------------
>  4 files changed, 5 insertions(+), 63 deletions(-)
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-03-13 10:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-09  3:43 [PATCH v2.0 0/3] ARM: AT91: pm cleanup for 4.1 Wenyou Yang
2015-03-09  3:44 ` [PATCH v2.0 1/3] pm: at91: pm_slowclock: remove the unused code related with SLOWDOWN_MASTER_CLOCK Wenyou Yang
2015-03-09  3:44 ` [PATCH v2.0 2/3] ARM: at91: move "select SRAM" under SOC_AT91SAM9 and SOC_SAMA5 Wenyou Yang
2015-03-09  3:45 ` [PATCH v2.0 3/3] pm: at91: remove CONFIG_AT91_SLOW_CLOCK config option Wenyou Yang
2015-03-12 14:43 ` [PATCH v2.0 0/3] ARM: AT91: pm cleanup for 4.1 Nicolas Ferre
2015-03-12 18:58 ` Sylvain Rochet
2015-03-13 10:04 ` 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).