Skip to content

Commit b38d355

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts: drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsparser.c drivers/staging/ath6kl/os/linux/ar6000_drv.c
2 parents ca1ba7c + af2bf4b commit b38d355

321 files changed

Lines changed: 22561 additions & 54152 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/mips/Kconfig‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,8 @@ config BCM47XX
9191
select DMA_NONCOHERENT
9292
select HW_HAS_PCI
9393
select IRQ_CPU
94-
select SYS_HAS_CPU_MIPS32_R1
9594
select SYS_SUPPORTS_32BIT_KERNEL
9695
select SYS_SUPPORTS_LITTLE_ENDIAN
97-
select SSB
98-
select SSB_DRIVER_MIPS
99-
select SSB_DRIVER_EXTIF
100-
select SSB_EMBEDDED
101-
select SSB_B43_PCI_BRIDGE if PCI
102-
select SSB_PCICORE_HOSTMODE if PCI
10396
select GENERIC_GPIO
10497
select SYS_HAS_EARLY_PRINTK
10598
select CFE
@@ -788,6 +781,7 @@ endchoice
788781

789782
source "arch/mips/alchemy/Kconfig"
790783
source "arch/mips/ath79/Kconfig"
784+
source "arch/mips/bcm47xx/Kconfig"
791785
source "arch/mips/bcm63xx/Kconfig"
792786
source "arch/mips/jazz/Kconfig"
793787
source "arch/mips/jz4740/Kconfig"

‎arch/mips/bcm47xx/Kconfig‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
if BCM47XX
2+
3+
config BCM47XX_SSB
4+
bool "SSB Support for Broadcom BCM47XX"
5+
select SYS_HAS_CPU_MIPS32_R1
6+
select SSB
7+
select SSB_DRIVER_MIPS
8+
select SSB_DRIVER_EXTIF
9+
select SSB_EMBEDDED
10+
select SSB_B43_PCI_BRIDGE if PCI
11+
select SSB_PCICORE_HOSTMODE if PCI
12+
default y
13+
help
14+
Add support for old Broadcom BCM47xx boards with Sonics Silicon Backplane support.
15+
16+
This will generate an image with support for SSB and MIPS32 R1 instruction set.
17+
18+
config BCM47XX_BCMA
19+
bool "BCMA Support for Broadcom BCM47XX"
20+
select SYS_HAS_CPU_MIPS32_R2
21+
select BCMA
22+
select BCMA_HOST_SOC
23+
select BCMA_DRIVER_MIPS
24+
select BCMA_DRIVER_PCI_HOSTMODE if PCI
25+
default y
26+
help
27+
Add support for new Broadcom BCM47xx boards with Broadcom specific Advanced Microcontroller Bus.
28+
29+
This will generate an image with support for BCMA and MIPS32 R2 instruction set.
30+
31+
endif

‎arch/mips/bcm47xx/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
# under Linux.
44
#
55

6-
obj-y := gpio.o irq.o nvram.o prom.o serial.o setup.o time.o wgt634u.o
6+
obj-y += gpio.o irq.o nvram.o prom.o serial.o setup.o time.o
7+
obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o

‎arch/mips/bcm47xx/gpio.c‎

Lines changed: 61 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,82 @@ static DECLARE_BITMAP(gpio_in_use, BCM47XX_EXTIF_GPIO_LINES);
2020

2121
int gpio_request(unsigned gpio, const char *tag)
2222
{
23-
if (ssb_chipco_available(&ssb_bcm47xx.chipco) &&
24-
((unsigned)gpio >= BCM47XX_CHIPCO_GPIO_LINES))
25-
return -EINVAL;
23+
switch (bcm47xx_bus_type) {
24+
#ifdef CONFIG_BCM47XX_SSB
25+
case BCM47XX_BUS_TYPE_SSB:
26+
if (ssb_chipco_available(&bcm47xx_bus.ssb.chipco) &&
27+
((unsigned)gpio >= BCM47XX_CHIPCO_GPIO_LINES))
28+
return -EINVAL;
2629

27-
if (ssb_extif_available(&ssb_bcm47xx.extif) &&
28-
((unsigned)gpio >= BCM47XX_EXTIF_GPIO_LINES))
29-
return -EINVAL;
30+
if (ssb_extif_available(&bcm47xx_bus.ssb.extif) &&
31+
((unsigned)gpio >= BCM47XX_EXTIF_GPIO_LINES))
32+
return -EINVAL;
3033

31-
if (test_and_set_bit(gpio, gpio_in_use))
32-
return -EBUSY;
34+
if (test_and_set_bit(gpio, gpio_in_use))
35+
return -EBUSY;
3336

34-
return 0;
37+
return 0;
38+
#endif
39+
#ifdef CONFIG_BCM47XX_BCMA
40+
case BCM47XX_BUS_TYPE_BCMA:
41+
if (gpio >= BCM47XX_CHIPCO_GPIO_LINES)
42+
return -EINVAL;
43+
44+
if (test_and_set_bit(gpio, gpio_in_use))
45+
return -EBUSY;
46+
47+
return 0;
48+
#endif
49+
}
50+
return -EINVAL;
3551
}
3652
EXPORT_SYMBOL(gpio_request);
3753

3854
void gpio_free(unsigned gpio)
3955
{
40-
if (ssb_chipco_available(&ssb_bcm47xx.chipco) &&
41-
((unsigned)gpio >= BCM47XX_CHIPCO_GPIO_LINES))
42-
return;
56+
switch (bcm47xx_bus_type) {
57+
#ifdef CONFIG_BCM47XX_SSB
58+
case BCM47XX_BUS_TYPE_SSB:
59+
if (ssb_chipco_available(&bcm47xx_bus.ssb.chipco) &&
60+
((unsigned)gpio >= BCM47XX_CHIPCO_GPIO_LINES))
61+
return;
62+
63+
if (ssb_extif_available(&bcm47xx_bus.ssb.extif) &&
64+
((unsigned)gpio >= BCM47XX_EXTIF_GPIO_LINES))
65+
return;
4366

44-
if (ssb_extif_available(&ssb_bcm47xx.extif) &&
45-
((unsigned)gpio >= BCM47XX_EXTIF_GPIO_LINES))
67+
clear_bit(gpio, gpio_in_use);
4668
return;
69+
#endif
70+
#ifdef CONFIG_BCM47XX_BCMA
71+
case BCM47XX_BUS_TYPE_BCMA:
72+
if (gpio >= BCM47XX_CHIPCO_GPIO_LINES)
73+
return;
4774

48-
clear_bit(gpio, gpio_in_use);
75+
clear_bit(gpio, gpio_in_use);
76+
return;
77+
#endif
78+
}
4979
}
5080
EXPORT_SYMBOL(gpio_free);
5181

5282
int gpio_to_irq(unsigned gpio)
5383
{
54-
if (ssb_chipco_available(&ssb_bcm47xx.chipco))
55-
return ssb_mips_irq(ssb_bcm47xx.chipco.dev) + 2;
56-
else if (ssb_extif_available(&ssb_bcm47xx.extif))
57-
return ssb_mips_irq(ssb_bcm47xx.extif.dev) + 2;
58-
else
59-
return -EINVAL;
84+
switch (bcm47xx_bus_type) {
85+
#ifdef CONFIG_BCM47XX_SSB
86+
case BCM47XX_BUS_TYPE_SSB:
87+
if (ssb_chipco_available(&bcm47xx_bus.ssb.chipco))
88+
return ssb_mips_irq(bcm47xx_bus.ssb.chipco.dev) + 2;
89+
else if (ssb_extif_available(&bcm47xx_bus.ssb.extif))
90+
return ssb_mips_irq(bcm47xx_bus.ssb.extif.dev) + 2;
91+
else
92+
return -EINVAL;
93+
#endif
94+
#ifdef CONFIG_BCM47XX_BCMA
95+
case BCM47XX_BUS_TYPE_BCMA:
96+
return bcma_core_mips_irq(bcm47xx_bus.bcma.bus.drv_cc.core) + 2;
97+
#endif
98+
}
99+
return -EINVAL;
60100
}
61101
EXPORT_SYMBOL_GPL(gpio_to_irq);

‎arch/mips/bcm47xx/irq.c‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <linux/interrupt.h>
2727
#include <linux/irq.h>
2828
#include <asm/irq_cpu.h>
29+
#include <bcm47xx.h>
2930

3031
void plat_irq_dispatch(void)
3132
{
@@ -51,5 +52,16 @@ void plat_irq_dispatch(void)
5152

5253
void __init arch_init_irq(void)
5354
{
55+
#ifdef CONFIG_BCM47XX_BCMA
56+
if (bcm47xx_bus_type == BCM47XX_BUS_TYPE_BCMA) {
57+
bcma_write32(bcm47xx_bus.bcma.bus.drv_mips.core,
58+
BCMA_MIPS_MIPS74K_INTMASK(5), 1 << 31);
59+
/*
60+
* the kernel reads the timer irq from some register and thinks
61+
* it's #5, but we offset it by 2 and route to #7
62+
*/
63+
cp0_compare_irq = 7;
64+
}
65+
#endif
5466
mips_cpu_irq_init();
5567
}

‎arch/mips/bcm47xx/nvram.c‎

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,35 @@ static char nvram_buf[NVRAM_SPACE];
2626
/* Probe for NVRAM header */
2727
static void early_nvram_init(void)
2828
{
29-
struct ssb_mipscore *mcore = &ssb_bcm47xx.mipscore;
29+
#ifdef CONFIG_BCM47XX_SSB
30+
struct ssb_mipscore *mcore_ssb;
31+
#endif
32+
#ifdef CONFIG_BCM47XX_BCMA
33+
struct bcma_drv_cc *bcma_cc;
34+
#endif
3035
struct nvram_header *header;
3136
int i;
32-
u32 base, lim, off;
37+
u32 base = 0;
38+
u32 lim = 0;
39+
u32 off;
3340
u32 *src, *dst;
3441

35-
base = mcore->flash_window;
36-
lim = mcore->flash_window_size;
42+
switch (bcm47xx_bus_type) {
43+
#ifdef CONFIG_BCM47XX_SSB
44+
case BCM47XX_BUS_TYPE_SSB:
45+
mcore_ssb = &bcm47xx_bus.ssb.mipscore;
46+
base = mcore_ssb->flash_window;
47+
lim = mcore_ssb->flash_window_size;
48+
break;
49+
#endif
50+
#ifdef CONFIG_BCM47XX_BCMA
51+
case BCM47XX_BUS_TYPE_BCMA:
52+
bcma_cc = &bcm47xx_bus.bcma.bus.drv_cc;
53+
base = bcma_cc->pflash.window;
54+
lim = bcma_cc->pflash.window_size;
55+
break;
56+
#endif
57+
}
3758

3859
off = FLASH_MIN;
3960
while (off <= lim) {

‎arch/mips/bcm47xx/serial.c‎

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ static struct platform_device uart8250_device = {
2323
},
2424
};
2525

26-
static int __init uart8250_init(void)
26+
#ifdef CONFIG_BCM47XX_SSB
27+
static int __init uart8250_init_ssb(void)
2728
{
2829
int i;
29-
struct ssb_mipscore *mcore = &(ssb_bcm47xx.mipscore);
30+
struct ssb_mipscore *mcore = &(bcm47xx_bus.ssb.mipscore);
3031

3132
memset(&uart8250_data, 0, sizeof(uart8250_data));
3233

@@ -44,6 +45,47 @@ static int __init uart8250_init(void)
4445
}
4546
return platform_device_register(&uart8250_device);
4647
}
48+
#endif
49+
50+
#ifdef CONFIG_BCM47XX_BCMA
51+
static int __init uart8250_init_bcma(void)
52+
{
53+
int i;
54+
struct bcma_drv_cc *cc = &(bcm47xx_bus.bcma.bus.drv_cc);
55+
56+
memset(&uart8250_data, 0, sizeof(uart8250_data));
57+
58+
for (i = 0; i < cc->nr_serial_ports; i++) {
59+
struct plat_serial8250_port *p = &(uart8250_data[i]);
60+
struct bcma_serial_port *bcma_port;
61+
bcma_port = &(cc->serial_ports[i]);
62+
63+
p->mapbase = (unsigned int) bcma_port->regs;
64+
p->membase = (void *) bcma_port->regs;
65+
p->irq = bcma_port->irq + 2;
66+
p->uartclk = bcma_port->baud_base;
67+
p->regshift = bcma_port->reg_shift;
68+
p->iotype = UPIO_MEM;
69+
p->flags = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
70+
}
71+
return platform_device_register(&uart8250_device);
72+
}
73+
#endif
74+
75+
static int __init uart8250_init(void)
76+
{
77+
switch (bcm47xx_bus_type) {
78+
#ifdef CONFIG_BCM47XX_SSB
79+
case BCM47XX_BUS_TYPE_SSB:
80+
return uart8250_init_ssb();
81+
#endif
82+
#ifdef CONFIG_BCM47XX_BCMA
83+
case BCM47XX_BUS_TYPE_BCMA:
84+
return uart8250_init_bcma();
85+
#endif
86+
}
87+
return -EINVAL;
88+
}
4789

4890
module_init(uart8250_init);
4991

0 commit comments

Comments
 (0)