aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-08 13:39:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-08 13:39:20 -0400
commitf4e70c2e5f1406e715f6359ae341e76e5004fb98 (patch)
tree79622d866d0cb8bdb494718e11d458770aee9713 /include/linux
parentea125dedbc14b305307889c40d74d564c4419851 (diff)
parentb771327a4530e7ff05ae173d4903cd70357bb803 (diff)
Merge tag 'mtd/for-4.18' of git://git.infradead.org/linux-mtd
Pull MTD updates from Boris Brezillon: "Core changes: - Add a sysfs attribute to expose available OOB size Driver changes: - Remove HAS_DMA dependency on various drivers - Use dev_get_drvdata() instead of platform_get_drvdata() in docg3 - Replace msleep by usleep_range() in the dataflash driver - Avoid VLA usage in nftl layers - Remove useless .owner assignment in pismo - Fix various issues in the CFI driver - Improve TRX partition handling expose a DT compat for this part parser - Clarify OFFSET_CONTINUOUS meaning NAND core changes: - Add Miquel as a NAND maintainer - Add access mode to the nand_page_io_req struct - Fix kernel-doc in rawnand.h - Support bit-wise majority to recover from corrupted ONFI parameter pages - Stop checking FAIL bit after a SET_FEATURES, as documented in the ONFI spec Raw NAND Driver changes: - Fix and cleanup the error path of many NAND controller drivers - GPMI: + Cleanup/simplification of a few aspects in the driver + Take ECC setup specified in the DT into account - sunxi: remove support for GPIO-based R/B polling - MTK: + Use of_device_get_match_data() instead of of_match_device() + Add an entry in MAINTAINERS for this driver + Fix nand-ecc-step-size and nand-ecc-strength description in the DT bindings doc - fsl_ifc: fix ->cmdfunc() to read more than one ONFI parameter page OneNAND driver changes: - samsung: use dev_get_drvdata() instead of platform_get_drvdata() SPI NOR core changes: - Add support for a bunch of SPI NOR chips - Clear EAR reg when switching to 3-byte addressing mode on Winbond chips SPI NOR controller driver changes: - cadence: Add DMA support for direct mode reads - hisi: Prefix a few functions with hisi_ - intel: + Mark the driver as "dangerous" in Kconfig + Fix atomic sequence handling + Pass a 40us delay (instead of 0us) to readl_poll_timeout() - fsl: + fix a typo in a function name + add support for IP variants embedded in the ls2080a and ls1080a SoCs - stm32: request exclusive control of the reset line" * tag 'mtd/for-4.18' of git://git.infradead.org/linux-mtd: (66 commits) mtd: nand: Pass mode information to nand_page_io_req mtd: cfi_cmdset_0002: Change erase one block to enable XIP once mtd: cfi_cmdset_0002: Change erase functions to check chip good only mtd: cfi_cmdset_0002: Change erase functions to retry for error mtd: cfi_cmdset_0002: Change definition naming to retry write operation mtd: cfi_cmdset_0002: Change write buffer to check correct value mtd: cmdlinepart: Update comment for introduction of OFFSET_CONTINUOUS mtd: bcm47xxpart: add of_match_table with a new DT binding dt-bindings: mtd: document Broadcom's BCM47xx partitions mtd: spi-nor: Add support for EN25QH32 mtd: spi-nor: Add support for is25wp series chips mtd: spi-nor: Add Winbond w25q32jv support mtd: spi-nor: fsl-quadspi: add support for ls2080a/ls1080a mtd: spi-nor: stm32-quadspi: explicitly request exclusive reset control mtd: spi-nor: intel: provide a range for poll_timout mtd: spi-nor: fsl-quadspi: fix api naming typo _init_ahb_read mtd: spi-nor: intel-spi: Explicitly mark the driver as dangerous in Kconfig mtd: spi-nor: intel-spi: Fix atomic sequence handling mtd: rawnand: Do not check FAIL bit when executing a SET_FEATURES op mtd: rawnand: use bit-wise majority to recover the ONFI param page ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mtd/nand.h3
-rw-r--r--include/linux/mtd/rawnand.h35
-rw-r--r--include/linux/mtd/spi-nor.h2
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;
28struct device_node; 28struct device_node;
29 29
30/* Scan and identify a NAND device */ 30/* Scan and identify a NAND device */
31int nand_scan(struct mtd_info *mtd, int max_chips); 31int nand_scan_with_ids(struct mtd_info *mtd, int max_chips,
32 struct nand_flash_dev *ids);
33
34static 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 */
746struct nand_data_interface { 754struct 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 */
1008struct nand_op_parser_pattern_elem { 1023struct 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
1235struct nand_chip { 1252struct 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) */