Skip to contentSkip to conversation

OMAP3: clean up ASM idle code

PATCH Superseded Jean Pihet 1 participant 1 message Dec 14, 2010

Subsystems (4)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Jean Pihet

author
#0 lore raw

PATCH v2 1/1 OMAP3: clean up ASM idle code

This patch only contains clean-ups and cosmetic changes, no functional change.

Clean up of the ASM code:
- reorganized the code in logical sections: defines, API functions, internal functions and variables,
- reworked and simplified the execution paths, for better readability and to avoid duplication of code,
- added comments on the entry and exit points and the interaction with the ROM code for OFF mode restore,
- reworked the existing comments for better readability,
- reworked the code formating, alignment and white spaces,
- added comments for the i443 erratum workarounds,
- changed the hardcoded values in favor of existing macros from include files,
- clean up of non used symbols.

Tested on OMAP3EVM and Beagleboard with full RET and OFF modes,
using cpuidle and suspend.

Based on original patch from Vishwa.

Cc Vishwanath BS <[email protected]>
---
 arch/arm/mach-omap2/control.c   |   10 +-
 arch/arm/mach-omap2/control.h   |    2 +
 arch/arm/mach-omap2/pm.h        |    1 -
 arch/arm/mach-omap2/pm34xx.c    |    4 +-
 arch/arm/mach-omap2/sleep34xx.S |  581 +++++++++++++++++++++------------------
 5 files changed, 329 insertions(+), 269 deletions(-)
arch/arm/mach-omap2/control.c +9 -1
index 728f268..5cb7276 100644
@@ -239,7 +239,15 @@ void omap3_save_scratchpad_contents(void)
 	struct omap3_scratchpad_prcm_block prcm_block_contents;
 	struct omap3_scratchpad_sdrc_block sdrc_block_contents;
 
-	/* Populate the Scratchpad contents */
+	/*
+	 * Populate the Scratchpad contents
+	 *
+	 * The get_*restore_pointer functions are used to get the resume
+	 *  function pointer to be called by the ROM code when back from WFI
+	 *  in OFF mode.
+	 * The restore pointer is stored into the scratchpad for later access
+	 *  by the ROM code.
+	 */
 	scratchpad_contents.boot_config_ptr = 0x0;
 	if (cpu_is_omap3630())
 		scratchpad_contents.public_restore_ptr =
arch/arm/mach-omap2/control.h +2 -0
index d7911c5..72efefb 100644
@@ -274,6 +274,8 @@
 #define OMAP343X_SCRATCHPAD_ROM		(OMAP343X_CTRL_BASE + 0x860)
 #define OMAP343X_SCRATCHPAD		(OMAP343X_CTRL_BASE + 0x910)
 #define OMAP343X_SCRATCHPAD_ROM_OFFSET	0x19C
+#define OMAP343X_SCRATCHPAD_REGADDR(reg)	OMAP2_L4_IO_ADDRESS(\
+						OMAP343X_SCRATCHPAD + reg)
 
 /* AM35XX_CONTROL_IPSS_CLK_CTRL bits */
 #define AM35XX_USBOTG_VBUSP_CLK_SHIFT   0
arch/arm/mach-omap2/pm.h +0 -1
index aff39d0..e458b2a 100644
@@ -80,7 +80,6 @@ extern void save_secure_ram_context(u32 *addr);
 extern void omap3_save_scratchpad_contents(void);
 
 extern unsigned int omap24xx_idle_loop_suspend_sz;
-extern unsigned int omap34xx_suspend_sz;
 extern unsigned int save_secure_ram_context_sz;
 extern unsigned int omap24xx_cpu_suspend_sz;
 extern unsigned int omap34xx_cpu_suspend_sz;
arch/arm/mach-omap2/pm34xx.c +2 -2
index ba3c0d6..0e3cc35 100644
@@ -135,7 +135,7 @@ static void omap3_core_save_context(void)
 
 	/*
 	 * Force write last pad into memory, as this can fail in some
-	 * cases according to erratas 1.157, 1.185
+	 * cases according to errata 1.157 & 1.185
 	 */
 	omap_ctrl_writel(omap_ctrl_readl(OMAP343X_PADCONF_ETK_D14),
 		OMAP343X_CONTROL_MEM_WKUP + 0x2a0);
@@ -432,7 +432,7 @@ void omap_sram_idle(void)
 	/*
 	* On EMU/HS devices ROM code restores a SRDC value
 	* from scratchpad which has automatic self refresh on timeout
-	* of AUTO_CNT = 1 enabled. This takes care of errata 1.142.
+	* of AUTO_CNT = 1 enabled. This takes care of erratum ID i443.
 	* Hence store/restore the SDRC_POWER register here.
 	*/
 	if (omap_rev() >= OMAP3430_REV_ES3_0 &&
arch/arm/mach-omap2/sleep34xx.S +316 -265

793 lines not on this page · raw message

Signature · 1 line
1.7.2.3