ARM: OMAP3: hwmod data: some mainline backports
[pandora-kernel.git] / arch / arm / mach-omap2 / omap_hwmod_3xxx_data.c
index 9449bd5..34b2dfa 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "omap_hwmod_common_data.h"
 
+#include "smartreflex.h"
 #include "prm-regbits-34xx.h"
 #include "cm-regbits-34xx.h"
 #include "wd_timer.h"
@@ -65,7 +66,9 @@ static struct omap_hwmod omap3xxx_gpio4_hwmod;
 static struct omap_hwmod omap3xxx_gpio5_hwmod;
 static struct omap_hwmod omap3xxx_gpio6_hwmod;
 static struct omap_hwmod omap34xx_sr1_hwmod;
+static struct omap_hwmod omap36xx_sr1_hwmod;
 static struct omap_hwmod omap34xx_sr2_hwmod;
+static struct omap_hwmod omap36xx_sr2_hwmod;
 static struct omap_hwmod omap34xx_mcspi1;
 static struct omap_hwmod omap34xx_mcspi2;
 static struct omap_hwmod omap34xx_mcspi3;
@@ -163,7 +166,7 @@ static struct omap_hwmod omap3xxx_l4_wkup_hwmod;
 static struct omap_hwmod omap3xxx_uart1_hwmod;
 static struct omap_hwmod omap3xxx_uart2_hwmod;
 static struct omap_hwmod omap3xxx_uart3_hwmod;
-static struct omap_hwmod omap3xxx_uart4_hwmod;
+static struct omap_hwmod omap36xx_uart4_hwmod;
 static struct omap_hwmod omap3xxx_usbhsotg_hwmod;
 
 /* l3_core -> usbhsotg interface */
@@ -282,7 +285,7 @@ static struct omap_hwmod_ocp_if omap3_l4_per__uart3 = {
 };
 
 /* L4 PER -> UART4 interface */
-static struct omap_hwmod_addr_space omap3xxx_uart4_addr_space[] = {
+static struct omap_hwmod_addr_space omap36xx_uart4_addr_space[] = {
        {
                .pa_start       = OMAP3_UART4_BASE,
                .pa_end         = OMAP3_UART4_BASE + SZ_1K - 1,
@@ -291,11 +294,11 @@ static struct omap_hwmod_addr_space omap3xxx_uart4_addr_space[] = {
        { }
 };
 
-static struct omap_hwmod_ocp_if omap3_l4_per__uart4 = {
+static struct omap_hwmod_ocp_if omap36xx_l4_per__uart4 = {
        .master         = &omap3xxx_l4_per_hwmod,
-       .slave          = &omap3xxx_uart4_hwmod,
+       .slave          = &omap36xx_uart4_hwmod,
        .clk            = "uart4_ick",
-       .addr           = omap3xxx_uart4_addr_space,
+       .addr           = omap36xx_uart4_addr_space,
        .user           = OCP_USER_MPU | OCP_USER_SDMA,
 };
 
@@ -356,6 +359,16 @@ static struct omap_hwmod_ocp_if omap3_l4_core__i2c3 = {
        .user           = OCP_USER_MPU | OCP_USER_SDMA,
 };
 
+static struct omap_hwmod_irq_info omap3_smartreflex_mpu_irqs[] = {
+       { .irq = 18},
+       { .irq = -1 }
+};
+
+static struct omap_hwmod_irq_info omap3_smartreflex_core_irqs[] = {
+       { .irq = 19},
+       { .irq = -1 }
+};
+
 /* L4 CORE -> SR1 interface */
 static struct omap_hwmod_addr_space omap3_sr1_addr_space[] = {
        {
@@ -366,7 +379,7 @@ static struct omap_hwmod_addr_space omap3_sr1_addr_space[] = {
        { }
 };
 
-static struct omap_hwmod_ocp_if omap3_l4_core__sr1 = {
+static struct omap_hwmod_ocp_if omap34xx_l4_core__sr1 = {
        .master         = &omap3xxx_l4_core_hwmod,
        .slave          = &omap34xx_sr1_hwmod,
        .clk            = "sr_l4_ick",
@@ -374,6 +387,14 @@ static struct omap_hwmod_ocp_if omap3_l4_core__sr1 = {
        .user           = OCP_USER_MPU,
 };
 
+static struct omap_hwmod_ocp_if omap36xx_l4_core__sr1 = {
+       .master         = &omap3xxx_l4_core_hwmod,
+       .slave          = &omap36xx_sr1_hwmod,
+       .clk            = "sr_l4_ick",
+       .addr           = omap3_sr1_addr_space,
+       .user           = OCP_USER_MPU,
+};
+
 /* L4 CORE -> SR1 interface */
 static struct omap_hwmod_addr_space omap3_sr2_addr_space[] = {
        {
@@ -384,7 +405,7 @@ static struct omap_hwmod_addr_space omap3_sr2_addr_space[] = {
        { }
 };
 
-static struct omap_hwmod_ocp_if omap3_l4_core__sr2 = {
+static struct omap_hwmod_ocp_if omap34xx_l4_core__sr2 = {
        .master         = &omap3xxx_l4_core_hwmod,
        .slave          = &omap34xx_sr2_hwmod,
        .clk            = "sr_l4_ick",
@@ -392,6 +413,14 @@ static struct omap_hwmod_ocp_if omap3_l4_core__sr2 = {
        .user           = OCP_USER_MPU,
 };
 
+static struct omap_hwmod_ocp_if omap36xx_l4_core__sr2 = {
+       .master         = &omap3xxx_l4_core_hwmod,
+       .slave          = &omap36xx_sr2_hwmod,
+       .clk            = "sr_l4_ick",
+       .addr           = omap3_sr2_addr_space,
+       .user           = OCP_USER_MPU,
+};
+
 /*
 * usbhsotg interface data
 */
@@ -1067,7 +1096,7 @@ static struct omap_hwmod omap3xxx_timer11_hwmod = {
        .class          = &omap3xxx_timer_hwmod_class,
 };
 
-/* timer12*/
+/* timer12 */
 static struct omap_hwmod omap3xxx_timer12_hwmod;
 static struct omap_hwmod_irq_info omap3xxx_timer12_mpu_irqs[] = {
        { .irq = 95, },
@@ -1287,14 +1316,15 @@ static struct omap_hwmod_dma_info uart4_sdma_reqs[] = {
 };
 
 static struct omap_hwmod_ocp_if *omap3xxx_uart4_slaves[] = {
-       &omap3_l4_per__uart4,
+       &omap36xx_l4_per__uart4,
 };
 
-static struct omap_hwmod omap3xxx_uart4_hwmod = {
+static struct omap_hwmod omap36xx_uart4_hwmod = {
        .name           = "uart4",
        .mpu_irqs       = uart4_mpu_irqs,
        .sdma_reqs      = uart4_sdma_reqs,
        .main_clk       = "uart4_fck",
+       .flags          = HWMOD_SWSUP_SIDLE,
        .prcm           = {
                .omap2 = {
                        .module_offs = OMAP3430_PER_MOD,
@@ -2610,15 +2640,18 @@ static struct omap_hwmod_class omap36xx_smartreflex_hwmod_class = {
 };
 
 /* SR1 */
-static struct omap_hwmod_ocp_if *omap3_sr1_slaves[] = {
-       &omap3_l4_core__sr1,
+static struct omap_smartreflex_dev_attr sr1_dev_attr = {
+       .sensor_voltdm_name   = "mpu_iva",
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_sr1_slaves[] = {
+       &omap34xx_l4_core__sr1,
 };
 
 static struct omap_hwmod omap34xx_sr1_hwmod = {
-       .name           = "sr1_hwmod",
+       .name           = "sr1",
        .class          = &omap34xx_smartreflex_hwmod_class,
        .main_clk       = "sr1_fck",
-       .vdd_name       = "mpu_iva",
        .prcm           = {
                .omap2 = {
                        .prcm_reg_id = 1,
@@ -2628,16 +2661,21 @@ static struct omap_hwmod omap34xx_sr1_hwmod = {
                        .idlest_idle_bit = OMAP3430_EN_SR1_SHIFT,
                },
        },
-       .slaves         = omap3_sr1_slaves,
-       .slaves_cnt     = ARRAY_SIZE(omap3_sr1_slaves),
+       .slaves         = omap34xx_sr1_slaves,
+       .slaves_cnt     = ARRAY_SIZE(omap34xx_sr1_slaves),
+       .dev_attr       = &sr1_dev_attr,
+       .mpu_irqs       = omap3_smartreflex_mpu_irqs,
        .flags          = HWMOD_SET_DEFAULT_CLOCKACT,
 };
 
+static struct omap_hwmod_ocp_if *omap36xx_sr1_slaves[] = {
+       &omap36xx_l4_core__sr1,
+};
+
 static struct omap_hwmod omap36xx_sr1_hwmod = {
-       .name           = "sr1_hwmod",
+       .name           = "sr1",
        .class          = &omap36xx_smartreflex_hwmod_class,
        .main_clk       = "sr1_fck",
-       .vdd_name       = "mpu_iva",
        .prcm           = {
                .omap2 = {
                        .prcm_reg_id = 1,
@@ -2647,20 +2685,25 @@ static struct omap_hwmod omap36xx_sr1_hwmod = {
                        .idlest_idle_bit = OMAP3430_EN_SR1_SHIFT,
                },
        },
-       .slaves         = omap3_sr1_slaves,
-       .slaves_cnt     = ARRAY_SIZE(omap3_sr1_slaves),
+       .slaves         = omap36xx_sr1_slaves,
+       .slaves_cnt     = ARRAY_SIZE(omap36xx_sr1_slaves),
+       .dev_attr       = &sr1_dev_attr,
+       .mpu_irqs       = omap3_smartreflex_mpu_irqs,
 };
 
 /* SR2 */
-static struct omap_hwmod_ocp_if *omap3_sr2_slaves[] = {
-       &omap3_l4_core__sr2,
+static struct omap_smartreflex_dev_attr sr2_dev_attr = {
+       .sensor_voltdm_name     = "core",
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_sr2_slaves[] = {
+       &omap34xx_l4_core__sr2,
 };
 
 static struct omap_hwmod omap34xx_sr2_hwmod = {
-       .name           = "sr2_hwmod",
+       .name           = "sr2",
        .class          = &omap34xx_smartreflex_hwmod_class,
        .main_clk       = "sr2_fck",
-       .vdd_name       = "core",
        .prcm           = {
                .omap2 = {
                        .prcm_reg_id = 1,
@@ -2670,16 +2713,21 @@ static struct omap_hwmod omap34xx_sr2_hwmod = {
                        .idlest_idle_bit = OMAP3430_EN_SR2_SHIFT,
                },
        },
-       .slaves         = omap3_sr2_slaves,
-       .slaves_cnt     = ARRAY_SIZE(omap3_sr2_slaves),
+       .slaves         = omap34xx_sr2_slaves,
+       .slaves_cnt     = ARRAY_SIZE(omap34xx_sr2_slaves),
+       .dev_attr       = &sr2_dev_attr,
+       .mpu_irqs       = omap3_smartreflex_core_irqs,
        .flags          = HWMOD_SET_DEFAULT_CLOCKACT,
 };
 
+static struct omap_hwmod_ocp_if *omap36xx_sr2_slaves[] = {
+       &omap36xx_l4_core__sr2,
+};
+
 static struct omap_hwmod omap36xx_sr2_hwmod = {
-       .name           = "sr2_hwmod",
+       .name           = "sr2",
        .class          = &omap36xx_smartreflex_hwmod_class,
        .main_clk       = "sr2_fck",
-       .vdd_name       = "core",
        .prcm           = {
                .omap2 = {
                        .prcm_reg_id = 1,
@@ -2689,8 +2737,10 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {
                        .idlest_idle_bit = OMAP3430_EN_SR2_SHIFT,
                },
        },
-       .slaves         = omap3_sr2_slaves,
-       .slaves_cnt     = ARRAY_SIZE(omap3_sr2_slaves),
+       .slaves         = omap36xx_sr2_slaves,
+       .slaves_cnt     = ARRAY_SIZE(omap36xx_sr2_slaves),
+       .dev_attr       = &sr2_dev_attr,
+       .mpu_irqs       = omap3_smartreflex_core_irqs,
 };
 
 /*
@@ -2968,6 +3018,44 @@ static struct omap_hwmod omap34xx_mcspi4 = {
        .dev_attr       = &omap_mcspi4_dev_attr,
 };
 
+/* temp. sensor */
+struct omap_hwmod_class omap34xx_bandgap_ts_class = {
+       .name   = "bandgap_ts",
+};
+
+static struct omap_hwmod_addr_space omap3xxx_bandgap_ts_addrs[] = {
+       {
+               .name           = "mpu",
+               .pa_start       = 0x48002524,
+               .pa_end         = 0x48002524 + 4,
+               .flags          = ADDR_TYPE_RT
+       },
+       { }
+};
+
+static struct omap_hwmod omap34xx_bandgap_ts;
+
+/* l4_core -> bandgap */
+static struct omap_hwmod_ocp_if omap3xxx_l4_core__bandgap_ts = {
+       .master         = &omap3xxx_l4_core_hwmod,
+       .slave          = &omap34xx_bandgap_ts,
+       .addr           = omap3xxx_bandgap_ts_addrs,
+       .user           = OCP_USER_MPU,
+};
+
+static struct omap_hwmod_ocp_if *omap3xxx_bandgap_ts_slaves[] = {
+       &omap3xxx_l4_core__bandgap_ts,
+};
+
+static struct omap_hwmod omap34xx_bandgap_ts = {
+       .name           = "bandgap_ts",
+       .main_clk       = "ts_fck",
+       .slaves         = omap3xxx_bandgap_ts_slaves,
+       .slaves_cnt     = ARRAY_SIZE(omap3xxx_bandgap_ts_slaves),
+       .class          = &omap34xx_bandgap_ts_class,
+       .flags          = HWMOD_NO_IDLEST,
+};
+
 /*
  * usbhsotg
  */
@@ -3019,9 +3107,14 @@ static struct omap_hwmod omap3xxx_usbhsotg_hwmod = {
         * Erratum ID: i479  idle_req / idle_ack mechanism potentially
         * broken when autoidle is enabled
         * workaround is to disable the autoidle bit at module level.
+        *
+        * Enabling the device in any other MIDLEMODE setting but force-idle
+        * causes core_pwrdm not enter idle states at least on OMAP3630.
+        * Note that musb has OTG_FORCESTDBY register that controls MSTANDBY
+        * signal when MIDLEMODE is set to force-idle.
         */
        .flags          = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE
-                               | HWMOD_SWSUP_MSTANDBY,
+                               | HWMOD_FORCE_MSTANDBY,
 };
 
 /* usb_otg_hs */
@@ -3311,6 +3404,8 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
        &omap34xx_mcspi3,
        &omap34xx_mcspi4,
 
+       &omap34xx_bandgap_ts,
+
        NULL,
 };
 
@@ -3359,7 +3454,7 @@ static __initdata struct omap_hwmod *omap34xx_hwmods[] = {
 /* 36xx-only hwmods (all ES revisions) */
 static __initdata struct omap_hwmod *omap36xx_hwmods[] = {
        &omap3xxx_iva_hwmod,
-       &omap3xxx_uart4_hwmod,
+       &omap36xx_uart4_hwmod,
        &omap3xxx_dss_core_hwmod,
        &omap36xx_sr1_hwmod,
        &omap36xx_sr2_hwmod,