aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bcma
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-02-08 13:16:17 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-02-08 13:16:17 -0500
commitf5237f278f30a92401539a54f87ee0c717b6f818 (patch)
tree209d4fd6fb00e660c76ca8ac5d4caed59dbb9957 /drivers/bcma
parentb285109dde7b873b5dc671ef1b3ae3090f4bc72f (diff)
parentb26f5f09ebdeb85ab152344cc1d6d484a3ce967d (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Diffstat (limited to 'drivers/bcma')
-rw-r--r--drivers/bcma/bcma_private.h1
-rw-r--r--drivers/bcma/driver_chipcommon_nflash.c4
-rw-r--r--drivers/bcma/driver_chipcommon_sflash.c4
-rw-r--r--drivers/bcma/driver_gpio.c11
-rw-r--r--drivers/bcma/driver_mips.c38
-rw-r--r--drivers/bcma/main.c8
6 files changed, 57 insertions, 9 deletions
diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
index 04f7c86ea3d8..6f377bd1a6d6 100644
--- a/drivers/bcma/bcma_private.h
+++ b/drivers/bcma/bcma_private.h
@@ -47,6 +47,7 @@ int bcma_sprom_get(struct bcma_bus *bus);
47/* driver_chipcommon.c */ 47/* driver_chipcommon.c */
48#ifdef CONFIG_BCMA_DRIVER_MIPS 48#ifdef CONFIG_BCMA_DRIVER_MIPS
49void bcma_chipco_serial_init(struct bcma_drv_cc *cc); 49void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
50extern struct platform_device bcma_pflash_dev;
50#endif /* CONFIG_BCMA_DRIVER_MIPS */ 51#endif /* CONFIG_BCMA_DRIVER_MIPS */
51 52
52/* driver_chipcommon_pmu.c */ 53/* driver_chipcommon_pmu.c */
diff --git a/drivers/bcma/driver_chipcommon_nflash.c b/drivers/bcma/driver_chipcommon_nflash.c
index 1f0b83e18f68..d4f699aef8c4 100644
--- a/drivers/bcma/driver_chipcommon_nflash.c
+++ b/drivers/bcma/driver_chipcommon_nflash.c
@@ -5,11 +5,11 @@
5 * Licensed under the GNU/GPL. See COPYING for details. 5 * Licensed under the GNU/GPL. See COPYING for details.
6 */ 6 */
7 7
8#include "bcma_private.h"
9
8#include <linux/platform_device.h> 10#include <linux/platform_device.h>
9#include <linux/bcma/bcma.h> 11#include <linux/bcma/bcma.h>
10 12
11#include "bcma_private.h"
12
13struct platform_device bcma_nflash_dev = { 13struct platform_device bcma_nflash_dev = {
14 .name = "bcma_nflash", 14 .name = "bcma_nflash",
15 .num_resources = 0, 15 .num_resources = 0,
diff --git a/drivers/bcma/driver_chipcommon_sflash.c b/drivers/bcma/driver_chipcommon_sflash.c
index 1e694db4532d..e6ed4fe5dced 100644
--- a/drivers/bcma/driver_chipcommon_sflash.c
+++ b/drivers/bcma/driver_chipcommon_sflash.c
@@ -5,11 +5,11 @@
5 * Licensed under the GNU/GPL. See COPYING for details. 5 * Licensed under the GNU/GPL. See COPYING for details.
6 */ 6 */
7 7
8#include "bcma_private.h"
9
8#include <linux/platform_device.h> 10#include <linux/platform_device.h>
9#include <linux/bcma/bcma.h> 11#include <linux/bcma/bcma.h>
10 12
11#include "bcma_private.h"
12
13static struct resource bcma_sflash_resource = { 13static struct resource bcma_sflash_resource = {
14 .name = "bcma_sflash", 14 .name = "bcma_sflash",
15 .start = BCMA_SOC_FLASH2, 15 .start = BCMA_SOC_FLASH2,
diff --git a/drivers/bcma/driver_gpio.c b/drivers/bcma/driver_gpio.c
index 9a6f585da2d9..0b5df538dfd9 100644
--- a/drivers/bcma/driver_gpio.c
+++ b/drivers/bcma/driver_gpio.c
@@ -73,6 +73,16 @@ static void bcma_gpio_free(struct gpio_chip *chip, unsigned gpio)
73 bcma_chipco_gpio_pullup(cc, 1 << gpio, 0); 73 bcma_chipco_gpio_pullup(cc, 1 << gpio, 0);
74} 74}
75 75
76static int bcma_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
77{
78 struct bcma_drv_cc *cc = bcma_gpio_get_cc(chip);
79
80 if (cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC)
81 return bcma_core_irq(cc->core);
82 else
83 return -EINVAL;
84}
85
76int bcma_gpio_init(struct bcma_drv_cc *cc) 86int bcma_gpio_init(struct bcma_drv_cc *cc)
77{ 87{
78 struct gpio_chip *chip = &cc->gpio; 88 struct gpio_chip *chip = &cc->gpio;
@@ -85,6 +95,7 @@ int bcma_gpio_init(struct bcma_drv_cc *cc)
85 chip->set = bcma_gpio_set_value; 95 chip->set = bcma_gpio_set_value;
86 chip->direction_input = bcma_gpio_direction_input; 96 chip->direction_input = bcma_gpio_direction_input;
87 chip->direction_output = bcma_gpio_direction_output; 97 chip->direction_output = bcma_gpio_direction_output;
98 chip->to_irq = bcma_gpio_to_irq;
88 chip->ngpio = 16; 99 chip->ngpio = 16;
89 /* There is just one SoC in one device and its GPIO addresses should be 100 /* There is just one SoC in one device and its GPIO addresses should be
90 * deterministic to address them more easily. The other buses could get 101 * deterministic to address them more easily. The other buses could get
diff --git a/drivers/bcma/driver_mips.c b/drivers/bcma/driver_mips.c
index 9fe86ee16c66..9a7f0e3ab5a3 100644
--- a/drivers/bcma/driver_mips.c
+++ b/drivers/bcma/driver_mips.c
@@ -14,11 +14,33 @@
14 14
15#include <linux/bcma/bcma.h> 15#include <linux/bcma/bcma.h>
16 16
17#include <linux/mtd/physmap.h>
18#include <linux/platform_device.h>
17#include <linux/serial.h> 19#include <linux/serial.h>
18#include <linux/serial_core.h> 20#include <linux/serial_core.h>
19#include <linux/serial_reg.h> 21#include <linux/serial_reg.h>
20#include <linux/time.h> 22#include <linux/time.h>
21 23
24static const char *part_probes[] = { "bcm47xxpart", NULL };
25
26static struct physmap_flash_data bcma_pflash_data = {
27 .part_probe_types = part_probes,
28};
29
30static struct resource bcma_pflash_resource = {
31 .name = "bcma_pflash",
32 .flags = IORESOURCE_MEM,
33};
34
35struct platform_device bcma_pflash_dev = {
36 .name = "physmap-flash",
37 .dev = {
38 .platform_data = &bcma_pflash_data,
39 },
40 .resource = &bcma_pflash_resource,
41 .num_resources = 1,
42};
43
22/* The 47162a0 hangs when reading MIPS DMP registers registers */ 44/* The 47162a0 hangs when reading MIPS DMP registers registers */
23static inline bool bcma_core_mips_bcm47162a0_quirk(struct bcma_device *dev) 45static inline bool bcma_core_mips_bcm47162a0_quirk(struct bcma_device *dev)
24{ 46{
@@ -211,6 +233,7 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore)
211{ 233{
212 struct bcma_bus *bus = mcore->core->bus; 234 struct bcma_bus *bus = mcore->core->bus;
213 struct bcma_drv_cc *cc = &bus->drv_cc; 235 struct bcma_drv_cc *cc = &bus->drv_cc;
236 struct bcma_pflash *pflash = &cc->pflash;
214 237
215 switch (cc->capabilities & BCMA_CC_CAP_FLASHT) { 238 switch (cc->capabilities & BCMA_CC_CAP_FLASHT) {
216 case BCMA_CC_FLASHT_STSER: 239 case BCMA_CC_FLASHT_STSER:
@@ -220,15 +243,20 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore)
220 break; 243 break;
221 case BCMA_CC_FLASHT_PARA: 244 case BCMA_CC_FLASHT_PARA:
222 bcma_debug(bus, "Found parallel flash\n"); 245 bcma_debug(bus, "Found parallel flash\n");
223 cc->pflash.present = true; 246 pflash->present = true;
224 cc->pflash.window = BCMA_SOC_FLASH2; 247 pflash->window = BCMA_SOC_FLASH2;
225 cc->pflash.window_size = BCMA_SOC_FLASH2_SZ; 248 pflash->window_size = BCMA_SOC_FLASH2_SZ;
226 249
227 if ((bcma_read32(cc->core, BCMA_CC_FLASH_CFG) & 250 if ((bcma_read32(cc->core, BCMA_CC_FLASH_CFG) &
228 BCMA_CC_FLASH_CFG_DS) == 0) 251 BCMA_CC_FLASH_CFG_DS) == 0)
229 cc->pflash.buswidth = 1; 252 pflash->buswidth = 1;
230 else 253 else
231 cc->pflash.buswidth = 2; 254 pflash->buswidth = 2;
255
256 bcma_pflash_data.width = pflash->buswidth;
257 bcma_pflash_resource.start = pflash->window;
258 bcma_pflash_resource.end = pflash->window + pflash->window_size;
259
232 break; 260 break;
233 default: 261 default:
234 bcma_err(bus, "Flash type not supported\n"); 262 bcma_err(bus, "Flash type not supported\n");
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index ff8528925322..6eda7ef0682f 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -149,6 +149,14 @@ static int bcma_register_cores(struct bcma_bus *bus)
149 dev_id++; 149 dev_id++;
150 } 150 }
151 151
152#ifdef CONFIG_BCMA_DRIVER_MIPS
153 if (bus->drv_cc.pflash.present) {
154 err = platform_device_register(&bcma_pflash_dev);
155 if (err)
156 bcma_err(bus, "Error registering parallel flash\n");
157 }
158#endif
159
152#ifdef CONFIG_BCMA_SFLASH 160#ifdef CONFIG_BCMA_SFLASH
153 if (bus->drv_cc.sflash.present) { 161 if (bus->drv_cc.sflash.present) {
154 err = platform_device_register(&bcma_sflash_dev); 162 err = platform_device_register(&bcma_sflash_dev);