9
0
Fork 0

fixup! davinci_nand: add support for the NAND controller

This commit is contained in:
Jan Luebbe 2015-07-30 17:12:23 +02:00 committed by Holger Hans Peter Freyther
parent 05ae0684e0
commit f437135e64
1 changed files with 10 additions and 20 deletions

View File

@ -23,8 +23,6 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
//#define DEBUG
#include <common.h>
#include <io.h>
#include <malloc.h>
@ -94,18 +92,15 @@ struct davinci_nand_pdata { /* platform_data */
/* Main and mirror bbt descriptor overrides */
struct nand_bbt_descr *bbt_td;
struct nand_bbt_descr *bbt_md;
/* Access timings */
//struct davinci_aemif_timing *timing;
};
#define NRCSR_OFFSET 0x00
#define AWCCR_OFFSET 0x04
#define A1CR_OFFSET 0x10
#define ACR_ASIZE_MASK 0x3
#define ACR_EW_MASK BIT(30)
#define ACR_SS_MASK BIT(31)
#define NRCSR_OFFSET 0x00
#define AWCCR_OFFSET 0x04
#define A1CR_OFFSET 0x10
#define ACR_ASIZE_MASK 0x3
#define ACR_EW_MASK BIT(30)
#define ACR_SS_MASK BIT(31)
/*
* This is a device driver for the NAND flash controller found on the
@ -141,8 +136,6 @@ struct davinci_nand_info {
uint32_t mask_cle;
uint32_t core_chipsel;
//struct davinci_aemif_timing *timing;
};
static bool ecc4_busy;
@ -267,7 +260,8 @@ static int nand_davinci_correct_1bit(struct mtd_info *mtd, u_char *dat,
(calc_ecc[2] << 16);
uint32_t diff = eccCalc ^ eccNand;
dev_dbg(info->dev, "%s nand=0x%x calc=0x%x\n", __func__, eccNand, eccCalc);
dev_dbg(info->dev, "%s nand=0x%x calc=0x%x\n", __func__, eccNand,
eccCalc);
if (diff) {
if ((((diff >> 12) ^ diff) & 0xfff) == 0xfff) {
@ -456,7 +450,6 @@ compare:
num_errors = 1 + ((fsr >> 16) & 0x03);
goto correct;
default: /* still working on it */
//cpu_relax();
continue;
}
}
@ -675,8 +668,6 @@ static int nand_davinci_probe(struct device_d *dev)
if (!info)
return -ENOMEM;
//platform_set_drvdata(pdev, info);
info->dev = dev;
info->base = dev_request_mem_region(dev, 1);
info->vaddr = dev_request_mem_region(dev, 0);
@ -686,7 +677,7 @@ static int nand_davinci_probe(struct device_d *dev)
(val >> 8) & 0xff, val & 0xff);
info->mtd.priv = &info->chip;
info->mtd.name = dev_name(dev);
info->mtd.name = xstrdup(dev_name(dev));
info->mtd.parent = dev;
info->chip.IO_ADDR_R = info->vaddr;
@ -700,7 +691,6 @@ static int nand_davinci_probe(struct device_d *dev)
info->chip.options = pdata->options;
info->chip.bbt_td = pdata->bbt_td;
info->chip.bbt_md = pdata->bbt_md;
//info->timing = pdata->timing;
info->ioaddr = (uint32_t __force) info->vaddr;