diff options
| author | Rafał Miłecki <zajec5@gmail.com> | 2012-11-23 03:58:11 -0500 |
|---|---|---|
| committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-12-03 09:36:52 -0500 |
| commit | a6b3ed29ae3fd9853280d4f6a9275c43fb4e1c3b (patch) | |
| tree | f03453eca34f16cd46665c8432884d6a0e42ce1a /drivers/mtd/nand/bcm47xxnflash | |
| parent | e7e46168bcc768fa31628d3d080ac9ee7b553b56 (diff) | |
mtd: bcm47xxnflash: support NAND_CMD_STATUS
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/nand/bcm47xxnflash')
| -rw-r--r-- | drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c b/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c index 672dc90aa5b1..ece343ccc1b0 100644 --- a/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c +++ b/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c | |||
| @@ -156,6 +156,7 @@ static void bcm47xxnflash_ops_bcm4706_cmdfunc(struct mtd_info *mtd, | |||
| 156 | { | 156 | { |
| 157 | struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv; | 157 | struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv; |
| 158 | struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; | 158 | struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; |
| 159 | struct bcma_drv_cc *cc = b47n->cc; | ||
| 159 | u32 ctlcode; | 160 | u32 ctlcode; |
| 160 | int i; | 161 | int i; |
| 161 | 162 | ||
| @@ -196,6 +197,11 @@ static void bcm47xxnflash_ops_bcm4706_cmdfunc(struct mtd_info *mtd, | |||
| 196 | } | 197 | } |
| 197 | 198 | ||
| 198 | break; | 199 | break; |
| 200 | case NAND_CMD_STATUS: | ||
| 201 | ctlcode = NCTL_CSA | NCTL_CMD0 | NAND_CMD_STATUS; | ||
| 202 | if (bcm47xxnflash_ops_bcm4706_ctl_cmd(cc, ctlcode)) | ||
| 203 | pr_err("STATUS command error\n"); | ||
| 204 | break; | ||
| 199 | case NAND_CMD_READ0: | 205 | case NAND_CMD_READ0: |
| 200 | break; | 206 | break; |
| 201 | case NAND_CMD_READOOB: | 207 | case NAND_CMD_READOOB: |
| @@ -213,6 +219,7 @@ static u8 bcm47xxnflash_ops_bcm4706_read_byte(struct mtd_info *mtd) | |||
| 213 | { | 219 | { |
| 214 | struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv; | 220 | struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv; |
| 215 | struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; | 221 | struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv; |
| 222 | struct bcma_drv_cc *cc = b47n->cc; | ||
| 216 | u32 tmp = 0; | 223 | u32 tmp = 0; |
| 217 | 224 | ||
| 218 | switch (b47n->curr_command) { | 225 | switch (b47n->curr_command) { |
| @@ -223,6 +230,10 @@ static u8 bcm47xxnflash_ops_bcm4706_read_byte(struct mtd_info *mtd) | |||
| 223 | return 0; | 230 | return 0; |
| 224 | } | 231 | } |
| 225 | return b47n->id_data[b47n->curr_column++]; | 232 | return b47n->id_data[b47n->curr_column++]; |
| 233 | case NAND_CMD_STATUS: | ||
| 234 | if (bcm47xxnflash_ops_bcm4706_ctl_cmd(cc, NCTL_READ)) | ||
| 235 | return 0; | ||
| 236 | return bcma_cc_read32(cc, BCMA_CC_NFLASH_DATA) & 0xff; | ||
| 226 | case NAND_CMD_READOOB: | 237 | case NAND_CMD_READOOB: |
| 227 | bcm47xxnflash_ops_bcm4706_read(mtd, (u8 *)&tmp, 4); | 238 | bcm47xxnflash_ops_bcm4706_read(mtd, (u8 *)&tmp, 4); |
| 228 | return tmp & 0xFF; | 239 | return tmp & 0xFF; |
