diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mtd/nand.h | 3 | ||||
| -rw-r--r-- | include/linux/mtd/rawnand.h | 35 |
2 files changed, 29 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 5dad59b31244..a206172ec23b 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 |
| @@ -997,7 +1010,9 @@ struct nand_op_parser_data_constraints { | |||
| 997 | * struct nand_op_parser_pattern_elem - One element of a pattern | 1010 | * struct nand_op_parser_pattern_elem - One element of a pattern |
| 998 | * @type: the instructuction type | 1011 | * @type: the instructuction type |
| 999 | * @optional: whether this element of the pattern is optional or mandatory | 1012 | * @optional: whether this element of the pattern is optional or mandatory |
| 1000 | * @addr/@data: address or data constraint (number of cycles or data length) | 1013 | * @ctx: address or data constraint |
| 1014 | * @ctx.addr: address constraint (number of cycles) | ||
| 1015 | * @ctx.data: data constraint (data length) | ||
| 1001 | */ | 1016 | */ |
| 1002 | struct nand_op_parser_pattern_elem { | 1017 | struct nand_op_parser_pattern_elem { |
| 1003 | enum nand_op_instr_type type; | 1018 | enum nand_op_instr_type type; |
| @@ -1224,6 +1239,8 @@ int nand_op_parser_exec_op(struct nand_chip *chip, | |||
| 1224 | * devices. | 1239 | * devices. |
| 1225 | * @priv: [OPTIONAL] pointer to private chip data | 1240 | * @priv: [OPTIONAL] pointer to private chip data |
| 1226 | * @manufacturer: [INTERN] Contains manufacturer information | 1241 | * @manufacturer: [INTERN] Contains manufacturer information |
| 1242 | * @manufacturer.desc: [INTERN] Contains manufacturer's description | ||
| 1243 | * @manufacturer.priv: [INTERN] Contains manufacturer private information | ||
| 1227 | */ | 1244 | */ |
| 1228 | 1245 | ||
| 1229 | struct nand_chip { | 1246 | struct nand_chip { |
