aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2014-08-19 03:14:14 -0400
committerBrian Norris <computersforpeace@gmail.com>2014-09-18 02:23:24 -0400
commit5282a3acbfa5295f331696e603a9fd6be3bd4094 (patch)
treefcd03a4e5ed1306fb441b3bf8af4595ec27544cb /drivers/mtd
parent785e5e111f2187ea3e6f4035f6009da62dd5c043 (diff)
mtd: bcm47xxnflash: add dev_ready and fill chip_delay
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c b/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c
index dc204f3a47ed..1ea5e77facd7 100644
--- a/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c
+++ b/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c
@@ -174,6 +174,14 @@ static void bcm47xxnflash_ops_bcm4706_select_chip(struct mtd_info *mtd,
174 return; 174 return;
175} 175}
176 176
177static int bcm47xxnflash_ops_bcm4706_dev_ready(struct mtd_info *mtd)
178{
179 struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv;
180 struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv;
181
182 return !!(bcma_cc_read32(b47n->cc, BCMA_CC_NFLASH_CTL) & NCTL_READY);
183}
184
177/* 185/*
178 * Default nand_command and nand_command_lp don't match BCM4706 hardware layout. 186 * Default nand_command and nand_command_lp don't match BCM4706 hardware layout.
179 * For example, reading chip id is performed in a non-standard way. 187 * For example, reading chip id is performed in a non-standard way.
@@ -341,6 +349,7 @@ static void bcm47xxnflash_ops_bcm4706_write_buf(struct mtd_info *mtd,
341 349
342int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n) 350int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n)
343{ 351{
352 struct nand_chip *nand_chip = (struct nand_chip *)&b47n->nand_chip;
344 int err; 353 int err;
345 u32 freq; 354 u32 freq;
346 u16 clock; 355 u16 clock;
@@ -351,10 +360,13 @@ int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n)
351 u32 val; 360 u32 val;
352 361
353 b47n->nand_chip.select_chip = bcm47xxnflash_ops_bcm4706_select_chip; 362 b47n->nand_chip.select_chip = bcm47xxnflash_ops_bcm4706_select_chip;
363 nand_chip->dev_ready = bcm47xxnflash_ops_bcm4706_dev_ready;
354 b47n->nand_chip.cmdfunc = bcm47xxnflash_ops_bcm4706_cmdfunc; 364 b47n->nand_chip.cmdfunc = bcm47xxnflash_ops_bcm4706_cmdfunc;
355 b47n->nand_chip.read_byte = bcm47xxnflash_ops_bcm4706_read_byte; 365 b47n->nand_chip.read_byte = bcm47xxnflash_ops_bcm4706_read_byte;
356 b47n->nand_chip.read_buf = bcm47xxnflash_ops_bcm4706_read_buf; 366 b47n->nand_chip.read_buf = bcm47xxnflash_ops_bcm4706_read_buf;
357 b47n->nand_chip.write_buf = bcm47xxnflash_ops_bcm4706_write_buf; 367 b47n->nand_chip.write_buf = bcm47xxnflash_ops_bcm4706_write_buf;
368
369 nand_chip->chip_delay = 50;
358 b47n->nand_chip.bbt_options = NAND_BBT_USE_FLASH; 370 b47n->nand_chip.bbt_options = NAND_BBT_USE_FLASH;
359 b47n->nand_chip.ecc.mode = NAND_ECC_NONE; /* TODO: implement ECC */ 371 b47n->nand_chip.ecc.mode = NAND_ECC_NONE; /* TODO: implement ECC */
360 372