Commit a4dc616ae321b5007fba0700fbd39ef13ced750b
Committed by
Santosh Shilimkar
1 parent
c464523488
Exists in
master
and in
4 other branches
OMAP4: Initialise the l3 device with the hwmod data.
The l3 interconnect device is build with all the data required to handle the error logging. The data is extracted from the hwmod data base. Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: sricharan <r.sricharan@ti.com> Acked-by: Benoit Cousson <b-cousson@ti.com>
Showing 1 changed file with 32 additions and 0 deletions Side-by-side Diff
arch/arm/mach-omap2/devices.c
... | ... | @@ -37,6 +37,7 @@ |
37 | 37 | #include "control.h" |
38 | 38 | |
39 | 39 | #define L3_MODULES_MAX_LEN 12 |
40 | +#define L3_MODULES 3 | |
40 | 41 | |
41 | 42 | static int __init omap3_l3_init(void) |
42 | 43 | { |
... | ... | @@ -67,6 +68,37 @@ |
67 | 68 | return PTR_ERR(od); |
68 | 69 | } |
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); | |
70 | 102 | |
71 | 103 | #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) |
72 | 104 |