Lines Matching refs:b47n
93 struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; in bcm47xxnflash_ops_bcm4706_read() local
100 BUG_ON(b47n->curr_page_addr & ~nand_chip->pagemask); in bcm47xxnflash_ops_bcm4706_read()
109 bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_COL_ADDR, in bcm47xxnflash_ops_bcm4706_read()
110 b47n->curr_column); in bcm47xxnflash_ops_bcm4706_read()
111 bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_ROW_ADDR, in bcm47xxnflash_ops_bcm4706_read()
112 b47n->curr_page_addr); in bcm47xxnflash_ops_bcm4706_read()
118 if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, ctlcode)) in bcm47xxnflash_ops_bcm4706_read()
120 if (bcm47xxnflash_ops_bcm4706_poll(b47n->cc)) in bcm47xxnflash_ops_bcm4706_read()
128 if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, in bcm47xxnflash_ops_bcm4706_read()
131 *dest = bcma_cc_read32(b47n->cc, BCMA_CC_NFLASH_DATA); in bcm47xxnflash_ops_bcm4706_read()
134 b47n->curr_column += toread; in bcm47xxnflash_ops_bcm4706_read()
143 struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; in bcm47xxnflash_ops_bcm4706_write() local
144 struct bcma_drv_cc *cc = b47n->cc; in bcm47xxnflash_ops_bcm4706_write()
150 BUG_ON(b47n->curr_page_addr & ~nand_chip->pagemask); in bcm47xxnflash_ops_bcm4706_write()
166 b47n->curr_column += len; in bcm47xxnflash_ops_bcm4706_write()
177 struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; in bcm47xxnflash_ops_bcm4706_cmd_ctrl() local
190 bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, code); in bcm47xxnflash_ops_bcm4706_cmd_ctrl()
203 struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; in bcm47xxnflash_ops_bcm4706_dev_ready() local
205 return !!(bcma_cc_read32(b47n->cc, BCMA_CC_NFLASH_CTL) & NCTL_READY); in bcm47xxnflash_ops_bcm4706_dev_ready()
220 struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; in bcm47xxnflash_ops_bcm4706_cmdfunc() local
221 struct bcma_drv_cc *cc = b47n->cc; in bcm47xxnflash_ops_bcm4706_cmdfunc()
226 b47n->curr_column = column; in bcm47xxnflash_ops_bcm4706_cmdfunc()
228 b47n->curr_page_addr = page_addr; in bcm47xxnflash_ops_bcm4706_cmdfunc()
240 if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, ctlcode)) { in bcm47xxnflash_ops_bcm4706_cmdfunc()
250 for (i = 0; i < ARRAY_SIZE(b47n->id_data); i++) { in bcm47xxnflash_ops_bcm4706_cmdfunc()
252 if (i == ARRAY_SIZE(b47n->id_data) - 1) in bcm47xxnflash_ops_bcm4706_cmdfunc()
254 if (bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, in bcm47xxnflash_ops_bcm4706_cmdfunc()
259 b47n->id_data[i] = in bcm47xxnflash_ops_bcm4706_cmdfunc()
260 bcma_cc_read32(b47n->cc, BCMA_CC_NFLASH_DATA) in bcm47xxnflash_ops_bcm4706_cmdfunc()
274 b47n->curr_column += mtd->writesize; in bcm47xxnflash_ops_bcm4706_cmdfunc()
278 b47n->curr_page_addr); in bcm47xxnflash_ops_bcm4706_cmdfunc()
289 b47n->curr_column); in bcm47xxnflash_ops_bcm4706_cmdfunc()
291 b47n->curr_page_addr); in bcm47xxnflash_ops_bcm4706_cmdfunc()
310 b47n->curr_command = command; in bcm47xxnflash_ops_bcm4706_cmdfunc()
316 struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; in bcm47xxnflash_ops_bcm4706_read_byte() local
317 struct bcma_drv_cc *cc = b47n->cc; in bcm47xxnflash_ops_bcm4706_read_byte()
320 switch (b47n->curr_command) { in bcm47xxnflash_ops_bcm4706_read_byte()
322 if (b47n->curr_column >= ARRAY_SIZE(b47n->id_data)) { in bcm47xxnflash_ops_bcm4706_read_byte()
324 b47n->curr_column); in bcm47xxnflash_ops_bcm4706_read_byte()
327 return b47n->id_data[b47n->curr_column++]; in bcm47xxnflash_ops_bcm4706_read_byte()
337 pr_err("Invalid command for byte read: 0x%X\n", b47n->curr_command); in bcm47xxnflash_ops_bcm4706_read_byte()
345 struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; in bcm47xxnflash_ops_bcm4706_read_buf() local
347 switch (b47n->curr_command) { in bcm47xxnflash_ops_bcm4706_read_buf()
354 pr_err("Invalid command for buf read: 0x%X\n", b47n->curr_command); in bcm47xxnflash_ops_bcm4706_read_buf()
361 struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; in bcm47xxnflash_ops_bcm4706_write_buf() local
363 switch (b47n->curr_command) { in bcm47xxnflash_ops_bcm4706_write_buf()
369 pr_err("Invalid command for buf write: 0x%X\n", b47n->curr_command); in bcm47xxnflash_ops_bcm4706_write_buf()
376 int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n) in bcm47xxnflash_ops_bcm4706_init() argument
378 struct nand_chip *nand_chip = (struct nand_chip *)&b47n->nand_chip; in bcm47xxnflash_ops_bcm4706_init()
388 b47n->nand_chip.select_chip = bcm47xxnflash_ops_bcm4706_select_chip; in bcm47xxnflash_ops_bcm4706_init()
391 b47n->nand_chip.cmdfunc = bcm47xxnflash_ops_bcm4706_cmdfunc; in bcm47xxnflash_ops_bcm4706_init()
392 b47n->nand_chip.read_byte = bcm47xxnflash_ops_bcm4706_read_byte; in bcm47xxnflash_ops_bcm4706_init()
393 b47n->nand_chip.read_buf = bcm47xxnflash_ops_bcm4706_read_buf; in bcm47xxnflash_ops_bcm4706_init()
394 b47n->nand_chip.write_buf = bcm47xxnflash_ops_bcm4706_write_buf; in bcm47xxnflash_ops_bcm4706_init()
397 b47n->nand_chip.bbt_options = NAND_BBT_USE_FLASH; in bcm47xxnflash_ops_bcm4706_init()
398 b47n->nand_chip.ecc.mode = NAND_ECC_NONE; /* TODO: implement ECC */ in bcm47xxnflash_ops_bcm4706_init()
401 bcma_cc_set32(b47n->cc, BCMA_CC_4706_FLASHSCFG, in bcm47xxnflash_ops_bcm4706_init()
405 if (b47n->cc->status & BCMA_CC_CHIPST_4706_PKG_OPTION) { in bcm47xxnflash_ops_bcm4706_init()
409 freq = bcma_chipco_pll_read(b47n->cc, 4); in bcm47xxnflash_ops_bcm4706_init()
420 bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_WAITCNT0, in bcm47xxnflash_ops_bcm4706_init()
424 err = nand_scan(&b47n->mtd, 1); in bcm47xxnflash_ops_bcm4706_init()
431 chipsize = b47n->nand_chip.chipsize >> 20; in bcm47xxnflash_ops_bcm4706_init()
440 col_bits = b47n->nand_chip.page_shift + 1; in bcm47xxnflash_ops_bcm4706_init()
447 bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_CONF, val); in bcm47xxnflash_ops_bcm4706_init()
451 bcma_cc_mask32(b47n->cc, BCMA_CC_4706_FLASHSCFG, in bcm47xxnflash_ops_bcm4706_init()