diff options
Diffstat (limited to 'include/linux/mtd')
| -rw-r--r-- | include/linux/mtd/nand.h | 3 | ||||
| -rw-r--r-- | include/linux/mtd/rawnand.h | 35 | ||||
| -rw-r--r-- | include/linux/mtd/spi-nor.h | 2 |
3 files changed, 31 insertions, 9 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 792ea5c26329..abe975c87b90 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
| @@ -86,6 +86,7 @@ struct nand_pos { | |||
| 86 | * @ooboffs: the OOB offset within the page | 86 | * @ooboffs: the OOB offset within the page |
| 87 | * @ooblen: the number of OOB bytes to read from/write to this page | 87 | * @ooblen: the number of OOB bytes to read from/write to this page |
| 88 | * @oobbuf: buffer to store OOB data in or get OOB data from | 88 | * @oobbuf: buffer to store OOB data in or get OOB data from |
| 89 | * @mode: one of the %MTD_OPS_XXX mode | ||
| 89 | * | 90 | * |
| 90 | * This object is used to pass per-page I/O requests to NAND sub-layers. This | 91 | * This object is used to pass per-page I/O requests to NAND sub-layers. This |
| 91 | * way all useful information are already formatted in a useful way and | 92 | * way all useful information are already formatted in a useful way and |
| @@ -106,6 +107,7 @@ struct nand_page_io_req { | |||
| 106 | const void *out; | 107 | const void *out; |
| 107 | void *in; | 108 | void *in; |
| 108 | } oobbuf; | 109 | } oobbuf; |
| 110 | int mode; | ||
| 109 | }; | 111 | }; |
| 110 | 112 | ||
| 111 | /** | 113 | /** |
| @@ -599,6 +601,7 @@ static inline void nanddev_io_iter_init(struct nand_device *nand, | |||
| 599 | { | 601 | { |
| 600 | struct mtd_info *mtd = nanddev_to_mtd(nand); | 602 | struct mtd_info *mtd = nanddev_to_mtd(nand); |
| 601 | 603 | ||
| 604 | iter->req.mode = req->mode; | ||
| 602 | iter->req.dataoffs = nanddev_offs_to_pos(nand, offs, &iter->req.pos); | 605 | iter->req.dataoffs = nanddev_offs_to_pos(nand, offs, &iter->req.pos); |
| 603 | iter->req.ooboffs = req->ooboffs; | 606 | iter->req.ooboffs = req->ooboffs; |
| 604 | iter->oobbytes_per_page = mtd_oobavail(mtd, req); | 607 | iter->oobbytes_per_page = mtd_oobavail(mtd, req); |
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index 17c919436f48..3e8ec3b8a39c 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h | |||
| @@ -28,7 +28,14 @@ struct nand_flash_dev; | |||
| 28 | struct device_node; | 28 | struct device_node; |
| 29 | 29 | ||
| 30 | /* Scan and identify a NAND device */ | 30 | /* Scan and identify a NAND device */ |
| 31 | int nand_scan(struct mtd_info *mtd, int max_chips); | 31 | int nand_scan_with_ids(struct mtd_info *mtd, int max_chips, |
| 32 | struct nand_flash_dev *ids); | ||
| 33 | |||
| 34 | static inline int nand_scan(struct mtd_info *mtd, int max_chips) | ||
| 35 | { | ||
| 36 | return nand_scan_with_ids(mtd, max_chips, NULL); | ||
| 37 | } | ||
| 38 | |||
| 32 | /* | 39 | /* |
| 33 | * Separate phases of nand_scan(), allowing board driver to intervene | 40 | * Separate phases of nand_scan(), allowing board driver to intervene |
| 34 | * and override command or ECC setup according to flash type. | 41 | * and override command or ECC setup according to flash type. |
| @@ -740,8 +747,9 @@ enum nand_data_interface_type { | |||
| 740 | 747 | ||
| 741 | /** | 748 | /** |
| 742 | * struct nand_data_interface - NAND interface timing | 749 | * struct nand_data_interface - NAND interface timing |
| 743 | * @type: type of the timing | 750 | * @type: type of the timing |
| 744 | * @timings: The timing, type according to @type | 751 | * @timings: The timing, type according to @type |
| 752 | * @timings.sdr: Use it when @type is %NAND_SDR_IFACE. | ||
| 745 | */ | 753 | */ |
| 746 | struct nand_data_interface { | 754 | struct nand_data_interface { |
| 747 | enum nand_data_interface_type type; | 755 | enum nand_data_interface_type type; |
| @@ -798,8 +806,9 @@ struct nand_op_addr_instr { | |||
| 798 | /** | 806 | /** |
| 799 | * struct nand_op_data_instr - Definition of a data instruction | 807 | * struct nand_op_data_instr - Definition of a data instruction |
| 800 | * @len: number of data bytes to move | 808 | * @len: number of data bytes to move |
| 801 | * @in: buffer to fill when reading from the NAND chip | 809 | * @buf: buffer to fill |
| 802 | * @out: buffer to read from when writing to the NAND chip | 810 | * @buf.in: buffer to fill when reading from the NAND chip |
| 811 | * @buf.out: buffer to read from when writing to the NAND chip | ||
| 803 | * @force_8bit: force 8-bit access | 812 | * @force_8bit: force 8-bit access |
| 804 | * | 813 | * |
| 805 | * Please note that "in" and "out" are inverted from the ONFI specification | 814 | * Please note that "in" and "out" are inverted from the ONFI specification |
| @@ -842,9 +851,13 @@ enum nand_op_instr_type { | |||
| 842 | /** | 851 | /** |
| 843 | * struct nand_op_instr - Instruction object | 852 | * struct nand_op_instr - Instruction object |
| 844 | * @type: the instruction type | 853 | * @type: the instruction type |
| 845 | * @cmd/@addr/@data/@waitrdy: extra data associated to the instruction. | 854 | * @ctx: extra data associated to the instruction. You'll have to use the |
| 846 | * You'll have to use the appropriate element | 855 | * appropriate element depending on @type |
| 847 | * depending on @type | 856 | * @ctx.cmd: use it if @type is %NAND_OP_CMD_INSTR |
| 857 | * @ctx.addr: use it if @type is %NAND_OP_ADDR_INSTR | ||
| 858 | * @ctx.data: use it if @type is %NAND_OP_DATA_IN_INSTR | ||
| 859 | * or %NAND_OP_DATA_OUT_INSTR | ||
| 860 | * @ctx.waitrdy: use it if @type is %NAND_OP_WAITRDY_INSTR | ||
| 848 | * @delay_ns: delay the controller should apply after the instruction has been | 861 | * @delay_ns: delay the controller should apply after the instruction has been |
| 849 | * issued on the bus. Most modern controllers have internal timings | 862 | * issued on the bus. Most modern controllers have internal timings |
| 850 | * control logic, and in this case, the controller driver can ignore | 863 | * control logic, and in this case, the controller driver can ignore |
| @@ -1003,7 +1016,9 @@ struct nand_op_parser_data_constraints { | |||
| 1003 | * struct nand_op_parser_pattern_elem - One element of a pattern | 1016 | * struct nand_op_parser_pattern_elem - One element of a pattern |
| 1004 | * @type: the instructuction type | 1017 | * @type: the instructuction type |
| 1005 | * @optional: whether this element of the pattern is optional or mandatory | 1018 | * @optional: whether this element of the pattern is optional or mandatory |
| 1006 | * @addr/@data: address or data constraint (number of cycles or data length) | 1019 | * @ctx: address or data constraint |
| 1020 | * @ctx.addr: address constraint (number of cycles) | ||
| 1021 | * @ctx.data: data constraint (data length) | ||
| 1007 | */ | 1022 | */ |
| 1008 | struct nand_op_parser_pattern_elem { | 1023 | struct nand_op_parser_pattern_elem { |
| 1009 | enum nand_op_instr_type type; | 1024 | enum nand_op_instr_type type; |
| @@ -1230,6 +1245,8 @@ int nand_op_parser_exec_op(struct nand_chip *chip, | |||
| 1230 | * devices. | 1245 | * devices. |
| 1231 | * @priv: [OPTIONAL] pointer to private chip data | 1246 | * @priv: [OPTIONAL] pointer to private chip data |
| 1232 | * @manufacturer: [INTERN] Contains manufacturer information | 1247 | * @manufacturer: [INTERN] Contains manufacturer information |
| 1248 | * @manufacturer.desc: [INTERN] Contains manufacturer's description | ||
| 1249 | * @manufacturer.priv: [INTERN] Contains manufacturer private information | ||
| 1233 | */ | 1250 | */ |
| 1234 | 1251 | ||
| 1235 | struct nand_chip { | 1252 | struct nand_chip { |
diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index de36969eb359..e60da0d34cc1 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h | |||
| @@ -62,6 +62,8 @@ | |||
| 62 | #define SPINOR_OP_RDCR 0x35 /* Read configuration register */ | 62 | #define SPINOR_OP_RDCR 0x35 /* Read configuration register */ |
| 63 | #define SPINOR_OP_RDFSR 0x70 /* Read flag status register */ | 63 | #define SPINOR_OP_RDFSR 0x70 /* Read flag status register */ |
| 64 | #define SPINOR_OP_CLFSR 0x50 /* Clear flag status register */ | 64 | #define SPINOR_OP_CLFSR 0x50 /* Clear flag status register */ |
| 65 | #define SPINOR_OP_RDEAR 0xc8 /* Read Extended Address Register */ | ||
| 66 | #define SPINOR_OP_WREAR 0xc5 /* Write Extended Address Register */ | ||
| 65 | 67 | ||
| 66 | /* 4-byte address opcodes - used on Spansion and some Macronix flashes. */ | 68 | /* 4-byte address opcodes - used on Spansion and some Macronix flashes. */ |
| 67 | #define SPINOR_OP_READ_4B 0x13 /* Read data bytes (low frequency) */ | 69 | #define SPINOR_OP_READ_4B 0x13 /* Read data bytes (low frequency) */ |
