diff options
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r-- | arch/arm/mach-omap2/devices.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 2cb720b5b12e..0d2d6a9c303c 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -36,6 +36,70 @@ | |||
36 | #include "mux.h" | 36 | #include "mux.h" |
37 | #include "control.h" | 37 | #include "control.h" |
38 | 38 | ||
39 | #define L3_MODULES_MAX_LEN 12 | ||
40 | #define L3_MODULES 3 | ||
41 | |||
42 | static int __init omap3_l3_init(void) | ||
43 | { | ||
44 | int l; | ||
45 | struct omap_hwmod *oh; | ||
46 | struct omap_device *od; | ||
47 | char oh_name[L3_MODULES_MAX_LEN]; | ||
48 | |||
49 | /* | ||
50 | * To avoid code running on other OMAPs in | ||
51 | * multi-omap builds | ||
52 | */ | ||
53 | if (!(cpu_is_omap34xx())) | ||
54 | return -ENODEV; | ||
55 | |||
56 | l = snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main"); | ||
57 | |||
58 | oh = omap_hwmod_lookup(oh_name); | ||
59 | |||
60 | if (!oh) | ||
61 | pr_err("could not look up %s\n", oh_name); | ||
62 | |||
63 | od = omap_device_build("omap_l3_smx", 0, oh, NULL, 0, | ||
64 | NULL, 0, 0); | ||
65 | |||
66 | WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name); | ||
67 | |||
68 | return PTR_ERR(od); | ||
69 | } | ||
70 | postcore_initcall(omap3_l3_init); | ||
71 | |||
72 | static int __init omap4_l3_init(void) | ||
73 | { | ||
74 | int l, i; | ||
75 | struct omap_hwmod *oh[3]; | ||
76 | struct omap_device *od; | ||
77 | char oh_name[L3_MODULES_MAX_LEN]; | ||
78 | |||
79 | /* | ||
80 | * To avoid code running on other OMAPs in | ||
81 | * multi-omap builds | ||
82 | */ | ||
83 | if (!(cpu_is_omap44xx())) | ||
84 | return -ENODEV; | ||
85 | |||
86 | for (i = 0; i < L3_MODULES; i++) { | ||
87 | l = snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main_%d", i+1); | ||
88 | |||
89 | oh[i] = omap_hwmod_lookup(oh_name); | ||
90 | if (!(oh[i])) | ||
91 | pr_err("could not look up %s\n", oh_name); | ||
92 | } | ||
93 | |||
94 | od = omap_device_build_ss("omap_l3_noc", 0, oh, 3, NULL, | ||
95 | 0, NULL, 0, 0); | ||
96 | |||
97 | WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name); | ||
98 | |||
99 | return PTR_ERR(od); | ||
100 | } | ||
101 | postcore_initcall(omap4_l3_init); | ||
102 | |||
39 | #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) | 103 | #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) |
40 | 104 | ||
41 | static struct resource cam_resources[] = { | 105 | static struct resource cam_resources[] = { |