OMAP hwmod: convert header files with static allocations into C files
authorPaul Walmsley <paul@pwsan.com>
Tue, 23 Feb 2010 05:09:32 +0000 (22:09 -0700)
committerPaul Walmsley <paul@pwsan.com>
Wed, 24 Feb 2010 19:29:45 +0000 (12:29 -0700)
Code should be able to #include any header file without the fear that
the header file will go allocating memory.  This is a coding style
issue, similar to commit 82e9bd588563c4e22ebb55b684ebec7e310cc715.
Move the existing hwmod data from .h files to .c files.

While here, convert "omap34xx" to "omap3xxx" in the hwmod files, since
most of these structures should be reusable across all OMAP3 chips.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: BenoƮt Cousson <b-cousson@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/io.c
arch/arm/mach-omap2/omap_hwmod_2420.h [deleted file]
arch/arm/mach-omap2/omap_hwmod_2420_data.c [new file with mode: 0644]
arch/arm/mach-omap2/omap_hwmod_2430.h [deleted file]
arch/arm/mach-omap2/omap_hwmod_2430_data.c [new file with mode: 0644]
arch/arm/mach-omap2/omap_hwmod_34xx.h [deleted file]
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c [new file with mode: 0644]
arch/arm/plat-omap/include/plat/omap_hwmod.h

index 5da5ca1130dfbffcb3d84b006246a94a4db4b1c8..7fa4dec2947e5c7f9f6e0d5c86ee502780154e6f 100644 (file)
@@ -74,6 +74,11 @@ obj-$(CONFIG_ARCH_OMAP4)             += $(clock-common) clock44xx_data.o \
 obj-$(CONFIG_ARCH_OMAP2420)            += opp2420_data.o
 obj-$(CONFIG_ARCH_OMAP2430)            += opp2430_data.o
 
+# hwmod data
+obj-$(CONFIG_ARCH_OMAP2420)            += omap_hwmod_2420_data.o
+obj-$(CONFIG_ARCH_OMAP2430)            += omap_hwmod_2430_data.o
+obj-$(CONFIG_ARCH_OMAP3)               += omap_hwmod_3xxx_data.o
+
 # EMU peripherals
 obj-$(CONFIG_OMAP3_EMU)                        += emu.o
 
index f1685572f98257b6644c3a803840fd20b3b3028c..303d5c2c6fb5184e99b813229368b676b0afb8b8 100644 (file)
@@ -46,9 +46,6 @@
 #include <plat/clockdomain.h>
 #include "clockdomains.h"
 #include <plat/omap_hwmod.h>
-#include "omap_hwmod_2420.h"
-#include "omap_hwmod_2430.h"
-#include "omap_hwmod_34xx.h"
 
 /*
  * The machine specific code may provide the extra mapping besides the
@@ -322,21 +319,17 @@ static int __init _omap2_init_reprogram_sdrc(void)
 void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
                                 struct omap_sdrc_params *sdrc_cs1)
 {
-       struct omap_hwmod **hwmods = NULL;
-
-       if (cpu_is_omap2420())
-               hwmods = omap2420_hwmods;
-       else if (cpu_is_omap2430())
-               hwmods = omap2430_hwmods;
-       else if (cpu_is_omap34xx())
-               hwmods = omap34xx_hwmods;
-
        pwrdm_init(powerdomains_omap);
        clkdm_init(clockdomains_omap, clkdm_autodeps);
 #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */
-       /* The OPP tables have to be registered before a clk init */
-       omap_hwmod_init(hwmods);
+       if (cpu_is_omap242x())
+               omap2420_hwmod_init();
+       else if (cpu_is_omap243x())
+               omap2430_hwmod_init();
+       else if (cpu_is_omap34xx())
+               omap3xxx_hwmod_init();
        omap2_mux_init();
+       /* The OPP tables have to be registered before a clk init */
        omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
 #endif
 
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420.h b/arch/arm/mach-omap2/omap_hwmod_2420.h
deleted file mode 100644 (file)
index 5932c1d..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * omap_hwmod_2420.h - hardware modules present on the OMAP2420 chips
- *
- * Copyright (C) 2009 Nokia Corporation
- * Paul Walmsley
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * XXX handle crossbar/shared link difference for L3?
- *
- */
-#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD2420_H
-#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD2420_H
-
-#ifdef CONFIG_ARCH_OMAP2420
-
-#include <plat/omap_hwmod.h>
-#include <mach/irqs.h>
-#include <plat/cpu.h>
-#include <plat/dma.h>
-
-#include "prm-regbits-24xx.h"
-
-static struct omap_hwmod omap2420_mpu_hwmod;
-static struct omap_hwmod omap2420_l3_hwmod;
-static struct omap_hwmod omap2420_l4_core_hwmod;
-
-/* L3 -> L4_CORE interface */
-static struct omap_hwmod_ocp_if omap2420_l3__l4_core = {
-       .master = &omap2420_l3_hwmod,
-       .slave  = &omap2420_l4_core_hwmod,
-       .user   = OCP_USER_MPU | OCP_USER_SDMA,
-};
-
-/* MPU -> L3 interface */
-static struct omap_hwmod_ocp_if omap2420_mpu__l3 = {
-       .master = &omap2420_mpu_hwmod,
-       .slave  = &omap2420_l3_hwmod,
-       .user   = OCP_USER_MPU,
-};
-
-/* Slave interfaces on the L3 interconnect */
-static struct omap_hwmod_ocp_if *omap2420_l3_slaves[] = {
-       &omap2420_mpu__l3,
-};
-
-/* Master interfaces on the L3 interconnect */
-static struct omap_hwmod_ocp_if *omap2420_l3_masters[] = {
-       &omap2420_l3__l4_core,
-};
-
-/* L3 */
-static struct omap_hwmod omap2420_l3_hwmod = {
-       .name           = "l3_hwmod",
-       .masters        = omap2420_l3_masters,
-       .masters_cnt    = ARRAY_SIZE(omap2420_l3_masters),
-       .slaves         = omap2420_l3_slaves,
-       .slaves_cnt     = ARRAY_SIZE(omap2420_l3_slaves),
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
-};
-
-static struct omap_hwmod omap2420_l4_wkup_hwmod;
-
-/* L4_CORE -> L4_WKUP interface */
-static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = {
-       .master = &omap2420_l4_core_hwmod,
-       .slave  = &omap2420_l4_wkup_hwmod,
-       .user   = OCP_USER_MPU | OCP_USER_SDMA,
-};
-
-/* Slave interfaces on the L4_CORE interconnect */
-static struct omap_hwmod_ocp_if *omap2420_l4_core_slaves[] = {
-       &omap2420_l3__l4_core,
-};
-
-/* Master interfaces on the L4_CORE interconnect */
-static struct omap_hwmod_ocp_if *omap2420_l4_core_masters[] = {
-       &omap2420_l4_core__l4_wkup,
-};
-
-/* L4 CORE */
-static struct omap_hwmod omap2420_l4_core_hwmod = {
-       .name           = "l4_core_hwmod",
-       .masters        = omap2420_l4_core_masters,
-       .masters_cnt    = ARRAY_SIZE(omap2420_l4_core_masters),
-       .slaves         = omap2420_l4_core_slaves,
-       .slaves_cnt     = ARRAY_SIZE(omap2420_l4_core_slaves),
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
-};
-
-/* Slave interfaces on the L4_WKUP interconnect */
-static struct omap_hwmod_ocp_if *omap2420_l4_wkup_slaves[] = {
-       &omap2420_l4_core__l4_wkup,
-};
-
-/* Master interfaces on the L4_WKUP interconnect */
-static struct omap_hwmod_ocp_if *omap2420_l4_wkup_masters[] = {
-};
-
-/* L4 WKUP */
-static struct omap_hwmod omap2420_l4_wkup_hwmod = {
-       .name           = "l4_wkup_hwmod",
-       .masters        = omap2420_l4_wkup_masters,
-       .masters_cnt    = ARRAY_SIZE(omap2420_l4_wkup_masters),
-       .slaves         = omap2420_l4_wkup_slaves,
-       .slaves_cnt     = ARRAY_SIZE(omap2420_l4_wkup_slaves),
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
-};
-
-/* Master interfaces on the MPU device */
-static struct omap_hwmod_ocp_if *omap2420_mpu_masters[] = {
-       &omap2420_mpu__l3,
-};
-
-/* MPU */
-static struct omap_hwmod omap2420_mpu_hwmod = {
-       .name           = "mpu_hwmod",
-       .main_clk       = "mpu_ck",
-       .masters        = omap2420_mpu_masters,
-       .masters_cnt    = ARRAY_SIZE(omap2420_mpu_masters),
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
-};
-
-static __initdata struct omap_hwmod *omap2420_hwmods[] = {
-       &omap2420_l3_hwmod,
-       &omap2420_l4_core_hwmod,
-       &omap2420_l4_wkup_hwmod,
-       &omap2420_mpu_hwmod,
-       NULL,
-};
-
-#else
-# define omap2420_hwmods               0
-#endif
-
-#endif
-
-
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
new file mode 100644 (file)
index 0000000..a1c5839
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * omap_hwmod_2420_data.c - hardware modules present on the OMAP2420 chips
+ *
+ * Copyright (C) 2009-2010 Nokia Corporation
+ * Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * XXX handle crossbar/shared link difference for L3?
+ * XXX these should be marked initdata for multi-OMAP kernels
+ */
+#include <plat/omap_hwmod.h>
+#include <mach/irqs.h>
+#include <plat/cpu.h>
+#include <plat/dma.h>
+
+#include "prm-regbits-24xx.h"
+
+/*
+ * OMAP2420 hardware module integration data
+ *
+ * ALl of the data in this section should be autogeneratable from the
+ * TI hardware database or other technical documentation.  Data that
+ * is driver-specific or driver-kernel integration-specific belongs
+ * elsewhere.
+ */
+
+static struct omap_hwmod omap2420_mpu_hwmod;
+static struct omap_hwmod omap2420_l3_hwmod;
+static struct omap_hwmod omap2420_l4_core_hwmod;
+
+/* L3 -> L4_CORE interface */
+static struct omap_hwmod_ocp_if omap2420_l3__l4_core = {
+       .master = &omap2420_l3_hwmod,
+       .slave  = &omap2420_l4_core_hwmod,
+       .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* MPU -> L3 interface */
+static struct omap_hwmod_ocp_if omap2420_mpu__l3 = {
+       .master = &omap2420_mpu_hwmod,
+       .slave  = &omap2420_l3_hwmod,
+       .user   = OCP_USER_MPU,
+};
+
+/* Slave interfaces on the L3 interconnect */
+static struct omap_hwmod_ocp_if *omap2420_l3_slaves[] = {
+       &omap2420_mpu__l3,
+};
+
+/* Master interfaces on the L3 interconnect */
+static struct omap_hwmod_ocp_if *omap2420_l3_masters[] = {
+       &omap2420_l3__l4_core,
+};
+
+/* L3 */
+static struct omap_hwmod omap2420_l3_hwmod = {
+       .name           = "l3_hwmod",
+       .masters        = omap2420_l3_masters,
+       .masters_cnt    = ARRAY_SIZE(omap2420_l3_masters),
+       .slaves         = omap2420_l3_slaves,
+       .slaves_cnt     = ARRAY_SIZE(omap2420_l3_slaves),
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
+};
+
+static struct omap_hwmod omap2420_l4_wkup_hwmod;
+
+/* L4_CORE -> L4_WKUP interface */
+static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = {
+       .master = &omap2420_l4_core_hwmod,
+       .slave  = &omap2420_l4_wkup_hwmod,
+       .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* Slave interfaces on the L4_CORE interconnect */
+static struct omap_hwmod_ocp_if *omap2420_l4_core_slaves[] = {
+       &omap2420_l3__l4_core,
+};
+
+/* Master interfaces on the L4_CORE interconnect */
+static struct omap_hwmod_ocp_if *omap2420_l4_core_masters[] = {
+       &omap2420_l4_core__l4_wkup,
+};
+
+/* L4 CORE */
+static struct omap_hwmod omap2420_l4_core_hwmod = {
+       .name           = "l4_core_hwmod",
+       .masters        = omap2420_l4_core_masters,
+       .masters_cnt    = ARRAY_SIZE(omap2420_l4_core_masters),
+       .slaves         = omap2420_l4_core_slaves,
+       .slaves_cnt     = ARRAY_SIZE(omap2420_l4_core_slaves),
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
+};
+
+/* Slave interfaces on the L4_WKUP interconnect */
+static struct omap_hwmod_ocp_if *omap2420_l4_wkup_slaves[] = {
+       &omap2420_l4_core__l4_wkup,
+};
+
+/* Master interfaces on the L4_WKUP interconnect */
+static struct omap_hwmod_ocp_if *omap2420_l4_wkup_masters[] = {
+};
+
+/* L4 WKUP */
+static struct omap_hwmod omap2420_l4_wkup_hwmod = {
+       .name           = "l4_wkup_hwmod",
+       .masters        = omap2420_l4_wkup_masters,
+       .masters_cnt    = ARRAY_SIZE(omap2420_l4_wkup_masters),
+       .slaves         = omap2420_l4_wkup_slaves,
+       .slaves_cnt     = ARRAY_SIZE(omap2420_l4_wkup_slaves),
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
+};
+
+/* Master interfaces on the MPU device */
+static struct omap_hwmod_ocp_if *omap2420_mpu_masters[] = {
+       &omap2420_mpu__l3,
+};
+
+/* MPU */
+static struct omap_hwmod omap2420_mpu_hwmod = {
+       .name           = "mpu_hwmod",
+       .main_clk       = "mpu_ck",
+       .masters        = omap2420_mpu_masters,
+       .masters_cnt    = ARRAY_SIZE(omap2420_mpu_masters),
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static __initdata struct omap_hwmod *omap2420_hwmods[] = {
+       &omap2420_l3_hwmod,
+       &omap2420_l4_core_hwmod,
+       &omap2420_l4_wkup_hwmod,
+       &omap2420_mpu_hwmod,
+       NULL,
+};
+
+int __init omap2420_hwmod_init(void)
+{
+       return omap_hwmod_init(omap2420_hwmods);
+}
+
+
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430.h b/arch/arm/mach-omap2/omap_hwmod_2430.h
deleted file mode 100644 (file)
index 91f79c0..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * omap_hwmod_2430.h - hardware modules present on the OMAP2430 chips
- *
- * Copyright (C) 2009 Nokia Corporation
- * Paul Walmsley
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * XXX handle crossbar/shared link difference for L3?
- *
- */
-#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD2430_H
-#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD2430_H
-
-#ifdef CONFIG_ARCH_OMAP2430
-
-#include <plat/omap_hwmod.h>
-#include <mach/irqs.h>
-#include <plat/cpu.h>
-#include <plat/dma.h>
-
-#include "prm-regbits-24xx.h"
-
-static struct omap_hwmod omap2430_mpu_hwmod;
-static struct omap_hwmod omap2430_l3_hwmod;
-static struct omap_hwmod omap2430_l4_core_hwmod;
-
-/* L3 -> L4_CORE interface */
-static struct omap_hwmod_ocp_if omap2430_l3__l4_core = {
-       .master = &omap2430_l3_hwmod,
-       .slave  = &omap2430_l4_core_hwmod,
-       .user   = OCP_USER_MPU | OCP_USER_SDMA,
-};
-
-/* MPU -> L3 interface */
-static struct omap_hwmod_ocp_if omap2430_mpu__l3 = {
-       .master = &omap2430_mpu_hwmod,
-       .slave  = &omap2430_l3_hwmod,
-       .user   = OCP_USER_MPU,
-};
-
-/* Slave interfaces on the L3 interconnect */
-static struct omap_hwmod_ocp_if *omap2430_l3_slaves[] = {
-       &omap2430_mpu__l3,
-};
-
-/* Master interfaces on the L3 interconnect */
-static struct omap_hwmod_ocp_if *omap2430_l3_masters[] = {
-       &omap2430_l3__l4_core,
-};
-
-/* L3 */
-static struct omap_hwmod omap2430_l3_hwmod = {
-       .name           = "l3_hwmod",
-       .masters        = omap2430_l3_masters,
-       .masters_cnt    = ARRAY_SIZE(omap2430_l3_masters),
-       .slaves         = omap2430_l3_slaves,
-       .slaves_cnt     = ARRAY_SIZE(omap2430_l3_slaves),
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
-};
-
-static struct omap_hwmod omap2430_l4_wkup_hwmod;
-static struct omap_hwmod omap2430_mmc1_hwmod;
-static struct omap_hwmod omap2430_mmc2_hwmod;
-
-/* L4_CORE -> L4_WKUP interface */
-static struct omap_hwmod_ocp_if omap2430_l4_core__l4_wkup = {
-       .master = &omap2430_l4_core_hwmod,
-       .slave  = &omap2430_l4_wkup_hwmod,
-       .user   = OCP_USER_MPU | OCP_USER_SDMA,
-};
-
-/* Slave interfaces on the L4_CORE interconnect */
-static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = {
-       &omap2430_l3__l4_core,
-};
-
-/* Master interfaces on the L4_CORE interconnect */
-static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = {
-       &omap2430_l4_core__l4_wkup,
-};
-
-/* L4 CORE */
-static struct omap_hwmod omap2430_l4_core_hwmod = {
-       .name           = "l4_core_hwmod",
-       .masters        = omap2430_l4_core_masters,
-       .masters_cnt    = ARRAY_SIZE(omap2430_l4_core_masters),
-       .slaves         = omap2430_l4_core_slaves,
-       .slaves_cnt     = ARRAY_SIZE(omap2430_l4_core_slaves),
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
-};
-
-/* Slave interfaces on the L4_WKUP interconnect */
-static struct omap_hwmod_ocp_if *omap2430_l4_wkup_slaves[] = {
-       &omap2430_l4_core__l4_wkup,
-};
-
-/* Master interfaces on the L4_WKUP interconnect */
-static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = {
-};
-
-/* L4 WKUP */
-static struct omap_hwmod omap2430_l4_wkup_hwmod = {
-       .name           = "l4_wkup_hwmod",
-       .masters        = omap2430_l4_wkup_masters,
-       .masters_cnt    = ARRAY_SIZE(omap2430_l4_wkup_masters),
-       .slaves         = omap2430_l4_wkup_slaves,
-       .slaves_cnt     = ARRAY_SIZE(omap2430_l4_wkup_slaves),
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
-};
-
-/* Master interfaces on the MPU device */
-static struct omap_hwmod_ocp_if *omap2430_mpu_masters[] = {
-       &omap2430_mpu__l3,
-};
-
-/* MPU */
-static struct omap_hwmod omap2430_mpu_hwmod = {
-       .name           = "mpu_hwmod",
-       .main_clk       = "mpu_ck",
-       .masters        = omap2430_mpu_masters,
-       .masters_cnt    = ARRAY_SIZE(omap2430_mpu_masters),
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
-};
-
-static __initdata struct omap_hwmod *omap2430_hwmods[] = {
-       &omap2430_l3_hwmod,
-       &omap2430_l4_core_hwmod,
-       &omap2430_l4_wkup_hwmod,
-       &omap2430_mpu_hwmod,
-       NULL,
-};
-
-#else
-# define omap2430_hwmods               0
-#endif
-
-#endif
-
-
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
new file mode 100644 (file)
index 0000000..ed2de79
--- /dev/null
@@ -0,0 +1,145 @@
+/*
+ * omap_hwmod_2430_data.c - hardware modules present on the OMAP2430 chips
+ *
+ * Copyright (C) 2009-2010 Nokia Corporation
+ * Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * XXX handle crossbar/shared link difference for L3?
+ * XXX these should be marked initdata for multi-OMAP kernels
+ */
+#include <plat/omap_hwmod.h>
+#include <mach/irqs.h>
+#include <plat/cpu.h>
+#include <plat/dma.h>
+
+#include "prm-regbits-24xx.h"
+
+/*
+ * OMAP2430 hardware module integration data
+ *
+ * ALl of the data in this section should be autogeneratable from the
+ * TI hardware database or other technical documentation.  Data that
+ * is driver-specific or driver-kernel integration-specific belongs
+ * elsewhere.
+ */
+
+static struct omap_hwmod omap2430_mpu_hwmod;
+static struct omap_hwmod omap2430_l3_hwmod;
+static struct omap_hwmod omap2430_l4_core_hwmod;
+
+/* L3 -> L4_CORE interface */
+static struct omap_hwmod_ocp_if omap2430_l3__l4_core = {
+       .master = &omap2430_l3_hwmod,
+       .slave  = &omap2430_l4_core_hwmod,
+       .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* MPU -> L3 interface */
+static struct omap_hwmod_ocp_if omap2430_mpu__l3 = {
+       .master = &omap2430_mpu_hwmod,
+       .slave  = &omap2430_l3_hwmod,
+       .user   = OCP_USER_MPU,
+};
+
+/* Slave interfaces on the L3 interconnect */
+static struct omap_hwmod_ocp_if *omap2430_l3_slaves[] = {
+       &omap2430_mpu__l3,
+};
+
+/* Master interfaces on the L3 interconnect */
+static struct omap_hwmod_ocp_if *omap2430_l3_masters[] = {
+       &omap2430_l3__l4_core,
+};
+
+/* L3 */
+static struct omap_hwmod omap2430_l3_hwmod = {
+       .name           = "l3_hwmod",
+       .masters        = omap2430_l3_masters,
+       .masters_cnt    = ARRAY_SIZE(omap2430_l3_masters),
+       .slaves         = omap2430_l3_slaves,
+       .slaves_cnt     = ARRAY_SIZE(omap2430_l3_slaves),
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
+};
+
+static struct omap_hwmod omap2430_l4_wkup_hwmod;
+static struct omap_hwmod omap2430_mmc1_hwmod;
+static struct omap_hwmod omap2430_mmc2_hwmod;
+
+/* L4_CORE -> L4_WKUP interface */
+static struct omap_hwmod_ocp_if omap2430_l4_core__l4_wkup = {
+       .master = &omap2430_l4_core_hwmod,
+       .slave  = &omap2430_l4_wkup_hwmod,
+       .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* Slave interfaces on the L4_CORE interconnect */
+static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = {
+       &omap2430_l3__l4_core,
+};
+
+/* Master interfaces on the L4_CORE interconnect */
+static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = {
+       &omap2430_l4_core__l4_wkup,
+};
+
+/* L4 CORE */
+static struct omap_hwmod omap2430_l4_core_hwmod = {
+       .name           = "l4_core_hwmod",
+       .masters        = omap2430_l4_core_masters,
+       .masters_cnt    = ARRAY_SIZE(omap2430_l4_core_masters),
+       .slaves         = omap2430_l4_core_slaves,
+       .slaves_cnt     = ARRAY_SIZE(omap2430_l4_core_slaves),
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
+};
+
+/* Slave interfaces on the L4_WKUP interconnect */
+static struct omap_hwmod_ocp_if *omap2430_l4_wkup_slaves[] = {
+       &omap2430_l4_core__l4_wkup,
+};
+
+/* Master interfaces on the L4_WKUP interconnect */
+static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = {
+};
+
+/* L4 WKUP */
+static struct omap_hwmod omap2430_l4_wkup_hwmod = {
+       .name           = "l4_wkup_hwmod",
+       .masters        = omap2430_l4_wkup_masters,
+       .masters_cnt    = ARRAY_SIZE(omap2430_l4_wkup_masters),
+       .slaves         = omap2430_l4_wkup_slaves,
+       .slaves_cnt     = ARRAY_SIZE(omap2430_l4_wkup_slaves),
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
+};
+
+/* Master interfaces on the MPU device */
+static struct omap_hwmod_ocp_if *omap2430_mpu_masters[] = {
+       &omap2430_mpu__l3,
+};
+
+/* MPU */
+static struct omap_hwmod omap2430_mpu_hwmod = {
+       .name           = "mpu_hwmod",
+       .main_clk       = "mpu_ck",
+       .masters        = omap2430_mpu_masters,
+       .masters_cnt    = ARRAY_SIZE(omap2430_mpu_masters),
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static __initdata struct omap_hwmod *omap2430_hwmods[] = {
+       &omap2430_l3_hwmod,
+       &omap2430_l4_core_hwmod,
+       &omap2430_l4_wkup_hwmod,
+       &omap2430_mpu_hwmod,
+       NULL,
+};
+
+int __init omap2430_hwmod_init(void)
+{
+       return omap_hwmod_init(omap2430_hwmods);
+}
+
+
diff --git a/arch/arm/mach-omap2/omap_hwmod_34xx.h b/arch/arm/mach-omap2/omap_hwmod_34xx.h
deleted file mode 100644 (file)
index 2699114..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * omap_hwmod_34xx.h - hardware modules present on the OMAP34xx chips
- *
- * Copyright (C) 2009 Nokia Corporation
- * Paul Walmsley
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- */
-#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD34XX_H
-#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD34XX_H
-
-#ifdef CONFIG_ARCH_OMAP3
-
-#include <plat/omap_hwmod.h>
-#include <mach/irqs.h>
-#include <plat/cpu.h>
-#include <plat/dma.h>
-
-#include "prm-regbits-34xx.h"
-
-static struct omap_hwmod omap34xx_mpu_hwmod;
-static struct omap_hwmod omap34xx_l3_hwmod;
-static struct omap_hwmod omap34xx_l4_core_hwmod;
-static struct omap_hwmod omap34xx_l4_per_hwmod;
-
-/* L3 -> L4_CORE interface */
-static struct omap_hwmod_ocp_if omap34xx_l3__l4_core = {
-       .master = &omap34xx_l3_hwmod,
-       .slave  = &omap34xx_l4_core_hwmod,
-       .user   = OCP_USER_MPU | OCP_USER_SDMA,
-};
-
-/* L3 -> L4_PER interface */
-static struct omap_hwmod_ocp_if omap34xx_l3__l4_per = {
-       .master = &omap34xx_l3_hwmod,
-       .slave  = &omap34xx_l4_per_hwmod,
-       .user   = OCP_USER_MPU | OCP_USER_SDMA,
-};
-
-/* MPU -> L3 interface */
-static struct omap_hwmod_ocp_if omap34xx_mpu__l3 = {
-       .master = &omap34xx_mpu_hwmod,
-       .slave  = &omap34xx_l3_hwmod,
-       .user   = OCP_USER_MPU,
-};
-
-/* Slave interfaces on the L3 interconnect */
-static struct omap_hwmod_ocp_if *omap34xx_l3_slaves[] = {
-       &omap34xx_mpu__l3,
-};
-
-/* Master interfaces on the L3 interconnect */
-static struct omap_hwmod_ocp_if *omap34xx_l3_masters[] = {
-       &omap34xx_l3__l4_core,
-       &omap34xx_l3__l4_per,
-};
-
-/* L3 */
-static struct omap_hwmod omap34xx_l3_hwmod = {
-       .name           = "l3_hwmod",
-       .masters        = omap34xx_l3_masters,
-       .masters_cnt    = ARRAY_SIZE(omap34xx_l3_masters),
-       .slaves         = omap34xx_l3_slaves,
-       .slaves_cnt     = ARRAY_SIZE(omap34xx_l3_slaves),
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-};
-
-static struct omap_hwmod omap34xx_l4_wkup_hwmod;
-
-/* L4_CORE -> L4_WKUP interface */
-static struct omap_hwmod_ocp_if omap34xx_l4_core__l4_wkup = {
-       .master = &omap34xx_l4_core_hwmod,
-       .slave  = &omap34xx_l4_wkup_hwmod,
-       .user   = OCP_USER_MPU | OCP_USER_SDMA,
-};
-
-/* Slave interfaces on the L4_CORE interconnect */
-static struct omap_hwmod_ocp_if *omap34xx_l4_core_slaves[] = {
-       &omap34xx_l3__l4_core,
-};
-
-/* Master interfaces on the L4_CORE interconnect */
-static struct omap_hwmod_ocp_if *omap34xx_l4_core_masters[] = {
-       &omap34xx_l4_core__l4_wkup,
-};
-
-/* L4 CORE */
-static struct omap_hwmod omap34xx_l4_core_hwmod = {
-       .name           = "l4_core_hwmod",
-       .masters        = omap34xx_l4_core_masters,
-       .masters_cnt    = ARRAY_SIZE(omap34xx_l4_core_masters),
-       .slaves         = omap34xx_l4_core_slaves,
-       .slaves_cnt     = ARRAY_SIZE(omap34xx_l4_core_slaves),
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-};
-
-/* Slave interfaces on the L4_PER interconnect */
-static struct omap_hwmod_ocp_if *omap34xx_l4_per_slaves[] = {
-       &omap34xx_l3__l4_per,
-};
-
-/* Master interfaces on the L4_PER interconnect */
-static struct omap_hwmod_ocp_if *omap34xx_l4_per_masters[] = {
-};
-
-/* L4 PER */
-static struct omap_hwmod omap34xx_l4_per_hwmod = {
-       .name           = "l4_per_hwmod",
-       .masters        = omap34xx_l4_per_masters,
-       .masters_cnt    = ARRAY_SIZE(omap34xx_l4_per_masters),
-       .slaves         = omap34xx_l4_per_slaves,
-       .slaves_cnt     = ARRAY_SIZE(omap34xx_l4_per_slaves),
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-};
-
-/* Slave interfaces on the L4_WKUP interconnect */
-static struct omap_hwmod_ocp_if *omap34xx_l4_wkup_slaves[] = {
-       &omap34xx_l4_core__l4_wkup,
-};
-
-/* Master interfaces on the L4_WKUP interconnect */
-static struct omap_hwmod_ocp_if *omap34xx_l4_wkup_masters[] = {
-};
-
-/* L4 WKUP */
-static struct omap_hwmod omap34xx_l4_wkup_hwmod = {
-       .name           = "l4_wkup_hwmod",
-       .masters        = omap34xx_l4_wkup_masters,
-       .masters_cnt    = ARRAY_SIZE(omap34xx_l4_wkup_masters),
-       .slaves         = omap34xx_l4_wkup_slaves,
-       .slaves_cnt     = ARRAY_SIZE(omap34xx_l4_wkup_slaves),
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-};
-
-/* Master interfaces on the MPU device */
-static struct omap_hwmod_ocp_if *omap34xx_mpu_masters[] = {
-       &omap34xx_mpu__l3,
-};
-
-/* MPU */
-static struct omap_hwmod omap34xx_mpu_hwmod = {
-       .name           = "mpu_hwmod",
-       .main_clk       = "arm_fck",
-       .masters        = omap34xx_mpu_masters,
-       .masters_cnt    = ARRAY_SIZE(omap34xx_mpu_masters),
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
-};
-
-static __initdata struct omap_hwmod *omap34xx_hwmods[] = {
-       &omap34xx_l3_hwmod,
-       &omap34xx_l4_core_hwmod,
-       &omap34xx_l4_per_hwmod,
-       &omap34xx_l4_wkup_hwmod,
-       &omap34xx_mpu_hwmod,
-       NULL,
-};
-
-#else
-# define omap34xx_hwmods               0
-#endif
-
-#endif
-
-
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
new file mode 100644 (file)
index 0000000..8d4b686
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ * omap_hwmod_3xxx_data.c - hardware modules present on the OMAP3xxx chips
+ *
+ * Copyright (C) 2009-2010 Nokia Corporation
+ * Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * The data in this file should be completely autogeneratable from
+ * the TI hardware database or other technical documentation.
+ *
+ * XXX these should be marked initdata for multi-OMAP kernels
+ */
+#include <plat/omap_hwmod.h>
+#include <mach/irqs.h>
+#include <plat/cpu.h>
+#include <plat/dma.h>
+
+#include "prm-regbits-34xx.h"
+
+/*
+ * OMAP3xxx hardware module integration data
+ *
+ * ALl of the data in this section should be autogeneratable from the
+ * TI hardware database or other technical documentation.  Data that
+ * is driver-specific or driver-kernel integration-specific belongs
+ * elsewhere.
+ */
+
+static struct omap_hwmod omap3xxx_mpu_hwmod;
+static struct omap_hwmod omap3xxx_l3_hwmod;
+static struct omap_hwmod omap3xxx_l4_core_hwmod;
+static struct omap_hwmod omap3xxx_l4_per_hwmod;
+
+/* L3 -> L4_CORE interface */
+static struct omap_hwmod_ocp_if omap3xxx_l3__l4_core = {
+       .master = &omap3xxx_l3_hwmod,
+       .slave  = &omap3xxx_l4_core_hwmod,
+       .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* L3 -> L4_PER interface */
+static struct omap_hwmod_ocp_if omap3xxx_l3__l4_per = {
+       .master = &omap3xxx_l3_hwmod,
+       .slave  = &omap3xxx_l4_per_hwmod,
+       .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* MPU -> L3 interface */
+static struct omap_hwmod_ocp_if omap3xxx_mpu__l3 = {
+       .master = &omap3xxx_mpu_hwmod,
+       .slave  = &omap3xxx_l3_hwmod,
+       .user   = OCP_USER_MPU,
+};
+
+/* Slave interfaces on the L3 interconnect */
+static struct omap_hwmod_ocp_if *omap3xxx_l3_slaves[] = {
+       &omap3xxx_mpu__l3,
+};
+
+/* Master interfaces on the L3 interconnect */
+static struct omap_hwmod_ocp_if *omap3xxx_l3_masters[] = {
+       &omap3xxx_l3__l4_core,
+       &omap3xxx_l3__l4_per,
+};
+
+/* L3 */
+static struct omap_hwmod omap3xxx_l3_hwmod = {
+       .name           = "l3_hwmod",
+       .masters        = omap3xxx_l3_masters,
+       .masters_cnt    = ARRAY_SIZE(omap3xxx_l3_masters),
+       .slaves         = omap3xxx_l3_slaves,
+       .slaves_cnt     = ARRAY_SIZE(omap3xxx_l3_slaves),
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+};
+
+static struct omap_hwmod omap3xxx_l4_wkup_hwmod;
+
+/* L4_CORE -> L4_WKUP interface */
+static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = {
+       .master = &omap3xxx_l4_core_hwmod,
+       .slave  = &omap3xxx_l4_wkup_hwmod,
+       .user   = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* Slave interfaces on the L4_CORE interconnect */
+static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = {
+       &omap3xxx_l3__l4_core,
+};
+
+/* Master interfaces on the L4_CORE interconnect */
+static struct omap_hwmod_ocp_if *omap3xxx_l4_core_masters[] = {
+       &omap3xxx_l4_core__l4_wkup,
+};
+
+/* L4 CORE */
+static struct omap_hwmod omap3xxx_l4_core_hwmod = {
+       .name           = "l4_core_hwmod",
+       .masters        = omap3xxx_l4_core_masters,
+       .masters_cnt    = ARRAY_SIZE(omap3xxx_l4_core_masters),
+       .slaves         = omap3xxx_l4_core_slaves,
+       .slaves_cnt     = ARRAY_SIZE(omap3xxx_l4_core_slaves),
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+};
+
+/* Slave interfaces on the L4_PER interconnect */
+static struct omap_hwmod_ocp_if *omap3xxx_l4_per_slaves[] = {
+       &omap3xxx_l3__l4_per,
+};
+
+/* Master interfaces on the L4_PER interconnect */
+static struct omap_hwmod_ocp_if *omap3xxx_l4_per_masters[] = {
+};
+
+/* L4 PER */
+static struct omap_hwmod omap3xxx_l4_per_hwmod = {
+       .name           = "l4_per_hwmod",
+       .masters        = omap3xxx_l4_per_masters,
+       .masters_cnt    = ARRAY_SIZE(omap3xxx_l4_per_masters),
+       .slaves         = omap3xxx_l4_per_slaves,
+       .slaves_cnt     = ARRAY_SIZE(omap3xxx_l4_per_slaves),
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+};
+
+/* Slave interfaces on the L4_WKUP interconnect */
+static struct omap_hwmod_ocp_if *omap3xxx_l4_wkup_slaves[] = {
+       &omap3xxx_l4_core__l4_wkup,
+};
+
+/* Master interfaces on the L4_WKUP interconnect */
+static struct omap_hwmod_ocp_if *omap3xxx_l4_wkup_masters[] = {
+};
+
+/* L4 WKUP */
+static struct omap_hwmod omap3xxx_l4_wkup_hwmod = {
+       .name           = "l4_wkup_hwmod",
+       .masters        = omap3xxx_l4_wkup_masters,
+       .masters_cnt    = ARRAY_SIZE(omap3xxx_l4_wkup_masters),
+       .slaves         = omap3xxx_l4_wkup_slaves,
+       .slaves_cnt     = ARRAY_SIZE(omap3xxx_l4_wkup_slaves),
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+};
+
+/* Master interfaces on the MPU device */
+static struct omap_hwmod_ocp_if *omap3xxx_mpu_masters[] = {
+       &omap3xxx_mpu__l3,
+};
+
+/* MPU */
+static struct omap_hwmod omap3xxx_mpu_hwmod = {
+       .name           = "mpu_hwmod",
+       .main_clk       = "arm_fck",
+       .masters        = omap3xxx_mpu_masters,
+       .masters_cnt    = ARRAY_SIZE(omap3xxx_mpu_masters),
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
+       &omap3xxx_l3_hwmod,
+       &omap3xxx_l4_core_hwmod,
+       &omap3xxx_l4_per_hwmod,
+       &omap3xxx_l4_wkup_hwmod,
+       &omap3xxx_mpu_hwmod,
+       NULL,
+};
+
+int __init omap3xxx_hwmod_init(void)
+{
+       return omap_hwmod_init(omap3xxx_hwmods);
+}
+
+
index de4d0422cd2a502a4135cf097f23d14fb0ae83f8..d2241fc6379a0c38d2993625ad7bebe92387e9ab 100644 (file)
@@ -504,4 +504,12 @@ int omap_hwmod_set_clockact_none(struct omap_hwmod *oh);
 int omap_hwmod_enable_wakeup(struct omap_hwmod *oh);
 int omap_hwmod_disable_wakeup(struct omap_hwmod *oh);
 
+/*
+ * Chip variant-specific hwmod init routines - XXX should be converted
+ * to use initcalls once the initial boot ordering is straightened out
+ */
+extern int omap2420_hwmod_init(void);
+extern int omap2430_hwmod_init(void);
+extern int omap3xxx_hwmod_init(void);
+
 #endif
This page took 0.036851 seconds and 5 git commands to generate.