b47s 22 drivers/mtd/devices/bcm47xxsflash.c static void bcm47xxsflash_cmd(struct bcm47xxsflash *b47s, u32 opcode) b47s 26 drivers/mtd/devices/bcm47xxsflash.c b47s->cc_write(b47s, BCMA_CC_FLASHCTL, BCMA_CC_FLASHCTL_START | opcode); b47s 28 drivers/mtd/devices/bcm47xxsflash.c if (!(b47s->cc_read(b47s, BCMA_CC_FLASHCTL) & b47s 36 drivers/mtd/devices/bcm47xxsflash.c static int bcm47xxsflash_poll(struct bcm47xxsflash *b47s, int timeout) b47s 41 drivers/mtd/devices/bcm47xxsflash.c switch (b47s->type) { b47s 43 drivers/mtd/devices/bcm47xxsflash.c bcm47xxsflash_cmd(b47s, OPCODE_ST_RDSR); b47s 44 drivers/mtd/devices/bcm47xxsflash.c if (!(b47s->cc_read(b47s, BCMA_CC_FLASHDATA) & b47s 49 drivers/mtd/devices/bcm47xxsflash.c bcm47xxsflash_cmd(b47s, OPCODE_AT_STATUS); b47s 50 drivers/mtd/devices/bcm47xxsflash.c if (b47s->cc_read(b47s, BCMA_CC_FLASHDATA) & b47s 71 drivers/mtd/devices/bcm47xxsflash.c struct bcm47xxsflash *b47s = mtd->priv; b47s 73 drivers/mtd/devices/bcm47xxsflash.c switch (b47s->type) { b47s 75 drivers/mtd/devices/bcm47xxsflash.c bcm47xxsflash_cmd(b47s, OPCODE_ST_WREN); b47s 76 drivers/mtd/devices/bcm47xxsflash.c b47s->cc_write(b47s, BCMA_CC_FLASHADDR, erase->addr); b47s 81 drivers/mtd/devices/bcm47xxsflash.c if (b47s->blocksize < (64 * 1024)) b47s 82 drivers/mtd/devices/bcm47xxsflash.c bcm47xxsflash_cmd(b47s, OPCODE_ST_SSE); b47s 84 drivers/mtd/devices/bcm47xxsflash.c bcm47xxsflash_cmd(b47s, OPCODE_ST_SE); b47s 87 drivers/mtd/devices/bcm47xxsflash.c b47s->cc_write(b47s, BCMA_CC_FLASHADDR, erase->addr << 1); b47s 88 drivers/mtd/devices/bcm47xxsflash.c bcm47xxsflash_cmd(b47s, OPCODE_AT_PAGE_ERASE); b47s 92 drivers/mtd/devices/bcm47xxsflash.c return bcm47xxsflash_poll(b47s, HZ); b47s 98 drivers/mtd/devices/bcm47xxsflash.c struct bcm47xxsflash *b47s = mtd->priv; b47s 110 drivers/mtd/devices/bcm47xxsflash.c memcpy_fromio(buf, b47s->window + from, memcpy_len); b47s 118 drivers/mtd/devices/bcm47xxsflash.c b47s->cc_write(b47s, BCMA_CC_FLASHADDR, from++); b47s 119 drivers/mtd/devices/bcm47xxsflash.c bcm47xxsflash_cmd(b47s, OPCODE_ST_READ4B); b47s 120 drivers/mtd/devices/bcm47xxsflash.c *buf++ = b47s->cc_read(b47s, BCMA_CC_FLASHDATA); b47s 131 drivers/mtd/devices/bcm47xxsflash.c struct bcm47xxsflash *b47s = mtd->priv; b47s 135 drivers/mtd/devices/bcm47xxsflash.c bcm47xxsflash_cmd(b47s, OPCODE_ST_WREN); b47s 138 drivers/mtd/devices/bcm47xxsflash.c b47s->cc_write(b47s, BCMA_CC_FLASHADDR, offset); b47s 139 drivers/mtd/devices/bcm47xxsflash.c b47s->cc_write(b47s, BCMA_CC_FLASHDATA, *buf++); b47s 142 drivers/mtd/devices/bcm47xxsflash.c if (b47s->bcma_cc->core->id.rev < 20) { b47s 143 drivers/mtd/devices/bcm47xxsflash.c bcm47xxsflash_cmd(b47s, OPCODE_ST_PP); b47s 148 drivers/mtd/devices/bcm47xxsflash.c bcm47xxsflash_cmd(b47s, OPCODE_ST_CSA | OPCODE_ST_PP); b47s 158 drivers/mtd/devices/bcm47xxsflash.c bcm47xxsflash_cmd(b47s, OPCODE_ST_CSA | *buf++); b47s 165 drivers/mtd/devices/bcm47xxsflash.c b47s->cc_write(b47s, BCMA_CC_FLASHCTL, 0); b47s 167 drivers/mtd/devices/bcm47xxsflash.c if (bcm47xxsflash_poll(b47s, HZ / 10)) b47s 176 drivers/mtd/devices/bcm47xxsflash.c struct bcm47xxsflash *b47s = mtd->priv; b47s 177 drivers/mtd/devices/bcm47xxsflash.c u32 mask = b47s->blocksize - 1; b47s 183 drivers/mtd/devices/bcm47xxsflash.c if (byte || (len < b47s->blocksize)) { b47s 186 drivers/mtd/devices/bcm47xxsflash.c b47s->cc_write(b47s, BCMA_CC_FLASHADDR, page); b47s 187 drivers/mtd/devices/bcm47xxsflash.c bcm47xxsflash_cmd(b47s, OPCODE_AT_BUF1_LOAD); b47s 189 drivers/mtd/devices/bcm47xxsflash.c err = bcm47xxsflash_poll(b47s, HZ / 1000); b47s 199 drivers/mtd/devices/bcm47xxsflash.c if (byte == b47s->blocksize) b47s 202 drivers/mtd/devices/bcm47xxsflash.c b47s->cc_write(b47s, BCMA_CC_FLASHADDR, byte++); b47s 203 drivers/mtd/devices/bcm47xxsflash.c b47s->cc_write(b47s, BCMA_CC_FLASHDATA, *buf++); b47s 204 drivers/mtd/devices/bcm47xxsflash.c bcm47xxsflash_cmd(b47s, OPCODE_AT_BUF1_WRITE); b47s 210 drivers/mtd/devices/bcm47xxsflash.c b47s->cc_write(b47s, BCMA_CC_FLASHADDR, page); b47s 211 drivers/mtd/devices/bcm47xxsflash.c bcm47xxsflash_cmd(b47s, OPCODE_AT_BUF1_PROGRAM); b47s 219 drivers/mtd/devices/bcm47xxsflash.c struct bcm47xxsflash *b47s = mtd->priv; b47s 226 drivers/mtd/devices/bcm47xxsflash.c switch (b47s->type) { b47s 249 drivers/mtd/devices/bcm47xxsflash.c static void bcm47xxsflash_fill_mtd(struct bcm47xxsflash *b47s, b47s 252 drivers/mtd/devices/bcm47xxsflash.c struct mtd_info *mtd = &b47s->mtd; b47s 254 drivers/mtd/devices/bcm47xxsflash.c mtd->priv = b47s; b47s 260 drivers/mtd/devices/bcm47xxsflash.c mtd->size = b47s->size; b47s 261 drivers/mtd/devices/bcm47xxsflash.c mtd->erasesize = b47s->blocksize; b47s 274 drivers/mtd/devices/bcm47xxsflash.c static int bcm47xxsflash_bcma_cc_read(struct bcm47xxsflash *b47s, u16 offset) b47s 276 drivers/mtd/devices/bcm47xxsflash.c return bcma_cc_read32(b47s->bcma_cc, offset); b47s 279 drivers/mtd/devices/bcm47xxsflash.c static void bcm47xxsflash_bcma_cc_write(struct bcm47xxsflash *b47s, u16 offset, b47s 282 drivers/mtd/devices/bcm47xxsflash.c bcma_cc_write32(b47s->bcma_cc, offset, value); b47s 289 drivers/mtd/devices/bcm47xxsflash.c struct bcm47xxsflash *b47s; b47s 293 drivers/mtd/devices/bcm47xxsflash.c b47s = devm_kzalloc(dev, sizeof(*b47s), GFP_KERNEL); b47s 294 drivers/mtd/devices/bcm47xxsflash.c if (!b47s) b47s 308 drivers/mtd/devices/bcm47xxsflash.c b47s->bcma_cc = container_of(sflash, struct bcma_drv_cc, sflash); b47s 309 drivers/mtd/devices/bcm47xxsflash.c b47s->cc_read = bcm47xxsflash_bcma_cc_read; b47s 310 drivers/mtd/devices/bcm47xxsflash.c b47s->cc_write = bcm47xxsflash_bcma_cc_write; b47s 322 drivers/mtd/devices/bcm47xxsflash.c if (b47s->bcma_cc->core->id.rev == 54) b47s 323 drivers/mtd/devices/bcm47xxsflash.c b47s->window = ioremap_nocache(res->start, resource_size(res)); b47s 325 drivers/mtd/devices/bcm47xxsflash.c b47s->window = ioremap_cache(res->start, resource_size(res)); b47s 326 drivers/mtd/devices/bcm47xxsflash.c if (!b47s->window) { b47s 331 drivers/mtd/devices/bcm47xxsflash.c switch (b47s->bcma_cc->capabilities & BCMA_CC_CAP_FLASHT) { b47s 333 drivers/mtd/devices/bcm47xxsflash.c b47s->type = BCM47XXSFLASH_TYPE_ST; b47s 336 drivers/mtd/devices/bcm47xxsflash.c b47s->type = BCM47XXSFLASH_TYPE_ATMEL; b47s 340 drivers/mtd/devices/bcm47xxsflash.c b47s->blocksize = sflash->blocksize; b47s 341 drivers/mtd/devices/bcm47xxsflash.c b47s->numblocks = sflash->numblocks; b47s 342 drivers/mtd/devices/bcm47xxsflash.c b47s->size = sflash->size; b47s 343 drivers/mtd/devices/bcm47xxsflash.c bcm47xxsflash_fill_mtd(b47s, &pdev->dev); b47s 345 drivers/mtd/devices/bcm47xxsflash.c platform_set_drvdata(pdev, b47s); b47s 347 drivers/mtd/devices/bcm47xxsflash.c err = mtd_device_parse_register(&b47s->mtd, probes, NULL, NULL, 0); b47s 350 drivers/mtd/devices/bcm47xxsflash.c iounmap(b47s->window); b47s 354 drivers/mtd/devices/bcm47xxsflash.c if (bcm47xxsflash_poll(b47s, HZ / 10)) b47s 362 drivers/mtd/devices/bcm47xxsflash.c struct bcm47xxsflash *b47s = platform_get_drvdata(pdev); b47s 364 drivers/mtd/devices/bcm47xxsflash.c mtd_device_unregister(&b47s->mtd); b47s 365 drivers/mtd/devices/bcm47xxsflash.c iounmap(b47s->window); b47s 67 drivers/mtd/devices/bcm47xxsflash.h int (*cc_read)(struct bcm47xxsflash *b47s, u16 offset); b47s 68 drivers/mtd/devices/bcm47xxsflash.h void (*cc_write)(struct bcm47xxsflash *b47s, u16 offset, u32 value);