diff options
Diffstat (limited to 'drivers/bus')
-rw-r--r-- | drivers/bus/omap_l3_noc.c | 17 | ||||
-rw-r--r-- | drivers/bus/omap_l3_noc.h | 6 |
2 files changed, 17 insertions, 6 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 | /* |
diff --git a/drivers/bus/omap_l3_noc.h b/drivers/bus/omap_l3_noc.h index 36dc48b3dc00..aced4c546783 100644 --- a/drivers/bus/omap_l3_noc.h +++ b/drivers/bus/omap_l3_noc.h | |||
@@ -41,6 +41,8 @@ | |||
41 | 41 | ||
42 | #define L3_TARGET_NOT_SUPPORTED NULL | 42 | #define L3_TARGET_NOT_SUPPORTED NULL |
43 | 43 | ||
44 | #define L3_BASE_IS_SUBMODULE ((void __iomem *)(1 << 0)) | ||
45 | |||
44 | static const char * const l3_transaction_type[] = { | 46 | static const char * const l3_transaction_type[] = { |
45 | /* 0 0 0 */ "Idle", | 47 | /* 0 0 0 */ "Idle", |
46 | /* 0 0 1 */ "Write", | 48 | /* 0 0 1 */ "Write", |
@@ -96,7 +98,9 @@ struct l3_flagmux_data { | |||
96 | /** | 98 | /** |
97 | * struct omap_l3 - Description of data relevant for L3 bus. | 99 | * struct omap_l3 - Description of data relevant for L3 bus. |
98 | * @dev: device representing the bus (populated runtime) | 100 | * @dev: device representing the bus (populated runtime) |
99 | * @l3_base: base addresses of modules (populated runtime) | 101 | * @l3_base: base addresses of modules (populated runtime if 0) |
102 | * if set to L3_BASE_IS_SUBMODULE, then uses previous | ||
103 | * module index as the base address | ||
100 | * @l3_flag_mux: array containing flag mux data per module | 104 | * @l3_flag_mux: array containing flag mux data per module |
101 | * offset from corresponding module base indexed per | 105 | * offset from corresponding module base indexed per |
102 | * module. | 106 | * module. |