diff options
author | Olof Johansson <olof@lixom.net> | 2012-04-05 20:09:45 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-04-05 20:09:45 -0400 |
commit | a8f5b6e5ef0faf64997bfa87698aaabc989e64c4 (patch) | |
tree | 9eb41f6030258dc174c72c5431e690ee70ae750c /arch | |
parent | 1ac02d795889d1828a66d4b3a3fd66492d1d7cf2 (diff) | |
parent | a9dd31b744a033b4324c93cec4ecb4c74061e2cf (diff) |
Merge tag 'omap-fixes-a2-for-3.4rc' of git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending into fixes
From Paul Walmsley:
OMAP clock, powerdomain, clockdomain, and hwmod fixes intended for the
early v3.4-rc series. Also contains an HSMMC integration refinement
of an earlier hardware bug workaround.
* tag 'omap-fixes-a2-for-3.4rc' of git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending:
ARM: OMAP2+: hwmod: Fix wrong SYSC_TYPE1_XXX_MASK bit definitions
ARM: OMAP2+: hwmod: Make omap_hwmod_softreset wait for reset status
ARM: OMAP2+: hwmod: Restore sysc after a reset
ARM: OMAP2+: omap_hwmod: Allow io_ring wakeup configuration for all modules
ARM: OMAP3: clock data: fill in some missing clockdomains
ARM: OMAP4: clock data: Force a DPLL clkdm/pwrdm ON before a relock
ARM: OMAP4: clock data: fix mult and div mask for USB_DPLL
ARM: OMAP2+: powerdomain: Wait for powerdomain transition in pwrdm_state_switch()
ARM: OMAP AM3517/3505: clock data: change EMAC clocks aliases
ARM: OMAP: clock: fix race in disable all clocks
ARM: OMAP4: hwmod data: Add aliases for McBSP fclk clocks
ARM: OMAP3xxx: clock data: fix DPLL4 CLKSEL masks
ARM: OMAP3xxx: HSMMC: avoid erratum workaround when transceiver is attached
ARM: OMAP44xx: clockdomain data: correct the emu_sys_clkdm CLKTRCTRL data
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/clock3xxx_data.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock44xx_data.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clockdomains44xx_data.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/hsmmc.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 88 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 28 | ||||
-rw-r--r-- | arch/arm/mach-omap2/powerdomain.c | 8 | ||||
-rw-r--r-- | arch/arm/plat-omap/clock.c | 5 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap_hwmod.h | 12 |
9 files changed, 105 insertions, 68 deletions
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c index 480fb8f09aed..f4a626f7c79e 100644 --- a/arch/arm/mach-omap2/clock3xxx_data.c +++ b/arch/arm/mach-omap2/clock3xxx_data.c | |||
@@ -747,7 +747,7 @@ static struct clk dpll4_m3_ck = { | |||
747 | .parent = &dpll4_ck, | 747 | .parent = &dpll4_ck, |
748 | .init = &omap2_init_clksel_parent, | 748 | .init = &omap2_init_clksel_parent, |
749 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), | 749 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), |
750 | .clksel_mask = OMAP3430_CLKSEL_TV_MASK, | 750 | .clksel_mask = OMAP3630_CLKSEL_TV_MASK, |
751 | .clksel = dpll4_clksel, | 751 | .clksel = dpll4_clksel, |
752 | .clkdm_name = "dpll4_clkdm", | 752 | .clkdm_name = "dpll4_clkdm", |
753 | .recalc = &omap2_clksel_recalc, | 753 | .recalc = &omap2_clksel_recalc, |
@@ -832,7 +832,7 @@ static struct clk dpll4_m4_ck = { | |||
832 | .parent = &dpll4_ck, | 832 | .parent = &dpll4_ck, |
833 | .init = &omap2_init_clksel_parent, | 833 | .init = &omap2_init_clksel_parent, |
834 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), | 834 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), |
835 | .clksel_mask = OMAP3430_CLKSEL_DSS1_MASK, | 835 | .clksel_mask = OMAP3630_CLKSEL_DSS1_MASK, |
836 | .clksel = dpll4_clksel, | 836 | .clksel = dpll4_clksel, |
837 | .clkdm_name = "dpll4_clkdm", | 837 | .clkdm_name = "dpll4_clkdm", |
838 | .recalc = &omap2_clksel_recalc, | 838 | .recalc = &omap2_clksel_recalc, |
@@ -859,7 +859,7 @@ static struct clk dpll4_m5_ck = { | |||
859 | .parent = &dpll4_ck, | 859 | .parent = &dpll4_ck, |
860 | .init = &omap2_init_clksel_parent, | 860 | .init = &omap2_init_clksel_parent, |
861 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL), | 861 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL), |
862 | .clksel_mask = OMAP3430_CLKSEL_CAM_MASK, | 862 | .clksel_mask = OMAP3630_CLKSEL_CAM_MASK, |
863 | .clksel = dpll4_clksel, | 863 | .clksel = dpll4_clksel, |
864 | .clkdm_name = "dpll4_clkdm", | 864 | .clkdm_name = "dpll4_clkdm", |
865 | .set_rate = &omap2_clksel_set_rate, | 865 | .set_rate = &omap2_clksel_set_rate, |
@@ -886,7 +886,7 @@ static struct clk dpll4_m6_ck = { | |||
886 | .parent = &dpll4_ck, | 886 | .parent = &dpll4_ck, |
887 | .init = &omap2_init_clksel_parent, | 887 | .init = &omap2_init_clksel_parent, |
888 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), | 888 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), |
889 | .clksel_mask = OMAP3430_DIV_DPLL4_MASK, | 889 | .clksel_mask = OMAP3630_DIV_DPLL4_MASK, |
890 | .clksel = dpll4_clksel, | 890 | .clksel = dpll4_clksel, |
891 | .clkdm_name = "dpll4_clkdm", | 891 | .clkdm_name = "dpll4_clkdm", |
892 | .recalc = &omap2_clksel_recalc, | 892 | .recalc = &omap2_clksel_recalc, |
@@ -1394,6 +1394,7 @@ static struct clk cpefuse_fck = { | |||
1394 | .name = "cpefuse_fck", | 1394 | .name = "cpefuse_fck", |
1395 | .ops = &clkops_omap2_dflt, | 1395 | .ops = &clkops_omap2_dflt, |
1396 | .parent = &sys_ck, | 1396 | .parent = &sys_ck, |
1397 | .clkdm_name = "core_l4_clkdm", | ||
1397 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), | 1398 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), |
1398 | .enable_bit = OMAP3430ES2_EN_CPEFUSE_SHIFT, | 1399 | .enable_bit = OMAP3430ES2_EN_CPEFUSE_SHIFT, |
1399 | .recalc = &followparent_recalc, | 1400 | .recalc = &followparent_recalc, |
@@ -1403,6 +1404,7 @@ static struct clk ts_fck = { | |||
1403 | .name = "ts_fck", | 1404 | .name = "ts_fck", |
1404 | .ops = &clkops_omap2_dflt, | 1405 | .ops = &clkops_omap2_dflt, |
1405 | .parent = &omap_32k_fck, | 1406 | .parent = &omap_32k_fck, |
1407 | .clkdm_name = "core_l4_clkdm", | ||
1406 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), | 1408 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), |
1407 | .enable_bit = OMAP3430ES2_EN_TS_SHIFT, | 1409 | .enable_bit = OMAP3430ES2_EN_TS_SHIFT, |
1408 | .recalc = &followparent_recalc, | 1410 | .recalc = &followparent_recalc, |
@@ -1412,6 +1414,7 @@ static struct clk usbtll_fck = { | |||
1412 | .name = "usbtll_fck", | 1414 | .name = "usbtll_fck", |
1413 | .ops = &clkops_omap2_dflt_wait, | 1415 | .ops = &clkops_omap2_dflt_wait, |
1414 | .parent = &dpll5_m2_ck, | 1416 | .parent = &dpll5_m2_ck, |
1417 | .clkdm_name = "core_l4_clkdm", | ||
1415 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), | 1418 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), |
1416 | .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, | 1419 | .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, |
1417 | .recalc = &followparent_recalc, | 1420 | .recalc = &followparent_recalc, |
@@ -1617,6 +1620,7 @@ static struct clk fshostusb_fck = { | |||
1617 | .name = "fshostusb_fck", | 1620 | .name = "fshostusb_fck", |
1618 | .ops = &clkops_omap2_dflt_wait, | 1621 | .ops = &clkops_omap2_dflt_wait, |
1619 | .parent = &core_48m_fck, | 1622 | .parent = &core_48m_fck, |
1623 | .clkdm_name = "core_l4_clkdm", | ||
1620 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1624 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1621 | .enable_bit = OMAP3430ES1_EN_FSHOSTUSB_SHIFT, | 1625 | .enable_bit = OMAP3430ES1_EN_FSHOSTUSB_SHIFT, |
1622 | .recalc = &followparent_recalc, | 1626 | .recalc = &followparent_recalc, |
@@ -2043,6 +2047,7 @@ static struct clk omapctrl_ick = { | |||
2043 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2047 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2044 | .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT, | 2048 | .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT, |
2045 | .flags = ENABLE_ON_INIT, | 2049 | .flags = ENABLE_ON_INIT, |
2050 | .clkdm_name = "core_l4_clkdm", | ||
2046 | .recalc = &followparent_recalc, | 2051 | .recalc = &followparent_recalc, |
2047 | }; | 2052 | }; |
2048 | 2053 | ||
@@ -2094,6 +2099,7 @@ static struct clk usb_l4_ick = { | |||
2094 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), | 2099 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), |
2095 | .clksel_mask = OMAP3430ES1_CLKSEL_FSHOSTUSB_MASK, | 2100 | .clksel_mask = OMAP3430ES1_CLKSEL_FSHOSTUSB_MASK, |
2096 | .clksel = usb_l4_clksel, | 2101 | .clksel = usb_l4_clksel, |
2102 | .clkdm_name = "core_l4_clkdm", | ||
2097 | .recalc = &omap2_clksel_recalc, | 2103 | .recalc = &omap2_clksel_recalc, |
2098 | }; | 2104 | }; |
2099 | 2105 | ||
@@ -3467,8 +3473,8 @@ static struct omap_clk omap3xxx_clks[] = { | |||
3467 | CLK(NULL, "ipss_ick", &ipss_ick, CK_AM35XX), | 3473 | CLK(NULL, "ipss_ick", &ipss_ick, CK_AM35XX), |
3468 | CLK(NULL, "rmii_ck", &rmii_ck, CK_AM35XX), | 3474 | CLK(NULL, "rmii_ck", &rmii_ck, CK_AM35XX), |
3469 | CLK(NULL, "pclk_ck", &pclk_ck, CK_AM35XX), | 3475 | CLK(NULL, "pclk_ck", &pclk_ck, CK_AM35XX), |
3470 | CLK("davinci_emac", "emac_clk", &emac_ick, CK_AM35XX), | 3476 | CLK("davinci_emac", NULL, &emac_ick, CK_AM35XX), |
3471 | CLK("davinci_emac", "phy_clk", &emac_fck, CK_AM35XX), | 3477 | CLK("davinci_mdio.0", NULL, &emac_fck, CK_AM35XX), |
3472 | CLK("vpfe-capture", "master", &vpfe_ick, CK_AM35XX), | 3478 | CLK("vpfe-capture", "master", &vpfe_ick, CK_AM35XX), |
3473 | CLK("vpfe-capture", "slave", &vpfe_fck, CK_AM35XX), | 3479 | CLK("vpfe-capture", "slave", &vpfe_fck, CK_AM35XX), |
3474 | CLK("musb-am35x", "ick", &hsotgusb_ick_am35xx, CK_AM35XX), | 3480 | CLK("musb-am35x", "ick", &hsotgusb_ick_am35xx, CK_AM35XX), |
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c index c03c1108468e..fa6ea65ad44b 100644 --- a/arch/arm/mach-omap2/clock44xx_data.c +++ b/arch/arm/mach-omap2/clock44xx_data.c | |||
@@ -957,8 +957,8 @@ static struct dpll_data dpll_usb_dd = { | |||
957 | .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED), | 957 | .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED), |
958 | .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_USB, | 958 | .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_USB, |
959 | .idlest_reg = OMAP4430_CM_IDLEST_DPLL_USB, | 959 | .idlest_reg = OMAP4430_CM_IDLEST_DPLL_USB, |
960 | .mult_mask = OMAP4430_DPLL_MULT_MASK, | 960 | .mult_mask = OMAP4430_DPLL_MULT_USB_MASK, |
961 | .div1_mask = OMAP4430_DPLL_DIV_MASK, | 961 | .div1_mask = OMAP4430_DPLL_DIV_0_7_MASK, |
962 | .enable_mask = OMAP4430_DPLL_EN_MASK, | 962 | .enable_mask = OMAP4430_DPLL_EN_MASK, |
963 | .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK, | 963 | .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK, |
964 | .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK, | 964 | .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK, |
@@ -978,6 +978,7 @@ static struct clk dpll_usb_ck = { | |||
978 | .recalc = &omap3_dpll_recalc, | 978 | .recalc = &omap3_dpll_recalc, |
979 | .round_rate = &omap2_dpll_round_rate, | 979 | .round_rate = &omap2_dpll_round_rate, |
980 | .set_rate = &omap3_noncore_dpll_set_rate, | 980 | .set_rate = &omap3_noncore_dpll_set_rate, |
981 | .clkdm_name = "l3_init_clkdm", | ||
981 | }; | 982 | }; |
982 | 983 | ||
983 | static struct clk dpll_usb_clkdcoldo_ck = { | 984 | static struct clk dpll_usb_clkdcoldo_ck = { |
diff --git a/arch/arm/mach-omap2/clockdomains44xx_data.c b/arch/arm/mach-omap2/clockdomains44xx_data.c index 9299ac291d28..bd7ed13515cc 100644 --- a/arch/arm/mach-omap2/clockdomains44xx_data.c +++ b/arch/arm/mach-omap2/clockdomains44xx_data.c | |||
@@ -390,7 +390,7 @@ static struct clockdomain emu_sys_44xx_clkdm = { | |||
390 | .prcm_partition = OMAP4430_PRM_PARTITION, | 390 | .prcm_partition = OMAP4430_PRM_PARTITION, |
391 | .cm_inst = OMAP4430_PRM_EMU_CM_INST, | 391 | .cm_inst = OMAP4430_PRM_EMU_CM_INST, |
392 | .clkdm_offs = OMAP4430_PRM_EMU_CM_EMU_CDOFFS, | 392 | .clkdm_offs = OMAP4430_PRM_EMU_CM_EMU_CDOFFS, |
393 | .flags = CLKDM_CAN_HWSUP, | 393 | .flags = CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_FORCE_WAKEUP, |
394 | }; | 394 | }; |
395 | 395 | ||
396 | static struct clockdomain l3_dma_44xx_clkdm = { | 396 | static struct clockdomain l3_dma_44xx_clkdm = { |
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c index 100db6217f39..b0268eaffe13 100644 --- a/arch/arm/mach-omap2/hsmmc.c +++ b/arch/arm/mach-omap2/hsmmc.c | |||
@@ -506,6 +506,13 @@ static void __init omap_hsmmc_init_one(struct omap2_hsmmc_info *hsmmcinfo, | |||
506 | if (oh->dev_attr != NULL) { | 506 | if (oh->dev_attr != NULL) { |
507 | mmc_dev_attr = oh->dev_attr; | 507 | mmc_dev_attr = oh->dev_attr; |
508 | mmc_data->controller_flags = mmc_dev_attr->flags; | 508 | mmc_data->controller_flags = mmc_dev_attr->flags; |
509 | /* | ||
510 | * erratum 2.1.1.128 doesn't apply if board has | ||
511 | * a transceiver is attached | ||
512 | */ | ||
513 | if (hsmmcinfo->transceiver) | ||
514 | mmc_data->controller_flags &= | ||
515 | ~OMAP_HSMMC_BROKEN_MULTIBLOCK_READ; | ||
509 | } | 516 | } |
510 | 517 | ||
511 | pdev = platform_device_alloc(name, ctrl_nr - 1); | 518 | pdev = platform_device_alloc(name, ctrl_nr - 1); |
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index f9b9bb9c3e32..2c27fdb61e66 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -1479,6 +1479,11 @@ static int _reset(struct omap_hwmod *oh) | |||
1479 | 1479 | ||
1480 | ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh); | 1480 | ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh); |
1481 | 1481 | ||
1482 | if (oh->class->sysc) { | ||
1483 | _update_sysc_cache(oh); | ||
1484 | _enable_sysc(oh); | ||
1485 | } | ||
1486 | |||
1482 | return ret; | 1487 | return ret; |
1483 | } | 1488 | } |
1484 | 1489 | ||
@@ -1788,20 +1793,9 @@ static int _setup(struct omap_hwmod *oh, void *data) | |||
1788 | return 0; | 1793 | return 0; |
1789 | } | 1794 | } |
1790 | 1795 | ||
1791 | if (!(oh->flags & HWMOD_INIT_NO_RESET)) { | 1796 | if (!(oh->flags & HWMOD_INIT_NO_RESET)) |
1792 | _reset(oh); | 1797 | _reset(oh); |
1793 | 1798 | ||
1794 | /* | ||
1795 | * OCP_SYSCONFIG bits need to be reprogrammed after a softreset. | ||
1796 | * The _enable() function should be split to | ||
1797 | * avoid the rewrite of the OCP_SYSCONFIG register. | ||
1798 | */ | ||
1799 | if (oh->class->sysc) { | ||
1800 | _update_sysc_cache(oh); | ||
1801 | _enable_sysc(oh); | ||
1802 | } | ||
1803 | } | ||
1804 | |||
1805 | postsetup_state = oh->_postsetup_state; | 1799 | postsetup_state = oh->_postsetup_state; |
1806 | if (postsetup_state == _HWMOD_STATE_UNKNOWN) | 1800 | if (postsetup_state == _HWMOD_STATE_UNKNOWN) |
1807 | postsetup_state = _HWMOD_STATE_ENABLED; | 1801 | postsetup_state = _HWMOD_STATE_ENABLED; |
@@ -1909,20 +1903,10 @@ void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs) | |||
1909 | */ | 1903 | */ |
1910 | int omap_hwmod_softreset(struct omap_hwmod *oh) | 1904 | int omap_hwmod_softreset(struct omap_hwmod *oh) |
1911 | { | 1905 | { |
1912 | u32 v; | 1906 | if (!oh) |
1913 | int ret; | ||
1914 | |||
1915 | if (!oh || !(oh->_sysc_cache)) | ||
1916 | return -EINVAL; | 1907 | return -EINVAL; |
1917 | 1908 | ||
1918 | v = oh->_sysc_cache; | 1909 | return _ocp_softreset(oh); |
1919 | ret = _set_softreset(oh, &v); | ||
1920 | if (ret) | ||
1921 | goto error; | ||
1922 | _write_sysconfig(v, oh); | ||
1923 | |||
1924 | error: | ||
1925 | return ret; | ||
1926 | } | 1910 | } |
1927 | 1911 | ||
1928 | /** | 1912 | /** |
@@ -2465,26 +2449,28 @@ int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh, | |||
2465 | * @oh: struct omap_hwmod * | 2449 | * @oh: struct omap_hwmod * |
2466 | * | 2450 | * |
2467 | * Sets the module OCP socket ENAWAKEUP bit to allow the module to | 2451 | * Sets the module OCP socket ENAWAKEUP bit to allow the module to |
2468 | * send wakeups to the PRCM. Eventually this should sets PRCM wakeup | 2452 | * send wakeups to the PRCM, and enable I/O ring wakeup events for |
2469 | * registers to cause the PRCM to receive wakeup events from the | 2453 | * this IP block if it has dynamic mux entries. Eventually this |
2470 | * module. Does not set any wakeup routing registers beyond this | 2454 | * should set PRCM wakeup registers to cause the PRCM to receive |
2471 | * point - if the module is to wake up any other module or subsystem, | 2455 | * wakeup events from the module. Does not set any wakeup routing |
2472 | * that must be set separately. Called by omap_device code. Returns | 2456 | * registers beyond this point - if the module is to wake up any other |
2473 | * -EINVAL on error or 0 upon success. | 2457 | * module or subsystem, that must be set separately. Called by |
2458 | * omap_device code. Returns -EINVAL on error or 0 upon success. | ||
2474 | */ | 2459 | */ |
2475 | int omap_hwmod_enable_wakeup(struct omap_hwmod *oh) | 2460 | int omap_hwmod_enable_wakeup(struct omap_hwmod *oh) |
2476 | { | 2461 | { |
2477 | unsigned long flags; | 2462 | unsigned long flags; |
2478 | u32 v; | 2463 | u32 v; |
2479 | 2464 | ||
2480 | if (!oh->class->sysc || | ||
2481 | !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) | ||
2482 | return -EINVAL; | ||
2483 | |||
2484 | spin_lock_irqsave(&oh->_lock, flags); | 2465 | spin_lock_irqsave(&oh->_lock, flags); |
2485 | v = oh->_sysc_cache; | 2466 | |
2486 | _enable_wakeup(oh, &v); | 2467 | if (oh->class->sysc && |
2487 | _write_sysconfig(v, oh); | 2468 | (oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) { |
2469 | v = oh->_sysc_cache; | ||
2470 | _enable_wakeup(oh, &v); | ||
2471 | _write_sysconfig(v, oh); | ||
2472 | } | ||
2473 | |||
2488 | _set_idle_ioring_wakeup(oh, true); | 2474 | _set_idle_ioring_wakeup(oh, true); |
2489 | spin_unlock_irqrestore(&oh->_lock, flags); | 2475 | spin_unlock_irqrestore(&oh->_lock, flags); |
2490 | 2476 | ||
@@ -2496,26 +2482,28 @@ int omap_hwmod_enable_wakeup(struct omap_hwmod *oh) | |||
2496 | * @oh: struct omap_hwmod * | 2482 | * @oh: struct omap_hwmod * |
2497 | * | 2483 | * |
2498 | * Clears the module OCP socket ENAWAKEUP bit to prevent the module | 2484 | * Clears the module OCP socket ENAWAKEUP bit to prevent the module |
2499 | * from sending wakeups to the PRCM. Eventually this should clear | 2485 | * from sending wakeups to the PRCM, and disable I/O ring wakeup |
2500 | * PRCM wakeup registers to cause the PRCM to ignore wakeup events | 2486 | * events for this IP block if it has dynamic mux entries. Eventually |
2501 | * from the module. Does not set any wakeup routing registers beyond | 2487 | * this should clear PRCM wakeup registers to cause the PRCM to ignore |
2502 | * this point - if the module is to wake up any other module or | 2488 | * wakeup events from the module. Does not set any wakeup routing |
2503 | * subsystem, that must be set separately. Called by omap_device | 2489 | * registers beyond this point - if the module is to wake up any other |
2504 | * code. Returns -EINVAL on error or 0 upon success. | 2490 | * module or subsystem, that must be set separately. Called by |
2491 | * omap_device code. Returns -EINVAL on error or 0 upon success. | ||
2505 | */ | 2492 | */ |
2506 | int omap_hwmod_disable_wakeup(struct omap_hwmod *oh) | 2493 | int omap_hwmod_disable_wakeup(struct omap_hwmod *oh) |
2507 | { | 2494 | { |
2508 | unsigned long flags; | 2495 | unsigned long flags; |
2509 | u32 v; | 2496 | u32 v; |
2510 | 2497 | ||
2511 | if (!oh->class->sysc || | ||
2512 | !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) | ||
2513 | return -EINVAL; | ||
2514 | |||
2515 | spin_lock_irqsave(&oh->_lock, flags); | 2498 | spin_lock_irqsave(&oh->_lock, flags); |
2516 | v = oh->_sysc_cache; | 2499 | |
2517 | _disable_wakeup(oh, &v); | 2500 | if (oh->class->sysc && |
2518 | _write_sysconfig(v, oh); | 2501 | (oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) { |
2502 | v = oh->_sysc_cache; | ||
2503 | _disable_wakeup(oh, &v); | ||
2504 | _write_sysconfig(v, oh); | ||
2505 | } | ||
2506 | |||
2519 | _set_idle_ioring_wakeup(oh, false); | 2507 | _set_idle_ioring_wakeup(oh, false); |
2520 | spin_unlock_irqrestore(&oh->_lock, flags); | 2508 | spin_unlock_irqrestore(&oh->_lock, flags); |
2521 | 2509 | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index 08daa5e0eb5f..cc9bd106a854 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c | |||
@@ -2996,6 +2996,11 @@ static struct omap_hwmod_ocp_if *omap44xx_mcbsp1_slaves[] = { | |||
2996 | &omap44xx_l4_abe__mcbsp1_dma, | 2996 | &omap44xx_l4_abe__mcbsp1_dma, |
2997 | }; | 2997 | }; |
2998 | 2998 | ||
2999 | static struct omap_hwmod_opt_clk mcbsp1_opt_clks[] = { | ||
3000 | { .role = "pad_fck", .clk = "pad_clks_ck" }, | ||
3001 | { .role = "prcm_clk", .clk = "mcbsp1_sync_mux_ck" }, | ||
3002 | }; | ||
3003 | |||
2999 | static struct omap_hwmod omap44xx_mcbsp1_hwmod = { | 3004 | static struct omap_hwmod omap44xx_mcbsp1_hwmod = { |
3000 | .name = "mcbsp1", | 3005 | .name = "mcbsp1", |
3001 | .class = &omap44xx_mcbsp_hwmod_class, | 3006 | .class = &omap44xx_mcbsp_hwmod_class, |
@@ -3012,6 +3017,8 @@ static struct omap_hwmod omap44xx_mcbsp1_hwmod = { | |||
3012 | }, | 3017 | }, |
3013 | .slaves = omap44xx_mcbsp1_slaves, | 3018 | .slaves = omap44xx_mcbsp1_slaves, |
3014 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp1_slaves), | 3019 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp1_slaves), |
3020 | .opt_clks = mcbsp1_opt_clks, | ||
3021 | .opt_clks_cnt = ARRAY_SIZE(mcbsp1_opt_clks), | ||
3015 | }; | 3022 | }; |
3016 | 3023 | ||
3017 | /* mcbsp2 */ | 3024 | /* mcbsp2 */ |
@@ -3071,6 +3078,11 @@ static struct omap_hwmod_ocp_if *omap44xx_mcbsp2_slaves[] = { | |||
3071 | &omap44xx_l4_abe__mcbsp2_dma, | 3078 | &omap44xx_l4_abe__mcbsp2_dma, |
3072 | }; | 3079 | }; |
3073 | 3080 | ||
3081 | static struct omap_hwmod_opt_clk mcbsp2_opt_clks[] = { | ||
3082 | { .role = "pad_fck", .clk = "pad_clks_ck" }, | ||
3083 | { .role = "prcm_clk", .clk = "mcbsp2_sync_mux_ck" }, | ||
3084 | }; | ||
3085 | |||
3074 | static struct omap_hwmod omap44xx_mcbsp2_hwmod = { | 3086 | static struct omap_hwmod omap44xx_mcbsp2_hwmod = { |
3075 | .name = "mcbsp2", | 3087 | .name = "mcbsp2", |
3076 | .class = &omap44xx_mcbsp_hwmod_class, | 3088 | .class = &omap44xx_mcbsp_hwmod_class, |
@@ -3087,6 +3099,8 @@ static struct omap_hwmod omap44xx_mcbsp2_hwmod = { | |||
3087 | }, | 3099 | }, |
3088 | .slaves = omap44xx_mcbsp2_slaves, | 3100 | .slaves = omap44xx_mcbsp2_slaves, |
3089 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp2_slaves), | 3101 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp2_slaves), |
3102 | .opt_clks = mcbsp2_opt_clks, | ||
3103 | .opt_clks_cnt = ARRAY_SIZE(mcbsp2_opt_clks), | ||
3090 | }; | 3104 | }; |
3091 | 3105 | ||
3092 | /* mcbsp3 */ | 3106 | /* mcbsp3 */ |
@@ -3146,6 +3160,11 @@ static struct omap_hwmod_ocp_if *omap44xx_mcbsp3_slaves[] = { | |||
3146 | &omap44xx_l4_abe__mcbsp3_dma, | 3160 | &omap44xx_l4_abe__mcbsp3_dma, |
3147 | }; | 3161 | }; |
3148 | 3162 | ||
3163 | static struct omap_hwmod_opt_clk mcbsp3_opt_clks[] = { | ||
3164 | { .role = "pad_fck", .clk = "pad_clks_ck" }, | ||
3165 | { .role = "prcm_clk", .clk = "mcbsp3_sync_mux_ck" }, | ||
3166 | }; | ||
3167 | |||
3149 | static struct omap_hwmod omap44xx_mcbsp3_hwmod = { | 3168 | static struct omap_hwmod omap44xx_mcbsp3_hwmod = { |
3150 | .name = "mcbsp3", | 3169 | .name = "mcbsp3", |
3151 | .class = &omap44xx_mcbsp_hwmod_class, | 3170 | .class = &omap44xx_mcbsp_hwmod_class, |
@@ -3162,6 +3181,8 @@ static struct omap_hwmod omap44xx_mcbsp3_hwmod = { | |||
3162 | }, | 3181 | }, |
3163 | .slaves = omap44xx_mcbsp3_slaves, | 3182 | .slaves = omap44xx_mcbsp3_slaves, |
3164 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp3_slaves), | 3183 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp3_slaves), |
3184 | .opt_clks = mcbsp3_opt_clks, | ||
3185 | .opt_clks_cnt = ARRAY_SIZE(mcbsp3_opt_clks), | ||
3165 | }; | 3186 | }; |
3166 | 3187 | ||
3167 | /* mcbsp4 */ | 3188 | /* mcbsp4 */ |
@@ -3200,6 +3221,11 @@ static struct omap_hwmod_ocp_if *omap44xx_mcbsp4_slaves[] = { | |||
3200 | &omap44xx_l4_per__mcbsp4, | 3221 | &omap44xx_l4_per__mcbsp4, |
3201 | }; | 3222 | }; |
3202 | 3223 | ||
3224 | static struct omap_hwmod_opt_clk mcbsp4_opt_clks[] = { | ||
3225 | { .role = "pad_fck", .clk = "pad_clks_ck" }, | ||
3226 | { .role = "prcm_clk", .clk = "mcbsp4_sync_mux_ck" }, | ||
3227 | }; | ||
3228 | |||
3203 | static struct omap_hwmod omap44xx_mcbsp4_hwmod = { | 3229 | static struct omap_hwmod omap44xx_mcbsp4_hwmod = { |
3204 | .name = "mcbsp4", | 3230 | .name = "mcbsp4", |
3205 | .class = &omap44xx_mcbsp_hwmod_class, | 3231 | .class = &omap44xx_mcbsp_hwmod_class, |
@@ -3216,6 +3242,8 @@ static struct omap_hwmod omap44xx_mcbsp4_hwmod = { | |||
3216 | }, | 3242 | }, |
3217 | .slaves = omap44xx_mcbsp4_slaves, | 3243 | .slaves = omap44xx_mcbsp4_slaves, |
3218 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp4_slaves), | 3244 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp4_slaves), |
3245 | .opt_clks = mcbsp4_opt_clks, | ||
3246 | .opt_clks_cnt = ARRAY_SIZE(mcbsp4_opt_clks), | ||
3219 | }; | 3247 | }; |
3220 | 3248 | ||
3221 | /* | 3249 | /* |
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 8a18d1bd61c8..96ad3dbeac34 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c | |||
@@ -972,7 +972,13 @@ int pwrdm_wait_transition(struct powerdomain *pwrdm) | |||
972 | 972 | ||
973 | int pwrdm_state_switch(struct powerdomain *pwrdm) | 973 | int pwrdm_state_switch(struct powerdomain *pwrdm) |
974 | { | 974 | { |
975 | return _pwrdm_state_switch(pwrdm, PWRDM_STATE_NOW); | 975 | int ret; |
976 | |||
977 | ret = pwrdm_wait_transition(pwrdm); | ||
978 | if (!ret) | ||
979 | ret = _pwrdm_state_switch(pwrdm, PWRDM_STATE_NOW); | ||
980 | |||
981 | return ret; | ||
976 | } | 982 | } |
977 | 983 | ||
978 | int pwrdm_clkdm_state_switch(struct clockdomain *clkdm) | 984 | int pwrdm_clkdm_state_switch(struct clockdomain *clkdm) |
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index 56b6f8b7053e..8506cbb7fea4 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c | |||
@@ -441,6 +441,8 @@ static int __init clk_disable_unused(void) | |||
441 | return 0; | 441 | return 0; |
442 | 442 | ||
443 | pr_info("clock: disabling unused clocks to save power\n"); | 443 | pr_info("clock: disabling unused clocks to save power\n"); |
444 | |||
445 | spin_lock_irqsave(&clockfw_lock, flags); | ||
444 | list_for_each_entry(ck, &clocks, node) { | 446 | list_for_each_entry(ck, &clocks, node) { |
445 | if (ck->ops == &clkops_null) | 447 | if (ck->ops == &clkops_null) |
446 | continue; | 448 | continue; |
@@ -448,10 +450,9 @@ static int __init clk_disable_unused(void) | |||
448 | if (ck->usecount > 0 || !ck->enable_reg) | 450 | if (ck->usecount > 0 || !ck->enable_reg) |
449 | continue; | 451 | continue; |
450 | 452 | ||
451 | spin_lock_irqsave(&clockfw_lock, flags); | ||
452 | arch_clock->clk_disable_unused(ck); | 453 | arch_clock->clk_disable_unused(ck); |
453 | spin_unlock_irqrestore(&clockfw_lock, flags); | ||
454 | } | 454 | } |
455 | spin_unlock_irqrestore(&clockfw_lock, flags); | ||
455 | 456 | ||
456 | return 0; | 457 | return 0; |
457 | } | 458 | } |
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h index 9e8e63d52aab..8070145ccb98 100644 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h | |||
@@ -47,17 +47,17 @@ extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2; | |||
47 | * with the original PRCM protocol defined for OMAP2420 | 47 | * with the original PRCM protocol defined for OMAP2420 |
48 | */ | 48 | */ |
49 | #define SYSC_TYPE1_MIDLEMODE_SHIFT 12 | 49 | #define SYSC_TYPE1_MIDLEMODE_SHIFT 12 |
50 | #define SYSC_TYPE1_MIDLEMODE_MASK (0x3 << SYSC_MIDLEMODE_SHIFT) | 50 | #define SYSC_TYPE1_MIDLEMODE_MASK (0x3 << SYSC_TYPE1_MIDLEMODE_SHIFT) |
51 | #define SYSC_TYPE1_CLOCKACTIVITY_SHIFT 8 | 51 | #define SYSC_TYPE1_CLOCKACTIVITY_SHIFT 8 |
52 | #define SYSC_TYPE1_CLOCKACTIVITY_MASK (0x3 << SYSC_CLOCKACTIVITY_SHIFT) | 52 | #define SYSC_TYPE1_CLOCKACTIVITY_MASK (0x3 << SYSC_TYPE1_CLOCKACTIVITY_SHIFT) |
53 | #define SYSC_TYPE1_SIDLEMODE_SHIFT 3 | 53 | #define SYSC_TYPE1_SIDLEMODE_SHIFT 3 |
54 | #define SYSC_TYPE1_SIDLEMODE_MASK (0x3 << SYSC_SIDLEMODE_SHIFT) | 54 | #define SYSC_TYPE1_SIDLEMODE_MASK (0x3 << SYSC_TYPE1_SIDLEMODE_SHIFT) |
55 | #define SYSC_TYPE1_ENAWAKEUP_SHIFT 2 | 55 | #define SYSC_TYPE1_ENAWAKEUP_SHIFT 2 |
56 | #define SYSC_TYPE1_ENAWAKEUP_MASK (1 << SYSC_ENAWAKEUP_SHIFT) | 56 | #define SYSC_TYPE1_ENAWAKEUP_MASK (1 << SYSC_TYPE1_ENAWAKEUP_SHIFT) |
57 | #define SYSC_TYPE1_SOFTRESET_SHIFT 1 | 57 | #define SYSC_TYPE1_SOFTRESET_SHIFT 1 |
58 | #define SYSC_TYPE1_SOFTRESET_MASK (1 << SYSC_SOFTRESET_SHIFT) | 58 | #define SYSC_TYPE1_SOFTRESET_MASK (1 << SYSC_TYPE1_SOFTRESET_SHIFT) |
59 | #define SYSC_TYPE1_AUTOIDLE_SHIFT 0 | 59 | #define SYSC_TYPE1_AUTOIDLE_SHIFT 0 |
60 | #define SYSC_TYPE1_AUTOIDLE_MASK (1 << SYSC_AUTOIDLE_SHIFT) | 60 | #define SYSC_TYPE1_AUTOIDLE_MASK (1 << SYSC_TYPE1_AUTOIDLE_SHIFT) |
61 | 61 | ||
62 | /* | 62 | /* |
63 | * OCP SYSCONFIG bit shifts/masks TYPE2. These are for IPs compliant | 63 | * OCP SYSCONFIG bit shifts/masks TYPE2. These are for IPs compliant |