aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mtd/nand.h
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2013-03-04 08:39:18 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2013-04-05 07:03:47 -0400
commit8dbfae1ef04311ba19d6b6c9a4d8fdddbb90ab0f (patch)
tree27735e4b90a56ad97635303ceb8ecb6178816c9a /include/linux/mtd/nand.h
parent51148f1fb0835fc87ab3630d191dc3c880d4d0af (diff)
mtd: nand_ids: introduce helper macros
Introduce helper macros for defining NAND chips. These macros do not really add much value in the current code-base. However, we are going to add full ID support which adds some more complexity to the table, and helper macros become useful for readability. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux/mtd/nand.h')
-rw-r--r--include/linux/mtd/nand.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 9aed31a49af1..63b319a6f98c 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -546,6 +546,30 @@ struct nand_chip {
546#define NAND_MFR_MACRONIX 0xc2 546#define NAND_MFR_MACRONIX 0xc2
547#define NAND_MFR_EON 0x92 547#define NAND_MFR_EON 0x92
548 548
549/*
550 * A helper for defining older NAND chips where the second ID byte fully
551 * defined the chip, including the geometry (chip size, eraseblock size, page
552 * size).
553 */
554#define LEGACY_ID_NAND(nm, devid, pagesz, chipsz, erasesz, opts) \
555 { .name = (nm), .dev_id = (devid), .pagesize = (pagesz), \
556 .chipsize = (chipsz), .erasesize = (erasesz), \
557 .options = (opts) }
558
559/*
560 * A helper for defining newer chips which report their page size and
561 * eraseblock size via the extended ID bytes.
562 *
563 * The real difference between LEGACY_ID_NAND and EXTENDED_ID_NAND is that with
564 * EXTENDED_ID_NAND, manufacturers overloaded the same device ID so that the
565 * device ID now only represented a particular total chip size (and voltage,
566 * buswidth), and the page size, eraseblock size, and OOB size could vary while
567 * using the same device ID.
568 */
569#define EXTENDED_ID_NAND(nm, devid, chipsz, opts) \
570 { .name = (nm), .dev_id = (devid), .chipsize = (chipsz), \
571 .options = (opts) }
572
549/** 573/**
550 * struct nand_flash_dev - NAND Flash Device ID Structure 574 * struct nand_flash_dev - NAND Flash Device ID Structure
551 * @name: a human-readable name of the NAND chip 575 * @name: a human-readable name of the NAND chip