Skip to content

Commit 23a2f39

Browse files
haukelinvjw
authored andcommitted
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: Hauke Mehrtens <hauke@hauke-m.de> CC: linux-usb@vger.kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 367b341 commit 23a2f39

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎drivers/bcma/scan.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
276276
struct bcma_device *core)
277277
{
278278
u32 tmp;
279-
u8 i, j;
279+
u8 i, j, k;
280280
s32 cia, cib;
281281
u8 ports[2], wrappers[2];
282282

@@ -367,6 +367,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
367367
core->addr = tmp;
368368

369369
/* get & parse slave ports */
370+
k = 0;
370371
for (i = 0; i < ports[1]; i++) {
371372
for (j = 0; ; j++) {
372373
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,
376377
/* pr_debug("erom: slave port %d "
377378
* "has %d descriptors\n", i, j); */
378379
break;
379-
} else {
380-
if (i == 0 && j == 0)
381-
core->addr1 = tmp;
380+
} else if (k < ARRAY_SIZE(core->addr_s)) {
381+
core->addr_s[k] = tmp;
382+
k++;
382383
}
383384
}
384385
}

‎drivers/usb/host/bcma-hcd.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static int bcma_hcd_probe(struct bcma_device *dev)
237237
bcma_hcd_init_chip(dev);
238238

239239
/* In AI chips EHCI is addrspace 0, OHCI is 1 */
240-
ohci_addr = dev->addr1;
240+
ohci_addr = dev->addr_s[0];
241241
if ((chipinfo->id == 0x5357 || chipinfo->id == 0x4749)
242242
&& chipinfo->rev == 0)
243243
ohci_addr = 0x18009000;

‎include/linux/bcma/bcma.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ struct bcma_device {
267267
u8 core_unit;
268268

269269
u32 addr;
270-
u32 addr1;
270+
u32 addr_s[8];
271271
u32 wrap;
272272

273273
void __iomem *io_addr;

0 commit comments

Comments
 (0)