aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_hwmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c250
1 files changed, 186 insertions, 64 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 293fa6cd50e..02b6016393a 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2,6 +2,7 @@
2 * omap_hwmod implementation for OMAP2/3/4 2 * omap_hwmod implementation for OMAP2/3/4
3 * 3 *
4 * Copyright (C) 2009-2011 Nokia Corporation 4 * Copyright (C) 2009-2011 Nokia Corporation
5 * Copyright (C) 2011 Texas Instruments, Inc.
5 * 6 *
6 * Paul Walmsley, Benoît Cousson, Kevin Hilman 7 * Paul Walmsley, Benoît Cousson, Kevin Hilman
7 * 8 *
@@ -387,11 +388,10 @@ static int _set_module_autoidle(struct omap_hwmod *oh, u8 autoidle,
387 */ 388 */
388static int _enable_wakeup(struct omap_hwmod *oh, u32 *v) 389static int _enable_wakeup(struct omap_hwmod *oh, u32 *v)
389{ 390{
390 u32 wakeup_mask;
391
392 if (!oh->class->sysc || 391 if (!oh->class->sysc ||
393 !((oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) || 392 !((oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) ||
394 (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP))) 393 (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP) ||
394 (oh->class->sysc->idlemodes & MSTANDBY_SMART_WKUP)))
395 return -EINVAL; 395 return -EINVAL;
396 396
397 if (!oh->class->sysc->sysc_fields) { 397 if (!oh->class->sysc->sysc_fields) {
@@ -399,12 +399,13 @@ static int _enable_wakeup(struct omap_hwmod *oh, u32 *v)
399 return -EINVAL; 399 return -EINVAL;
400 } 400 }
401 401
402 wakeup_mask = (0x1 << oh->class->sysc->sysc_fields->enwkup_shift); 402 if (oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)
403 403 *v |= 0x1 << oh->class->sysc->sysc_fields->enwkup_shift;
404 *v |= wakeup_mask;
405 404
406 if (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP) 405 if (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP)
407 _set_slave_idlemode(oh, HWMOD_IDLEMODE_SMART_WKUP, v); 406 _set_slave_idlemode(oh, HWMOD_IDLEMODE_SMART_WKUP, v);
407 if (oh->class->sysc->idlemodes & MSTANDBY_SMART_WKUP)
408 _set_master_standbymode(oh, HWMOD_IDLEMODE_SMART_WKUP, v);
408 409
409 /* XXX test pwrdm_get_wken for this hwmod's subsystem */ 410 /* XXX test pwrdm_get_wken for this hwmod's subsystem */
410 411
@@ -422,11 +423,10 @@ static int _enable_wakeup(struct omap_hwmod *oh, u32 *v)
422 */ 423 */
423static int _disable_wakeup(struct omap_hwmod *oh, u32 *v) 424static int _disable_wakeup(struct omap_hwmod *oh, u32 *v)
424{ 425{
425 u32 wakeup_mask;
426
427 if (!oh->class->sysc || 426 if (!oh->class->sysc ||
428 !((oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) || 427 !((oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) ||
429 (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP))) 428 (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP) ||
429 (oh->class->sysc->idlemodes & MSTANDBY_SMART_WKUP)))
430 return -EINVAL; 430 return -EINVAL;
431 431
432 if (!oh->class->sysc->sysc_fields) { 432 if (!oh->class->sysc->sysc_fields) {
@@ -434,12 +434,13 @@ static int _disable_wakeup(struct omap_hwmod *oh, u32 *v)
434 return -EINVAL; 434 return -EINVAL;
435 } 435 }
436 436
437 wakeup_mask = (0x1 << oh->class->sysc->sysc_fields->enwkup_shift); 437 if (oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)
438 438 *v &= ~(0x1 << oh->class->sysc->sysc_fields->enwkup_shift);
439 *v &= ~wakeup_mask;
440 439
441 if (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP) 440 if (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP)
442 _set_slave_idlemode(oh, HWMOD_IDLEMODE_SMART, v); 441 _set_slave_idlemode(oh, HWMOD_IDLEMODE_SMART, v);
442 if (oh->class->sysc->idlemodes & MSTANDBY_SMART_WKUP)
443 _set_master_standbymode(oh, HWMOD_IDLEMODE_SMART_WKUP, v);
443 444
444 /* XXX test pwrdm_get_wken for this hwmod's subsystem */ 445 /* XXX test pwrdm_get_wken for this hwmod's subsystem */
445 446
@@ -678,6 +679,75 @@ static void _disable_optional_clocks(struct omap_hwmod *oh)
678} 679}
679 680
680/** 681/**
682 * _count_mpu_irqs - count the number of MPU IRQ lines associated with @oh
683 * @oh: struct omap_hwmod *oh
684 *
685 * Count and return the number of MPU IRQs associated with the hwmod
686 * @oh. Used to allocate struct resource data. Returns 0 if @oh is
687 * NULL.
688 */
689static int _count_mpu_irqs(struct omap_hwmod *oh)
690{
691 struct omap_hwmod_irq_info *ohii;
692 int i = 0;
693
694 if (!oh || !oh->mpu_irqs)
695 return 0;
696
697 do {
698 ohii = &oh->mpu_irqs[i++];
699 } while (ohii->irq != -1);
700
701 return i;
702}
703
704/**
705 * _count_sdma_reqs - count the number of SDMA request lines associated with @oh
706 * @oh: struct omap_hwmod *oh
707 *
708 * Count and return the number of SDMA request lines associated with
709 * the hwmod @oh. Used to allocate struct resource data. Returns 0
710 * if @oh is NULL.
711 */
712static int _count_sdma_reqs(struct omap_hwmod *oh)
713{
714 struct omap_hwmod_dma_info *ohdi;
715 int i = 0;
716
717 if (!oh || !oh->sdma_reqs)
718 return 0;
719
720 do {
721 ohdi = &oh->sdma_reqs[i++];
722 } while (ohdi->dma_req != -1);
723
724 return i;
725}
726
727/**
728 * _count_ocp_if_addr_spaces - count the number of address space entries for @oh
729 * @oh: struct omap_hwmod *oh
730 *
731 * Count and return the number of address space ranges associated with
732 * the hwmod @oh. Used to allocate struct resource data. Returns 0
733 * if @oh is NULL.
734 */
735static int _count_ocp_if_addr_spaces(struct omap_hwmod_ocp_if *os)
736{
737 struct omap_hwmod_addr_space *mem;
738 int i = 0;
739
740 if (!os || !os->addr)
741 return 0;
742
743 do {
744 mem = &os->addr[i++];
745 } while (mem->pa_start != mem->pa_end);
746
747 return i;
748}
749
750/**
681 * _find_mpu_port_index - find hwmod OCP slave port ID intended for MPU use 751 * _find_mpu_port_index - find hwmod OCP slave port ID intended for MPU use
682 * @oh: struct omap_hwmod * 752 * @oh: struct omap_hwmod *
683 * 753 *
@@ -722,8 +792,7 @@ static void __iomem * __init _find_mpu_rt_base(struct omap_hwmod *oh, u8 index)
722{ 792{
723 struct omap_hwmod_ocp_if *os; 793 struct omap_hwmod_ocp_if *os;
724 struct omap_hwmod_addr_space *mem; 794 struct omap_hwmod_addr_space *mem;
725 int i; 795 int i = 0, found = 0;
726 int found = 0;
727 void __iomem *va_start; 796 void __iomem *va_start;
728 797
729 if (!oh || oh->slaves_cnt == 0) 798 if (!oh || oh->slaves_cnt == 0)
@@ -731,12 +800,14 @@ static void __iomem * __init _find_mpu_rt_base(struct omap_hwmod *oh, u8 index)
731 800
732 os = oh->slaves[index]; 801 os = oh->slaves[index];
733 802
734 for (i = 0, mem = os->addr; i < os->addr_cnt; i++, mem++) { 803 if (!os->addr)
735 if (mem->flags & ADDR_TYPE_RT) { 804 return NULL;
805
806 do {
807 mem = &os->addr[i++];
808 if (mem->flags & ADDR_TYPE_RT)
736 found = 1; 809 found = 1;
737 break; 810 } while (!found && mem->pa_start != mem->pa_end);
738 }
739 }
740 811
741 if (found) { 812 if (found) {
742 va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start); 813 va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start);
@@ -781,8 +852,16 @@ static void _enable_sysc(struct omap_hwmod *oh)
781 } 852 }
782 853
783 if (sf & SYSC_HAS_MIDLEMODE) { 854 if (sf & SYSC_HAS_MIDLEMODE) {
784 idlemode = (oh->flags & HWMOD_SWSUP_MSTANDBY) ? 855 if (oh->flags & HWMOD_SWSUP_MSTANDBY) {
785 HWMOD_IDLEMODE_NO : HWMOD_IDLEMODE_SMART; 856 idlemode = HWMOD_IDLEMODE_NO;
857 } else {
858 if (sf & SYSC_HAS_ENAWAKEUP)
859 _enable_wakeup(oh, &v);
860 if (oh->class->sysc->idlemodes & MSTANDBY_SMART_WKUP)
861 idlemode = HWMOD_IDLEMODE_SMART_WKUP;
862 else
863 idlemode = HWMOD_IDLEMODE_SMART;
864 }
786 _set_master_standbymode(oh, idlemode, &v); 865 _set_master_standbymode(oh, idlemode, &v);
787 } 866 }
788 867
@@ -840,8 +919,16 @@ static void _idle_sysc(struct omap_hwmod *oh)
840 } 919 }
841 920
842 if (sf & SYSC_HAS_MIDLEMODE) { 921 if (sf & SYSC_HAS_MIDLEMODE) {
843 idlemode = (oh->flags & HWMOD_SWSUP_MSTANDBY) ? 922 if (oh->flags & HWMOD_SWSUP_MSTANDBY) {
844 HWMOD_IDLEMODE_FORCE : HWMOD_IDLEMODE_SMART; 923 idlemode = HWMOD_IDLEMODE_FORCE;
924 } else {
925 if (sf & SYSC_HAS_ENAWAKEUP)
926 _enable_wakeup(oh, &v);
927 if (oh->class->sysc->idlemodes & MSTANDBY_SMART_WKUP)
928 idlemode = HWMOD_IDLEMODE_SMART_WKUP;
929 else
930 idlemode = HWMOD_IDLEMODE_SMART;
931 }
845 _set_master_standbymode(oh, idlemode, &v); 932 _set_master_standbymode(oh, idlemode, &v);
846 } 933 }
847 934
@@ -928,6 +1015,8 @@ static int _init_clocks(struct omap_hwmod *oh, void *data)
928 1015
929 if (!ret) 1016 if (!ret)
930 oh->_state = _HWMOD_STATE_CLKS_INITED; 1017 oh->_state = _HWMOD_STATE_CLKS_INITED;
1018 else
1019 pr_warning("omap_hwmod: %s: cannot _init_clocks\n", oh->name);
931 1020
932 return ret; 1021 return ret;
933} 1022}
@@ -1224,6 +1313,8 @@ static int _enable(struct omap_hwmod *oh)
1224{ 1313{
1225 int r; 1314 int r;
1226 1315
1316 pr_debug("omap_hwmod: %s: enabling\n", oh->name);
1317
1227 if (oh->_state != _HWMOD_STATE_INITIALIZED && 1318 if (oh->_state != _HWMOD_STATE_INITIALIZED &&
1228 oh->_state != _HWMOD_STATE_IDLE && 1319 oh->_state != _HWMOD_STATE_IDLE &&
1229 oh->_state != _HWMOD_STATE_DISABLED) { 1320 oh->_state != _HWMOD_STATE_DISABLED) {
@@ -1232,17 +1323,6 @@ static int _enable(struct omap_hwmod *oh)
1232 return -EINVAL; 1323 return -EINVAL;
1233 } 1324 }
1234 1325
1235 pr_debug("omap_hwmod: %s: enabling\n", oh->name);
1236
1237 /*
1238 * If an IP contains only one HW reset line, then de-assert it in order
1239 * to allow to enable the clocks. Otherwise the PRCM will return
1240 * Intransition status, and the init will failed.
1241 */
1242 if ((oh->_state == _HWMOD_STATE_INITIALIZED ||
1243 oh->_state == _HWMOD_STATE_DISABLED) && oh->rst_lines_cnt == 1)
1244 _deassert_hardreset(oh, oh->rst_lines[0].name);
1245
1246 /* Mux pins for device runtime if populated */ 1326 /* Mux pins for device runtime if populated */
1247 if (oh->mux && (!oh->mux->enabled || 1327 if (oh->mux && (!oh->mux->enabled ||
1248 ((oh->_state == _HWMOD_STATE_IDLE) && 1328 ((oh->_state == _HWMOD_STATE_IDLE) &&
@@ -1252,20 +1332,31 @@ static int _enable(struct omap_hwmod *oh)
1252 _add_initiator_dep(oh, mpu_oh); 1332 _add_initiator_dep(oh, mpu_oh);
1253 _enable_clocks(oh); 1333 _enable_clocks(oh);
1254 1334
1255 r = _wait_target_ready(oh); 1335 /*
1256 if (!r) { 1336 * If an IP contains only one HW reset line, then de-assert it in order
1257 oh->_state = _HWMOD_STATE_ENABLED; 1337 * to allow the module state transition. Otherwise the PRCM will return
1338 * Intransition status, and the init will failed.
1339 */
1340 if ((oh->_state == _HWMOD_STATE_INITIALIZED ||
1341 oh->_state == _HWMOD_STATE_DISABLED) && oh->rst_lines_cnt == 1)
1342 _deassert_hardreset(oh, oh->rst_lines[0].name);
1258 1343
1259 /* Access the sysconfig only if the target is ready */ 1344 r = _wait_target_ready(oh);
1260 if (oh->class->sysc) { 1345 if (r) {
1261 if (!(oh->_int_flags & _HWMOD_SYSCONFIG_LOADED))
1262 _update_sysc_cache(oh);
1263 _enable_sysc(oh);
1264 }
1265 } else {
1266 _disable_clocks(oh);
1267 pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n", 1346 pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n",
1268 oh->name, r); 1347 oh->name, r);
1348 _disable_clocks(oh);
1349
1350 return r;
1351 }
1352
1353 oh->_state = _HWMOD_STATE_ENABLED;
1354
1355 /* Access the sysconfig only if the target is ready */
1356 if (oh->class->sysc) {
1357 if (!(oh->_int_flags & _HWMOD_SYSCONFIG_LOADED))
1358 _update_sysc_cache(oh);
1359 _enable_sysc(oh);
1269 } 1360 }
1270 1361
1271 return r; 1362 return r;
@@ -1281,14 +1372,14 @@ static int _enable(struct omap_hwmod *oh)
1281 */ 1372 */
1282static int _idle(struct omap_hwmod *oh) 1373static int _idle(struct omap_hwmod *oh)
1283{ 1374{
1375 pr_debug("omap_hwmod: %s: idling\n", oh->name);
1376
1284 if (oh->_state != _HWMOD_STATE_ENABLED) { 1377 if (oh->_state != _HWMOD_STATE_ENABLED) {
1285 WARN(1, "omap_hwmod: %s: idle state can only be entered from " 1378 WARN(1, "omap_hwmod: %s: idle state can only be entered from "
1286 "enabled state\n", oh->name); 1379 "enabled state\n", oh->name);
1287 return -EINVAL; 1380 return -EINVAL;
1288 } 1381 }
1289 1382
1290 pr_debug("omap_hwmod: %s: idling\n", oh->name);
1291
1292 if (oh->class->sysc) 1383 if (oh->class->sysc)
1293 _idle_sysc(oh); 1384 _idle_sysc(oh);
1294 _del_initiator_dep(oh, mpu_oh); 1385 _del_initiator_dep(oh, mpu_oh);
@@ -1374,15 +1465,11 @@ static int _shutdown(struct omap_hwmod *oh)
1374 } 1465 }
1375 } 1466 }
1376 1467
1377 if (oh->class->sysc) 1468 if (oh->class->sysc) {
1469 if (oh->_state == _HWMOD_STATE_IDLE)
1470 _enable(oh);
1378 _shutdown_sysc(oh); 1471 _shutdown_sysc(oh);
1379 1472 }
1380 /*
1381 * If an IP contains only one HW reset line, then assert it
1382 * before disabling the clocks and shutting down the IP.
1383 */
1384 if (oh->rst_lines_cnt == 1)
1385 _assert_hardreset(oh, oh->rst_lines[0].name);
1386 1473
1387 /* clocks and deps are already disabled in idle */ 1474 /* clocks and deps are already disabled in idle */
1388 if (oh->_state == _HWMOD_STATE_ENABLED) { 1475 if (oh->_state == _HWMOD_STATE_ENABLED) {
@@ -1392,6 +1479,13 @@ static int _shutdown(struct omap_hwmod *oh)
1392 } 1479 }
1393 /* XXX Should this code also force-disable the optional clocks? */ 1480 /* XXX Should this code also force-disable the optional clocks? */
1394 1481
1482 /*
1483 * If an IP contains only one HW reset line, then assert it
1484 * after disabling the clocks and before shutting down the IP.
1485 */
1486 if (oh->rst_lines_cnt == 1)
1487 _assert_hardreset(oh, oh->rst_lines[0].name);
1488
1395 /* Mux pins to safe mode or use populated off mode values */ 1489 /* Mux pins to safe mode or use populated off mode values */
1396 if (oh->mux) 1490 if (oh->mux)
1397 omap_hwmod_mux(oh->mux, _HWMOD_STATE_DISABLED); 1491 omap_hwmod_mux(oh->mux, _HWMOD_STATE_DISABLED);
@@ -1562,6 +1656,33 @@ void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs)
1562} 1656}
1563 1657
1564/** 1658/**
1659 * omap_hwmod_softreset - reset a module via SYSCONFIG.SOFTRESET bit
1660 * @oh: struct omap_hwmod *
1661 *
1662 * This is a public function exposed to drivers. Some drivers may need to do
1663 * some settings before and after resetting the device. Those drivers after
1664 * doing the necessary settings could use this function to start a reset by
1665 * setting the SYSCONFIG.SOFTRESET bit.
1666 */
1667int omap_hwmod_softreset(struct omap_hwmod *oh)
1668{
1669 u32 v;
1670 int ret;
1671
1672 if (!oh || !(oh->_sysc_cache))
1673 return -EINVAL;
1674
1675 v = oh->_sysc_cache;
1676 ret = _set_softreset(oh, &v);
1677 if (ret)
1678 goto error;
1679 _write_sysconfig(v, oh);
1680
1681error:
1682 return ret;
1683}
1684
1685/**
1565 * omap_hwmod_set_slave_idlemode - set the hwmod's OCP slave idlemode 1686 * omap_hwmod_set_slave_idlemode - set the hwmod's OCP slave idlemode
1566 * @oh: struct omap_hwmod * 1687 * @oh: struct omap_hwmod *
1567 * @idlemode: SIDLEMODE field bits (shifted to bit 0) 1688 * @idlemode: SIDLEMODE field bits (shifted to bit 0)
@@ -1685,9 +1806,6 @@ static int __init _populate_mpu_rt_base(struct omap_hwmod *oh, void *data)
1685 return 0; 1806 return 0;
1686 1807
1687 oh->_mpu_rt_va = _find_mpu_rt_base(oh, oh->_mpu_port_index); 1808 oh->_mpu_rt_va = _find_mpu_rt_base(oh, oh->_mpu_port_index);
1688 if (!oh->_mpu_rt_va)
1689 pr_warning("omap_hwmod: %s found no _mpu_rt_va for %s\n",
1690 __func__, oh->name);
1691 1809
1692 return 0; 1810 return 0;
1693} 1811}
@@ -1939,10 +2057,10 @@ int omap_hwmod_count_resources(struct omap_hwmod *oh)
1939{ 2057{
1940 int ret, i; 2058 int ret, i;
1941 2059
1942 ret = oh->mpu_irqs_cnt + oh->sdma_reqs_cnt; 2060 ret = _count_mpu_irqs(oh) + _count_sdma_reqs(oh);
1943 2061
1944 for (i = 0; i < oh->slaves_cnt; i++) 2062 for (i = 0; i < oh->slaves_cnt; i++)
1945 ret += oh->slaves[i]->addr_cnt; 2063 ret += _count_ocp_if_addr_spaces(oh->slaves[i]);
1946 2064
1947 return ret; 2065 return ret;
1948} 2066}
@@ -1959,12 +2077,13 @@ int omap_hwmod_count_resources(struct omap_hwmod *oh)
1959 */ 2077 */
1960int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res) 2078int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)
1961{ 2079{
1962 int i, j; 2080 int i, j, mpu_irqs_cnt, sdma_reqs_cnt;
1963 int r = 0; 2081 int r = 0;
1964 2082
1965 /* For each IRQ, DMA, memory area, fill in array.*/ 2083 /* For each IRQ, DMA, memory area, fill in array.*/
1966 2084
1967 for (i = 0; i < oh->mpu_irqs_cnt; i++) { 2085 mpu_irqs_cnt = _count_mpu_irqs(oh);
2086 for (i = 0; i < mpu_irqs_cnt; i++) {
1968 (res + r)->name = (oh->mpu_irqs + i)->name; 2087 (res + r)->name = (oh->mpu_irqs + i)->name;
1969 (res + r)->start = (oh->mpu_irqs + i)->irq; 2088 (res + r)->start = (oh->mpu_irqs + i)->irq;
1970 (res + r)->end = (oh->mpu_irqs + i)->irq; 2089 (res + r)->end = (oh->mpu_irqs + i)->irq;
@@ -1972,7 +2091,8 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)
1972 r++; 2091 r++;
1973 } 2092 }
1974 2093
1975 for (i = 0; i < oh->sdma_reqs_cnt; i++) { 2094 sdma_reqs_cnt = _count_sdma_reqs(oh);
2095 for (i = 0; i < sdma_reqs_cnt; i++) {
1976 (res + r)->name = (oh->sdma_reqs + i)->name; 2096 (res + r)->name = (oh->sdma_reqs + i)->name;
1977 (res + r)->start = (oh->sdma_reqs + i)->dma_req; 2097 (res + r)->start = (oh->sdma_reqs + i)->dma_req;
1978 (res + r)->end = (oh->sdma_reqs + i)->dma_req; 2098 (res + r)->end = (oh->sdma_reqs + i)->dma_req;
@@ -1982,10 +2102,12 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)
1982 2102
1983 for (i = 0; i < oh->slaves_cnt; i++) { 2103 for (i = 0; i < oh->slaves_cnt; i++) {
1984 struct omap_hwmod_ocp_if *os; 2104 struct omap_hwmod_ocp_if *os;
2105 int addr_cnt;
1985 2106
1986 os = oh->slaves[i]; 2107 os = oh->slaves[i];
2108 addr_cnt = _count_ocp_if_addr_spaces(os);
1987 2109
1988 for (j = 0; j < os->addr_cnt; j++) { 2110 for (j = 0; j < addr_cnt; j++) {
1989 (res + r)->name = (os->addr + j)->name; 2111 (res + r)->name = (os->addr + j)->name;
1990 (res + r)->start = (os->addr + j)->pa_start; 2112 (res + r)->start = (os->addr + j)->pa_start;
1991 (res + r)->end = (os->addr + j)->pa_end; 2113 (res + r)->end = (os->addr + j)->pa_end;