summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJörg Krause <joerg.krause@embedded.rocks>2018-01-14 21:26:37 +0300
committerStefano Babic <sbabic@denx.de>2018-06-27 13:20:55 +0300
commitda37d096820e15b2bcdb0243da2dc01707c650f2 (patch)
tree067250f9f3235917ad0c1a06fabcfccc147ea75f /include/linux
parent02bbe2aaa28fe2dde79b6d0e9ed5ed8963f79a8b (diff)
downloadu-boot-da37d096820e15b2bcdb0243da2dc01707c650f2.tar.xz
mtd: nand: export nand_get_flash_type function
`nand_get_flash_type()` allows identification of supported NAND flashs. The function is useful in SPL (like mxs_nand_spl.c) to lookup for a NAND flash (which does not support ONFi) instead of using nand_simple.c and hard-coding all required NAND parameters. Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mtd/rawnand.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
index 7fe553fc51..cdad7b85fa 100644
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -22,9 +22,16 @@
#include <asm/cache.h>
struct mtd_info;
+struct nand_chip;
struct nand_flash_dev;
struct device_node;
+/* Get the flash and manufacturer id and lookup if the type is supported. */
+struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
+ struct nand_chip *chip,
+ int *maf_id, int *dev_id,
+ struct nand_flash_dev *type);
+
/* Scan and identify a NAND device */
int nand_scan(struct mtd_info *mtd, int max_chips);
/*
@@ -247,9 +254,6 @@ typedef enum {
#define NAND_CI_CELLTYPE_MSK 0x0C
#define NAND_CI_CELLTYPE_SHIFT 2
-/* Keep gcc happy */
-struct nand_chip;
-
/* ONFI features */
#define ONFI_FEATURE_16_BIT_BUS (1 << 0)
#define ONFI_FEATURE_EXT_PARAM_PAGE (1 << 7)