mtd: atmel_nand: enable Nand Flash Controller (NFC) support
Subsystems (5)
cover mtd: atmel_nand: enable Nand Flash Controller (NFC) support
This patch series enable NFC support for SAMA5 soc. It can send command, address cycles automaticly. Also when enable NFC sram, NFC will transfer data to sram. Which can save lots of cpu time.
Josh Wu (4):
mtd: atmel_nand: replace pmecc enable code with one function.
mtd: atmel_nand: add Nand Flash Controller (NFC) support
mtd: atmel_nand: enable Nand Flash Controller (NFC) read data
via sram
mtd: atmel_nand: enable Nand Flash Controller (NFC) write via
sram
.../devicetree/bindings/mtd/atmel-nand.txt | 4 + drivers/mtd/nand/atmel_nand.c | 658 ++++++++++++++++++-- drivers/mtd/nand/atmel_nand_ecc.h | 7 +- drivers/mtd/nand/atmel_nand_nfc.h | 106 ++++ 4 files changed, 725 insertions(+), 50 deletions(-) create mode 100644 drivers/mtd/nand/atmel_nand_nfc.h
Signature · 1 line
1.7.9.5
PATCH 1/4 mtd: atmel_nand: replace pmecc enable code with one function.
--- drivers/mtd/nand/atmel_nand.c | 35 ++++++++++++++++++++--------------- drivers/mtd/nand/atmel_nand_ecc.h | 7 ++++++- 2 files changed, 26 insertions(+), 16 deletions(-)
drivers/mtd/nand/atmel_nand.c +20 -15
@@ -763,6 +763,24 @@ normal_check:return total_err; } +static void pmecc_enable (struct atmel_nand_host *host,enum pmecc_op op) +{ +u32 val; +pmecc_writel (host->ecc,CTRL ,PMECC_CTRL_RST ); +pmecc_writel (host->ecc,CTRL ,PMECC_CTRL_DISABLE ); + val =pmecc_readl_relaxed (host->ecc,CFG ); + +if (op ==PMECC_READ ) +pmecc_writel (host->ecc,CFG , (val & ~PMECC_CFG_WRITE_OP ) + |PMECC_CFG_AUTO_ENABLE ); +else +pmecc_writel (host->ecc,CFG , (val |PMECC_CFG_WRITE_OP ) + & ~PMECC_CFG_AUTO_ENABLE ); + +pmecc_writel (host->ecc,CTRL ,PMECC_CTRL_ENABLE ); +pmecc_writel (host->ecc,CTRL ,PMECC_CTRL_DATA ); +} +static int atmel_nand_pmecc_read_page (struct mtd_info *mtd,struct nand_chip *chip,uint8_t *buf,int oob_required,int page) {
@@ -774,13 +792,7 @@ static int atmel_nand_pmecc_read_page(struct mtd_info *mtd,unsigned long end_time;int bitflips =0 ; -pmecc_writel (host->ecc,CTRL ,PMECC_CTRL_RST ); -pmecc_writel (host->ecc,CTRL ,PMECC_CTRL_DISABLE ); -pmecc_writel (host->ecc,CFG , (pmecc_readl_relaxed (host->ecc,CFG ) - & ~PMECC_CFG_WRITE_OP ) |PMECC_CFG_AUTO_ENABLE ); - -pmecc_writel (host->ecc,CTRL ,PMECC_CTRL_ENABLE ); -pmecc_writel (host->ecc,CTRL ,PMECC_CTRL_DATA ); +pmecc_enable (host,PMECC_READ ); chip->read_buf (mtd, buf, eccsize); chip->read_buf (mtd, oob, mtd->oobsize);
@@ -813,14 +825,7 @@ static int atmel_nand_pmecc_write_page(struct mtd_info *mtd,int i, j;unsigned long end_time; -pmecc_writel (host->ecc,CTRL ,PMECC_CTRL_RST ); -pmecc_writel (host->ecc,CTRL ,PMECC_CTRL_DISABLE ); - -pmecc_writel (host->ecc,CFG , (pmecc_readl_relaxed (host->ecc,CFG ) | -PMECC_CFG_WRITE_OP ) & ~PMECC_CFG_AUTO_ENABLE ); - -pmecc_writel (host->ecc,CTRL ,PMECC_CTRL_ENABLE ); -pmecc_writel (host->ecc,CTRL ,PMECC_CTRL_DATA ); +pmecc_enable (host,PMECC_WRITE ); chip->write_buf (mtd, (u8 *)buf, mtd->writesize);
drivers/mtd/nand/atmel_nand_ecc.h +6 -1
@@ -3,7 +3,7 @@* Based on AT91SAM9260 datasheet revision B. * * Copyright (C) 2007 Andrew Victor -* Copyright (C) 2007 - 2012 Atmel Corporation. +* Copyright (C) 2007 - 2013 Atmel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the
@@ -148,4 +148,9 @@/* Time out value for reading PMECC status register */ #define PMECC_MAX_TIMEOUT_MS 100 +enum pmecc_op { +PMECC_READ , +PMECC_WRITE , +}; +#endif
Signature · 1 line
1.7.9.5
PATCH 2/4 mtd: atmel_nand: add Nand Flash Controller (NFC) support
In reply to Josh WuNand Flash Controller (NFC) can handle automatic transfers, sending the commands and address cycles to the NAND Flash.
To use NFC in this driver, the user needs to set the address and size of NFC command registers, NFC registers (embedded in HSMC) and NFC SRAM in dts. Also user need to set up the HSMC irq, which use to check whether nfc command is finish or not.
This driver has been tested on SAMA5D3X-EK board with JFFS2, YAFFS, UBIFS and mtd-utils.
I put the part of the mtd_speedtest result here for your information.
Quoted 1 line
From the
mtd_speedtest, we can see the NFC will reduce the %50 of cpu load
when writing nand flash. No change when reading.
In the meantime, the speed will be slow about %8.
- commands use to test:
#insmod /mnt/mtd_speedtest.ko dev=2 &
#top -n 30 -d 1 | grep speedtest
- test result:
Before the patch:
=================================================mtd_speedtest: MTD device: 2mtd_speedtest: MTD device size 41943040, eraseblock size 131072, page size 2048, count of eraseblocks 320, pages per eraseblock 64, OOB size 64
515 495 root R 1164 0% 93% insmod /mnt/mtd_speedtest.ko dev=2 515 495 root R 1164 0% 98% insmod /mnt/mtd_speedtest.ko dev=2 515 495 root R 1164 0% 99% insmod /mnt/mtd_speedtest.ko dev=2 mtd_speedtest: eraseblock write speed is 5768 KiB/s mtd_speedtest: testing eraseblock read speed 515 495 root R 1164 0% 92% insmod /mnt/mtd_speedtest.ko dev=2 515 495 root R 1164 0% 91% insmod /mnt/mtd_speedtest.ko dev=2 515 495 root R 1164 0% 94% insmod /mnt/mtd_speedtest.ko dev=2 mtd_speedtest: eraseblock read speed is 5932 KiB/s mtd_speedtest: testing page write speed 515 495 root R 1164 0% 94% insmod /mnt/mtd_speedtest.ko dev=2 515 495 root R 1164 0% 98% insmod /mnt/mtd_speedtest.ko dev=2 515 495 root R 1164 0% 98% insmod /mnt/mtd_speedtest.ko dev=2 mtd_speedtest: page write speed is 5770 KiB/s mtd_speedtest: testing page read speed 515 495 root R 1164 0% 91% insmod /mnt/mtd_speedtest.ko dev=2 515 495 root R 1164 0% 89% insmod /mnt/mtd_speedtest.ko dev=2 515 495 root R 1164 0% 91% insmod /mnt/mtd_speedtest.ko dev=2
mtd_speedtest: page read speed is 5910 KiB/s
After the patch:
=================================================mtd_speedtest: MTD device: 2mtd_speedtest: MTD device size 41943040, eraseblock size 131072, page size 2048, count of eraseblocks 320, pages per eraseblock 64, OOB size 64mtd_speedtest: testing eraseblock write speed
509 495 root D 1164 0% 49% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root D 1164 0% 50% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root D 1164 0% 47% insmod /mnt/mtd_speedtest.ko dev=2 mtd_speedtest: eraseblock write speed is 5370 KiB/s mtd_speedtest: testing eraseblock read speed 509 495 root R 1164 0% 92% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root R 1164 0% 91% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root R 1164 0% 95% insmod /mnt/mtd_speedtest.ko dev=2 mtd_speedtest: eraseblock read speed is 5715 KiB/s mtd_speedtest: testing page write speed 509 495 root D 1164 0% 48% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root D 1164 0% 47% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root D 1164 0% 50% insmod /mnt/mtd_speedtest.ko dev=2 mtd_speedtest: page write speed is 5224 KiB/s mtd_speedtest: testing page read speed 509 495 root R 1164 0% 89% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root R 1164 0% 94% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root R 1164 0% 93% insmod /mnt/mtd_speedtest.ko dev=2
mtd_speedtest: page read speed is 5641 KiB/s
--- .../devicetree/bindings/mtd/atmel-nand.txt | 3 + drivers/mtd/nand/atmel_nand.c | 383 ++++++++++++++++++-- drivers/mtd/nand/atmel_nand_nfc.h | 106 ++++++ 3 files changed, 464 insertions(+), 28 deletions(-) create mode 100644 drivers/mtd/nand/atmel_nand_nfc.h
Documentation/devicetree/bindings/mtd/atmel-nand.txt +3 -0
@@ -6,6 +6,8 @@ Required properties: and hardware ECC controller if available. If the hardware ECC is PMECC, it should contain address and size for PMECC, PMECC Error Location controller and ROM which has lookup tables. + If hardware supports Nand Flash Controller, it should contain address and + size for NFC command registers, NFC registers and NFC Sram. - atmel,nand-addr-offset : offset for the address latch. - atmel,nand-cmd-offset : offset for the command latch. - #address-cells, #size-cells : Must be present if the device has sub-nodes
@@ -29,6 +31,7 @@ Optional properties: sector size 1024. - nand-bus-width : 8 or 16 bus width if not present 8 - nand-on-flash-bbt: boolean to enable on flash bbt option if not present false +- atmel,has-nfc: boolean to enable Nand Flash Controller(NFC). Examples: nand0: nand at 40000000,0 {
drivers/mtd/nand/atmel_nand.c +355 -28
465 lines not on this page · raw message
drivers/mtd/nand/atmel_nand_nfc.h new file +106 -0
106 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 3/4 mtd: atmel_nand: enable Nand Flash Controller (NFC) read data via sram
In reply to Josh WuNFC has embedded sram which can use to transfer data. This patch enable reading nand flash via NFC SRAM. It will minimize the CPU overhead.
This driver has been tested on SAMA5D3X-EK with JFFS2, YAFFS2, UBIFS and mtd-utils.
Here puts the part of mtd_speedtest (read test) result as following:
Compare with non-NFC mtd_speedtest result, reading will reduce %45 cpu load with increase %80 speed.
- commands use to test:
# insmod /mnt/mtd_speedtest.ko dev=2 & # top -n 30 -d 1 | grep speedtest
- test result:
=================================================mtd_speedtest: MTD device: 2mtd_speedtest: MTD device size 41943040, eraseblock size 131072, page size 2048, count of eraseblocks 320, pages per eraseblock 64, OOB size 64mtd_speedtest: testing eraseblock read speed
509 495 root D 1164 0% 28% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root D 1164 0% 25% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root D 1164 0% 26% insmod /mnt/mtd_speedtest.ko dev=2 mtd_speedtest: eraseblock read speed is 9403 KiB/s mtd_speedtest: testing page read speed 509 495 root R 1164 0% 31% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root D 1164 0% 57% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root D 1164 0% 53% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root D 1164 0% 71% insmod /mnt/mtd_speedtest.ko dev=2
mtd_speedtest: page read speed is 9258 KiB/s
--- .../devicetree/bindings/mtd/atmel-nand.txt | 1 + drivers/mtd/nand/atmel_nand.c | 154 +++++++++++++++++++- 2 files changed, 151 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/mtd/atmel-nand.txt +1 -0
@@ -32,6 +32,7 @@ Optional properties: - nand-bus-width : 8 or 16 bus width if not present 8 - nand-on-flash-bbt: boolean to enable on flash bbt option if not present false - atmel,has-nfc: boolean to enable Nand Flash Controller(NFC). +- atmel,use-nfc-sram: boolean to enable NFC transfer data via sram. Examples: nand0: nand at 40000000,0 {
drivers/mtd/nand/atmel_nand.c +150 -4
257 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 4/4 mtd: atmel_nand: enable Nand Flash Controller (NFC) write via sram
In reply to Josh WuThis patch enable writing nand flash via NFC SRAM. It will minimize the CPU overhead. The SRAM write only support ECC_NONE and ECC_HW with PMECC.
This driver has been tested on SAMA5D3X-EK with JFFS2, YAFFS2, UBIFS and mtd-utils.
Here is part of mtd_speedtest (writing test) result, compare with non-NFC writing, it reduces %65 cpu load with loss %12 speed.
- commands use to test:
# insmod /mnt/mtd_speedtest.ko dev=2 & # top -n 30 -d 1 | grep speedtest
- test result:
=================================================mtd_speedtest: MTD device: 2mtd_speedtest: MTD device size 41943040, eraseblock size 131072, page size 2048, count of eraseblocks 320, pages per eraseblock 64, OOB size 64mtd_speedtest: testing eraseblock write speed
509 495 root D 1164 0% 7% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root D 1164 0% 8% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root R 1164 0% 5% insmod /mnt/mtd_speedtest.ko dev=2 mtd_speedtest: eraseblock write speed is 5194 KiB/s mtd_speedtest: testing page write speed 509 495 root D 1164 0% 32% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root D 1164 0% 27% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root D 1164 0% 25% insmod /mnt/mtd_speedtest.ko dev=2 509 495 root D 1164 0% 30% insmod /mnt/mtd_speedtest.ko dev=2
mtd_speedtest: page write speed is 5024 KiB/s
--- drivers/mtd/nand/atmel_nand.c | 90 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 4 deletions(-)
drivers/mtd/nand/atmel_nand.c +86 -4
@@ -99,6 +99,7 @@ struct atmel_nfc {/* Point to the sram bank which include readed data via NFC */ void __iomem *data_in_sram; +bool will_write_sram; };struct atmel_nand_host {
@@ -218,6 +219,16 @@ static void memcpy32_fromio(void *trg, const void __iomem *src, size_t size) *t++ =readl_relaxed (s++); } +static void memcpy32_toio (void __iomem *trg,const void *src,int size) +{ +int i; +u32 __iomem *t = trg; +const u32 *s = src; + +for (i =0 ; i < (size >>2 ); i++) +writel_relaxed (*s++, t++); +} +/* * Minimal-overhead PIO for data access. */
@@ -339,7 +350,11 @@ static int atmel_nand_dma_op(struct mtd_info *mtd, void *buf, int len, dma_dst_addr = phys_addr; }else { dma_src_addr = phys_addr; - dma_dst_addr = host->io_phys; + +if (host->use_nfc_sram) + dma_dst_addr =nfc_sram_phys (host); +else + dma_dst_addr = host->io_phys; } tx = dma_dev->device_prep_dma_memcpy(host->dma_chan, dma_dst_addr,
@@ -914,9 +929,10 @@ static int atmel_nand_pmecc_write_page(struct mtd_info *mtd,int i, j;unsigned long end_time; -pmecc_enable (host,PMECC_WRITE ); - - chip->write_buf (mtd, (u8 *)buf, mtd->writesize); +if (!host->use_nfc_sram) { +pmecc_enable (host,PMECC_WRITE ); + chip->write_buf (mtd, (u8 *)buf, mtd->writesize); + } end_time = jiffies +msecs_to_jiffies (PMECC_MAX_TIMEOUT_MS );while ((pmecc_readl_relaxed (host->ecc,SR ) &PMECC_SR_BUSY )) {
@@ -1800,6 +1816,8 @@ static void nfc_nand_command(struct mtd_info *mtd, unsigned int command,case NAND_CMD_SEQIN :case NAND_CMD_RNDIN : nfcwr =NFCADDR_CMD_NFCWR ; +if (host->nfc.will_write_sram && command ==NAND_CMD_SEQIN ) + dataen =NFCADDR_CMD_DATAEN ;break ;default :break ;
@@ -1854,6 +1872,64 @@ static void nfc_nand_command(struct mtd_info *mtd, unsigned int command, } } +static int nfc_sram_write_page (struct mtd_info *mtd,struct nand_chip *chip, +const uint8_t *buf,int oob_required,int page, +int cached,int raw) +{ +int cfg, len; +int status =0 ; +struct atmel_nand_host *host = chip->priv; +void __iomem *sram = host->nfc.sram_bank0 +nfc_get_sram_off (host); + + cfg =nfc_readl (host->nfc.hsmc_regs,CFG ); + len = mtd->writesize; + +if (unlikely (raw)) { + len += mtd->oobsize; +nfc_writel (host->nfc.hsmc_regs,CFG , cfg |ATMEL_HSMC_WSPARE ); + }else +nfc_writel (host->nfc.hsmc_regs,CFG , cfg & ~ATMEL_HSMC_WSPARE ); + +/* Copy page data to sram that will write to nand via NFC */ +if (use_dma) { +if (atmel_nand_dma_op (mtd, (void *)buf, len,0 ) !=0 ) +/* Fall back to use cpu copy */ +memcpy32_toio (sram, buf, len); + }else { +memcpy32_toio (sram, buf, len); + } + +if (chip->ecc.mode ==NAND_ECC_HW && host->has_pmecc) +/* +* When use NFC sram, need set up PMECC before send +* NAND_CMD_SEQIN command. Since when the nand command +* is sent, nfc will do transfer from sram and nand. +*/ +pmecc_enable (host,PMECC_WRITE ); + + host->nfc.will_write_sram = true; + chip->cmdfunc (mtd,NAND_CMD_SEQIN ,0x00 , page); + host->nfc.will_write_sram = false; + +if (likely (!raw)) +/* Need to write ecc into oob */ + status = chip->ecc.write_page (mtd, chip, buf, oob_required); + +if (status <0 ) +return status; + + chip->cmdfunc (mtd,NAND_CMD_PAGEPROG ,-1 ,-1 ); + status = chip->waitfunc (mtd, chip); + +if ((status &NAND_STATUS_FAIL ) && (chip->errstat)) + status = chip->errstat (mtd, chip,FL_WRITING , status, page); + +if (status &NAND_STATUS_FAIL ) +return -EIO ; + +return 0 ; +} +static int nfc_sram_init (struct mtd_info *mtd) {struct nand_chip *chip = mtd->priv;
@@ -1892,10 +1968,16 @@ static int nfc_sram_init(struct mtd_info *mtd)nfc_writel (host->nfc.hsmc_regs,CFG , cfg_nfc); + host->nfc.will_write_sram = false;nfc_set_sram_bank (host,0 );dev_info (host->dev,"Using NFC Sram\n" ); +/* Use Write page with NFC SRAM only for PMECC or ECC NONE. */ +if ((chip->ecc.mode ==NAND_ECC_HW && host->has_pmecc) || + chip->ecc.mode ==NAND_ECC_NONE ) + chip->write_page = nfc_sram_write_page; +return 0 ; }
Signature · 1 line
1.7.9.5
cover mtd: atmel_nand: enable Nand Flash Controller (NFC) support
In reply to Josh WuQuoted 11 lines · Josh Wu
This patch series enable NFC support for SAMA5 soc. It can send command, address cycles automaticly. Also when enable NFC sram, NFC will transfer data to sram. Which can save lots of cpu time.
Josh Wu (4):
mtd:atmel_nand: replace pmecc enable code with one function.
mtd:atmel_nand: add Nand Flash Controller (NFC) support
mtd:atmel_nand: enable Nand Flash Controller (NFC) read data
via sram
mtd:atmel_nand: enable Nand Flash Controller (NFC) write via
sram
Please, re-base against the latest l2-mtd.git tree. The patches do not compile:
--------------------------------------------------------------------------------
Failed to build the following commit for configuration "arm-at91cap9_defconfig" (architecture arm)":
2bd4bff mtd: atmel_nand: enable Nand Flash Controller (NFC) write via sram
drivers/mtd/nand/atmel_nand.c: In function 'nfc_nand_command':drivers/mtd/nand/atmel_nand.c:1848: error: 'NAND_CMD_DEPLETE1' undeclared (first use in this function) drivers/mtd/nand/atmel_nand.c:1848: error: (Each undeclared identifier is reported only once drivers/mtd/nand/atmel_nand.c:1848: error: for each function it appears in.) drivers/mtd/nand/atmel_nand.c:1854: error: 'NAND_CMD_STATUS_ERROR' undeclared (first use in this function) drivers/mtd/nand/atmel_nand.c:1855: error: 'NAND_CMD_STATUS_ERROR0' undeclared (first use in this function) drivers/mtd/nand/atmel_nand.c:1856: error: 'NAND_CMD_STATUS_ERROR1' undeclared (first use in this function) drivers/mtd/nand/atmel_nand.c:1857: error: 'NAND_CMD_STATUS_ERROR2' undeclared (first use in this function) drivers/mtd/nand/atmel_nand.c:1858: error: 'NAND_CMD_STATUS_ERROR3' undeclared (first use in this function) drivers/mtd/nand/atmel_nand.c: In function 'nfc_sram_init':drivers/mtd/nand/atmel_nand.c:1979: warning: assignment from incompatible pointer type make[4]: *** [drivers/mtd/nand/atmel_nand.o] Error 1
Signature · 2 lines
Best Regards, Artem Bityutskiy
cover mtd: atmel_nand: enable Nand Flash Controller (NFC) support
Hi, Artem
Quoted 12 lines · Artem Bityutskiy
Quoted 11 lines · Josh Wu
This patch series enable NFC support for SAMA5 soc. It can send command, address cycles automaticly. Also when enable NFC sram, NFC will transfer data to sram. Which can save lots of cpu time.
Josh Wu (4):
mtd:atmel_nand: replace pmecc enable code with one function.
mtd:atmel_nand: add Nand Flash Controller (NFC) support
mtd:atmel_nand: enable Nand Flash Controller (NFC) read data
via sram
mtd:atmel_nand: enable Nand Flash Controller (NFC) write via
sram
Quoted 2 lines
Please, re-base against the latest l2-mtd.git tree. The patches do not compile:
I've sent out the v2 version which is rebased on the latest l2-mtd.git tree. It fixed the compiler error and imcompatible parameters of the write_page().
Thanks for point out.
Best Regards,
Josh Wu
Quoted 18 lines
--------------------------------------------------------------------------------
Failed to build the following commit for configuration "arm-at91cap9_defconfig" (architecture arm)":2bd4bff mtd:
atmel_nand: enable Nand Flash Controller (NFC) write via sram
drivers/mtd/nand/atmel_nand.c: In function 'nfc_nand_command':drivers/mtd/nand/atmel_nand.c:1848: error: 'NAND_CMD_DEPLETE1' undeclared (first use in this function)drivers/mtd/nand/atmel_nand.c:1848: error: (Each undeclared identifier is reported only oncedrivers/mtd/nand/atmel_nand.c:1848: error: for each function it appears in.)drivers/mtd/nand/atmel_nand.c:1854: error: 'NAND_CMD_STATUS_ERROR' undeclared (first use in this function)drivers/mtd/nand/atmel_nand.c:1855: error: 'NAND_CMD_STATUS_ERROR0' undeclared (first use in this function)drivers/mtd/nand/atmel_nand.c:1856: error: 'NAND_CMD_STATUS_ERROR1' undeclared (first use in this function)drivers/mtd/nand/atmel_nand.c:1857: error: 'NAND_CMD_STATUS_ERROR2' undeclared (first use in this function)drivers/mtd/nand/atmel_nand.c:1858: error: 'NAND_CMD_STATUS_ERROR3' undeclared (first use in this function)drivers/mtd/nand/atmel_nand.c: In function 'nfc_sram_init':drivers/mtd/nand/atmel_nand.c:1979: warning: assignment from incompatible pointer type make[4]: *** [drivers/mtd/nand/atmel_nand.o] Error 1