Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 1 | #include <linux/kernel.h> |
| 2 | #include <linux/module.h> |
| 3 | #include <linux/slab.h> |
Rafał Miłecki | bddcb5e | 2013-03-24 21:51:31 +0100 | [diff] [blame] | 4 | #include <linux/delay.h> |
Brian Norris | 5651d6a | 2016-02-26 11:50:28 +0100 | [diff] [blame] | 5 | #include <linux/ioport.h> |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 6 | #include <linux/mtd/mtd.h> |
| 7 | #include <linux/platform_device.h> |
| 8 | #include <linux/bcma/bcma.h> |
| 9 | |
Rafał Miłecki | a2f74a7 | 2013-01-06 21:28:50 +0100 | [diff] [blame] | 10 | #include "bcm47xxsflash.h" |
| 11 | |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 12 | MODULE_LICENSE("GPL"); |
| 13 | MODULE_DESCRIPTION("Serial flash driver for BCMA bus"); |
| 14 | |
Artem Bityutskiy | afffeec | 2013-03-12 10:50:07 +0200 | [diff] [blame] | 15 | static const char * const probes[] = { "bcm47xxpart", NULL }; |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 16 | |
Rafał Miłecki | bddcb5e | 2013-03-24 21:51:31 +0100 | [diff] [blame] | 17 | /************************************************** |
| 18 | * Various helpers |
| 19 | **************************************************/ |
| 20 | |
| 21 | static void bcm47xxsflash_cmd(struct bcm47xxsflash *b47s, u32 opcode) |
| 22 | { |
| 23 | int i; |
| 24 | |
| 25 | b47s->cc_write(b47s, BCMA_CC_FLASHCTL, BCMA_CC_FLASHCTL_START | opcode); |
| 26 | for (i = 0; i < 1000; i++) { |
| 27 | if (!(b47s->cc_read(b47s, BCMA_CC_FLASHCTL) & |
| 28 | BCMA_CC_FLASHCTL_BUSY)) |
| 29 | return; |
| 30 | cpu_relax(); |
| 31 | } |
| 32 | pr_err("Control command failed (timeout)!\n"); |
| 33 | } |
| 34 | |
| 35 | static int bcm47xxsflash_poll(struct bcm47xxsflash *b47s, int timeout) |
| 36 | { |
| 37 | unsigned long deadline = jiffies + timeout; |
| 38 | |
| 39 | do { |
| 40 | switch (b47s->type) { |
| 41 | case BCM47XXSFLASH_TYPE_ST: |
| 42 | bcm47xxsflash_cmd(b47s, OPCODE_ST_RDSR); |
| 43 | if (!(b47s->cc_read(b47s, BCMA_CC_FLASHDATA) & |
| 44 | SR_ST_WIP)) |
| 45 | return 0; |
| 46 | break; |
| 47 | case BCM47XXSFLASH_TYPE_ATMEL: |
| 48 | bcm47xxsflash_cmd(b47s, OPCODE_AT_STATUS); |
| 49 | if (b47s->cc_read(b47s, BCMA_CC_FLASHDATA) & |
| 50 | SR_AT_READY) |
| 51 | return 0; |
| 52 | break; |
| 53 | } |
| 54 | |
| 55 | cpu_relax(); |
| 56 | udelay(1); |
| 57 | } while (!time_after_eq(jiffies, deadline)); |
| 58 | |
| 59 | pr_err("Timeout waiting for flash to be ready!\n"); |
| 60 | |
| 61 | return -EBUSY; |
| 62 | } |
| 63 | |
| 64 | /************************************************** |
| 65 | * MTD ops |
| 66 | **************************************************/ |
| 67 | |
Rafał Miłecki | c0fcbc5 | 2013-05-21 21:03:46 +0200 | [diff] [blame] | 68 | static int bcm47xxsflash_erase(struct mtd_info *mtd, struct erase_info *erase) |
| 69 | { |
| 70 | struct bcm47xxsflash *b47s = mtd->priv; |
| 71 | int err; |
| 72 | |
| 73 | switch (b47s->type) { |
| 74 | case BCM47XXSFLASH_TYPE_ST: |
| 75 | bcm47xxsflash_cmd(b47s, OPCODE_ST_WREN); |
| 76 | b47s->cc_write(b47s, BCMA_CC_FLASHADDR, erase->addr); |
| 77 | /* Newer flashes have "sub-sectors" which can be erased |
| 78 | * independently with a new command: ST_SSE. The ST_SE command |
| 79 | * erases 64KB just as before. |
| 80 | */ |
| 81 | if (b47s->blocksize < (64 * 1024)) |
| 82 | bcm47xxsflash_cmd(b47s, OPCODE_ST_SSE); |
| 83 | else |
| 84 | bcm47xxsflash_cmd(b47s, OPCODE_ST_SE); |
| 85 | break; |
| 86 | case BCM47XXSFLASH_TYPE_ATMEL: |
| 87 | b47s->cc_write(b47s, BCMA_CC_FLASHADDR, erase->addr << 1); |
| 88 | bcm47xxsflash_cmd(b47s, OPCODE_AT_PAGE_ERASE); |
| 89 | break; |
| 90 | } |
| 91 | |
| 92 | err = bcm47xxsflash_poll(b47s, HZ); |
| 93 | if (err) |
| 94 | erase->state = MTD_ERASE_FAILED; |
| 95 | else |
| 96 | erase->state = MTD_ERASE_DONE; |
| 97 | |
| 98 | if (erase->callback) |
| 99 | erase->callback(erase); |
| 100 | |
| 101 | return err; |
| 102 | } |
| 103 | |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 104 | static int bcm47xxsflash_read(struct mtd_info *mtd, loff_t from, size_t len, |
| 105 | size_t *retlen, u_char *buf) |
| 106 | { |
Rafał Miłecki | a2f74a7 | 2013-01-06 21:28:50 +0100 | [diff] [blame] | 107 | struct bcm47xxsflash *b47s = mtd->priv; |
Rafał Miłecki | ccc3823 | 2017-02-08 23:53:44 +0100 | [diff] [blame] | 108 | size_t orig_len = len; |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 109 | |
| 110 | /* Check address range */ |
| 111 | if ((from + len) > mtd->size) |
| 112 | return -EINVAL; |
| 113 | |
Rafał Miłecki | ccc3823 | 2017-02-08 23:53:44 +0100 | [diff] [blame] | 114 | /* Read as much as possible using fast MMIO window */ |
| 115 | if (from < BCM47XXSFLASH_WINDOW_SZ) { |
| 116 | size_t memcpy_len; |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 117 | |
Rafał Miłecki | ccc3823 | 2017-02-08 23:53:44 +0100 | [diff] [blame] | 118 | memcpy_len = min(len, (size_t)(BCM47XXSFLASH_WINDOW_SZ - from)); |
| 119 | memcpy_fromio(buf, b47s->window + from, memcpy_len); |
| 120 | from += memcpy_len; |
| 121 | len -= memcpy_len; |
| 122 | buf += memcpy_len; |
| 123 | } |
| 124 | |
| 125 | /* Use indirect access for content out of the window */ |
| 126 | for (; len; len--) { |
| 127 | b47s->cc_write(b47s, BCMA_CC_FLASHADDR, from++); |
| 128 | bcm47xxsflash_cmd(b47s, OPCODE_ST_READ4B); |
| 129 | *buf++ = b47s->cc_read(b47s, BCMA_CC_FLASHDATA); |
| 130 | } |
| 131 | |
| 132 | *retlen = orig_len; |
| 133 | |
| 134 | return orig_len; |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 135 | } |
| 136 | |
Rafał Miłecki | 13134f4 | 2013-05-22 14:39:02 +0200 | [diff] [blame] | 137 | static int bcm47xxsflash_write_st(struct mtd_info *mtd, u32 offset, size_t len, |
| 138 | const u_char *buf) |
| 139 | { |
| 140 | struct bcm47xxsflash *b47s = mtd->priv; |
| 141 | int written = 0; |
| 142 | |
| 143 | /* Enable writes */ |
| 144 | bcm47xxsflash_cmd(b47s, OPCODE_ST_WREN); |
| 145 | |
| 146 | /* Write first byte */ |
| 147 | b47s->cc_write(b47s, BCMA_CC_FLASHADDR, offset); |
| 148 | b47s->cc_write(b47s, BCMA_CC_FLASHDATA, *buf++); |
| 149 | |
| 150 | /* Program page */ |
| 151 | if (b47s->bcma_cc->core->id.rev < 20) { |
| 152 | bcm47xxsflash_cmd(b47s, OPCODE_ST_PP); |
| 153 | return 1; /* 1B written */ |
| 154 | } |
| 155 | |
| 156 | /* Program page and set CSA (on newer chips we can continue writing) */ |
| 157 | bcm47xxsflash_cmd(b47s, OPCODE_ST_CSA | OPCODE_ST_PP); |
| 158 | offset++; |
| 159 | len--; |
| 160 | written++; |
| 161 | |
| 162 | while (len > 0) { |
| 163 | /* Page boundary, another function call is needed */ |
| 164 | if ((offset & 0xFF) == 0) |
| 165 | break; |
| 166 | |
| 167 | bcm47xxsflash_cmd(b47s, OPCODE_ST_CSA | *buf++); |
| 168 | offset++; |
| 169 | len--; |
| 170 | written++; |
| 171 | } |
| 172 | |
| 173 | /* All done, drop CSA & poll */ |
| 174 | b47s->cc_write(b47s, BCMA_CC_FLASHCTL, 0); |
| 175 | udelay(1); |
| 176 | if (bcm47xxsflash_poll(b47s, HZ / 10)) |
| 177 | pr_err("Flash rejected dropping CSA\n"); |
| 178 | |
| 179 | return written; |
| 180 | } |
| 181 | |
| 182 | static int bcm47xxsflash_write_at(struct mtd_info *mtd, u32 offset, size_t len, |
| 183 | const u_char *buf) |
| 184 | { |
| 185 | struct bcm47xxsflash *b47s = mtd->priv; |
| 186 | u32 mask = b47s->blocksize - 1; |
| 187 | u32 page = (offset & ~mask) << 1; |
| 188 | u32 byte = offset & mask; |
| 189 | int written = 0; |
| 190 | |
| 191 | /* If we don't overwrite whole page, read it to the buffer first */ |
| 192 | if (byte || (len < b47s->blocksize)) { |
| 193 | int err; |
| 194 | |
| 195 | b47s->cc_write(b47s, BCMA_CC_FLASHADDR, page); |
| 196 | bcm47xxsflash_cmd(b47s, OPCODE_AT_BUF1_LOAD); |
| 197 | /* 250 us for AT45DB321B */ |
| 198 | err = bcm47xxsflash_poll(b47s, HZ / 1000); |
| 199 | if (err) { |
| 200 | pr_err("Timeout reading page 0x%X info buffer\n", page); |
| 201 | return err; |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | /* Change buffer content with our data */ |
| 206 | while (len > 0) { |
| 207 | /* Page boundary, another function call is needed */ |
| 208 | if (byte == b47s->blocksize) |
| 209 | break; |
| 210 | |
| 211 | b47s->cc_write(b47s, BCMA_CC_FLASHADDR, byte++); |
| 212 | b47s->cc_write(b47s, BCMA_CC_FLASHDATA, *buf++); |
| 213 | bcm47xxsflash_cmd(b47s, OPCODE_AT_BUF1_WRITE); |
| 214 | len--; |
| 215 | written++; |
| 216 | } |
| 217 | |
| 218 | /* Program page with the buffer content */ |
| 219 | b47s->cc_write(b47s, BCMA_CC_FLASHADDR, page); |
| 220 | bcm47xxsflash_cmd(b47s, OPCODE_AT_BUF1_PROGRAM); |
| 221 | |
| 222 | return written; |
| 223 | } |
| 224 | |
| 225 | static int bcm47xxsflash_write(struct mtd_info *mtd, loff_t to, size_t len, |
| 226 | size_t *retlen, const u_char *buf) |
| 227 | { |
| 228 | struct bcm47xxsflash *b47s = mtd->priv; |
| 229 | int written; |
| 230 | |
| 231 | /* Writing functions can return without writing all passed data, for |
| 232 | * example when the hardware is too old or when we git page boundary. |
| 233 | */ |
| 234 | while (len > 0) { |
| 235 | switch (b47s->type) { |
| 236 | case BCM47XXSFLASH_TYPE_ST: |
| 237 | written = bcm47xxsflash_write_st(mtd, to, len, buf); |
| 238 | break; |
| 239 | case BCM47XXSFLASH_TYPE_ATMEL: |
| 240 | written = bcm47xxsflash_write_at(mtd, to, len, buf); |
| 241 | break; |
| 242 | default: |
| 243 | BUG_ON(1); |
| 244 | } |
| 245 | if (written < 0) { |
| 246 | pr_err("Error writing at offset 0x%llX\n", to); |
| 247 | return written; |
| 248 | } |
| 249 | to += (loff_t)written; |
| 250 | len -= written; |
| 251 | *retlen += written; |
| 252 | buf += written; |
| 253 | } |
| 254 | |
| 255 | return 0; |
| 256 | } |
| 257 | |
Frans Klaver | eb98198 | 2015-06-10 22:38:17 +0200 | [diff] [blame] | 258 | static void bcm47xxsflash_fill_mtd(struct bcm47xxsflash *b47s, |
| 259 | struct device *dev) |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 260 | { |
Rafał Miłecki | a2f74a7 | 2013-01-06 21:28:50 +0100 | [diff] [blame] | 261 | struct mtd_info *mtd = &b47s->mtd; |
| 262 | |
| 263 | mtd->priv = b47s; |
Frans Klaver | eb98198 | 2015-06-10 22:38:17 +0200 | [diff] [blame] | 264 | mtd->dev.parent = dev; |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 265 | mtd->name = "bcm47xxsflash"; |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 266 | |
Rafał Miłecki | 13134f4 | 2013-05-22 14:39:02 +0200 | [diff] [blame] | 267 | mtd->type = MTD_NORFLASH; |
| 268 | mtd->flags = MTD_CAP_NORFLASH; |
Rafał Miłecki | c0fcbc5 | 2013-05-21 21:03:46 +0200 | [diff] [blame] | 269 | mtd->size = b47s->size; |
| 270 | mtd->erasesize = b47s->blocksize; |
Rafał Miłecki | 13134f4 | 2013-05-22 14:39:02 +0200 | [diff] [blame] | 271 | mtd->writesize = 1; |
| 272 | mtd->writebufsize = 1; |
Rafał Miłecki | c0fcbc5 | 2013-05-21 21:03:46 +0200 | [diff] [blame] | 273 | |
| 274 | mtd->_erase = bcm47xxsflash_erase; |
| 275 | mtd->_read = bcm47xxsflash_read; |
Rafał Miłecki | 13134f4 | 2013-05-22 14:39:02 +0200 | [diff] [blame] | 276 | mtd->_write = bcm47xxsflash_write; |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 277 | } |
| 278 | |
Rafał Miłecki | f1a7c9d | 2013-02-04 08:23:08 +0100 | [diff] [blame] | 279 | /************************************************** |
| 280 | * BCMA |
| 281 | **************************************************/ |
| 282 | |
Rafał Miłecki | 265dfbd | 2013-03-24 21:53:24 +0100 | [diff] [blame] | 283 | static int bcm47xxsflash_bcma_cc_read(struct bcm47xxsflash *b47s, u16 offset) |
| 284 | { |
| 285 | return bcma_cc_read32(b47s->bcma_cc, offset); |
| 286 | } |
| 287 | |
| 288 | static void bcm47xxsflash_bcma_cc_write(struct bcm47xxsflash *b47s, u16 offset, |
| 289 | u32 value) |
| 290 | { |
| 291 | bcma_cc_write32(b47s->bcma_cc, offset, value); |
| 292 | } |
| 293 | |
Rafał Miłecki | f1a7c9d | 2013-02-04 08:23:08 +0100 | [diff] [blame] | 294 | static int bcm47xxsflash_bcma_probe(struct platform_device *pdev) |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 295 | { |
Brian Norris | 5651d6a | 2016-02-26 11:50:28 +0100 | [diff] [blame] | 296 | struct device *dev = &pdev->dev; |
| 297 | struct bcma_sflash *sflash = dev_get_platdata(dev); |
Rafał Miłecki | a2f74a7 | 2013-01-06 21:28:50 +0100 | [diff] [blame] | 298 | struct bcm47xxsflash *b47s; |
Brian Norris | 5651d6a | 2016-02-26 11:50:28 +0100 | [diff] [blame] | 299 | struct resource *res; |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 300 | int err; |
| 301 | |
Brian Norris | 5651d6a | 2016-02-26 11:50:28 +0100 | [diff] [blame] | 302 | b47s = devm_kzalloc(dev, sizeof(*b47s), GFP_KERNEL); |
Libo Chen | d2b1bd1 | 2013-05-30 10:22:12 +0800 | [diff] [blame] | 303 | if (!b47s) |
| 304 | return -ENOMEM; |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 305 | |
Brian Norris | 5651d6a | 2016-02-26 11:50:28 +0100 | [diff] [blame] | 306 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 307 | if (!res) { |
| 308 | dev_err(dev, "invalid resource\n"); |
| 309 | return -EINVAL; |
| 310 | } |
| 311 | if (!devm_request_mem_region(dev, res->start, resource_size(res), |
| 312 | res->name)) { |
| 313 | dev_err(dev, "can't request region for resource %pR\n", res); |
| 314 | return -EBUSY; |
| 315 | } |
Brian Norris | 5651d6a | 2016-02-26 11:50:28 +0100 | [diff] [blame] | 316 | |
Rafał Miłecki | 41c8153 | 2013-03-06 12:33:17 +0100 | [diff] [blame] | 317 | b47s->bcma_cc = container_of(sflash, struct bcma_drv_cc, sflash); |
Rafał Miłecki | 265dfbd | 2013-03-24 21:53:24 +0100 | [diff] [blame] | 318 | b47s->cc_read = bcm47xxsflash_bcma_cc_read; |
| 319 | b47s->cc_write = bcm47xxsflash_bcma_cc_write; |
Rafał Miłecki | 41c8153 | 2013-03-06 12:33:17 +0100 | [diff] [blame] | 320 | |
Rafał Miłecki | 64ad463 | 2016-08-15 14:21:28 +0200 | [diff] [blame] | 321 | /* |
| 322 | * On old MIPS devices cache was magically invalidated when needed, |
| 323 | * allowing us to use cached access and gain some performance. Trying |
| 324 | * the same on ARM based BCM53573 results in flash corruptions, we need |
| 325 | * to use uncached access for it. |
| 326 | * |
| 327 | * It may be arch specific, but right now there is only 1 ARM SoC using |
| 328 | * this driver, so let's follow Broadcom's reference code and check |
| 329 | * ChipCommon revision. |
| 330 | */ |
| 331 | if (b47s->bcma_cc->core->id.rev == 54) |
| 332 | b47s->window = ioremap_nocache(res->start, resource_size(res)); |
| 333 | else |
| 334 | b47s->window = ioremap_cache(res->start, resource_size(res)); |
| 335 | if (!b47s->window) { |
| 336 | dev_err(dev, "ioremap failed for resource %pR\n", res); |
| 337 | return -ENOMEM; |
| 338 | } |
| 339 | |
Rafał Miłecki | 1f816bc | 2013-03-06 12:34:19 +0100 | [diff] [blame] | 340 | switch (b47s->bcma_cc->capabilities & BCMA_CC_CAP_FLASHT) { |
| 341 | case BCMA_CC_FLASHT_STSER: |
| 342 | b47s->type = BCM47XXSFLASH_TYPE_ST; |
| 343 | break; |
| 344 | case BCMA_CC_FLASHT_ATSER: |
| 345 | b47s->type = BCM47XXSFLASH_TYPE_ATMEL; |
| 346 | break; |
| 347 | } |
| 348 | |
Rafał Miłecki | a2f74a7 | 2013-01-06 21:28:50 +0100 | [diff] [blame] | 349 | b47s->blocksize = sflash->blocksize; |
| 350 | b47s->numblocks = sflash->numblocks; |
| 351 | b47s->size = sflash->size; |
Frans Klaver | eb98198 | 2015-06-10 22:38:17 +0200 | [diff] [blame] | 352 | bcm47xxsflash_fill_mtd(b47s, &pdev->dev); |
Rafał Miłecki | a2f74a7 | 2013-01-06 21:28:50 +0100 | [diff] [blame] | 353 | |
Rafał Miłecki | be5e509 | 2017-01-16 17:28:18 +0100 | [diff] [blame] | 354 | platform_set_drvdata(pdev, b47s); |
| 355 | |
Rafał Miłecki | a2f74a7 | 2013-01-06 21:28:50 +0100 | [diff] [blame] | 356 | err = mtd_device_parse_register(&b47s->mtd, probes, NULL, NULL, 0); |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 357 | if (err) { |
| 358 | pr_err("Failed to register MTD device: %d\n", err); |
Brian Norris | 5651d6a | 2016-02-26 11:50:28 +0100 | [diff] [blame] | 359 | iounmap(b47s->window); |
Libo Chen | d2b1bd1 | 2013-05-30 10:22:12 +0800 | [diff] [blame] | 360 | return err; |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 361 | } |
| 362 | |
Rafał Miłecki | bddcb5e | 2013-03-24 21:51:31 +0100 | [diff] [blame] | 363 | if (bcm47xxsflash_poll(b47s, HZ / 10)) |
| 364 | pr_warn("Serial flash busy\n"); |
| 365 | |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 366 | return 0; |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 367 | } |
| 368 | |
Rafał Miłecki | f1a7c9d | 2013-02-04 08:23:08 +0100 | [diff] [blame] | 369 | static int bcm47xxsflash_bcma_remove(struct platform_device *pdev) |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 370 | { |
Rafał Miłecki | be5e509 | 2017-01-16 17:28:18 +0100 | [diff] [blame] | 371 | struct bcm47xxsflash *b47s = platform_get_drvdata(pdev); |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 372 | |
Rafał Miłecki | a2f74a7 | 2013-01-06 21:28:50 +0100 | [diff] [blame] | 373 | mtd_device_unregister(&b47s->mtd); |
Brian Norris | 5651d6a | 2016-02-26 11:50:28 +0100 | [diff] [blame] | 374 | iounmap(b47s->window); |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 375 | |
| 376 | return 0; |
| 377 | } |
| 378 | |
| 379 | static struct platform_driver bcma_sflash_driver = { |
Rafał Miłecki | f1a7c9d | 2013-02-04 08:23:08 +0100 | [diff] [blame] | 380 | .probe = bcm47xxsflash_bcma_probe, |
| 381 | .remove = bcm47xxsflash_bcma_remove, |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 382 | .driver = { |
| 383 | .name = "bcma_sflash", |
Rafał Miłecki | 5fe42d5 | 2012-09-17 11:50:49 +0200 | [diff] [blame] | 384 | }, |
| 385 | }; |
| 386 | |
Rafał Miłecki | f1a7c9d | 2013-02-04 08:23:08 +0100 | [diff] [blame] | 387 | /************************************************** |
| 388 | * Init |
| 389 | **************************************************/ |
| 390 | |
Libo Chen | 8268df2 | 2013-05-30 10:22:16 +0800 | [diff] [blame] | 391 | module_platform_driver(bcma_sflash_driver); |