aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2013-04-09 10:40:45 -0400
committerArnd Bergmann <arnd@arndb.de>2013-04-09 10:40:45 -0400
commitb8250dc4192c6adab0b9a713a11bf19afc462c96 (patch)
tree830299d0edad314367e075012ef9ca841a3026d1 /arch/arm/mach-omap2
parent56734ee2835caaf62168c28281403b61b5826841 (diff)
parent7a9819950f47dbf319895ee78220f2761f3687a3 (diff)
Merge tag 'omap-for-v3.10/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/soc
From Tony Lindgren <tony@atomide.com>: Changes needed for enabling SOC_BUS for the SoC revision information. Also enable few HW errata workarounds for omap4. * tag 'omap-for-v3.10/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (236 commits) ARM: OMAP4: Enable fix for Cortex-A9 erratas ARM: OMAP2+: Export SoC information to userspace ARM: OMAP2+: SoC name and revision unification ARM: OMAP2+: Move common part of late init into common function Includes an update to Linux 3.9-rc6 Conflicts: arch/arm/mach-omap2/cclock44xx_data.c Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/Kconfig3
-rw-r--r--arch/arm/mach-omap2/cclock44xx_data.c20
-rw-r--r--arch/arm/mach-omap2/common.h11
-rw-r--r--arch/arm/mach-omap2/id.c95
-rw-r--r--arch/arm/mach-omap2/io.c52
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c7
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.h9
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c7
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c6
-rw-r--r--arch/arm/mach-omap2/timer.c4
10 files changed, 177 insertions, 37 deletions
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 8111cd9ff3e5..b56530cb5fa8 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -15,6 +15,7 @@ config ARCH_OMAP2PLUS
15 select OMAP_DM_TIMER 15 select OMAP_DM_TIMER
16 select PINCTRL 16 select PINCTRL
17 select PROC_DEVICETREE if PROC_FS 17 select PROC_DEVICETREE if PROC_FS
18 select SOC_BUS
18 select SPARSE_IRQ 19 select SPARSE_IRQ
19 select USE_OF 20 select USE_OF
20 help 21 help
@@ -96,6 +97,8 @@ config ARCH_OMAP4
96 select PM_RUNTIME if CPU_IDLE 97 select PM_RUNTIME if CPU_IDLE
97 select USB_ARCH_HAS_EHCI if USB_SUPPORT 98 select USB_ARCH_HAS_EHCI if USB_SUPPORT
98 select COMMON_CLK 99 select COMMON_CLK
100 select ARM_ERRATA_754322
101 select ARM_ERRATA_775420
99 102
100config SOC_OMAP5 103config SOC_OMAP5
101 bool "TI OMAP5" 104 bool "TI OMAP5"
diff --git a/arch/arm/mach-omap2/cclock44xx_data.c b/arch/arm/mach-omap2/cclock44xx_data.c
index b1e77ef968fa..88e37a474334 100644
--- a/arch/arm/mach-omap2/cclock44xx_data.c
+++ b/arch/arm/mach-omap2/cclock44xx_data.c
@@ -52,6 +52,13 @@
52 */ 52 */
53#define OMAP4_DPLL_ABE_DEFFREQ 98304000 53#define OMAP4_DPLL_ABE_DEFFREQ 98304000
54 54
55/*
56 * OMAP4 USB DPLL default frequency. In OMAP4430 TRM version V, section
57 * "3.6.3.9.5 DPLL_USB Preferred Settings" shows that the preferred
58 * locked frequency for the USB DPLL is 960MHz.
59 */
60#define OMAP4_DPLL_USB_DEFFREQ 960000000
61
55/* Root clocks */ 62/* Root clocks */
56 63
57DEFINE_CLK_FIXED_RATE(extalt_clkin_ck, CLK_IS_ROOT, 59000000, 0x0); 64DEFINE_CLK_FIXED_RATE(extalt_clkin_ck, CLK_IS_ROOT, 59000000, 0x0);
@@ -1011,6 +1018,10 @@ DEFINE_CLK_OMAP_MUX(hsmmc2_fclk, "l3_init_clkdm", hsmmc1_fclk_sel,
1011 OMAP4430_CM_L3INIT_MMC2_CLKCTRL, OMAP4430_CLKSEL_MASK, 1018 OMAP4430_CM_L3INIT_MMC2_CLKCTRL, OMAP4430_CLKSEL_MASK,
1012 hsmmc1_fclk_parents, func_dmic_abe_gfclk_ops); 1019 hsmmc1_fclk_parents, func_dmic_abe_gfclk_ops);
1013 1020
1021DEFINE_CLK_GATE(ocp2scp_usb_phy_phy_48m, "func_48m_fclk", &func_48m_fclk, 0x0,
1022 OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL,
1023 OMAP4430_OPTFCLKEN_PHY_48M_SHIFT, 0x0, NULL);
1024
1014DEFINE_CLK_GATE(sha2md5_fck, "l3_div_ck", &l3_div_ck, 0x0, 1025DEFINE_CLK_GATE(sha2md5_fck, "l3_div_ck", &l3_div_ck, 0x0,
1015 OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL, 1026 OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL,
1016 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL); 1027 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
@@ -1549,6 +1560,7 @@ static struct omap_clk omap44xx_clks[] = {
1549 CLK(NULL, "per_mcbsp4_gfclk", &per_mcbsp4_gfclk), 1560 CLK(NULL, "per_mcbsp4_gfclk", &per_mcbsp4_gfclk),
1550 CLK(NULL, "hsmmc1_fclk", &hsmmc1_fclk), 1561 CLK(NULL, "hsmmc1_fclk", &hsmmc1_fclk),
1551 CLK(NULL, "hsmmc2_fclk", &hsmmc2_fclk), 1562 CLK(NULL, "hsmmc2_fclk", &hsmmc2_fclk),
1563 CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m),
1552 CLK(NULL, "sha2md5_fck", &sha2md5_fck), 1564 CLK(NULL, "sha2md5_fck", &sha2md5_fck),
1553 CLK(NULL, "slimbus1_fclk_1", &slimbus1_fclk_1), 1565 CLK(NULL, "slimbus1_fclk_1", &slimbus1_fclk_1),
1554 CLK(NULL, "slimbus1_fclk_0", &slimbus1_fclk_0), 1566 CLK(NULL, "slimbus1_fclk_0", &slimbus1_fclk_0),
@@ -1706,5 +1718,13 @@ int __init omap4xxx_clk_init(void)
1706 if (rc) 1718 if (rc)
1707 pr_err("%s: failed to configure ABE DPLL!\n", __func__); 1719 pr_err("%s: failed to configure ABE DPLL!\n", __func__);
1708 1720
1721 /*
1722 * Lock USB DPLL on OMAP4 devices so that the L3INIT power
1723 * domain can transition to retention state when not in use.
1724 */
1725 rc = clk_set_rate(&dpll_usb_ck, OMAP4_DPLL_USB_DEFFREQ);
1726 if (rc)
1727 pr_err("%s: failed to configure USB DPLL!\n", __func__);
1728
1709 return 0; 1729 return 0;
1710} 1730}
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 40f4a03d728f..1ddd0cb5fab9 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -110,6 +110,14 @@ void am35xx_init_late(void);
110void ti81xx_init_late(void); 110void ti81xx_init_late(void);
111int omap2_common_pm_late_init(void); 111int omap2_common_pm_late_init(void);
112 112
113#ifdef CONFIG_SOC_BUS
114void omap_soc_device_init(void);
115#else
116static inline void omap_soc_device_init(void)
117{
118}
119#endif
120
113#if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430) 121#if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430)
114void omap2xxx_restart(char mode, const char *cmd); 122void omap2xxx_restart(char mode, const char *cmd);
115#else 123#else
@@ -293,5 +301,8 @@ extern void omap_reserve(void);
293struct omap_hwmod; 301struct omap_hwmod;
294extern int omap_dss_reset(struct omap_hwmod *); 302extern int omap_dss_reset(struct omap_hwmod *);
295 303
304/* SoC specific clock initializer */
305extern int (*omap_clk_init)(void);
306
296#endif /* __ASSEMBLER__ */ 307#endif /* __ASSEMBLER__ */
297#endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ 308#endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 8a68f1ec66b9..098e94e31336 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -18,6 +18,11 @@
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/slab.h>
22
23#ifdef CONFIG_SOC_BUS
24#include <linux/sys_soc.h>
25#endif
21 26
22#include <asm/cputype.h> 27#include <asm/cputype.h>
23 28
@@ -31,8 +36,11 @@
31#define OMAP4_SILICON_TYPE_STANDARD 0x01 36#define OMAP4_SILICON_TYPE_STANDARD 0x01
32#define OMAP4_SILICON_TYPE_PERFORMANCE 0x02 37#define OMAP4_SILICON_TYPE_PERFORMANCE 0x02
33 38
39#define OMAP_SOC_MAX_NAME_LENGTH 16
40
34static unsigned int omap_revision; 41static unsigned int omap_revision;
35static const char *cpu_rev; 42static char soc_name[OMAP_SOC_MAX_NAME_LENGTH];
43static char soc_rev[OMAP_SOC_MAX_NAME_LENGTH];
36u32 omap_features; 44u32 omap_features;
37 45
38unsigned int omap_rev(void) 46unsigned int omap_rev(void)
@@ -169,9 +177,12 @@ void __init omap2xxx_check_revision(void)
169 j = i; 177 j = i;
170 } 178 }
171 179
172 pr_info("OMAP%04x", omap_rev() >> 16); 180 sprintf(soc_name, "OMAP%04x", omap_rev() >> 16);
181 sprintf(soc_rev, "ES%x", (omap_rev() >> 12) & 0xf);
182
183 pr_info("%s", soc_name);
173 if ((omap_rev() >> 8) & 0x0f) 184 if ((omap_rev() >> 8) & 0x0f)
174 pr_info("ES%x", (omap_rev() >> 12) & 0xf); 185 pr_info("%s", soc_rev);
175 pr_info("\n"); 186 pr_info("\n");
176} 187}
177 188
@@ -211,8 +222,10 @@ static void __init omap3_cpuinfo(void)
211 cpu_name = "OMAP3503"; 222 cpu_name = "OMAP3503";
212 } 223 }
213 224
225 sprintf(soc_name, "%s", cpu_name);
226
214 /* Print verbose information */ 227 /* Print verbose information */
215 pr_info("%s ES%s (", cpu_name, cpu_rev); 228 pr_info("%s %s (", soc_name, soc_rev);
216 229
217 OMAP3_SHOW_FEATURE(l2cache); 230 OMAP3_SHOW_FEATURE(l2cache);
218 OMAP3_SHOW_FEATURE(iva); 231 OMAP3_SHOW_FEATURE(iva);
@@ -291,6 +304,7 @@ void __init ti81xx_check_features(void)
291 304
292void __init omap3xxx_check_revision(void) 305void __init omap3xxx_check_revision(void)
293{ 306{
307 const char *cpu_rev;
294 u32 cpuid, idcode; 308 u32 cpuid, idcode;
295 u16 hawkeye; 309 u16 hawkeye;
296 u8 rev; 310 u8 rev;
@@ -438,6 +452,7 @@ void __init omap3xxx_check_revision(void)
438 cpu_rev = "1.2"; 452 cpu_rev = "1.2";
439 pr_warn("Warning: unknown chip type; assuming OMAP3630ES1.2\n"); 453 pr_warn("Warning: unknown chip type; assuming OMAP3630ES1.2\n");
440 } 454 }
455 sprintf(soc_rev, "ES%s", cpu_rev);
441} 456}
442 457
443void __init omap4xxx_check_revision(void) 458void __init omap4xxx_check_revision(void)
@@ -512,8 +527,10 @@ void __init omap4xxx_check_revision(void)
512 omap_revision = OMAP4430_REV_ES2_3; 527 omap_revision = OMAP4430_REV_ES2_3;
513 } 528 }
514 529
515 pr_info("OMAP%04x ES%d.%d\n", omap_rev() >> 16, 530 sprintf(soc_name, "OMAP%04x", omap_rev() >> 16);
516 ((omap_rev() >> 12) & 0xf), ((omap_rev() >> 8) & 0xf)); 531 sprintf(soc_rev, "ES%d.%d", (omap_rev() >> 12) & 0xf,
532 (omap_rev() >> 8) & 0xf);
533 pr_info("%s %s\n", soc_name, soc_rev);
517} 534}
518 535
519void __init omap5xxx_check_revision(void) 536void __init omap5xxx_check_revision(void)
@@ -547,8 +564,10 @@ void __init omap5xxx_check_revision(void)
547 omap_revision = OMAP5430_REV_ES1_0; 564 omap_revision = OMAP5430_REV_ES1_0;
548 } 565 }
549 566
550 pr_info("OMAP%04x ES%d.0\n", 567 sprintf(soc_name, "OMAP%04x", omap_rev() >> 16);
551 omap_rev() >> 16, ((omap_rev() >> 12) & 0xf)); 568 sprintf(soc_rev, "ES%d.0", (omap_rev() >> 12) & 0xf);
569
570 pr_info("%s %s\n", soc_name, soc_rev);
552} 571}
553 572
554/* 573/*
@@ -569,3 +588,63 @@ void __init omap2_set_globals_tap(u32 class, void __iomem *tap)
569 else 588 else
570 tap_prod_id = 0x0208; 589 tap_prod_id = 0x0208;
571} 590}
591
592#ifdef CONFIG_SOC_BUS
593
594static const char const *omap_types[] = {
595 [OMAP2_DEVICE_TYPE_TEST] = "TST",
596 [OMAP2_DEVICE_TYPE_EMU] = "EMU",
597 [OMAP2_DEVICE_TYPE_SEC] = "HS",
598 [OMAP2_DEVICE_TYPE_GP] = "GP",
599 [OMAP2_DEVICE_TYPE_BAD] = "BAD",
600};
601
602static const char * __init omap_get_family(void)
603{
604 if (cpu_is_omap24xx())
605 return kasprintf(GFP_KERNEL, "OMAP2");
606 else if (cpu_is_omap34xx())
607 return kasprintf(GFP_KERNEL, "OMAP3");
608 else if (cpu_is_omap44xx())
609 return kasprintf(GFP_KERNEL, "OMAP4");
610 else if (soc_is_omap54xx())
611 return kasprintf(GFP_KERNEL, "OMAP5");
612 else
613 return kasprintf(GFP_KERNEL, "Unknown");
614}
615
616static ssize_t omap_get_type(struct device *dev,
617 struct device_attribute *attr,
618 char *buf)
619{
620 return sprintf(buf, "%s\n", omap_types[omap_type()]);
621}
622
623static struct device_attribute omap_soc_attr =
624 __ATTR(type, S_IRUGO, omap_get_type, NULL);
625
626void __init omap_soc_device_init(void)
627{
628 struct device *parent;
629 struct soc_device *soc_dev;
630 struct soc_device_attribute *soc_dev_attr;
631
632 soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
633 if (!soc_dev_attr)
634 return;
635
636 soc_dev_attr->machine = soc_name;
637 soc_dev_attr->family = omap_get_family();
638 soc_dev_attr->revision = soc_rev;
639
640 soc_dev = soc_device_register(soc_dev_attr);
641 if (IS_ERR_OR_NULL(soc_dev)) {
642 kfree(soc_dev_attr);
643 return;
644 }
645
646 parent = soc_device_to_device(soc_dev);
647 if (!IS_ERR_OR_NULL(parent))
648 device_create_file(parent, &omap_soc_attr);
649}
650#endif /* CONFIG_SOC_BUS */
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 2c3fdd65387b..3241f23afe09 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -55,6 +55,12 @@
55#include "prm44xx.h" 55#include "prm44xx.h"
56 56
57/* 57/*
58 * omap_clk_init: points to a function that does the SoC-specific
59 * clock initializations
60 */
61int (*omap_clk_init)(void);
62
63/*
58 * The machine specific code may provide the extra mapping besides the 64 * The machine specific code may provide the extra mapping besides the
59 * default mapping provided here. 65 * default mapping provided here.
60 */ 66 */
@@ -379,6 +385,13 @@ static void __init omap_hwmod_init_postsetup(void)
379 omap_pm_if_early_init(); 385 omap_pm_if_early_init();
380} 386}
381 387
388static void __init omap_common_late_init(void)
389{
390 omap_mux_late_init();
391 omap2_common_pm_late_init();
392 omap_soc_device_init();
393}
394
382#ifdef CONFIG_SOC_OMAP2420 395#ifdef CONFIG_SOC_OMAP2420
383void __init omap2420_init_early(void) 396void __init omap2420_init_early(void)
384{ 397{
@@ -397,13 +410,12 @@ void __init omap2420_init_early(void)
397 omap242x_clockdomains_init(); 410 omap242x_clockdomains_init();
398 omap2420_hwmod_init(); 411 omap2420_hwmod_init();
399 omap_hwmod_init_postsetup(); 412 omap_hwmod_init_postsetup();
400 omap2420_clk_init(); 413 omap_clk_init = omap2420_clk_init;
401} 414}
402 415
403void __init omap2420_init_late(void) 416void __init omap2420_init_late(void)
404{ 417{
405 omap_mux_late_init(); 418 omap_common_late_init();
406 omap2_common_pm_late_init();
407 omap2_pm_init(); 419 omap2_pm_init();
408 omap2_clk_enable_autoidle_all(); 420 omap2_clk_enable_autoidle_all();
409} 421}
@@ -427,13 +439,12 @@ void __init omap2430_init_early(void)
427 omap243x_clockdomains_init(); 439 omap243x_clockdomains_init();
428 omap2430_hwmod_init(); 440 omap2430_hwmod_init();
429 omap_hwmod_init_postsetup(); 441 omap_hwmod_init_postsetup();
430 omap2430_clk_init(); 442 omap_clk_init = omap2430_clk_init;
431} 443}
432 444
433void __init omap2430_init_late(void) 445void __init omap2430_init_late(void)
434{ 446{
435 omap_mux_late_init(); 447 omap_common_late_init();
436 omap2_common_pm_late_init();
437 omap2_pm_init(); 448 omap2_pm_init();
438 omap2_clk_enable_autoidle_all(); 449 omap2_clk_enable_autoidle_all();
439} 450}
@@ -462,7 +473,7 @@ void __init omap3_init_early(void)
462 omap3xxx_clockdomains_init(); 473 omap3xxx_clockdomains_init();
463 omap3xxx_hwmod_init(); 474 omap3xxx_hwmod_init();
464 omap_hwmod_init_postsetup(); 475 omap_hwmod_init_postsetup();
465 omap3xxx_clk_init(); 476 omap_clk_init = omap3xxx_clk_init;
466} 477}
467 478
468void __init omap3430_init_early(void) 479void __init omap3430_init_early(void)
@@ -500,53 +511,47 @@ void __init ti81xx_init_early(void)
500 omap3xxx_clockdomains_init(); 511 omap3xxx_clockdomains_init();
501 omap3xxx_hwmod_init(); 512 omap3xxx_hwmod_init();
502 omap_hwmod_init_postsetup(); 513 omap_hwmod_init_postsetup();
503 omap3xxx_clk_init(); 514 omap_clk_init = omap3xxx_clk_init;
504} 515}
505 516
506void __init omap3_init_late(void) 517void __init omap3_init_late(void)
507{ 518{
508 omap_mux_late_init(); 519 omap_common_late_init();
509 omap2_common_pm_late_init();
510 omap3_pm_init(); 520 omap3_pm_init();
511 omap2_clk_enable_autoidle_all(); 521 omap2_clk_enable_autoidle_all();
512} 522}
513 523
514void __init omap3430_init_late(void) 524void __init omap3430_init_late(void)
515{ 525{
516 omap_mux_late_init(); 526 omap_common_late_init();
517 omap2_common_pm_late_init();
518 omap3_pm_init(); 527 omap3_pm_init();
519 omap2_clk_enable_autoidle_all(); 528 omap2_clk_enable_autoidle_all();
520} 529}
521 530
522void __init omap35xx_init_late(void) 531void __init omap35xx_init_late(void)
523{ 532{
524 omap_mux_late_init(); 533 omap_common_late_init();
525 omap2_common_pm_late_init();
526 omap3_pm_init(); 534 omap3_pm_init();
527 omap2_clk_enable_autoidle_all(); 535 omap2_clk_enable_autoidle_all();
528} 536}
529 537
530void __init omap3630_init_late(void) 538void __init omap3630_init_late(void)
531{ 539{
532 omap_mux_late_init(); 540 omap_common_late_init();
533 omap2_common_pm_late_init();
534 omap3_pm_init(); 541 omap3_pm_init();
535 omap2_clk_enable_autoidle_all(); 542 omap2_clk_enable_autoidle_all();
536} 543}
537 544
538void __init am35xx_init_late(void) 545void __init am35xx_init_late(void)
539{ 546{
540 omap_mux_late_init(); 547 omap_common_late_init();
541 omap2_common_pm_late_init();
542 omap3_pm_init(); 548 omap3_pm_init();
543 omap2_clk_enable_autoidle_all(); 549 omap2_clk_enable_autoidle_all();
544} 550}
545 551
546void __init ti81xx_init_late(void) 552void __init ti81xx_init_late(void)
547{ 553{
548 omap_mux_late_init(); 554 omap_common_late_init();
549 omap2_common_pm_late_init();
550 omap3_pm_init(); 555 omap3_pm_init();
551 omap2_clk_enable_autoidle_all(); 556 omap2_clk_enable_autoidle_all();
552} 557}
@@ -568,7 +573,7 @@ void __init am33xx_init_early(void)
568 am33xx_clockdomains_init(); 573 am33xx_clockdomains_init();
569 am33xx_hwmod_init(); 574 am33xx_hwmod_init();
570 omap_hwmod_init_postsetup(); 575 omap_hwmod_init_postsetup();
571 am33xx_clk_init(); 576 omap_clk_init = am33xx_clk_init;
572} 577}
573#endif 578#endif
574 579
@@ -593,13 +598,12 @@ void __init omap4430_init_early(void)
593 omap44xx_clockdomains_init(); 598 omap44xx_clockdomains_init();
594 omap44xx_hwmod_init(); 599 omap44xx_hwmod_init();
595 omap_hwmod_init_postsetup(); 600 omap_hwmod_init_postsetup();
596 omap4xxx_clk_init(); 601 omap_clk_init = omap4xxx_clk_init;
597} 602}
598 603
599void __init omap4430_init_late(void) 604void __init omap4430_init_late(void)
600{ 605{
601 omap_mux_late_init(); 606 omap_common_late_init();
602 omap2_common_pm_late_init();
603 omap4_pm_init(); 607 omap4_pm_init();
604 omap2_clk_enable_autoidle_all(); 608 omap2_clk_enable_autoidle_all();
605} 609}
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index c2c798c08c2b..a202a4785104 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1368,7 +1368,9 @@ static void _enable_sysc(struct omap_hwmod *oh)
1368 } 1368 }
1369 1369
1370 if (sf & SYSC_HAS_MIDLEMODE) { 1370 if (sf & SYSC_HAS_MIDLEMODE) {
1371 if (oh->flags & HWMOD_SWSUP_MSTANDBY) { 1371 if (oh->flags & HWMOD_FORCE_MSTANDBY) {
1372 idlemode = HWMOD_IDLEMODE_FORCE;
1373 } else if (oh->flags & HWMOD_SWSUP_MSTANDBY) {
1372 idlemode = HWMOD_IDLEMODE_NO; 1374 idlemode = HWMOD_IDLEMODE_NO;
1373 } else { 1375 } else {
1374 if (sf & SYSC_HAS_ENAWAKEUP) 1376 if (sf & SYSC_HAS_ENAWAKEUP)
@@ -1440,7 +1442,8 @@ static void _idle_sysc(struct omap_hwmod *oh)
1440 } 1442 }
1441 1443
1442 if (sf & SYSC_HAS_MIDLEMODE) { 1444 if (sf & SYSC_HAS_MIDLEMODE) {
1443 if (oh->flags & HWMOD_SWSUP_MSTANDBY) { 1445 if ((oh->flags & HWMOD_SWSUP_MSTANDBY) ||
1446 (oh->flags & HWMOD_FORCE_MSTANDBY)) {
1444 idlemode = HWMOD_IDLEMODE_FORCE; 1447 idlemode = HWMOD_IDLEMODE_FORCE;
1445 } else { 1448 } else {
1446 if (sf & SYSC_HAS_ENAWAKEUP) 1449 if (sf & SYSC_HAS_ENAWAKEUP)
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index d43d9b608eda..d5dc935f6060 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -427,8 +427,8 @@ struct omap_hwmod_omap4_prcm {
427 * 427 *
428 * HWMOD_SWSUP_SIDLE: omap_hwmod code should manually bring module in and out 428 * HWMOD_SWSUP_SIDLE: omap_hwmod code should manually bring module in and out
429 * of idle, rather than relying on module smart-idle 429 * of idle, rather than relying on module smart-idle
430 * HWMOD_SWSUP_MSTDBY: omap_hwmod code should manually bring module in and out 430 * HWMOD_SWSUP_MSTANDBY: omap_hwmod code should manually bring module in and
431 * of standby, rather than relying on module smart-standby 431 * out of standby, rather than relying on module smart-standby
432 * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for 432 * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for
433 * SDRAM controller, etc. XXX probably belongs outside the main hwmod file 433 * SDRAM controller, etc. XXX probably belongs outside the main hwmod file
434 * XXX Should be HWMOD_SETUP_NO_RESET 434 * XXX Should be HWMOD_SETUP_NO_RESET
@@ -459,6 +459,10 @@ struct omap_hwmod_omap4_prcm {
459 * correctly, or this is being abused to deal with some PM latency 459 * correctly, or this is being abused to deal with some PM latency
460 * issues -- but we're currently suffering from a shortage of 460 * issues -- but we're currently suffering from a shortage of
461 * folks who are able to track these issues down properly. 461 * folks who are able to track these issues down properly.
462 * HWMOD_FORCE_MSTANDBY: Always keep MIDLEMODE bits cleared so that device
463 * is kept in force-standby mode. Failing to do so causes PM problems
464 * with musb on OMAP3630 at least. Note that musb has a dedicated register
465 * to control MSTANDBY signal when MIDLEMODE is set to force-standby.
462 */ 466 */
463#define HWMOD_SWSUP_SIDLE (1 << 0) 467#define HWMOD_SWSUP_SIDLE (1 << 0)
464#define HWMOD_SWSUP_MSTANDBY (1 << 1) 468#define HWMOD_SWSUP_MSTANDBY (1 << 1)
@@ -471,6 +475,7 @@ struct omap_hwmod_omap4_prcm {
471#define HWMOD_16BIT_REG (1 << 8) 475#define HWMOD_16BIT_REG (1 << 8)
472#define HWMOD_EXT_OPT_MAIN_CLK (1 << 9) 476#define HWMOD_EXT_OPT_MAIN_CLK (1 << 9)
473#define HWMOD_BLOCK_WFI (1 << 10) 477#define HWMOD_BLOCK_WFI (1 << 10)
478#define HWMOD_FORCE_MSTANDBY (1 << 11)
474 479
475/* 480/*
476 * omap_hwmod._int_flags definitions 481 * omap_hwmod._int_flags definitions
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 85c917cb193d..4083606ea1da 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -1707,9 +1707,14 @@ static struct omap_hwmod omap3xxx_usbhsotg_hwmod = {
1707 * Erratum ID: i479 idle_req / idle_ack mechanism potentially 1707 * Erratum ID: i479 idle_req / idle_ack mechanism potentially
1708 * broken when autoidle is enabled 1708 * broken when autoidle is enabled
1709 * workaround is to disable the autoidle bit at module level. 1709 * workaround is to disable the autoidle bit at module level.
1710 *
1711 * Enabling the device in any other MIDLEMODE setting but force-idle
1712 * causes core_pwrdm not enter idle states at least on OMAP3630.
1713 * Note that musb has OTG_FORCESTDBY register that controls MSTANDBY
1714 * signal when MIDLEMODE is set to force-idle.
1710 */ 1715 */
1711 .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE 1716 .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE
1712 | HWMOD_SWSUP_MSTANDBY, 1717 | HWMOD_FORCE_MSTANDBY,
1713}; 1718};
1714 1719
1715/* usb_otg_hs */ 1720/* usb_otg_hs */
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 0e47d2e1687c..9e0576569e07 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -2714,6 +2714,10 @@ static struct omap_ocp2scp_dev ocp2scp_dev_attr[] = {
2714 { } 2714 { }
2715}; 2715};
2716 2716
2717static struct omap_hwmod_opt_clk ocp2scp_usb_phy_opt_clks[] = {
2718 { .role = "48mhz", .clk = "ocp2scp_usb_phy_phy_48m" },
2719};
2720
2717/* ocp2scp_usb_phy */ 2721/* ocp2scp_usb_phy */
2718static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = { 2722static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = {
2719 .name = "ocp2scp_usb_phy", 2723 .name = "ocp2scp_usb_phy",
@@ -2728,6 +2732,8 @@ static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = {
2728 }, 2732 },
2729 }, 2733 },
2730 .dev_attr = ocp2scp_dev_attr, 2734 .dev_attr = ocp2scp_dev_attr,
2735 .opt_clks = ocp2scp_usb_phy_opt_clks,
2736 .opt_clks_cnt = ARRAY_SIZE(ocp2scp_usb_phy_opt_clks),
2731}; 2737};
2732 2738
2733/* 2739/*
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 2bdd4cf17a8f..f62b509ed08d 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -547,6 +547,8 @@ static inline void __init realtime_counter_init(void)
547 clksrc_nr, clksrc_src) \ 547 clksrc_nr, clksrc_src) \
548void __init omap##name##_gptimer_timer_init(void) \ 548void __init omap##name##_gptimer_timer_init(void) \
549{ \ 549{ \
550 if (omap_clk_init) \
551 omap_clk_init(); \
550 omap_dmtimer_init(); \ 552 omap_dmtimer_init(); \
551 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \ 553 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \
552 omap2_gptimer_clocksource_init((clksrc_nr), clksrc_src); \ 554 omap2_gptimer_clocksource_init((clksrc_nr), clksrc_src); \
@@ -556,6 +558,8 @@ void __init omap##name##_gptimer_timer_init(void) \
556 clksrc_nr, clksrc_src) \ 558 clksrc_nr, clksrc_src) \
557void __init omap##name##_sync32k_timer_init(void) \ 559void __init omap##name##_sync32k_timer_init(void) \
558{ \ 560{ \
561 if (omap_clk_init) \
562 omap_clk_init(); \
559 omap_dmtimer_init(); \ 563 omap_dmtimer_init(); \
560 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \ 564 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \
561 /* Enable the use of clocksource="gp_timer" kernel parameter */ \ 565 /* Enable the use of clocksource="gp_timer" kernel parameter */ \