Lines Matching refs:b47n

89 	struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip);  in bcm47xxnflash_ops_bcm4706_read()  local
96 BUG_ON(b47n->curr_page_addr & ~nand_chip->pagemask); in bcm47xxnflash_ops_bcm4706_read()
105 bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_COL_ADDR, in bcm47xxnflash_ops_bcm4706_read()
106 b47n->curr_column); in bcm47xxnflash_ops_bcm4706_read()
107 bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_ROW_ADDR, in bcm47xxnflash_ops_bcm4706_read()
108 b47n->curr_page_addr); in bcm47xxnflash_ops_bcm4706_read()
114 if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, ctlcode)) in bcm47xxnflash_ops_bcm4706_read()
116 if (bcm47xxnflash_ops_bcm4706_poll(b47n->cc)) in bcm47xxnflash_ops_bcm4706_read()
124 if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, in bcm47xxnflash_ops_bcm4706_read()
127 *dest = bcma_cc_read32(b47n->cc, BCMA_CC_NFLASH_DATA); in bcm47xxnflash_ops_bcm4706_read()
130 b47n->curr_column += toread; in bcm47xxnflash_ops_bcm4706_read()
139 struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); in bcm47xxnflash_ops_bcm4706_write() local
140 struct bcma_drv_cc *cc = b47n->cc; in bcm47xxnflash_ops_bcm4706_write()
146 BUG_ON(b47n->curr_page_addr & ~nand_chip->pagemask); in bcm47xxnflash_ops_bcm4706_write()
162 b47n->curr_column += len; in bcm47xxnflash_ops_bcm4706_write()
172 struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); in bcm47xxnflash_ops_bcm4706_cmd_ctrl() local
185 bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, code); in bcm47xxnflash_ops_bcm4706_cmd_ctrl()
197 struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); in bcm47xxnflash_ops_bcm4706_dev_ready() local
199 return !!(bcma_cc_read32(b47n->cc, BCMA_CC_NFLASH_CTL) & NCTL_READY); in bcm47xxnflash_ops_bcm4706_dev_ready()
214 struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); in bcm47xxnflash_ops_bcm4706_cmdfunc() local
215 struct bcma_drv_cc *cc = b47n->cc; in bcm47xxnflash_ops_bcm4706_cmdfunc()
220 b47n->curr_column = column; in bcm47xxnflash_ops_bcm4706_cmdfunc()
222 b47n->curr_page_addr = page_addr; in bcm47xxnflash_ops_bcm4706_cmdfunc()
234 if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, ctlcode)) { in bcm47xxnflash_ops_bcm4706_cmdfunc()
244 for (i = 0; i < ARRAY_SIZE(b47n->id_data); i++) { in bcm47xxnflash_ops_bcm4706_cmdfunc()
246 if (i == ARRAY_SIZE(b47n->id_data) - 1) in bcm47xxnflash_ops_bcm4706_cmdfunc()
248 if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, in bcm47xxnflash_ops_bcm4706_cmdfunc()
253 b47n->id_data[i] = in bcm47xxnflash_ops_bcm4706_cmdfunc()
254 bcma_cc_read32(b47n->cc, BCMA_CC_NFLASH_DATA) in bcm47xxnflash_ops_bcm4706_cmdfunc()
268 b47n->curr_column += mtd->writesize; in bcm47xxnflash_ops_bcm4706_cmdfunc()
272 b47n->curr_page_addr); in bcm47xxnflash_ops_bcm4706_cmdfunc()
283 b47n->curr_column); in bcm47xxnflash_ops_bcm4706_cmdfunc()
285 b47n->curr_page_addr); in bcm47xxnflash_ops_bcm4706_cmdfunc()
304 b47n->curr_command = command; in bcm47xxnflash_ops_bcm4706_cmdfunc()
310 struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); in bcm47xxnflash_ops_bcm4706_read_byte() local
311 struct bcma_drv_cc *cc = b47n->cc; in bcm47xxnflash_ops_bcm4706_read_byte()
314 switch (b47n->curr_command) { in bcm47xxnflash_ops_bcm4706_read_byte()
316 if (b47n->curr_column >= ARRAY_SIZE(b47n->id_data)) { in bcm47xxnflash_ops_bcm4706_read_byte()
318 b47n->curr_column); in bcm47xxnflash_ops_bcm4706_read_byte()
321 return b47n->id_data[b47n->curr_column++]; in bcm47xxnflash_ops_bcm4706_read_byte()
331 pr_err("Invalid command for byte read: 0x%X\n", b47n->curr_command); in bcm47xxnflash_ops_bcm4706_read_byte()
338 struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); in bcm47xxnflash_ops_bcm4706_read_buf() local
340 switch (b47n->curr_command) { in bcm47xxnflash_ops_bcm4706_read_buf()
348 pr_err("Invalid command for buf read: 0x%X\n", b47n->curr_command); in bcm47xxnflash_ops_bcm4706_read_buf()
354 struct bcm47xxnflash *b47n = nand_get_controller_data(nand_chip); in bcm47xxnflash_ops_bcm4706_write_buf() local
356 switch (b47n->curr_command) { in bcm47xxnflash_ops_bcm4706_write_buf()
363 pr_err("Invalid command for buf write: 0x%X\n", b47n->curr_command); in bcm47xxnflash_ops_bcm4706_write_buf()
370 int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n) in bcm47xxnflash_ops_bcm4706_init() argument
372 struct nand_chip *nand_chip = (struct nand_chip *)&b47n->nand_chip; in bcm47xxnflash_ops_bcm4706_init()
385 b47n->nand_chip.legacy.cmdfunc = bcm47xxnflash_ops_bcm4706_cmdfunc; in bcm47xxnflash_ops_bcm4706_init()
386 b47n->nand_chip.legacy.read_byte = bcm47xxnflash_ops_bcm4706_read_byte; in bcm47xxnflash_ops_bcm4706_init()
387 b47n->nand_chip.legacy.read_buf = bcm47xxnflash_ops_bcm4706_read_buf; in bcm47xxnflash_ops_bcm4706_init()
388 b47n->nand_chip.legacy.write_buf = bcm47xxnflash_ops_bcm4706_write_buf; in bcm47xxnflash_ops_bcm4706_init()
389 b47n->nand_chip.legacy.set_features = nand_get_set_features_notsupp; in bcm47xxnflash_ops_bcm4706_init()
390 b47n->nand_chip.legacy.get_features = nand_get_set_features_notsupp; in bcm47xxnflash_ops_bcm4706_init()
393 b47n->nand_chip.bbt_options = NAND_BBT_USE_FLASH; in bcm47xxnflash_ops_bcm4706_init()
395 b47n->nand_chip.ecc.engine_type = NAND_ECC_ENGINE_TYPE_NONE; in bcm47xxnflash_ops_bcm4706_init()
398 bcma_cc_set32(b47n->cc, BCMA_CC_4706_FLASHSCFG, in bcm47xxnflash_ops_bcm4706_init()
402 if (b47n->cc->status & BCMA_CC_CHIPST_4706_PKG_OPTION) { in bcm47xxnflash_ops_bcm4706_init()
406 freq = bcma_chipco_pll_read(b47n->cc, 4); in bcm47xxnflash_ops_bcm4706_init()
417 bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_WAITCNT0, in bcm47xxnflash_ops_bcm4706_init()
421 err = nand_scan(&b47n->nand_chip, 1); in bcm47xxnflash_ops_bcm4706_init()
428 chipsize = nanddev_target_size(&b47n->nand_chip.base) >> 20; in bcm47xxnflash_ops_bcm4706_init()
437 col_bits = b47n->nand_chip.page_shift + 1; in bcm47xxnflash_ops_bcm4706_init()
444 bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_CONF, val); in bcm47xxnflash_ops_bcm4706_init()
448 bcma_cc_mask32(b47n->cc, BCMA_CC_4706_FLASHSCFG, in bcm47xxnflash_ops_bcm4706_init()