summaryrefslogtreecommitdiffstats
path: root/drivers/nand
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-04-24 21:42:37 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2009-06-10 13:54:37 +0200
commit8bd42496f79ab6d86b6cbcd567599151645fe172 (patch)
tree2470889e61d0c2b8ef16c20317d9f78b4259a19a /drivers/nand
parent7733de908ba918ca47f13157335a100d74ba7cf1 (diff)
downloadbarebox-8bd42496f79ab6d86b6cbcd567599151645fe172.tar.gz
barebox-8bd42496f79ab6d86b6cbcd567599151645fe172.tar.xz
mtd: Replace DEBUG by MTD_DEBUG
DEBUG is already used for another purpose by U-Boot Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/nand')
-rw-r--r--drivers/nand/nand_base.c34
-rw-r--r--drivers/nand/nand_bbt.c2
-rw-r--r--drivers/nand/nand_imx.c30
3 files changed, 33 insertions, 33 deletions
diff --git a/drivers/nand/nand_base.c b/drivers/nand/nand_base.c
index 843ad334cb..cd726fc8c6 100644
--- a/drivers/nand/nand_base.c
+++ b/drivers/nand/nand_base.c
@@ -1250,7 +1250,7 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
int len;
uint8_t *buf = ops->oobbuf;
- DEBUG(MTD_DEBUG_LEVEL3, "nand_read_oob: from = 0x%08Lx, len = %i\n",
+ MTD_DEBUG(MTD_DEBUG_LEVEL3, "nand_read_oob: from = 0x%08Lx, len = %i\n",
(unsigned long long)from, readlen);
if (ops->mode == MTD_OOB_AUTO)
@@ -1259,7 +1259,7 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
len = mtd->oobsize;
if (unlikely(ops->ooboffs >= len)) {
- DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
+ MTD_DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
"Attempt to start read outside oob\n");
return -EINVAL;
}
@@ -1268,7 +1268,7 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
if (unlikely(from >= mtd->size ||
ops->ooboffs + readlen > ((mtd->size >> chip->page_shift) -
(from >> chip->page_shift)) * len)) {
- DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
+ MTD_DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
"Attempt read beyond end of device\n");
return -EINVAL;
}
@@ -1343,7 +1343,7 @@ static int nand_read_oob(struct mtd_info *mtd, loff_t from,
/* Do not allow reads past end of device */
if (ops->datbuf && (from + ops->len) > mtd->size) {
- DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
+ MTD_DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
"Attempt read beyond end of device\n");
return -EINVAL;
}
@@ -1743,7 +1743,7 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
int chipnr, page, status, len;
struct nand_chip *chip = mtd->priv;
- DEBUG(MTD_DEBUG_LEVEL3, "nand_write_oob: to = 0x%08x, len = %i\n",
+ MTD_DEBUG(MTD_DEBUG_LEVEL3, "nand_write_oob: to = 0x%08x, len = %i\n",
(unsigned int)to, (int)ops->ooblen);
if (ops->mode == MTD_OOB_AUTO)
@@ -1753,13 +1753,13 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
/* Do not allow write past end of page */
if ((ops->ooboffs + ops->ooblen) > len) {
- DEBUG(MTD_DEBUG_LEVEL0, "nand_write_oob: "
+ MTD_DEBUG(MTD_DEBUG_LEVEL0, "nand_write_oob: "
"Attempt to write past end of page\n");
return -EINVAL;
}
if (unlikely(ops->ooboffs >= len)) {
- DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
+ MTD_DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
"Attempt to start write outside oob\n");
return -EINVAL;
}
@@ -1769,7 +1769,7 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
ops->ooboffs + ops->ooblen >
((mtd->size >> chip->page_shift) -
(to >> chip->page_shift)) * len)) {
- DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
+ MTD_DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
"Attempt write beyond end of device\n");
return -EINVAL;
}
@@ -1825,7 +1825,7 @@ static int nand_write_oob(struct mtd_info *mtd, loff_t to,
/* Do not allow writes past end of device */
if (ops->datbuf && (to + ops->len) > mtd->size) {
- DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
+ MTD_DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
"Attempt read beyond end of device\n");
return -EINVAL;
}
@@ -1915,25 +1915,25 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
int rewrite_bbt[NAND_MAX_CHIPS]={0};
unsigned int bbt_masked_page = 0xffffffff;
- DEBUG(MTD_DEBUG_LEVEL3, "nand_erase: start = 0x%08x, len = %i\n",
+ MTD_DEBUG(MTD_DEBUG_LEVEL3, "nand_erase: start = 0x%08x, len = %i\n",
(unsigned int)instr->addr, (unsigned int)instr->len);
/* Start address must align on block boundary */
if (instr->addr & ((1 << chip->phys_erase_shift) - 1)) {
- DEBUG(MTD_DEBUG_LEVEL0, "nand_erase: Unaligned address\n");
+ MTD_DEBUG(MTD_DEBUG_LEVEL0, "nand_erase: Unaligned address\n");
return -EINVAL;
}
/* Length must align on block boundary */
if (instr->len & ((1 << chip->phys_erase_shift) - 1)) {
- DEBUG(MTD_DEBUG_LEVEL0, "nand_erase: "
+ MTD_DEBUG(MTD_DEBUG_LEVEL0, "nand_erase: "
"Length not block aligned\n");
return -EINVAL;
}
/* Do not allow erase past end of device */
if ((instr->len + instr->addr) > mtd->size) {
- DEBUG(MTD_DEBUG_LEVEL0, "nand_erase: "
+ MTD_DEBUG(MTD_DEBUG_LEVEL0, "nand_erase: "
"Erase past end of device\n");
return -EINVAL;
}
@@ -1955,7 +1955,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
/* Check, if it is write protected */
if (nand_check_wp(mtd)) {
- DEBUG(MTD_DEBUG_LEVEL0, "nand_erase: "
+ MTD_DEBUG(MTD_DEBUG_LEVEL0, "nand_erase: "
"Device is write protected!!!\n");
instr->state = MTD_ERASE_FAILED;
goto erase_exit;
@@ -2009,7 +2009,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
/* See if block erase succeeded */
if (status & NAND_STATUS_FAIL) {
- DEBUG(MTD_DEBUG_LEVEL0, "nand_erase: "
+ MTD_DEBUG(MTD_DEBUG_LEVEL0, "nand_erase: "
"Failed erase, page 0x%08x\n", page);
instr->state = MTD_ERASE_FAILED;
instr->fail_addr = (page << chip->page_shift);
@@ -2068,7 +2068,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
if (!rewrite_bbt[chipnr])
continue;
/* update the BBT for chip */
- DEBUG(MTD_DEBUG_LEVEL0, "nand_erase_nand: nand_update_bbt "
+ MTD_DEBUG(MTD_DEBUG_LEVEL0, "nand_erase_nand: nand_update_bbt "
"(%d:0x%0x 0x%0x)\n", chipnr, rewrite_bbt[chipnr],
chip->bbt_td->pages[chipnr]);
nand_update_bbt(mtd, rewrite_bbt[chipnr]);
@@ -2088,7 +2088,7 @@ static void nand_sync(struct mtd_info *mtd)
{
struct nand_chip *chip = mtd->priv;
- DEBUG(MTD_DEBUG_LEVEL3, "nand_sync: called\n");
+ MTD_DEBUG(MTD_DEBUG_LEVEL3, "nand_sync: called\n");
/* Grab the lock and see if the device is available */
nand_get_device(chip, mtd, FL_SYNCING);
diff --git a/drivers/nand/nand_bbt.c b/drivers/nand/nand_bbt.c
index abdcdecaea..aa5ec7e23b 100644
--- a/drivers/nand/nand_bbt.c
+++ b/drivers/nand/nand_bbt.c
@@ -1202,7 +1202,7 @@ int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt)
block = (int)(offs >> (this->bbt_erase_shift - 1));
res = (this->bbt[block >> 3] >> (block & 0x06)) & 0x03;
- DEBUG(MTD_DEBUG_LEVEL2, "nand_isbad_bbt(): bbt info for offs 0x%08x: (block %d) 0x%02x\n",
+ MTD_DEBUG(MTD_DEBUG_LEVEL2, "nand_isbad_bbt(): bbt info for offs 0x%08x: (block %d) 0x%02x\n",
(unsigned int)offs, block >> 1, res);
switch ((int)res) {
diff --git a/drivers/nand/nand_imx.c b/drivers/nand/nand_imx.c
index 43f4218cc6..cbff7ceef4 100644
--- a/drivers/nand/nand_imx.c
+++ b/drivers/nand/nand_imx.c
@@ -198,7 +198,7 @@ static void __nand_boot_init wait_op_done(struct imx_nand_host *host, u16 param)
*/
static void __nand_boot_init send_cmd(struct imx_nand_host *host, u16 cmd)
{
- DEBUG(MTD_DEBUG_LEVEL3, "send_cmd(host, 0x%x)\n", cmd);
+ MTD_DEBUG(MTD_DEBUG_LEVEL3, "send_cmd(host, 0x%x)\n", cmd);
writew(cmd, host->regs + NFC_FLASH_CMD);
writew(NFC_CMD, host->regs + NFC_CONFIG2);
@@ -217,7 +217,7 @@ static void __nand_boot_init send_cmd(struct imx_nand_host *host, u16 cmd)
*/
static void __nand_boot_init send_addr(struct imx_nand_host *host, u16 addr)
{
- DEBUG(MTD_DEBUG_LEVEL3, "send_addr(host, 0x%x %d)\n", addr, islast);
+ MTD_DEBUG(MTD_DEBUG_LEVEL3, "send_addr(host, 0x%x %d)\n", addr, islast);
writew(addr, host->regs + NFC_FLASH_ADDR);
writew(NFC_ADDR, host->regs + NFC_CONFIG2);
@@ -236,7 +236,7 @@ static void __nand_boot_init send_addr(struct imx_nand_host *host, u16 addr)
static void send_prog_page(struct imx_nand_host *host, u8 buf_id,
int spare_only)
{
- DEBUG(MTD_DEBUG_LEVEL3, "send_prog_page (%d)\n", spare_only);
+ MTD_DEBUG(MTD_DEBUG_LEVEL3, "send_prog_page (%d)\n", spare_only);
/* NANDFC buffer 0 is used for page read/write */
@@ -268,7 +268,7 @@ static void send_prog_page(struct imx_nand_host *host, u8 buf_id,
static void __nand_boot_init send_read_page(struct imx_nand_host *host,
u8 buf_id, int spare_only)
{
- DEBUG(MTD_DEBUG_LEVEL3, "send_read_page (%d)\n", spare_only);
+ MTD_DEBUG(MTD_DEBUG_LEVEL3, "send_read_page (%d)\n", spare_only);
/* NANDFC buffer 0 is used for page read/write */
writew(buf_id, host->regs + NFC_BUF_ADDR);
@@ -403,7 +403,7 @@ static int imx_nand_correct_data(struct mtd_info *mtd, u_char * dat,
u16 ecc_status = readw(host->regs + NFC_ECC_STATUS_RESULT);
if (((ecc_status & 0x3) == 2) || ((ecc_status >> 2) == 2)) {
- DEBUG(MTD_DEBUG_LEVEL0,
+ MTD_DEBUG(MTD_DEBUG_LEVEL0,
"MXC_NAND: HWECC uncorrectable 2-bit ECC error\n");
return -1;
}
@@ -475,7 +475,7 @@ static u16 imx_nand_read_word(struct mtd_info *mtd)
u16 rdword, ret;
volatile u16 *p;
- DEBUG(MTD_DEBUG_LEVEL3,
+ MTD_DEBUG(MTD_DEBUG_LEVEL3,
"imx_nand_read_word(col = %d)\n", host->col_addr);
col = host->col_addr;
@@ -531,7 +531,7 @@ static void imx_nand_write_buf(struct mtd_info *mtd,
int col;
int i = 0;
- DEBUG(MTD_DEBUG_LEVEL3,
+ MTD_DEBUG(MTD_DEBUG_LEVEL3,
"imx_nand_write_buf(col = %d, len = %d)\n", host->col_addr,
len);
@@ -544,7 +544,7 @@ static void imx_nand_write_buf(struct mtd_info *mtd,
n = mtd->writesize + mtd->oobsize - col;
n = min(len, n);
- DEBUG(MTD_DEBUG_LEVEL3,
+ MTD_DEBUG(MTD_DEBUG_LEVEL3,
"%s:%d: col = %d, n = %d\n", __FUNCTION__, __LINE__, col, n);
while (n) {
@@ -556,7 +556,7 @@ static void imx_nand_write_buf(struct mtd_info *mtd,
p = (volatile u32 *)((ulong) (host->regs + SPARE_AREA0)
- mtd->writesize + (col & ~3));
- DEBUG(MTD_DEBUG_LEVEL3, "%s:%d: p = %p\n", __FUNCTION__,
+ MTD_DEBUG(MTD_DEBUG_LEVEL3, "%s:%d: p = %p\n", __FUNCTION__,
__LINE__, p);
if (((col | (int)&buf[i]) & 3) || n < 16) {
@@ -605,7 +605,7 @@ static void imx_nand_write_buf(struct mtd_info *mtd,
m = min(n, m) & ~3;
- DEBUG(MTD_DEBUG_LEVEL3,
+ MTD_DEBUG(MTD_DEBUG_LEVEL3,
"%s:%d: n = %d, m = %d, i = %d, col = %d\n",
__FUNCTION__, __LINE__, n, m, i, col);
@@ -638,7 +638,7 @@ static void imx_nand_read_buf(struct mtd_info *mtd, u_char * buf, int len)
int col;
int i = 0;
- DEBUG(MTD_DEBUG_LEVEL3,
+ MTD_DEBUG(MTD_DEBUG_LEVEL3,
"imx_nand_read_buf(col = %d, len = %d)\n", host->col_addr,
len);
@@ -735,7 +735,7 @@ static void imx_nand_select_chip(struct mtd_info *mtd, int chip)
u16 tmp;
if (chip > 0) {
- DEBUG(MTD_DEBUG_LEVEL0,
+ MTD_DEBUG(MTD_DEBUG_LEVEL0,
"ERROR: Illegal chip select (chip = %d)\n", chip);
return;
}
@@ -768,7 +768,7 @@ static void imx_nand_command(struct mtd_info *mtd, unsigned command,
struct nand_chip *nand_chip = mtd->priv;
struct imx_nand_host *host = nand_chip->priv;
- DEBUG(MTD_DEBUG_LEVEL3,
+ MTD_DEBUG(MTD_DEBUG_LEVEL3,
"imx_nand_command (cmd = 0x%x, col = 0x%x, page = 0x%x)\n",
command, column, page_addr);
@@ -936,7 +936,7 @@ static void imx_low_erase(struct mtd_info *mtd)
unsigned int page_addr, addr;
u_char status;
- DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : imx_low_erase:Erasing NAND\n");
+ MTD_DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : imx_low_erase:Erasing NAND\n");
for (addr = 0; addr < this->chipsize; addr += mtd->erasesize) {
page_addr = addr / mtd->writesize;
imx_nand_command(mtd, NAND_CMD_ERASE1, -1, page_addr);
@@ -1054,7 +1054,7 @@ static int __init imxnd_probe(struct device_d *dev)
/* Scan to find existence of the device */
if (nand_scan(mtd, 1)) {
- DEBUG(MTD_DEBUG_LEVEL0,
+ MTD_DEBUG(MTD_DEBUG_LEVEL0,
"MXC_ND: Unable to find any NAND device.\n");
err = -ENXIO;
goto escan;