ARM: OMAP2/3: hwmod data: add gpmc
authorAfzal Mohammed <afzal@ti.com>
Sun, 23 Sep 2012 23:28:24 +0000 (17:28 -0600)
committerPaul Walmsley <paul@pwsan.com>
Sun, 23 Sep 2012 23:28:24 +0000 (17:28 -0600)
Add gpmc hwmod and associated interconnect data

Signed-off-by: Afzal Mohammed <afzal@ti.com>
[paul@pwsan.com: added comments to the use of HWMOD_INIT_NO_RESET]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
arch/arm/mach-omap2/omap_hwmod_2420_data.c
arch/arm/mach-omap2/omap_hwmod_2430_data.c
arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
arch/arm/mach-omap2/omap_hwmod_44xx_data.c
arch/arm/mach-omap2/omap_hwmod_common_data.h
arch/arm/mach-omap2/prcm-common.h

index 4e81637640e9b554f8b927070eedb0d74836976b..5fcd225d207e427b775cdabbdb0e5a4aff79daca 100644 (file)
@@ -535,6 +535,15 @@ static struct omap_hwmod_addr_space omap2420_counter_32k_addrs[] = {
        { }
 };
 
+static struct omap_hwmod_addr_space omap2420_gpmc_addrs[] = {
+       {
+               .pa_start       = 0x6800a000,
+               .pa_end         = 0x6800afff,
+               .flags          = ADDR_TYPE_RT
+       },
+       { }
+};
+
 static struct omap_hwmod_ocp_if omap2420_l4_wkup__counter_32k = {
        .master         = &omap2xxx_l4_wkup_hwmod,
        .slave          = &omap2xxx_counter_32k_hwmod,
@@ -543,6 +552,14 @@ static struct omap_hwmod_ocp_if omap2420_l4_wkup__counter_32k = {
        .user           = OCP_USER_MPU | OCP_USER_SDMA,
 };
 
+static struct omap_hwmod_ocp_if omap2420_l3__gpmc = {
+       .master         = &omap2xxx_l3_main_hwmod,
+       .slave          = &omap2xxx_gpmc_hwmod,
+       .clk            = "core_l3_ck",
+       .addr           = omap2420_gpmc_addrs,
+       .user           = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 static struct omap_hwmod_ocp_if *omap2420_hwmod_ocp_ifs[] __initdata = {
        &omap2xxx_l3_main__l4_core,
        &omap2xxx_mpu__l3_main,
@@ -586,6 +603,7 @@ static struct omap_hwmod_ocp_if *omap2420_hwmod_ocp_ifs[] __initdata = {
        &omap2420_l4_core__msdi1,
        &omap2420_l4_core__hdq1w,
        &omap2420_l4_wkup__counter_32k,
+       &omap2420_l3__gpmc,
        NULL,
 };
 
index ceb23c3fa89ddb5975b06f709986f2e05f612d30..a560563daf58a71e0842e3c0abf2dd303d0b0002 100644 (file)
@@ -887,6 +887,15 @@ static struct omap_hwmod_addr_space omap2430_counter_32k_addrs[] = {
        { }
 };
 
+static struct omap_hwmod_addr_space omap2430_gpmc_addrs[] = {
+       {
+               .pa_start       = 0x6e000000,
+               .pa_end         = 0x6e000fff,
+               .flags          = ADDR_TYPE_RT
+       },
+       { }
+};
+
 static struct omap_hwmod_ocp_if omap2430_l4_wkup__counter_32k = {
        .master         = &omap2xxx_l4_wkup_hwmod,
        .slave          = &omap2xxx_counter_32k_hwmod,
@@ -895,6 +904,14 @@ static struct omap_hwmod_ocp_if omap2430_l4_wkup__counter_32k = {
        .user           = OCP_USER_MPU | OCP_USER_SDMA,
 };
 
+static struct omap_hwmod_ocp_if omap2430_l3__gpmc = {
+       .master         = &omap2xxx_l3_main_hwmod,
+       .slave          = &omap2xxx_gpmc_hwmod,
+       .clk            = "core_l3_ck",
+       .addr           = omap2430_gpmc_addrs,
+       .user           = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 static struct omap_hwmod_ocp_if *omap2430_hwmod_ocp_ifs[] __initdata = {
        &omap2xxx_l3_main__l4_core,
        &omap2xxx_mpu__l3_main,
@@ -945,6 +962,7 @@ static struct omap_hwmod_ocp_if *omap2430_hwmod_ocp_ifs[] __initdata = {
        &omap2430_l4_core__mcbsp5,
        &omap2430_l4_core__hdq1w,
        &omap2430_l4_wkup__counter_32k,
+       &omap2430_l3__gpmc,
        NULL,
 };
 
index ceb30524234001673907f202a0f08da29039fcaa..3c009069f2f29abdb74d660d775c8e80babdb81b 100644 (file)
@@ -172,6 +172,26 @@ struct omap_hwmod_class omap2xxx_mcspi_class = {
        .rev    = OMAP2_MCSPI_REV,
 };
 
+/*
+ * 'gpmc' class
+ * general purpose memory controller
+ */
+
+static struct omap_hwmod_class_sysconfig omap2xxx_gpmc_sysc = {
+       .rev_offs       = 0x0000,
+       .sysc_offs      = 0x0010,
+       .syss_offs      = 0x0014,
+       .sysc_flags     = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE |
+                          SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
+       .idlemodes      = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+       .sysc_fields    = &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap2xxx_gpmc_hwmod_class = {
+       .name   = "gpmc",
+       .sysc   = &omap2xxx_gpmc_sysc,
+};
+
 /*
  * IP blocks
  */
@@ -724,7 +744,6 @@ struct omap_hwmod omap2xxx_mcspi2_hwmod = {
        .dev_attr       = &omap_mcspi2_dev_attr,
 };
 
-
 static struct omap_hwmod_class omap2xxx_counter_hwmod_class = {
        .name   = "counter",
 };
@@ -743,3 +762,33 @@ struct omap_hwmod omap2xxx_counter_32k_hwmod = {
        },
        .class          = &omap2xxx_counter_hwmod_class,
 };
+
+/* gpmc */
+static struct omap_hwmod_irq_info omap2xxx_gpmc_irqs[] = {
+       { .irq = 20 },
+       { .irq = -1 }
+};
+
+struct omap_hwmod omap2xxx_gpmc_hwmod = {
+       .name           = "gpmc",
+       .class          = &omap2xxx_gpmc_hwmod_class,
+       .mpu_irqs       = omap2xxx_gpmc_irqs,
+       .main_clk       = "gpmc_fck",
+       /*
+        * XXX HWMOD_INIT_NO_RESET should not be needed for this IP
+        * block.  It is not being added due to any known bugs with
+        * resetting the GPMC IP block, but rather because any timings
+        * set by the bootloader are not being correctly programmed by
+        * the kernel from the board file or DT data.
+        * HWMOD_INIT_NO_RESET should be removed ASAP.
+        */
+       .flags          = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET |
+                          HWMOD_NO_IDLEST),
+       .prcm           = {
+               .omap2  = {
+                       .prcm_reg_id = 3,
+                       .module_bit = OMAP24XX_EN_GPMC_MASK,
+                       .module_offs = CORE_MOD,
+               },
+       },
+};
index 11442d84dacde39c8480d4aadb05b68545b81567..da6eca0ff79bb05bb3cf05876259b74bade97590 100644 (file)
@@ -2095,6 +2095,49 @@ static struct omap_hwmod omap3xxx_counter_32k_hwmod = {
        },
 };
 
+/*
+ * 'gpmc' class
+ * general purpose memory controller
+ */
+
+static struct omap_hwmod_class_sysconfig omap3xxx_gpmc_sysc = {
+       .rev_offs       = 0x0000,
+       .sysc_offs      = 0x0010,
+       .syss_offs      = 0x0014,
+       .sysc_flags     = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE |
+                          SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
+       .idlemodes      = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+       .sysc_fields    = &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap3xxx_gpmc_hwmod_class = {
+       .name   = "gpmc",
+       .sysc   = &omap3xxx_gpmc_sysc,
+};
+
+static struct omap_hwmod_irq_info omap3xxx_gpmc_irqs[] = {
+       { .irq = 20 },
+       { .irq = -1 }
+};
+
+static struct omap_hwmod omap3xxx_gpmc_hwmod = {
+       .name           = "gpmc",
+       .class          = &omap3xxx_gpmc_hwmod_class,
+       .clkdm_name     = "core_l3_clkdm",
+       .mpu_irqs       = omap3xxx_gpmc_irqs,
+       .main_clk       = "gpmc_fck",
+       /*
+        * XXX HWMOD_INIT_NO_RESET should not be needed for this IP
+        * block.  It is not being added due to any known bugs with
+        * resetting the GPMC IP block, but rather because any timings
+        * set by the bootloader are not being correctly programmed by
+        * the kernel from the board file or DT data.
+        * HWMOD_INIT_NO_RESET should be removed ASAP.
+        */
+       .flags          = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET |
+                          HWMOD_NO_IDLEST),
+};
+
 /*
  * interfaces
  */
@@ -3320,6 +3363,15 @@ static struct omap_hwmod_addr_space omap3xxx_counter_32k_addrs[] = {
        { }
 };
 
+static struct omap_hwmod_addr_space omap3xxx_gpmc_addrs[] = {
+       {
+               .pa_start       = 0x6e000000,
+               .pa_end         = 0x6e000fff,
+               .flags          = ADDR_TYPE_RT
+       },
+       { }
+};
+
 static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__counter_32k = {
        .master         = &omap3xxx_l4_wkup_hwmod,
        .slave          = &omap3xxx_counter_32k_hwmod,
@@ -3429,6 +3481,14 @@ static struct omap_hwmod_ocp_if am35xx_l4_core__emac = {
        .user           = OCP_USER_MPU,
 };
 
+static struct omap_hwmod_ocp_if omap3xxx_l3_main__gpmc = {
+       .master         = &omap3xxx_l3_main_hwmod,
+       .slave          = &omap3xxx_gpmc_hwmod,
+       .clk            = "core_l3_ick",
+       .addr           = omap3xxx_gpmc_addrs,
+       .user           = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 static struct omap_hwmod_ocp_if *omap3xxx_hwmod_ocp_ifs[] __initdata = {
        &omap3xxx_l3_main__l4_core,
        &omap3xxx_l3_main__l4_per,
@@ -3474,6 +3534,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_hwmod_ocp_ifs[] __initdata = {
        &omap34xx_l4_core__mcspi3,
        &omap34xx_l4_core__mcspi4,
        &omap3xxx_l4_wkup__counter_32k,
+       &omap3xxx_l3_main__gpmc,
        NULL,
 };
 
index d6233740c8e11665a4678e1328349bc3c50d0743..46fd80c29a02f94c1bcafcfebc219fb6e6a0b6e6 100644 (file)
@@ -1352,6 +1352,14 @@ static struct omap_hwmod omap44xx_gpmc_hwmod = {
        .name           = "gpmc",
        .class          = &omap44xx_gpmc_hwmod_class,
        .clkdm_name     = "l3_2_clkdm",
+       /*
+        * XXX HWMOD_INIT_NO_RESET should not be needed for this IP
+        * block.  It is not being added due to any known bugs with
+        * resetting the GPMC IP block, but rather because any timings
+        * set by the bootloader are not being correctly programmed by
+        * the kernel from the board file or DT data.
+        * HWMOD_INIT_NO_RESET should be removed ASAP.
+        */
        .flags          = HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET,
        .mpu_irqs       = omap44xx_gpmc_irqs,
        .sdma_reqs      = omap44xx_gpmc_sdma_reqs,
index dddb677fed688c16b0198df03a646330da003968..6a033b878359fd3846842c8aef233fc5a1e7b633 100644 (file)
@@ -77,6 +77,7 @@ extern struct omap_hwmod omap2xxx_gpio4_hwmod;
 extern struct omap_hwmod omap2xxx_mcspi1_hwmod;
 extern struct omap_hwmod omap2xxx_mcspi2_hwmod;
 extern struct omap_hwmod omap2xxx_counter_32k_hwmod;
+extern struct omap_hwmod omap2xxx_gpmc_hwmod;
 
 /* Common interface data across OMAP2xxx */
 extern struct omap_hwmod_ocp_if omap2xxx_l3_main__l4_core;
index e5f0503a68b09e5a2eff32e1a01350a33e32c91b..72df97482cc04f7eb95f8f5acfe87aa2372081e0 100644 (file)
 #define OMAP2430_EN_MDM_INTC_MASK                      (1 << 11)
 #define OMAP2430_EN_USBHS_SHIFT                                6
 #define OMAP2430_EN_USBHS_MASK                         (1 << 6)
+#define OMAP24XX_EN_GPMC_SHIFT                         1
+#define OMAP24XX_EN_GPMC_MASK                          (1 << 1)
 
 /* CM_IDLEST1_CORE, PM_WKST1_CORE shared bits */
 #define OMAP2420_ST_MMC_SHIFT                          26