aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-17 12:59:26 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-17 12:59:26 -0500
commitd6666be6f0c43efb9475d1d35fbef9f8be61b7b1 (patch)
treef544aec1dfdffa0c6b6d381f8e6710cad7e16074 /include/linux
parent0ea90b9e79cff66934119e6dd8fa8e9d0f7d005a (diff)
parent68f29815034e9dc9ed53cad85946c32b07adc8cc (diff)
Merge tag 'for-linus-20141215' of git://git.infradead.org/linux-mtd
Pull MTD updates from Brian Norris: "Summary: - Add device tree support for DoC3 - SPI NOR: Refactoring, for better layering between spi-nor.c and its driver users (e.g., m25p80.c) New flash device support Support 6-byte ID strings - NAND: New NAND driver for Allwinner SoC's (sunxi) GPMI NAND: add support for raw (no ECC) access, for testing purposes Add ATO manufacturer ID A few odd driver fixes - MTD tests: Allow testers to compensate for OOB bitflips in oobtest Fix a torturetest regression - nandsim: Support longer ID byte strings And more" * tag 'for-linus-20141215' of git://git.infradead.org/linux-mtd: (63 commits) mtd: tests: abort torturetest on erase errors mtd: physmap_of: fix potential NULL dereference mtd: spi-nor: allow NULL as chip name and try to auto detect it mtd: nand: gpmi: add raw oob access functions mtd: nand: gpmi: add proper raw access support mtd: nand: gpmi: add gpmi_copy_bits function mtd: spi-nor: factor out write_enable() for erase commands mtd: spi-nor: add support for s25fl128s mtd: spi-nor: remove the jedec_id/ext_id mtd: spi-nor: add id/id_len for flash_info{} mtd: nand: correct the comment of function nand_block_isreserved() jffs2: Drop bogus if in comment mtd: atmel_nand: replace memcpy32_toio/memcpy32_fromio with memcpy mtd: cafe_nand: drop duplicate .write_page implementation mtd: m25p80: Add support for serial flash Spansion S25FL132K MTD: m25p80: fix inconsistency in m25p_ids compared to spi_nor_ids mtd: spi-nor: improve wait-till-ready timeout loop mtd: delete unnecessary checks before two function calls mtd: nand: omap: Fix NAND enumeration on 3430 LDP mtd: nand: add ATO manufacturer info ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fsl_ifc.h21
-rw-r--r--include/linux/mtd/nand.h18
-rw-r--r--include/linux/mtd/spi-nor.h11
3 files changed, 38 insertions, 12 deletions
diff --git a/include/linux/fsl_ifc.h b/include/linux/fsl_ifc.h
index 84d60cb841b1..bf0321eabbda 100644
--- a/include/linux/fsl_ifc.h
+++ b/include/linux/fsl_ifc.h
@@ -29,7 +29,16 @@
29#include <linux/of_platform.h> 29#include <linux/of_platform.h>
30#include <linux/interrupt.h> 30#include <linux/interrupt.h>
31 31
32#define FSL_IFC_BANK_COUNT 4 32/*
33 * The actual number of banks implemented depends on the IFC version
34 * - IFC version 1.0 implements 4 banks.
35 * - IFC version 1.1 onward implements 8 banks.
36 */
37#define FSL_IFC_BANK_COUNT 8
38
39#define FSL_IFC_VERSION_MASK 0x0F0F0000
40#define FSL_IFC_VERSION_1_0_0 0x01000000
41#define FSL_IFC_VERSION_1_1_0 0x01010000
33 42
34/* 43/*
35 * CSPR - Chip Select Property Register 44 * CSPR - Chip Select Property Register
@@ -776,23 +785,23 @@ struct fsl_ifc_regs {
776 __be32 cspr; 785 __be32 cspr;
777 u32 res2; 786 u32 res2;
778 } cspr_cs[FSL_IFC_BANK_COUNT]; 787 } cspr_cs[FSL_IFC_BANK_COUNT];
779 u32 res3[0x19]; 788 u32 res3[0xd];
780 struct { 789 struct {
781 __be32 amask; 790 __be32 amask;
782 u32 res4[0x2]; 791 u32 res4[0x2];
783 } amask_cs[FSL_IFC_BANK_COUNT]; 792 } amask_cs[FSL_IFC_BANK_COUNT];
784 u32 res5[0x18]; 793 u32 res5[0xc];
785 struct { 794 struct {
786 __be32 csor; 795 __be32 csor;
787 __be32 csor_ext; 796 __be32 csor_ext;
788 u32 res6; 797 u32 res6;
789 } csor_cs[FSL_IFC_BANK_COUNT]; 798 } csor_cs[FSL_IFC_BANK_COUNT];
790 u32 res7[0x18]; 799 u32 res7[0xc];
791 struct { 800 struct {
792 __be32 ftim[4]; 801 __be32 ftim[4];
793 u32 res8[0x8]; 802 u32 res8[0x8];
794 } ftim_cs[FSL_IFC_BANK_COUNT]; 803 } ftim_cs[FSL_IFC_BANK_COUNT];
795 u32 res9[0x60]; 804 u32 res9[0x30];
796 __be32 rb_stat; 805 __be32 rb_stat;
797 u32 res10[0x2]; 806 u32 res10[0x2];
798 __be32 ifc_gcr; 807 __be32 ifc_gcr;
@@ -827,6 +836,8 @@ struct fsl_ifc_ctrl {
827 int nand_irq; 836 int nand_irq;
828 spinlock_t lock; 837 spinlock_t lock;
829 void *nand; 838 void *nand;
839 int version;
840 int banks;
830 841
831 u32 nand_stat; 842 u32 nand_stat;
832 wait_queue_head_t nand_wait; 843 wait_queue_head_t nand_wait;
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index e4d451e4600b..3d4ea7eb2b68 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -455,8 +455,21 @@ struct nand_hw_control {
455 * be provided if an hardware ECC is available 455 * be provided if an hardware ECC is available
456 * @calculate: function for ECC calculation or readback from ECC hardware 456 * @calculate: function for ECC calculation or readback from ECC hardware
457 * @correct: function for ECC correction, matching to ECC generator (sw/hw) 457 * @correct: function for ECC correction, matching to ECC generator (sw/hw)
458 * @read_page_raw: function to read a raw page without ECC 458 * @read_page_raw: function to read a raw page without ECC. This function
459 * @write_page_raw: function to write a raw page without ECC 459 * should hide the specific layout used by the ECC
460 * controller and always return contiguous in-band and
461 * out-of-band data even if they're not stored
462 * contiguously on the NAND chip (e.g.
463 * NAND_ECC_HW_SYNDROME interleaves in-band and
464 * out-of-band data).
465 * @write_page_raw: function to write a raw page without ECC. This function
466 * should hide the specific layout used by the ECC
467 * controller and consider the passed data as contiguous
468 * in-band and out-of-band data. ECC controller is
469 * responsible for doing the appropriate transformations
470 * to adapt to its specific layout (e.g.
471 * NAND_ECC_HW_SYNDROME interleaves in-band and
472 * out-of-band data).
460 * @read_page: function to read a page according to the ECC generator 473 * @read_page: function to read a page according to the ECC generator
461 * requirements; returns maximum number of bitflips corrected in 474 * requirements; returns maximum number of bitflips corrected in
462 * any single ECC step, 0 if bitflips uncorrectable, -EIO hw error 475 * any single ECC step, 0 if bitflips uncorrectable, -EIO hw error
@@ -723,6 +736,7 @@ struct nand_chip {
723#define NAND_MFR_EON 0x92 736#define NAND_MFR_EON 0x92
724#define NAND_MFR_SANDISK 0x45 737#define NAND_MFR_SANDISK 0x45
725#define NAND_MFR_INTEL 0x89 738#define NAND_MFR_INTEL 0x89
739#define NAND_MFR_ATO 0x9b
726 740
727/* The maximum expected count of bytes in the NAND ID sequence */ 741/* The maximum expected count of bytes in the NAND ID sequence */
728#define NAND_MAX_ID_LEN 8 742#define NAND_MAX_ID_LEN 8
diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h
index 046a0a2e4c4e..63aeccf9ddc8 100644
--- a/include/linux/mtd/spi-nor.h
+++ b/include/linux/mtd/spi-nor.h
@@ -116,6 +116,10 @@ enum spi_nor_ops {
116 SPI_NOR_OPS_UNLOCK, 116 SPI_NOR_OPS_UNLOCK,
117}; 117};
118 118
119enum spi_nor_option_flags {
120 SNOR_F_USE_FSR = BIT(0),
121};
122
119/** 123/**
120 * struct spi_nor - Structure for defining a the SPI NOR layer 124 * struct spi_nor - Structure for defining a the SPI NOR layer
121 * @mtd: point to a mtd_info structure 125 * @mtd: point to a mtd_info structure
@@ -129,6 +133,7 @@ enum spi_nor_ops {
129 * @program_opcode: the program opcode 133 * @program_opcode: the program opcode
130 * @flash_read: the mode of the read 134 * @flash_read: the mode of the read
131 * @sst_write_second: used by the SST write operation 135 * @sst_write_second: used by the SST write operation
136 * @flags: flag options for the current SPI-NOR (SNOR_F_*)
132 * @cfg: used by the read_xfer/write_xfer 137 * @cfg: used by the read_xfer/write_xfer
133 * @cmd_buf: used by the write_reg 138 * @cmd_buf: used by the write_reg
134 * @prepare: [OPTIONAL] do some preparations for the 139 * @prepare: [OPTIONAL] do some preparations for the
@@ -139,9 +144,6 @@ enum spi_nor_ops {
139 * @write_xfer: [OPTIONAL] the writefundamental primitive 144 * @write_xfer: [OPTIONAL] the writefundamental primitive
140 * @read_reg: [DRIVER-SPECIFIC] read out the register 145 * @read_reg: [DRIVER-SPECIFIC] read out the register
141 * @write_reg: [DRIVER-SPECIFIC] write data to the register 146 * @write_reg: [DRIVER-SPECIFIC] write data to the register
142 * @read_id: [REPLACEABLE] read out the ID data, and find
143 * the proper spi_device_id
144 * @wait_till_ready: [REPLACEABLE] wait till the NOR becomes ready
145 * @read: [DRIVER-SPECIFIC] read data from the SPI NOR 147 * @read: [DRIVER-SPECIFIC] read data from the SPI NOR
146 * @write: [DRIVER-SPECIFIC] write data to the SPI NOR 148 * @write: [DRIVER-SPECIFIC] write data to the SPI NOR
147 * @erase: [DRIVER-SPECIFIC] erase a sector of the SPI NOR 149 * @erase: [DRIVER-SPECIFIC] erase a sector of the SPI NOR
@@ -160,6 +162,7 @@ struct spi_nor {
160 u8 program_opcode; 162 u8 program_opcode;
161 enum read_mode flash_read; 163 enum read_mode flash_read;
162 bool sst_write_second; 164 bool sst_write_second;
165 u32 flags;
163 struct spi_nor_xfer_cfg cfg; 166 struct spi_nor_xfer_cfg cfg;
164 u8 cmd_buf[SPI_NOR_MAX_CMD_SIZE]; 167 u8 cmd_buf[SPI_NOR_MAX_CMD_SIZE];
165 168
@@ -172,8 +175,6 @@ struct spi_nor {
172 int (*read_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len); 175 int (*read_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len);
173 int (*write_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len, 176 int (*write_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len,
174 int write_enable); 177 int write_enable);
175 const struct spi_device_id *(*read_id)(struct spi_nor *nor);
176 int (*wait_till_ready)(struct spi_nor *nor);
177 178
178 int (*read)(struct spi_nor *nor, loff_t from, 179 int (*read)(struct spi_nor *nor, loff_t from,
179 size_t len, size_t *retlen, u_char *read_buf); 180 size_t len, size_t *retlen, u_char *read_buf);