OMAP3: clean up ASM idle code
PATCH v3 1/1 OMAP3: clean up ASM idle code
From: Jean Pihet <[email protected]>
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.
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
Tony Lindgren
maintainerPATCH v3 1/1 OMAP3: clean up ASM idle code
Hi Jean,
Quoted 5 lines · jean.pihet at newoldbits.com
From: Jean Pihet <[email protected]>
This patch only contains clean-ups and cosmetic changes, no functional change.
Quoted 13 lines
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.
Can you please split it further, it's not obvious from reading it that it does not change anything.
How about first do one or more patches to move the code around. Then rework the comments and formatting.
Thanks,
Tony
PATCH v3 1/1 OMAP3: clean up ASM idle code
Tony,
Quoted 22 lines · Tony Lindgren
Hi Jean,
Quoted 5 lines · jean.pihet at newoldbits.com
From: Jean Pihet <[email protected]>
This patch only contains clean-ups and cosmetic changes, no functional change.
Quoted 13 lines
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.
Quoted 2 lines
Can you please split it further, it's not obvious from reading it that it does not change anything.
That makes sense indeed.
Quoted 2 lines
How about first do one or more patches to move the code around. Then rework the comments and formatting.
I just re-sent the changes as a series '[PATCH 0/7 v4] OMAP3: clean up ASM sleep code'.
The patches are now much more readable and it also allowed me to solve issues in a more generic way, cf. for example '[PATCH 2/7] OMAP2+: use global values for the SRAM PA addresses'.
Quoted 5 lines
Thanks,
Tony
Thanks,
Jean