OMAP2/3 clock: revise module idlest handling
Subsystems (5)
Paul Walmsley
maintainercover OMAP2/3 clock: revise module idlest handling
Hello,
This series revises module idlest handling to use a new "idlest_bit" field defined in struct clk for the CM_IDLEST mask. After doing so, the omap2_clk_wait_ready() function can be cleaned up. More details of the new arrangement are in the individual patch comments.
Applies on top of the "OMAP2/3 clock: encode prcm_mod for each struct clk" series.
Boot-tested on 2430SDP and 3430SDP. Comments welcome.
- Paul
---
text data bss dec hex filename
3098504 137136 150888 3386528 33aca0 vmlinux.3430sdp.orig 3098472 137712 150888 3387072 33aec0 vmlinux.3430sdp
arch/arm/mach-omap2/clock.c | 96 ++----- arch/arm/mach-omap2/clock24xx.h | 194 +++++++++----- arch/arm/mach-omap2/clock34xx.h | 445 ++++++++++++++++++++++--------- arch/arm/mach-omap2/cm-regbits-24xx.h | 81 ++++-- arch/arm/mach-omap2/cm-regbits-34xx.h | 101 +++++-- arch/arm/mach-omap2/pm-debug.c | 15 + arch/arm/mach-omap2/prcm-common.h | 198 +++++++++----- arch/arm/plat-omap/include/mach/clock.h | 8 - 8 files changed, 741 insertions(+), 397 deletions(-)
Paul Walmsley
maintainerPATCH 1/5 OMAP2 PRCM: fix CM_IDLEST bits incorrectly marked as 2xxx-common
This patch fixes a few OMAP2xxx CM_IDLEST bits that were incorrectly marked as being OMAP2xxx-wide, when they were actually 2420-specific.
--- arch/arm/mach-omap2/cm-regbits-24xx.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/cm-regbits-24xx.h +2 -2
@@ -117,8 +117,8 @@#define OMAP24XX_ST_FAC (1 << 25)#define OMAP2420_ST_EAC (1 << 24)#define OMAP24XX_ST_HDQ (1 << 23) -#define OMAP24XX_ST_I2C2 (1 << 20) -#define OMAP24XX_ST_I2C1 (1 << 19) +#define OMAP2420_ST_I2C2 (1 << 20) +#define OMAP2420_ST_I2C1 (1 << 19)#define OMAP24XX_ST_MCBSP2 (1 << 16)#define OMAP24XX_ST_MCBSP1 (1 << 15)#define OMAP24XX_ST_DSS (1 << 0)
Paul Walmsley
maintainerPATCH 2/5 OMAP2/3 PRCM: convert IDLEST register bit macros to use the _SHIFT/_MASK style
In reply to Paul WalmsleyOriginally when the PRCM register macros were defined, bit shift macros used a "_SHIFT" suffix, and mask macros used none. This became a source of bugs and confusion, as the mask macros were mistakenly used for shift values. Gradually, the mask macros have been updated, piece by piece, to add a "_MASK" suffix on the end to clarify. This patch applies this change to the CM_IDLEST_* register bits.
The patch also adds a few bits that were missing, mostly from the 3430ES1 to ES2 revisions.
--- arch/arm/mach-omap2/clock.c | 6 + arch/arm/mach-omap2/cm-regbits-24xx.h | 80 +++++++++---- arch/arm/mach-omap2/cm-regbits-34xx.h | 94 +++++++++++----- arch/arm/mach-omap2/pm-debug.c | 15 ++- arch/arm/mach-omap2/prcm-common.h | 198 ++++++++++++++++++++++----------- 5 files changed, 262 insertions(+), 131 deletions(-)
arch/arm/mach-omap2/clock.c +3 -3
@@ -345,7 +345,7 @@ static void omap2_clk_wait_ready(struct clk *clk)if (system_rev ==OMAP3430_REV_ES1_0 )return ; - idlest_bit =OMAP3430ES2_ST_SSI_IDLE ; + idlest_bit =OMAP3430ES2_ST_SSI_IDLE_SHIFT ; }/* DSS */
@@ -362,7 +362,7 @@ static void omap2_clk_wait_ready(struct clk *clk)if (clk->enable_bit !=OMAP3430_EN_DSS1_SHIFT )return ; - idlest_bit =OMAP3430ES2_ST_DSS_IDLE ; + idlest_bit =OMAP3430ES2_ST_DSS_IDLE_SHIFT ; }/* USBHOST */
@@ -376,7 +376,7 @@ static void omap2_clk_wait_ready(struct clk *clk)if (clk->enable_bit ==OMAP3430ES2_EN_USBHOST2_SHIFT )return ; - idlest_bit =OMAP3430ES2_ST_USBHOST_IDLE ; + idlest_bit =OMAP3430ES2_ST_USBHOST_IDLE_SHIFT ; } }
arch/arm/mach-omap2/cm-regbits-24xx.h +53 -27
99 lines not on this page · raw message
arch/arm/mach-omap2/cm-regbits-34xx.h +64 -30
130 lines not on this page · raw message
arch/arm/mach-omap2/pm-debug.c +9 -6
@@ -108,17 +108,17 @@ void serial_console_sleep(int enable)switch (serial_console_uart) {case 1 : l =prm_read_mod_reg (CORE_MOD ,PM_WKST1 ); -if (l &OMAP24XX_ST_UART1 ) +if (l &OMAP24XX_ST_UART1_MASK ) serial_wakeup =1 ;break ;case 2 : l =prm_read_mod_reg (CORE_MOD ,PM_WKST1 ); -if (l &OMAP24XX_ST_UART2 ) +if (l &OMAP24XX_ST_UART2_MASK ) serial_wakeup =1 ;break ;case 3 : l =prm_read_mod_reg (CORE_MOD ,OMAP24XX_PM_WKST2 ); -if (l &OMAP24XX_ST_UART3 ) +if (l &OMAP24XX_ST_UART3_MASK ) serial_wakeup =1 ;break ; }
@@ -158,13 +158,16 @@ void pm_init_serial_console(void) }switch (serial_console_uart) {case 1 : -prm_set_mod_reg_bits (OMAP24XX_ST_UART1 ,CORE_MOD ,PM_WKEN1 ); +prm_set_mod_reg_bits (OMAP24XX_ST_UART1_MASK ,CORE_MOD , +PM_WKEN1 );break ;case 2 : -prm_set_mod_reg_bits (OMAP24XX_ST_UART2 ,CORE_MOD ,PM_WKEN1 ); +prm_set_mod_reg_bits (OMAP24XX_ST_UART2_MASK ,CORE_MOD , +PM_WKEN1 );break ;case 3 : -prm_set_mod_reg_bits (OMAP24XX_ST_UART3 ,CORE_MOD ,OMAP24XX_PM_WKEN2 ); +prm_set_mod_reg_bits (OMAP24XX_ST_UART3_MASK ,CORE_MOD , +OMAP24XX_PM_WKEN2 );break ; } }
arch/arm/mach-omap2/prcm-common.h +133 -65
232 lines not on this page · raw message
Paul Walmsley
maintainerPATCH 3/5 OMAP2/3 clock: encode target IDLEST bits and clean omap2_clk_wait_ready()
In reply to Paul WalmsleyFor each OMAP module that has a target IDLEST bit, add the appropriate bits to the clock tree on both the module interface clock and the appropriate functional clock. Add a new clock bit, "WAIT_READY", that indicates that the clock code must wait for the clock's module to come out of idle after both the target functional clock and interface clocks are enabled. Fix some clock flag comments while there to indicate that clocks marked as "3430ES2" clocks also are valid for later 3430 revisions.
Several OMAP3xxx clocks must be split into platform-specific variants, since some early silicon revisions do not have target idle state bits available. DSS, HSOTGUSB, and SSI clocks are affected. In the future, it would be ideal to #ifdef out those clocks for kernels that don't need to run on 3430ES1 chips to save memory.
--- arch/arm/mach-omap2/clock24xx.h | 194 +++++++++----- arch/arm/mach-omap2/clock34xx.h | 437 ++++++++++++++++++++++--------- arch/arm/mach-omap2/cm-regbits-24xx.h | 1 arch/arm/plat-omap/include/mach/clock.h | 8 - 4 files changed, 448 insertions(+), 192 deletions(-)
arch/arm/mach-omap2/clock24xx.h +130 -64
@@ -1232,10 +1232,11 @@ static struct clk usb_l4_ick = { /* FS-USB interface clock */ .parent = &core_l3_ck, .prcm_mod = CORE_MOD, .flags =CLOCK_IN_OMAP242X |CLOCK_IN_OMAP243X | - DELAYED_APP | CONFIG_PARTICIPANT, + DELAYED_APP | CONFIG_PARTICIPANT | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN2, .enable_bit = OMAP24XX_EN_USB_SHIFT, + .idlest_bit = OMAP24XX_ST_USB_SHIFT, .clksel_reg = CM_CLKSEL1, .clksel_mask = OMAP24XX_CLKSEL_USB_MASK, .clksel = usb_l4_ick_clksel,
@@ -1305,11 +1306,12 @@ static struct clk ssi_ssr_sst_fck = { .name = "ssi_fck", .parent = &core_ck, .prcm_mod = CORE_MOD, - .flags =CLOCK_IN_OMAP242X |CLOCK_IN_OMAP243X | + .flags =CLOCK_IN_OMAP242X |CLOCK_IN_OMAP243X |WAIT_READY | DELAYED_APP, .clkdm = { .name = "core_l3_clkdm" }, .enable_reg = OMAP24XX_CM_FCLKEN2, .enable_bit = OMAP24XX_EN_SSI_SHIFT, + .idlest_bit = OMAP24XX_ST_SSI_SHIFT, .clksel_reg = CM_CLKSEL1, .clksel_mask = OMAP24XX_CLKSEL_SSI_MASK, .clksel = ssi_ssr_sst_fck_clksel,
@@ -1327,9 +1329,10 @@ static struct clk ssi_l4_ick = { .parent = &l4_ck, .prcm_mod = CORE_MOD, .clkdm = { .name = "core_l4_clkdm" }, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .enable_reg = CM_ICLKEN2, .enable_bit = OMAP24XX_EN_SSI_SHIFT, + .idlest_bit = OMAP24XX_ST_SSI_SHIFT, .recalc = &followparent_recalc, };
@@ -1572,10 +1575,11 @@ static struct clk gpt1_ick = { .name = "gpt1_ick", .parent = &l4_ck, .prcm_mod = WKUP_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN, .enable_bit = OMAP24XX_EN_GPT1_SHIFT, + .idlest_bit = OMAP24XX_ST_GPT1_SHIFT, .recalc = &followparent_recalc, };
@@ -1600,10 +1604,11 @@ static struct clk gpt2_ick = { .name = "gpt2_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_GPT2_SHIFT, + .idlest_bit = OMAP24XX_ST_GPT2_SHIFT, .recalc = &followparent_recalc, };
@@ -1626,10 +1631,11 @@ static struct clk gpt3_ick = { .name = "gpt3_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_GPT3_SHIFT, + .idlest_bit = OMAP24XX_ST_GPT3_SHIFT, .recalc = &followparent_recalc, };
@@ -1652,10 +1658,11 @@ static struct clk gpt4_ick = { .name = "gpt4_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_GPT4_SHIFT, + .idlest_bit = OMAP24XX_ST_GPT4_SHIFT, .recalc = &followparent_recalc, };
@@ -1678,10 +1685,11 @@ static struct clk gpt5_ick = { .name = "gpt5_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_GPT5_SHIFT, + .idlest_bit = OMAP24XX_ST_GPT5_SHIFT, .recalc = &followparent_recalc, };
@@ -1704,10 +1712,11 @@ static struct clk gpt6_ick = { .name = "gpt6_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_GPT6_SHIFT, + .idlest_bit = OMAP24XX_ST_GPT6_SHIFT, .recalc = &followparent_recalc, };
@@ -1730,10 +1739,11 @@ static struct clk gpt7_ick = { .name = "gpt7_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_GPT7_SHIFT, + .idlest_bit = OMAP24XX_ST_GPT7_SHIFT, .recalc = &followparent_recalc, };
@@ -1756,10 +1766,11 @@ static struct clk gpt8_ick = { .name = "gpt8_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_GPT8_SHIFT, + .idlest_bit = OMAP24XX_ST_GPT8_SHIFT, .recalc = &followparent_recalc, };
@@ -1782,10 +1793,11 @@ static struct clk gpt9_ick = { .name = "gpt9_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_GPT9_SHIFT, + .idlest_bit = OMAP24XX_ST_GPT9_SHIFT, .recalc = &followparent_recalc, };
@@ -1808,10 +1820,11 @@ static struct clk gpt10_ick = { .name = "gpt10_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_GPT10_SHIFT, + .idlest_bit = OMAP24XX_ST_GPT10_SHIFT, .recalc = &followparent_recalc, };
@@ -1834,10 +1847,11 @@ static struct clk gpt11_ick = { .name = "gpt11_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_GPT11_SHIFT, + .idlest_bit = OMAP24XX_ST_GPT11_SHIFT, .recalc = &followparent_recalc, };
@@ -1860,10 +1874,11 @@ static struct clk gpt12_ick = { .name = "gpt12_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_GPT12_SHIFT, + .idlest_bit = OMAP24XX_ST_GPT12_SHIFT, .recalc = &followparent_recalc, };
@@ -1887,10 +1902,11 @@ static struct clk mcbsp1_ick = { .id = 1, .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT, + .idlest_bit = OMAP24XX_ST_MCBSP1_SHIFT, .recalc = &followparent_recalc, };
@@ -1911,10 +1927,11 @@ static struct clk mcbsp2_ick = { .id = 2, .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT, + .idlest_bit = OMAP24XX_ST_MCBSP2_SHIFT, .recalc = &followparent_recalc, };
@@ -1935,10 +1952,11 @@ static struct clk mcbsp3_ick = { .id = 3, .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN2, .enable_bit = OMAP2430_EN_MCBSP3_SHIFT, + .idlest_bit = OMAP2430_ST_MCBSP3_SHIFT, .recalc = &followparent_recalc, };
@@ -1959,10 +1977,11 @@ static struct clk mcbsp4_ick = { .id = 4, .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN2, .enable_bit = OMAP2430_EN_MCBSP4_SHIFT, + .idlest_bit = OMAP2430_ST_MCBSP4_SHIFT, .recalc = &followparent_recalc, };
@@ -1983,10 +2002,11 @@ static struct clk mcbsp5_ick = { .id = 5, .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN2, .enable_bit = OMAP2430_EN_MCBSP5_SHIFT, + .idlest_bit = OMAP2430_ST_MCBSP5_SHIFT, .recalc = &followparent_recalc, };
@@ -2008,9 +2028,10 @@ static struct clk mcspi1_ick = { .parent = &l4_ck, .prcm_mod = CORE_MOD, .clkdm = { .name = "core_l4_clkdm" }, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT, + .idlest_bit = OMAP24XX_ST_MCSPI1_SHIFT, .recalc = &followparent_recalc, };
@@ -2031,10 +2052,11 @@ static struct clk mcspi2_ick = { .id = 2, .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT, + .idlest_bit = OMAP24XX_ST_MCSPI2_SHIFT, .recalc = &followparent_recalc, };
@@ -2055,10 +2077,11 @@ static struct clk mcspi3_ick = { .id = 3, .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN2, .enable_bit = OMAP2430_EN_MCSPI3_SHIFT, + .idlest_bit = OMAP2430_ST_MCSPI3_SHIFT, .recalc = &followparent_recalc, };
@@ -2078,10 +2101,11 @@ static struct clk uart1_ick = { .name = "uart1_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_UART1_SHIFT, + .idlest_bit = OMAP24XX_ST_UART1_SHIFT, .recalc = &followparent_recalc, };
@@ -2100,10 +2124,11 @@ static struct clk uart2_ick = { .name = "uart2_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_UART2_SHIFT, + .idlest_bit = OMAP24XX_ST_UART2_SHIFT, .recalc = &followparent_recalc, };
@@ -2122,10 +2147,11 @@ static struct clk uart3_ick = { .name = "uart3_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN2, .enable_bit = OMAP24XX_EN_UART3_SHIFT, + .idlest_bit = OMAP24XX_ST_UART3_SHIFT, .recalc = &followparent_recalc, };
@@ -2144,10 +2170,11 @@ static struct clk gpios_ick = { .name = "gpios_ick", .parent = &l4_ck, .prcm_mod = WKUP_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN, .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, + .idlest_bit = OMAP24XX_ST_GPIOS_SHIFT, .recalc = &followparent_recalc, };
@@ -2155,10 +2182,11 @@ static struct clk gpios_fck = { .name = "gpios_fck", .parent = &func_32k_ck, .prcm_mod = WKUP_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "prm_clkdm" }, .enable_reg = CM_FCLKEN, .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, + .idlest_bit = OMAP24XX_ST_GPIOS_SHIFT, .recalc = &followparent_recalc, };
@@ -2167,10 +2195,11 @@ static struct clk mpu_wdt_ick = { .name = "mpu_wdt_ick", .parent = &l4_ck, .prcm_mod = WKUP_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "prm_clkdm" }, .enable_reg = CM_ICLKEN, .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, + .idlest_bit = OMAP24XX_ST_MPU_WDT_SHIFT, .recalc = &followparent_recalc, };
@@ -2179,10 +2208,11 @@ static struct clk mpu_wdt_fck = { .name = "mpu_wdt_fck", .parent = &func_32k_ck, .prcm_mod = WKUP_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "prm_clkdm" }, .enable_reg = CM_FCLKEN, .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, + .idlest_bit = OMAP24XX_ST_MPU_WDT_SHIFT, .recalc = &followparent_recalc, };
@@ -2191,10 +2221,11 @@ static struct clk sync_32k_ick = { .parent = &l4_ck, .prcm_mod = WKUP_MOD, .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | - ENABLE_ON_INIT, + ENABLE_ON_INIT | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN, .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, + .idlest_bit = OMAP24XX_ST_32KSYNC_SHIFT, .recalc = &followparent_recalc, };
@@ -2207,6 +2238,7 @@ static struct clk wdt1_ick = { .clkdm = { .name = "prm_clkdm" }, .enable_reg = CM_ICLKEN, .enable_bit = OMAP24XX_EN_WDT1_SHIFT, + .idlest_bit = OMAP24XX_ST_WDT1_SHIFT, .recalc = &followparent_recalc, };
@@ -2219,6 +2251,7 @@ static struct clk omapctrl_ick = { .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN, .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, + .idlest_bit = OMAP24XX_ST_OMAPCTRL_SHIFT, .recalc = &followparent_recalc, };
@@ -2226,10 +2259,11 @@ static struct clk icr_ick = { .name = "icr_ick", .parent = &l4_ck, .prcm_mod = WKUP_MOD, - .flags = CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN, .enable_bit = OMAP2430_EN_ICR_SHIFT, + .idlest_bit = OMAP2430_ST_ICR_SHIFT, .recalc = &followparent_recalc, };
@@ -2264,10 +2298,11 @@ static struct clk mailboxes_ick = { .name = "mailboxes_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_MAILBOXES_SHIFT, + .idlest_bit = OMAP24XX_ST_MAILBOXES_SHIFT, .recalc = &followparent_recalc, };
@@ -2275,10 +2310,11 @@ static struct clk wdt4_ick = { .name = "wdt4_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_WDT4_SHIFT, + .idlest_bit = OMAP24XX_ST_WDT4_SHIFT, .recalc = &followparent_recalc, };
@@ -2297,10 +2333,11 @@ static struct clk wdt3_ick = { .name = "wdt3_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X, + .flags = CLOCK_IN_OMAP242X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP2420_EN_WDT3_SHIFT, + .idlest_bit = OMAP2420_ST_WDT3_SHIFT, .recalc = &followparent_recalc, };
@@ -2308,10 +2345,11 @@ static struct clk wdt3_fck = { .name = "wdt3_fck", .parent = &func_32k_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X, + .flags = CLOCK_IN_OMAP242X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_FCLKEN1, .enable_bit = OMAP2420_EN_WDT3_SHIFT, + .enable_bit = OMAP2420_ST_WDT3_SHIFT, .recalc = &followparent_recalc, };
@@ -2319,10 +2357,11 @@ static struct clk mspro_ick = { .name = "mspro_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_MSPRO_SHIFT, + .idlest_bit = OMAP24XX_ST_MSPRO_SHIFT, .recalc = &followparent_recalc, };
@@ -2330,10 +2369,11 @@ static struct clk mspro_fck = { .name = "mspro_fck", .parent = &func_96m_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_FCLKEN1, .enable_bit = OMAP24XX_EN_MSPRO_SHIFT, + .idlest_bit = OMAP24XX_ST_MSPRO_SHIFT, .recalc = &followparent_recalc, };
@@ -2341,10 +2381,11 @@ static struct clk mmc_ick = { .name = "mmc_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X, + .flags = CLOCK_IN_OMAP242X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP2420_EN_MMC_SHIFT, + .idlest_bit = OMAP2420_ST_MMC_SHIFT, .recalc = &followparent_recalc, };
@@ -2352,10 +2393,11 @@ static struct clk mmc_fck = { .name = "mmc_fck", .parent = &func_96m_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X, + .flags = CLOCK_IN_OMAP242X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_FCLKEN1, .enable_bit = OMAP2420_EN_MMC_SHIFT, + .idlest_bit = OMAP2420_ST_MMC_SHIFT, .recalc = &followparent_recalc, };
@@ -2363,10 +2405,11 @@ static struct clk fac_ick = { .name = "fac_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_FAC_SHIFT, + .idlest_bit = OMAP24XX_ST_FAC_SHIFT, .recalc = &followparent_recalc, };
@@ -2374,10 +2417,11 @@ static struct clk fac_fck = { .name = "fac_fck", .parent = &func_12m_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_FCLKEN1, .enable_bit = OMAP24XX_EN_FAC_SHIFT, + .idlest_bit = OMAP24XX_ST_FAC_SHIFT, .recalc = &followparent_recalc, };
@@ -2385,10 +2429,11 @@ static struct clk eac_ick = { .name = "eac_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X, + .flags = CLOCK_IN_OMAP242X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP2420_EN_EAC_SHIFT, + .idlest_bit = OMAP2420_ST_EAC_SHIFT, .recalc = &followparent_recalc, };
@@ -2396,10 +2441,11 @@ static struct clk eac_fck = { .name = "eac_fck", .parent = &func_96m_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X, + .flags = CLOCK_IN_OMAP242X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_FCLKEN1, .enable_bit = OMAP2420_EN_EAC_SHIFT, + .idlest_bit = OMAP2420_ST_EAC_SHIFT, .recalc = &followparent_recalc, };
@@ -2407,10 +2453,11 @@ static struct clk hdq_ick = { .name = "hdq_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP24XX_EN_HDQ_SHIFT, + .idlest_bit = OMAP24XX_ST_HDQ_SHIFT, .recalc = &followparent_recalc, };
@@ -2418,10 +2465,11 @@ static struct clk hdq_fck = { .name = "hdq_fck", .parent = &func_12m_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_FCLKEN1, .enable_bit = OMAP24XX_EN_HDQ_SHIFT, + .idlest_bit = OMAP24XX_ST_HDQ_SHIFT, .recalc = &followparent_recalc, };
@@ -2430,10 +2478,11 @@ static struct clk i2c2_ick = { .id = 2, .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP2420_EN_I2C2_SHIFT, + .idlest_bit = OMAP2420_ST_I2C2_SHIFT, .recalc = &followparent_recalc, };
@@ -2442,10 +2491,11 @@ static struct clk i2c2_fck = { .id = 2, .parent = &func_12m_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X, + .flags = CLOCK_IN_OMAP242X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_FCLKEN1, .enable_bit = OMAP2420_EN_I2C2_SHIFT, + .idlest_bit = OMAP2420_ST_I2C2_SHIFT, .recalc = &followparent_recalc, };
@@ -2466,10 +2516,11 @@ static struct clk i2c1_ick = { .id = 1, .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP2420_EN_I2C1_SHIFT, + .idlest_bit = OMAP2420_ST_I2C1_SHIFT, .recalc = &followparent_recalc, };
@@ -2478,10 +2529,11 @@ static struct clk i2c1_fck = { .id = 1, .parent = &func_12m_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X, + .flags = CLOCK_IN_OMAP242X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_FCLKEN1, .enable_bit = OMAP2420_EN_I2C1_SHIFT, + .idlest_bit = OMAP2420_ST_I2C1_SHIFT, .recalc = &followparent_recalc, };
@@ -2526,10 +2578,11 @@ static struct clk vlynq_ick = { .name = "vlynq_ick", .parent = &core_l3_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X, + .flags = CLOCK_IN_OMAP242X | WAIT_READY, .clkdm = { .name = "core_l3_clkdm" }, .enable_reg = CM_ICLKEN1, .enable_bit = OMAP2420_EN_VLYNQ_SHIFT, + .idlest_bit = OMAP2420_ST_VLYNQ_SHIFT, .recalc = &followparent_recalc, };
@@ -2562,10 +2615,11 @@ static struct clk vlynq_fck = { .name = "vlynq_fck", .parent = &func_96m_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP242X | DELAYED_APP, + .flags = CLOCK_IN_OMAP242X | DELAYED_APP | WAIT_READY, .clkdm = { .name = "core_l3_clkdm" }, .enable_reg = CM_FCLKEN1, .enable_bit = OMAP2420_EN_VLYNQ_SHIFT, + .idlest_bit = OMAP2420_ST_VLYNQ_SHIFT, .init = &omap2_init_clksel_parent, .clksel_reg = CM_CLKSEL1, .clksel_mask = OMAP2420_CLKSEL_VLYNQ_MASK,
@@ -2579,10 +2633,11 @@ static struct clk sdrc_ick = { .name = "sdrc_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP243X | ENABLE_ON_INIT, + .flags = CLOCK_IN_OMAP243X | WAIT_READY | ENABLE_ON_INIT, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN3, .enable_bit = OMAP2430_EN_SDRC_SHIFT, + .idlest_bit = OMAP2430_ST_SDRC_SHIFT, .recalc = &followparent_recalc, };
@@ -2590,10 +2645,11 @@ static struct clk des_ick = { .name = "des_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X, + .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = OMAP24XX_CM_ICLKEN4, .enable_bit = OMAP24XX_EN_DES_SHIFT, + .idlest_bit = OMAP24XX_ST_DES_SHIFT, .recalc = &followparent_recalc, };
@@ -2601,10 +2657,11 @@ static struct clk sha_ick = { .name = "sha_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X, + .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = OMAP24XX_CM_ICLKEN4, .enable_bit = OMAP24XX_EN_SHA_SHIFT, + .idlest_bit = OMAP24XX_ST_SHA_SHIFT, .recalc = &followparent_recalc, };
@@ -2612,10 +2669,11 @@ static struct clk rng_ick = { .name = "rng_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X, + .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = OMAP24XX_CM_ICLKEN4, .enable_bit = OMAP24XX_EN_RNG_SHIFT, + .idlest_bit = OMAP24XX_ST_RNG_SHIFT, .recalc = &followparent_recalc, };
@@ -2623,10 +2681,11 @@ static struct clk aes_ick = { .name = "aes_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X, + .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = OMAP24XX_CM_ICLKEN4, .enable_bit = OMAP24XX_EN_AES_SHIFT, + .idlest_bit = OMAP24XX_ST_AES_SHIFT, .recalc = &followparent_recalc, };
@@ -2634,10 +2693,11 @@ static struct clk pka_ick = { .name = "pka_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X, + .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = OMAP24XX_CM_ICLKEN4, .enable_bit = OMAP24XX_EN_PKA_SHIFT, + .idlest_bit = OMAP24XX_ST_PKA_SHIFT, .recalc = &followparent_recalc, };
@@ -2645,10 +2705,11 @@ static struct clk usb_fck = { .name = "usb_fck", .parent = &func_48m_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X, + .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X | WAIT_READY, .clkdm = { .name = "core_l3_clkdm" }, .enable_reg = OMAP24XX_CM_FCLKEN2, .enable_bit = OMAP24XX_EN_USB_SHIFT, + .idlest_bit = OMAP24XX_ST_USB_SHIFT, .recalc = &followparent_recalc, };
@@ -2656,10 +2717,11 @@ static struct clk usbhs_ick = { .name = "usbhs_ick", .parent = &core_l3_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l3_clkdm" }, .enable_reg = CM_ICLKEN2, .enable_bit = OMAP2430_EN_USBHS_SHIFT, + .idlest_bit = OMAP2430_ST_USBHS_SHIFT, .recalc = &followparent_recalc, };
@@ -2668,10 +2730,11 @@ static struct clk mmchs1_ick = { .id = 1, .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN2, .enable_bit = OMAP2430_EN_MMCHS1_SHIFT, + .idlest_bit = OMAP2430_ST_MMCHS1_SHIFT, .recalc = &followparent_recalc, };
@@ -2692,10 +2755,11 @@ static struct clk mmchs2_ick = { .id = 2, .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN2, .enable_bit = OMAP2430_EN_MMCHS2_SHIFT, + .idlest_bit = OMAP2430_ST_MMCHS2_SHIFT, .recalc = &followparent_recalc, };
@@ -2715,10 +2779,11 @@ static struct clk gpio5_ick = { .name = "gpio5_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN2, .enable_bit = OMAP2430_EN_GPIO5_SHIFT, + .idlest_bit = OMAP2430_ST_GPIO5_SHIFT, .recalc = &followparent_recalc, };
@@ -2737,10 +2802,11 @@ static struct clk mdm_intc_ick = { .name = "mdm_intc_ick", .parent = &l4_ck, .prcm_mod = CORE_MOD, - .flags = CLOCK_IN_OMAP243X, + .flags = CLOCK_IN_OMAP243X | WAIT_READY, .clkdm = { .name = "core_l4_clkdm" }, .enable_reg = CM_ICLKEN2, .enable_bit = OMAP2430_EN_MDM_INTC_SHIFT, + .idlest_bit = OMAP2430_ST_MDM_INTC_SHIFT, .recalc = &followparent_recalc, };
arch/arm/mach-omap2/clock34xx.h +312 -125
1,194 lines not on this page · raw message
arch/arm/mach-omap2/cm-regbits-24xx.h +1 -0
@@ -147,6 +147,7 @@ /* CM_IDLEST3_CORE */ /* 2430 only */ +#define OMAP2430_ST_SDRC_SHIFT 2 #define OMAP2430_ST_SDRC_MASK (1 << 2) /* CM_IDLEST4_CORE */
arch/arm/plat-omap/include/mach/clock.h +5 -3
@@ -69,6 +69,7 @@ struct clk { u16 enable_reg; __u8 enable_bit; __s8 usecount; + u8 idlest_bit; void (*recalc)(struct clk *); int (*set_rate)(struct clk *, unsigned long); long (*round_rate)(struct clk *, unsigned long);
@@ -142,7 +143,8 @@ extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); #define CONFIG_PARTICIPANT (1 << 10) /* Fundamental clock */ #define ENABLE_ON_INIT (1 << 11) /* Enable upon framework init */ #define INVERT_ENABLE (1 << 12) /* 0 enables, 1 disables */ -/* bits 13-20 are currently free */ +#define WAIT_READY (1 << 13) /* wait for dev to leave idle */ +/* bits 14-20 are currently free */ #define CLOCK_IN_OMAP310 (1 << 21) #define CLOCK_IN_OMAP730 (1 << 22) #define CLOCK_IN_OMAP1510 (1 << 23)
@@ -152,14 +154,14 @@ extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); #define CLOCK_IN_OMAP343X (1 << 27) /* clocks common to all 343X */ #define PARENT_CONTROLS_CLOCK (1 << 28) #define CLOCK_IN_OMAP3430ES1 (1 << 29) /* 3430ES1 clocks only */ -#define CLOCK_IN_OMAP3430ES2 (1 << 30) /* 3430ES2 clocks only */ +#define CLOCK_IN_OMAP3430ES2 (1 << 30) /* 3430ES2+ clocks only */ /* Clksel_rate flags */ #define DEFAULT_RATE (1 << 0) #define RATE_IN_242X (1 << 1) #define RATE_IN_243X (1 << 2) #define RATE_IN_343X (1 << 3) /* rates common to all 343X */ -#define RATE_IN_3430ES2 (1 << 4) /* 3430ES2 rates only */ +#define RATE_IN_3430ES2 (1 << 4) /* 3430ES2+ rates only */ #define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
Paul Walmsley
maintainerPATCH 4/5 OMAP2/3 clock: convert omap2_clk_wait_ready() to use the idlest_bit field
In reply to Paul WalmsleySimplify omap2_clk_wait_ready() to use the new idlest_bit field in struct clk, rather than the hunk of conditionals that were there previously.
--- arch/arm/mach-omap2/clock.c | 96 ++++++++++--------------------------------- 1 files changed, 23 insertions(+), 73 deletions(-)
arch/arm/mach-omap2/clock.c +23 -73
@@ -295,100 +295,50 @@ int omap2_wait_clock_ready(u16 prcm_mod, u16 reg_index, u32 mask,/* -* Note: We don't need special code here for INVERT_ENABLE -* for the time being since INVERT_ENABLE only applies to clocks enabled by -* CM_CLKEN_PLL +* omap2_clk_wait_ready - wait for a OMAP module to come out of target idle +* @clk: struct clk * recently enabled to indicate the module to test * -* REVISIT: This code is ugly and does not belong here. +* Wait for an OMAP module with a target idle state bit to come out of +* idle once both its interface clock and primary functional clock are +* both enabled. Any register read or write to the device before it +* returns from idle will cause an abort. Not all modules have target +* idle state bits (for example, DSS and CAM on OMAP24xx); so we don't +* wait for those. No return value. +* +* We don't need special code here for INVERT_ENABLE for the time +* being since INVERT_ENABLE only applies to clocks enabled by +* CM_CLKEN_PLL. +* +* REVISIT: This function is misnamed: it should be something like +* "omap2_module_wait_ready", and in the long-term, it does not belong +* in the clock framework. It also shouldn't be doing register +* arithmetic to determine the companion clock. */ static void omap2_clk_wait_ready (struct clk *clk) {u16 other_reg, idlest_reg; -u32 other_bit, idlest_bit; +u32 other_bit; -/* Only CM-controlled clocks affect module IDLEST */ -if (clk->prcm_mod & ~PRCM_MOD_ADDR_MASK ) +if (!(clk->flags &WAIT_READY ))return ; +/* If we are enabling an iclk, also test the fclk; and vice versa */ + other_bit =1 << clk->enable_bit; other_reg = clk->enable_reg & ~PRCM_REGTYPE_MASK ; -/* If we are enabling an iclk, also test the fclk; and vice versa */ if (clk->enable_reg &CM_ICLKEN_REGTYPE ) other_reg |=CM_FCLKEN_REGTYPE ;else other_reg |=CM_ICLKEN_REGTYPE ; -/* Covers most of the cases - a few exceptions are below */ - other_bit =1 << clk->enable_bit; - idlest_bit = other_bit; - -/* 24xx: DSS and CAM have no idlest bits for their target agents */ -if (cpu_is_omap24xx () && clk->prcm_mod ==CORE_MOD && - (clk->enable_reg ==CM_FCLKEN1 || clk->enable_reg ==CM_ICLKEN1 )) { - -if (clk->enable_bit ==OMAP24XX_EN_DSS2_SHIFT || - clk->enable_bit ==OMAP24XX_EN_DSS1_SHIFT || - clk->enable_bit ==OMAP24XX_EN_CAM_SHIFT ) -return ; - - } - -/* REVISIT: What are the appropriate exclusions for 34XX? */ -if (cpu_is_omap34xx ()) { - -/* SSI */ -if (clk->prcm_mod ==CORE_MOD && - (clk->enable_reg ==CM_FCLKEN1 || - clk->enable_reg ==CM_ICLKEN1 ) && - clk->enable_bit ==OMAP3430_EN_SSI_SHIFT ) { - -if (system_rev ==OMAP3430_REV_ES1_0 ) -return ; - - idlest_bit =OMAP3430ES2_ST_SSI_IDLE_SHIFT ; - } - -/* DSS */ -if (clk->prcm_mod ==OMAP3430_DSS_MOD ) { - -/* 3430ES1 DSS has no target idlest bits */ -if (system_rev ==OMAP3430_REV_ES1_0 ) -return ; - -/* -* For 3430ES2+ DSS, only wait once (dss1_alwon_fclk, -* dss_l3_iclk, dss_l4_iclk) are enabled -*/ -if (clk->enable_bit !=OMAP3430_EN_DSS1_SHIFT ) -return ; - - idlest_bit =OMAP3430ES2_ST_DSS_IDLE_SHIFT ; - } - -/* USBHOST */ -if (system_rev >OMAP3430_REV_ES1_0 && - clk->prcm_mod ==OMAP3430ES2_USBHOST_MOD ) { - -/* -* The 120MHz clock apparently has nothing to do with -* USBHOST module accessibility -*/ -if (clk->enable_bit ==OMAP3430ES2_EN_USBHOST2_SHIFT ) -return ; - - idlest_bit =OMAP3430ES2_ST_USBHOST_IDLE_SHIFT ; - - } - } - -/* Check if both functional and interface clocks are running. */ +/* Ensure functional and interface clocks are running. */ if (!(cm_read_mod_reg (clk->prcm_mod, other_reg) & other_bit))return ; idlest_reg = other_reg & ~PRCM_REGTYPE_MASK ; idlest_reg |=CM_IDLEST_REGTYPE ; -omap2_wait_clock_ready (clk->prcm_mod, idlest_reg, idlest_bit, +omap2_wait_clock_ready (clk->prcm_mod, idlest_reg,1 << clk->idlest_bit, clk->name); }
Paul Walmsley
maintainerPATCH 5/5 OMAP3 clock: add wait for USIM module to become active
In reply to Paul WalmsleyThis patch adds the register definitions and clock tree fields required to wait for the USIM module to come out of idle when the USIM clocks are enabled. Register bit definitions are from the 34xx HS Addendum Rev B. There, the clock is in fact named "USIM_ICLK".
--- arch/arm/mach-omap2/clock34xx.h | 8 ++++---- arch/arm/mach-omap2/cm-regbits-34xx.h | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/clock34xx.h +4 -4
@@ -2481,10 +2481,11 @@ static struct clk usim_fck = { .prcm_mod = WKUP_MOD, .enable_reg = CM_FCLKEN, .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT, + .idlest_bit = OMAP3430ES2_ST_USIMOCP_SHIFT, .clksel_reg = CM_CLKSEL, .clksel_mask = OMAP3430ES2_CLKSEL_USIMOCP_MASK, .clksel = usim_clksel, - .flags = CLOCK_IN_OMAP3430ES2, + .flags = CLOCK_IN_OMAP3430ES2 | WAIT_READY, .clkdm = { .name = "prm_clkdm" }, .recalc = &omap2_clksel_recalc, };
@@ -2545,15 +2546,14 @@ static struct clk wkup_l4_ick = { .recalc = &followparent_recalc, }; -/* 3430ES2 only */ -/* Never specifically named in the TRM, so we have to infer a likely name */ static struct clk usim_ick = { .name ="usim_ick" , .parent = &wkup_l4_ick, .prcm_mod =WKUP_MOD , .enable_reg =CM_ICLKEN , .enable_bit =OMAP3430ES2_EN_USIMOCP_SHIFT , - .flags =CLOCK_IN_OMAP3430ES2 , + .idlest_bit =OMAP3430ES2_ST_USIMOCP_SHIFT , + .flags =CLOCK_IN_OMAP3430ES2 |WAIT_READY , .clkdm = { .name ="prm_clkdm" }, .recalc = &followparent_recalc, };
arch/arm/mach-omap2/cm-regbits-34xx.h +7 -0
@@ -383,6 +383,7 @@/* CM_FCLKEN_WKUP specific bits */ #define OMAP3430ES2_EN_USIMOCP_SHIFT 9 +#define OMAP3430ES2_EN_USIMOCP_MASK (1 << 9)/* CM_ICLKEN_WKUP specific bits */ #define OMAP3430_EN_WDT1 (1 << 4)
@@ -391,6 +392,8 @@#define OMAP3430_EN_32KSYNC_SHIFT 2/* CM_IDLEST_WKUP specific bits */ +#define OMAP3430ES2_ST_USIMOCP_SHIFT 9 +#define OMAP3430ES2_ST_USIMOCP_MASK (1 << 9)#define OMAP3430_ST_WDT2_SHIFT 5#define OMAP3430_ST_WDT2_MASK (1 << 5)#define OMAP3430_ST_WDT1_SHIFT 4
@@ -399,6 +402,8 @@#define OMAP3430_ST_32KSYNC_MASK (1 << 2)/* CM_AUTOIDLE_WKUP */ +#define OMAP3430ES2_AUTO_USIMOCP (1 << 9) +#define OMAP3430ES2_AUTO_USIMOCP_SHIFT 9#define OMAP3430_AUTO_WDT2 (1 << 5)#define OMAP3430_AUTO_WDT2_SHIFT 5#define OMAP3430_AUTO_WDT1 (1 << 4)
@@ -463,6 +468,8 @@#define OMAP3430_ST_CORE_CLK_MASK (1 << 0)/* CM_IDLEST2_CKGEN */ +#define OMAP3430ES2_ST_USIM_CLK_SHIFT 2 +#define OMAP3430ES2_ST_USIM_CLK_MASK (1 << 2)#define OMAP3430ES2_ST_120M_CLK_SHIFT 1#define OMAP3430ES2_ST_120M_CLK_MASK (1 << 1)#define OMAP3430ES2_ST_PERIPH2_CLK_SHIFT 0