Commit 23a2f39c authored by Hauke Mehrtens's avatar Hauke Mehrtens Committed by John W. Linville

bcma: store more alternative addresses

Each core could have more than one alternative address. There are cores
with 8 alternative addresses for different functions. The PHY control
in the Chip common B core is done through the 2. alternative address
and not the first one.
Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
CC: linux-usb@vger.kernel.org
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 367b341e
...@@ -276,7 +276,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr, ...@@ -276,7 +276,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
struct bcma_device *core) struct bcma_device *core)
{ {
u32 tmp; u32 tmp;
u8 i, j; u8 i, j, k;
s32 cia, cib; s32 cia, cib;
u8 ports[2], wrappers[2]; u8 ports[2], wrappers[2];
...@@ -367,6 +367,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr, ...@@ -367,6 +367,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
core->addr = tmp; core->addr = tmp;
/* get & parse slave ports */ /* get & parse slave ports */
k = 0;
for (i = 0; i < ports[1]; i++) { for (i = 0; i < ports[1]; i++) {
for (j = 0; ; j++) { for (j = 0; ; j++) {
tmp = bcma_erom_get_addr_desc(bus, eromptr, tmp = bcma_erom_get_addr_desc(bus, eromptr,
...@@ -376,9 +377,9 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr, ...@@ -376,9 +377,9 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
/* pr_debug("erom: slave port %d " /* pr_debug("erom: slave port %d "
* "has %d descriptors\n", i, j); */ * "has %d descriptors\n", i, j); */
break; break;
} else { } else if (k < ARRAY_SIZE(core->addr_s)) {
if (i == 0 && j == 0) core->addr_s[k] = tmp;
core->addr1 = tmp; k++;
} }
} }
} }
......
...@@ -237,7 +237,7 @@ static int bcma_hcd_probe(struct bcma_device *dev) ...@@ -237,7 +237,7 @@ static int bcma_hcd_probe(struct bcma_device *dev)
bcma_hcd_init_chip(dev); bcma_hcd_init_chip(dev);
/* In AI chips EHCI is addrspace 0, OHCI is 1 */ /* In AI chips EHCI is addrspace 0, OHCI is 1 */
ohci_addr = dev->addr1; ohci_addr = dev->addr_s[0];
if ((chipinfo->id == 0x5357 || chipinfo->id == 0x4749) if ((chipinfo->id == 0x5357 || chipinfo->id == 0x4749)
&& chipinfo->rev == 0) && chipinfo->rev == 0)
ohci_addr = 0x18009000; ohci_addr = 0x18009000;
......
...@@ -267,7 +267,7 @@ struct bcma_device { ...@@ -267,7 +267,7 @@ struct bcma_device {
u8 core_unit; u8 core_unit;
u32 addr; u32 addr;
u32 addr1; u32 addr_s[8];
u32 wrap; u32 wrap;
void __iomem *io_addr; void __iomem *io_addr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment