aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bus/omap_l3_noc.c
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2014-04-11 15:37:03 -0400
committerNishanth Menon <nm@ti.com>2014-05-05 15:34:20 -0400
commitf33ddf745cbcd4145fcb2f8239f5dbba089fb8ff (patch)
tree4dc0f6bc51c36575db6ec839f9f6106bb547c0e0 /drivers/bus/omap_l3_noc.c
parentcf52b2ecd719ca7acb19c0fd74bcfcce9dc6a362 (diff)
bus: omap_l3_noc: introduce concept of submodule
While OMAP4 and OMAP5 had 3 separate clock domains, DRA7 has only 2 and the first one then is internally divided into 2 sub clock domains. To better represent this in the driver, we use the concept of submodule. The address defintions in the devicetree is as per the high level clock domain(module) base, the sub clockdomain/subdomain which shares the same register space of a clockdomain is marked in the SoC data as L3_BASE_IS_SUBMODULE. L3_BASE_IS_SUBMODULE is used as an indication that it's base address is the same as the parent module and offsets are considered from the same base address as they are usually intermingled. Other than the base address, the submodule is same as a module as it is functionally so. Signed-off-by: Nishanth Menon <nm@ti.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Darren Etheridge <detheridge@ti.com> Tested-by: Sekhar Nori <nsekhar@ti.com>
Diffstat (limited to 'drivers/bus/omap_l3_noc.c')
-rw-r--r--drivers/bus/omap_l3_noc.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c
index 08344b03fda6..0eba07ac6008 100644
--- a/drivers/bus/omap_l3_noc.c
+++ b/drivers/bus/omap_l3_noc.c
@@ -238,7 +238,7 @@ static int omap_l3_probe(struct platform_device *pdev)
238{ 238{
239 const struct of_device_id *of_id; 239 const struct of_device_id *of_id;
240 static struct omap_l3 *l3; 240 static struct omap_l3 *l3;
241 int ret, i; 241 int ret, i, res_idx;
242 242
243 of_id = of_match_device(l3_noc_match, &pdev->dev); 243 of_id = of_match_device(l3_noc_match, &pdev->dev);
244 if (!of_id) { 244 if (!of_id) {
@@ -255,15 +255,22 @@ static int omap_l3_probe(struct platform_device *pdev)
255 platform_set_drvdata(pdev, l3); 255 platform_set_drvdata(pdev, l3);
256 256
257 /* Get mem resources */ 257 /* Get mem resources */
258 for (i = 0; i < l3->num_modules; i++) { 258 for (i = 0, res_idx = 0; i < l3->num_modules; i++) {
259 struct resource *res = platform_get_resource(pdev, 259 struct resource *res;
260 IORESOURCE_MEM, i); 260
261 261 if (l3->l3_base[i] == L3_BASE_IS_SUBMODULE) {
262 /* First entry cannot be submodule */
263 BUG_ON(i == 0);
264 l3->l3_base[i] = l3->l3_base[i - 1];
265 continue;
266 }
267 res = platform_get_resource(pdev, IORESOURCE_MEM, res_idx);
262 l3->l3_base[i] = devm_ioremap_resource(&pdev->dev, res); 268 l3->l3_base[i] = devm_ioremap_resource(&pdev->dev, res);
263 if (IS_ERR(l3->l3_base[i])) { 269 if (IS_ERR(l3->l3_base[i])) {
264 dev_err(l3->dev, "ioremap %d failed\n", i); 270 dev_err(l3->dev, "ioremap %d failed\n", i);
265 return PTR_ERR(l3->l3_base[i]); 271 return PTR_ERR(l3->l3_base[i]);
266 } 272 }
273 res_idx++;
267 } 274 }
268 275
269 /* 276 /*