bcm53xx: add support for the PCIe controller
[openwrt/staging/chunkeey.git] / target / linux / bcm53xx / patches-3.14 / 141-bcma-store-more-alternative-addresses.patch
1 From 9317024aa1d8df94d3b021bc23b57f02a435e96c Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Mon, 12 May 2014 21:57:53 +0200
4 Subject: [PATCH 10/15] bcma: store more alternative addresses
5
6 Each core could have more than one alternative address. There are cores
7 with 8 alternative addresses for different functions. The PHY control
8 in the Chip common B core is done through the 2. alternative address
9 and not the first one.
10
11 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
12 ---
13 drivers/bcma/scan.c | 9 +++++----
14 drivers/usb/host/bcma-hcd.c | 2 +-
15 include/linux/bcma/bcma.h | 2 +-
16 3 files changed, 7 insertions(+), 6 deletions(-)
17
18 --- a/drivers/bcma/scan.c
19 +++ b/drivers/bcma/scan.c
20 @@ -276,7 +276,7 @@ static int bcma_get_next_core(struct bcm
21 struct bcma_device *core)
22 {
23 u32 tmp;
24 - u8 i, j;
25 + u8 i, j, k;
26 s32 cia, cib;
27 u8 ports[2], wrappers[2];
28
29 @@ -367,6 +367,7 @@ static int bcma_get_next_core(struct bcm
30 core->addr = tmp;
31
32 /* get & parse slave ports */
33 + k = 0;
34 for (i = 0; i < ports[1]; i++) {
35 for (j = 0; ; j++) {
36 tmp = bcma_erom_get_addr_desc(bus, eromptr,
37 @@ -376,9 +377,9 @@ static int bcma_get_next_core(struct bcm
38 /* pr_debug("erom: slave port %d "
39 * "has %d descriptors\n", i, j); */
40 break;
41 - } else {
42 - if (i == 0 && j == 0)
43 - core->addr1 = tmp;
44 + } else if (k < 8) {
45 + core->addr_s[k] = tmp;
46 + k++;
47 }
48 }
49 }
50 --- a/drivers/usb/host/bcma-hcd.c
51 +++ b/drivers/usb/host/bcma-hcd.c
52 @@ -237,7 +237,7 @@ static int bcma_hcd_probe(struct bcma_de
53 bcma_hcd_init_chip(dev);
54
55 /* In AI chips EHCI is addrspace 0, OHCI is 1 */
56 - ohci_addr = dev->addr1;
57 + ohci_addr = dev->addr_s[0];
58 if ((chipinfo->id == 0x5357 || chipinfo->id == 0x4749)
59 && chipinfo->rev == 0)
60 ohci_addr = 0x18009000;
61 --- a/include/linux/bcma/bcma.h
62 +++ b/include/linux/bcma/bcma.h
63 @@ -263,7 +263,7 @@ struct bcma_device {
64 u8 core_unit;
65
66 u32 addr;
67 - u32 addr1;
68 + u32 addr_s[8];
69 u32 wrap;
70
71 void __iomem *io_addr;