summaryrefslogtreecommitdiffstats
path: root/include/linux/mtd/nand.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-08-02 12:01:05 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-08-03 19:32:07 +0200
commit85f4fe32cfccf06223d55dc5751e0c644b119a9b (patch)
tree29ab6438c1717768c2a4a9d3ef3cf255f5e1a9ab /include/linux/mtd/nand.h
parent5a693051df54d9c690d141095089449346e748e5 (diff)
downloadbarebox-85f4fe32cfccf06223d55dc5751e0c644b119a9b.tar.gz
barebox-85f4fe32cfccf06223d55dc5751e0c644b119a9b.tar.xz
mtd nand: implement buswidth detection
This introduces a new NAND_BUSWIDTH_AUTO flag which can be used to automatically detect the nand buswidth. The id is always read in 8bit mode. An additional callback is needed to switch the nand controller into 16bit mode. This currently depends on a safe read_byte (always) and read_buf (for onfi-only flashes) callback. It has been tested on OMAP, but is not something that generally works. For this reason the existence of the set_buswidth callback is used to determine whether we are able to do autodetection or not. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/linux/mtd/nand.h')
-rw-r--r--include/linux/mtd/nand.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 4a492b5bcb..d2f864897c 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -169,6 +169,8 @@ typedef enum {
#define NAND_NO_READRDY 0x00000100
/* Chip does not allow subpage writes */
#define NAND_NO_SUBPAGE_WRITE 0x00000200
+/* Buswitdh shal be autodetected */
+#define NAND_BUSWIDTH_AUTO 0x00080000
/* Options valid for Samsung large page devices */
@@ -451,6 +453,7 @@ struct nand_chip {
int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page);
int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
const uint8_t *buf, int page, int cached, int raw);
+ int (*set_buswidth)(struct mtd_info *mtd, struct nand_chip *this, int buswidth);
int chip_delay;
unsigned int options;