diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2016-02-12 04:15:44 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2016-03-07 07:41:08 -0500 |
commit | d6a3b51ada68c2bd3e184f4729ce626a1721cf74 (patch) | |
tree | a328a3f4e2101ba5748ce468c3a622fcd2bbc79e /drivers/bcma/driver_mips.c | |
parent | 2e62f9b2a41e4ade1a0bb3c1bbda4defe4c67243 (diff) |
bcma: move parallel flash support to separated file
This follows the way of handling other flashes and cleans code a bit. As
next task we will want to move flash code to ChipCommon driver as:
1) Flash controllers are accesible using ChipCommon registers
2) This code isn't MIPS specific
This change prepares bcma for that.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/bcma/driver_mips.c')
-rw-r--r-- | drivers/bcma/driver_mips.c | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/drivers/bcma/driver_mips.c b/drivers/bcma/driver_mips.c index 20c134c016dc..967b0e85e2cc 100644 --- a/drivers/bcma/driver_mips.c +++ b/drivers/bcma/driver_mips.c | |||
@@ -14,8 +14,6 @@ | |||
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> | ||
19 | #include <linux/serial.h> | 17 | #include <linux/serial.h> |
20 | #include <linux/serial_core.h> | 18 | #include <linux/serial_core.h> |
21 | #include <linux/serial_reg.h> | 19 | #include <linux/serial_reg.h> |
@@ -32,26 +30,6 @@ enum bcma_boot_dev { | |||
32 | BCMA_BOOT_DEV_NAND, | 30 | BCMA_BOOT_DEV_NAND, |
33 | }; | 31 | }; |
34 | 32 | ||
35 | static const char * const part_probes[] = { "bcm47xxpart", NULL }; | ||
36 | |||
37 | static struct physmap_flash_data bcma_pflash_data = { | ||
38 | .part_probe_types = part_probes, | ||
39 | }; | ||
40 | |||
41 | static struct resource bcma_pflash_resource = { | ||
42 | .name = "bcma_pflash", | ||
43 | .flags = IORESOURCE_MEM, | ||
44 | }; | ||
45 | |||
46 | struct platform_device bcma_pflash_dev = { | ||
47 | .name = "physmap-flash", | ||
48 | .dev = { | ||
49 | .platform_data = &bcma_pflash_data, | ||
50 | }, | ||
51 | .resource = &bcma_pflash_resource, | ||
52 | .num_resources = 1, | ||
53 | }; | ||
54 | |||
55 | /* The 47162a0 hangs when reading MIPS DMP registers registers */ | 33 | /* The 47162a0 hangs when reading MIPS DMP registers registers */ |
56 | static inline bool bcma_core_mips_bcm47162a0_quirk(struct bcma_device *dev) | 34 | static inline bool bcma_core_mips_bcm47162a0_quirk(struct bcma_device *dev) |
57 | { | 35 | { |
@@ -276,7 +254,6 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore) | |||
276 | { | 254 | { |
277 | struct bcma_bus *bus = mcore->core->bus; | 255 | struct bcma_bus *bus = mcore->core->bus; |
278 | struct bcma_drv_cc *cc = &bus->drv_cc; | 256 | struct bcma_drv_cc *cc = &bus->drv_cc; |
279 | struct bcma_pflash *pflash = &cc->pflash; | ||
280 | enum bcma_boot_dev boot_dev; | 257 | enum bcma_boot_dev boot_dev; |
281 | 258 | ||
282 | switch (cc->capabilities & BCMA_CC_CAP_FLASHT) { | 259 | switch (cc->capabilities & BCMA_CC_CAP_FLASHT) { |
@@ -287,17 +264,7 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore) | |||
287 | break; | 264 | break; |
288 | case BCMA_CC_FLASHT_PARA: | 265 | case BCMA_CC_FLASHT_PARA: |
289 | bcma_debug(bus, "Found parallel flash\n"); | 266 | bcma_debug(bus, "Found parallel flash\n"); |
290 | pflash->present = true; | 267 | bcma_pflash_init(cc); |
291 | |||
292 | if ((bcma_read32(cc->core, BCMA_CC_FLASH_CFG) & | ||
293 | BCMA_CC_FLASH_CFG_DS) == 0) | ||
294 | bcma_pflash_data.width = 1; | ||
295 | else | ||
296 | bcma_pflash_data.width = 2; | ||
297 | |||
298 | bcma_pflash_resource.start = BCMA_SOC_FLASH2; | ||
299 | bcma_pflash_resource.end = BCMA_SOC_FLASH2 + BCMA_SOC_FLASH2_SZ; | ||
300 | |||
301 | break; | 268 | break; |
302 | default: | 269 | default: |
303 | bcma_err(bus, "Flash type not supported\n"); | 270 | bcma_err(bus, "Flash type not supported\n"); |