b47n 24 drivers/mtd/nand/raw/bcm47xxnflash/bcm47xxnflash.h int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n); b47n 25 drivers/mtd/nand/raw/bcm47xxnflash/main.c struct bcm47xxnflash *b47n; b47n 29 drivers/mtd/nand/raw/bcm47xxnflash/main.c b47n = devm_kzalloc(&pdev->dev, sizeof(*b47n), GFP_KERNEL); b47n 30 drivers/mtd/nand/raw/bcm47xxnflash/main.c if (!b47n) b47n 33 drivers/mtd/nand/raw/bcm47xxnflash/main.c nand_set_controller_data(&b47n->nand_chip, b47n); b47n 34 drivers/mtd/nand/raw/bcm47xxnflash/main.c mtd = nand_to_mtd(&b47n->nand_chip); b47n 36 drivers/mtd/nand/raw/bcm47xxnflash/main.c b47n->cc = container_of(nflash, struct bcma_drv_cc, nflash); b47n 38 drivers/mtd/nand/raw/bcm47xxnflash/main.c if (b47n->cc->core->bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) { b47n 39 drivers/mtd/nand/raw/bcm47xxnflash/main.c err = bcm47xxnflash_ops_bcm4706_init(b47n); b47n 49 drivers/mtd/nand/raw/bcm47xxnflash/main.c platform_set_drvdata(pdev, b47n); b47n 89 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); b47n 96 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c BUG_ON(b47n->curr_page_addr & ~nand_chip->pagemask); b47n 105 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_COL_ADDR, b47n 106 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->curr_column); b47n 107 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_ROW_ADDR, b47n 108 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->curr_page_addr); b47n 114 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, ctlcode)) b47n 116 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c if (bcm47xxnflash_ops_bcm4706_poll(b47n->cc)) b47n 124 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, b47n 127 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c *dest = bcma_cc_read32(b47n->cc, BCMA_CC_NFLASH_DATA); b47n 130 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->curr_column += toread; b47n 139 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); b47n 140 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c struct bcma_drv_cc *cc = b47n->cc; b47n 146 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c BUG_ON(b47n->curr_page_addr & ~nand_chip->pagemask); b47n 162 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->curr_column += len; b47n 172 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); b47n 185 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, code); b47n 197 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); b47n 199 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c return !!(bcma_cc_read32(b47n->cc, BCMA_CC_NFLASH_CTL) & NCTL_READY); b47n 214 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); b47n 215 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c struct bcma_drv_cc *cc = b47n->cc; b47n 220 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->curr_column = column; b47n 222 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->curr_page_addr = page_addr; b47n 234 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, ctlcode)) { b47n 244 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c for (i = 0; i < ARRAY_SIZE(b47n->id_data); i++) { b47n 246 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c if (i == ARRAY_SIZE(b47n->id_data) - 1) b47n 248 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, b47n 253 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->id_data[i] = b47n 254 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c bcma_cc_read32(b47n->cc, BCMA_CC_NFLASH_DATA) b47n 268 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->curr_column += mtd->writesize; b47n 272 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->curr_page_addr); b47n 283 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->curr_column); b47n 285 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->curr_page_addr); b47n 304 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->curr_command = command; b47n 310 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); b47n 311 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c struct bcma_drv_cc *cc = b47n->cc; b47n 314 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c switch (b47n->curr_command) { b47n 316 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c if (b47n->curr_column >= ARRAY_SIZE(b47n->id_data)) { b47n 318 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->curr_column); b47n 321 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c return b47n->id_data[b47n->curr_column++]; b47n 331 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c pr_err("Invalid command for byte read: 0x%X\n", b47n->curr_command); b47n 338 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); b47n 340 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c switch (b47n->curr_command) { b47n 348 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c pr_err("Invalid command for buf read: 0x%X\n", b47n->curr_command); b47n 354 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); b47n 356 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c switch (b47n->curr_command) { b47n 363 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c pr_err("Invalid command for buf write: 0x%X\n", b47n->curr_command); b47n 370 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n) b47n 372 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c struct nand_chip *nand_chip = (struct nand_chip *)&b47n->nand_chip; b47n 385 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->nand_chip.legacy.cmdfunc = bcm47xxnflash_ops_bcm4706_cmdfunc; b47n 386 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->nand_chip.legacy.read_byte = bcm47xxnflash_ops_bcm4706_read_byte; b47n 387 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->nand_chip.legacy.read_buf = bcm47xxnflash_ops_bcm4706_read_buf; b47n 388 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->nand_chip.legacy.write_buf = bcm47xxnflash_ops_bcm4706_write_buf; b47n 389 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->nand_chip.legacy.set_features = nand_get_set_features_notsupp; b47n 390 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->nand_chip.legacy.get_features = nand_get_set_features_notsupp; b47n 393 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->nand_chip.bbt_options = NAND_BBT_USE_FLASH; b47n 394 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->nand_chip.ecc.mode = NAND_ECC_NONE; /* TODO: implement ECC */ b47n 397 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c bcma_cc_set32(b47n->cc, BCMA_CC_4706_FLASHSCFG, b47n 401 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c if (b47n->cc->status & BCMA_CC_CHIPST_4706_PKG_OPTION) { b47n 405 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c freq = bcma_chipco_pll_read(b47n->cc, 4); b47n 416 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_WAITCNT0, b47n 420 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c err = nand_scan(&b47n->nand_chip, 1); b47n 427 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c chipsize = nanddev_target_size(&b47n->nand_chip.base) >> 20; b47n 436 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c col_bits = b47n->nand_chip.page_shift + 1; b47n 443 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_CONF, val); b47n 447 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c bcma_cc_mask32(b47n->cc, BCMA_CC_4706_FLASHSCFG,