diff options
author | Paul Walmsley <paul@pwsan.com> | 2009-07-24 21:44:06 -0400 |
---|---|---|
committer | paul <paul@twilight.(none)> | 2009-07-24 22:10:36 -0400 |
commit | 3c82e229f09a6acc8d24dc27c5e0e60b1d7161c2 (patch) | |
tree | fb73b268ce7fc660d3bcd2b64df9544759b08201 /arch/arm/mach-omap2/clock34xx.h | |
parent | 3dc2197579089c5b74c7fba666c8ccf1a449afb4 (diff) |
OMAP3 clock: correct module IDLEST bits: SSI; DSS; USBHOST; HSOTGUSB
Fix two bugs in the OMAP3 clock tree pertaining to the SSI, DSS,
USBHOST, and HSOTGUSB devices. These devices are both interconnect
initiators and targets. Without this patch, clk_enable()s on clocks for
these modules can be very high latency (potentially up to ~200
milliseconds) and message such as the following are generated:
Clock usbhost_48m_fck didn't enable in 100000 tries
Two bugs are fixed by this patch. First, OMAP hardware only supports
target CM_IDLEST register bits on ES2+ chips and beyond. ES1 chips
should not wait for these clocks to enable. So, split the appropriate
clocks into ES1 and ES2+ variants, so that kernels running on ES1
devices won't try to wait.
Second, the current heuristic in omap2_clk_dflt_find_idlest() will
fail for these clocks. It assumes that the CM_IDLEST bit to wait upon
is the same as the CM_*CLKEN bit, which is false[1]. Fix by
implementing custom clkops .find_idlest function pointers for the
appropriate clocks that return the correct slave IDLEST bit shift.
This was originally fixed in the linux-omap kernel during 2.6.29 in a
slightly different manner[2][3].
In the medium-term future, all of the module IDLEST code will
eventually be moved to the omap_hwmod code.
Problem reported by Jarkko Nikula <jhnikula@gmail.com>:
http://marc.info/?l=linux-omap&m=124306184903679&w=2
...
1. See for example 34xx TRM Revision P Table 4-213 and 4-217 (for the
DSS case).
2. http://www.spinics.net/lists/linux-omap/msg05512.html et seq.
3. http://lkml.indiana.edu/hypermail/linux/kernel/0901.3/01498.html
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Jarkko Nikula <jhnikula@gmail.com>
Diffstat (limited to 'arch/arm/mach-omap2/clock34xx.h')
-rw-r--r-- | arch/arm/mach-omap2/clock34xx.h | 85 |
1 files changed, 74 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h index e433aec4efdd..57cc2725b923 100644 --- a/arch/arm/mach-omap2/clock34xx.h +++ b/arch/arm/mach-omap2/clock34xx.h | |||
@@ -1568,7 +1568,7 @@ static const struct clksel ssi_ssr_clksel[] = { | |||
1568 | { .parent = NULL } | 1568 | { .parent = NULL } |
1569 | }; | 1569 | }; |
1570 | 1570 | ||
1571 | static struct clk ssi_ssr_fck = { | 1571 | static struct clk ssi_ssr_fck_3430es1 = { |
1572 | .name = "ssi_ssr_fck", | 1572 | .name = "ssi_ssr_fck", |
1573 | .ops = &clkops_omap2_dflt, | 1573 | .ops = &clkops_omap2_dflt, |
1574 | .init = &omap2_init_clksel_parent, | 1574 | .init = &omap2_init_clksel_parent, |
@@ -1581,10 +1581,31 @@ static struct clk ssi_ssr_fck = { | |||
1581 | .recalc = &omap2_clksel_recalc, | 1581 | .recalc = &omap2_clksel_recalc, |
1582 | }; | 1582 | }; |
1583 | 1583 | ||
1584 | static struct clk ssi_sst_fck = { | 1584 | static struct clk ssi_ssr_fck_3430es2 = { |
1585 | .name = "ssi_ssr_fck", | ||
1586 | .ops = &clkops_omap3430es2_ssi_wait, | ||
1587 | .init = &omap2_init_clksel_parent, | ||
1588 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1589 | .enable_bit = OMAP3430_EN_SSI_SHIFT, | ||
1590 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), | ||
1591 | .clksel_mask = OMAP3430_CLKSEL_SSI_MASK, | ||
1592 | .clksel = ssi_ssr_clksel, | ||
1593 | .clkdm_name = "core_l4_clkdm", | ||
1594 | .recalc = &omap2_clksel_recalc, | ||
1595 | }; | ||
1596 | |||
1597 | static struct clk ssi_sst_fck_3430es1 = { | ||
1585 | .name = "ssi_sst_fck", | 1598 | .name = "ssi_sst_fck", |
1586 | .ops = &clkops_null, | 1599 | .ops = &clkops_null, |
1587 | .parent = &ssi_ssr_fck, | 1600 | .parent = &ssi_ssr_fck_3430es1, |
1601 | .fixed_div = 2, | ||
1602 | .recalc = &omap2_fixed_divisor_recalc, | ||
1603 | }; | ||
1604 | |||
1605 | static struct clk ssi_sst_fck_3430es2 = { | ||
1606 | .name = "ssi_sst_fck", | ||
1607 | .ops = &clkops_null, | ||
1608 | .parent = &ssi_ssr_fck_3430es2, | ||
1588 | .fixed_div = 2, | 1609 | .fixed_div = 2, |
1589 | .recalc = &omap2_fixed_divisor_recalc, | 1610 | .recalc = &omap2_fixed_divisor_recalc, |
1590 | }; | 1611 | }; |
@@ -1606,9 +1627,19 @@ static struct clk core_l3_ick = { | |||
1606 | .recalc = &followparent_recalc, | 1627 | .recalc = &followparent_recalc, |
1607 | }; | 1628 | }; |
1608 | 1629 | ||
1609 | static struct clk hsotgusb_ick = { | 1630 | static struct clk hsotgusb_ick_3430es1 = { |
1610 | .name = "hsotgusb_ick", | 1631 | .name = "hsotgusb_ick", |
1611 | .ops = &clkops_omap2_dflt_wait, | 1632 | .ops = &clkops_omap2_dflt, |
1633 | .parent = &core_l3_ick, | ||
1634 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1635 | .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, | ||
1636 | .clkdm_name = "core_l3_clkdm", | ||
1637 | .recalc = &followparent_recalc, | ||
1638 | }; | ||
1639 | |||
1640 | static struct clk hsotgusb_ick_3430es2 = { | ||
1641 | .name = "hsotgusb_ick", | ||
1642 | .ops = &clkops_omap3430es2_hsotgusb_wait, | ||
1612 | .parent = &core_l3_ick, | 1643 | .parent = &core_l3_ick, |
1613 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1644 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1614 | .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, | 1645 | .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, |
@@ -1947,7 +1978,7 @@ static struct clk ssi_l4_ick = { | |||
1947 | .recalc = &followparent_recalc, | 1978 | .recalc = &followparent_recalc, |
1948 | }; | 1979 | }; |
1949 | 1980 | ||
1950 | static struct clk ssi_ick = { | 1981 | static struct clk ssi_ick_3430es1 = { |
1951 | .name = "ssi_ick", | 1982 | .name = "ssi_ick", |
1952 | .ops = &clkops_omap2_dflt, | 1983 | .ops = &clkops_omap2_dflt, |
1953 | .parent = &ssi_l4_ick, | 1984 | .parent = &ssi_l4_ick, |
@@ -1957,6 +1988,16 @@ static struct clk ssi_ick = { | |||
1957 | .recalc = &followparent_recalc, | 1988 | .recalc = &followparent_recalc, |
1958 | }; | 1989 | }; |
1959 | 1990 | ||
1991 | static struct clk ssi_ick_3430es2 = { | ||
1992 | .name = "ssi_ick", | ||
1993 | .ops = &clkops_omap3430es2_ssi_wait, | ||
1994 | .parent = &ssi_l4_ick, | ||
1995 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1996 | .enable_bit = OMAP3430_EN_SSI_SHIFT, | ||
1997 | .clkdm_name = "core_l4_clkdm", | ||
1998 | .recalc = &followparent_recalc, | ||
1999 | }; | ||
2000 | |||
1960 | /* REVISIT: Technically the TRM claims that this is CORE_CLK based, | 2001 | /* REVISIT: Technically the TRM claims that this is CORE_CLK based, |
1961 | * but l4_ick makes more sense to me */ | 2002 | * but l4_ick makes more sense to me */ |
1962 | 2003 | ||
@@ -2024,7 +2065,7 @@ static struct clk des1_ick = { | |||
2024 | }; | 2065 | }; |
2025 | 2066 | ||
2026 | /* DSS */ | 2067 | /* DSS */ |
2027 | static struct clk dss1_alwon_fck = { | 2068 | static struct clk dss1_alwon_fck_3430es1 = { |
2028 | .name = "dss1_alwon_fck", | 2069 | .name = "dss1_alwon_fck", |
2029 | .ops = &clkops_omap2_dflt, | 2070 | .ops = &clkops_omap2_dflt, |
2030 | .parent = &dpll4_m4x2_ck, | 2071 | .parent = &dpll4_m4x2_ck, |
@@ -2034,6 +2075,16 @@ static struct clk dss1_alwon_fck = { | |||
2034 | .recalc = &followparent_recalc, | 2075 | .recalc = &followparent_recalc, |
2035 | }; | 2076 | }; |
2036 | 2077 | ||
2078 | static struct clk dss1_alwon_fck_3430es2 = { | ||
2079 | .name = "dss1_alwon_fck", | ||
2080 | .ops = &clkops_omap3430es2_dss_usbhost_wait, | ||
2081 | .parent = &dpll4_m4x2_ck, | ||
2082 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN), | ||
2083 | .enable_bit = OMAP3430_EN_DSS1_SHIFT, | ||
2084 | .clkdm_name = "dss_clkdm", | ||
2085 | .recalc = &followparent_recalc, | ||
2086 | }; | ||
2087 | |||
2037 | static struct clk dss_tv_fck = { | 2088 | static struct clk dss_tv_fck = { |
2038 | .name = "dss_tv_fck", | 2089 | .name = "dss_tv_fck", |
2039 | .ops = &clkops_omap2_dflt, | 2090 | .ops = &clkops_omap2_dflt, |
@@ -2067,7 +2118,7 @@ static struct clk dss2_alwon_fck = { | |||
2067 | .recalc = &followparent_recalc, | 2118 | .recalc = &followparent_recalc, |
2068 | }; | 2119 | }; |
2069 | 2120 | ||
2070 | static struct clk dss_ick = { | 2121 | static struct clk dss_ick_3430es1 = { |
2071 | /* Handles both L3 and L4 clocks */ | 2122 | /* Handles both L3 and L4 clocks */ |
2072 | .name = "dss_ick", | 2123 | .name = "dss_ick", |
2073 | .ops = &clkops_omap2_dflt, | 2124 | .ops = &clkops_omap2_dflt, |
@@ -2079,6 +2130,18 @@ static struct clk dss_ick = { | |||
2079 | .recalc = &followparent_recalc, | 2130 | .recalc = &followparent_recalc, |
2080 | }; | 2131 | }; |
2081 | 2132 | ||
2133 | static struct clk dss_ick_3430es2 = { | ||
2134 | /* Handles both L3 and L4 clocks */ | ||
2135 | .name = "dss_ick", | ||
2136 | .ops = &clkops_omap3430es2_dss_usbhost_wait, | ||
2137 | .parent = &l4_ick, | ||
2138 | .init = &omap2_init_clk_clkdm, | ||
2139 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN), | ||
2140 | .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT, | ||
2141 | .clkdm_name = "dss_clkdm", | ||
2142 | .recalc = &followparent_recalc, | ||
2143 | }; | ||
2144 | |||
2082 | /* CAM */ | 2145 | /* CAM */ |
2083 | 2146 | ||
2084 | static struct clk cam_mclk = { | 2147 | static struct clk cam_mclk = { |
@@ -2118,7 +2181,7 @@ static struct clk csi2_96m_fck = { | |||
2118 | 2181 | ||
2119 | static struct clk usbhost_120m_fck = { | 2182 | static struct clk usbhost_120m_fck = { |
2120 | .name = "usbhost_120m_fck", | 2183 | .name = "usbhost_120m_fck", |
2121 | .ops = &clkops_omap2_dflt_wait, | 2184 | .ops = &clkops_omap2_dflt, |
2122 | .parent = &dpll5_m2_ck, | 2185 | .parent = &dpll5_m2_ck, |
2123 | .init = &omap2_init_clk_clkdm, | 2186 | .init = &omap2_init_clk_clkdm, |
2124 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN), | 2187 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN), |
@@ -2129,7 +2192,7 @@ static struct clk usbhost_120m_fck = { | |||
2129 | 2192 | ||
2130 | static struct clk usbhost_48m_fck = { | 2193 | static struct clk usbhost_48m_fck = { |
2131 | .name = "usbhost_48m_fck", | 2194 | .name = "usbhost_48m_fck", |
2132 | .ops = &clkops_omap2_dflt_wait, | 2195 | .ops = &clkops_omap3430es2_dss_usbhost_wait, |
2133 | .parent = &omap_48m_fck, | 2196 | .parent = &omap_48m_fck, |
2134 | .init = &omap2_init_clk_clkdm, | 2197 | .init = &omap2_init_clk_clkdm, |
2135 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN), | 2198 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN), |
@@ -2141,7 +2204,7 @@ static struct clk usbhost_48m_fck = { | |||
2141 | static struct clk usbhost_ick = { | 2204 | static struct clk usbhost_ick = { |
2142 | /* Handles both L3 and L4 clocks */ | 2205 | /* Handles both L3 and L4 clocks */ |
2143 | .name = "usbhost_ick", | 2206 | .name = "usbhost_ick", |
2144 | .ops = &clkops_omap2_dflt_wait, | 2207 | .ops = &clkops_omap3430es2_dss_usbhost_wait, |
2145 | .parent = &l4_ick, | 2208 | .parent = &l4_ick, |
2146 | .init = &omap2_init_clk_clkdm, | 2209 | .init = &omap2_init_clk_clkdm, |
2147 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN), | 2210 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN), |