aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-03-02 19:33:54 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-03-02 19:33:54 -0500
commit48476df99894492a0f7239f2f3c9a2dde4ff38e2 (patch)
tree5a1b80f20449968f0de6e5bfbcda5e360e31ba1f
parent37cae6ad4c484030fa972241533c32730ec79b7d (diff)
parent24dea0c9feccf699749f860fa2f4ccd84d30390d (diff)
Merge tag 'for-linus-20130301' of git://git.infradead.org/linux-mtd
Pull MTD update from David Woodhouse: "Fairly unexciting MTD merge for 3.9: - misc clean-ups in the MTD command-line partitioning parser (cmdlinepart) - add flash locking support for STmicro chips serial flash chips, as well as for CFI command set 2 chips. - new driver for the ELM error correction HW module found in various TI chips, enable the OMAP NAND driver to use the ELM HW error correction - added number of new serial flash IDs - various fixes and improvements in the gpmi NAND driver - bcm47xx NAND driver improvements - make the mtdpart module actually removable" * tag 'for-linus-20130301' of git://git.infradead.org/linux-mtd: (45 commits) mtd: map: BUG() in non handled cases mtd: bcm47xxnflash: use pr_fmt for module prefix in messages mtd: davinci_nand: Use managed resources mtd: mtd_torturetest can cause stack overflows mtd: physmap_of: Convert device allocation to managed devm_kzalloc() mtd: at91: atmel_nand: for PMECC, add code to check the ONFI parameter ECC requirement. mtd: atmel_nand: make pmecc-cap, pmecc-sector-size in dts is optional. mtd: atmel_nand: avoid to report an error when lookup table offset is 0. mtd: bcm47xxsflash: adjust names of bus-specific functions mtd: bcm47xxpart: improve probing of nvram partition mtd: bcm47xxpart: add support for other erase sizes mtd: bcm47xxnflash: register this as normal driver mtd: bcm47xxnflash: fix message mtd: bcm47xxsflash: register this as normal driver mtd: bcm47xxsflash: write number of written bytes mtd: gpmi: add sanity check for the ECC mtd: gpmi: set the Golois Field bit for mx6q's BCH mtd: devices: elm: Removes <xx> literals in elm DT node mtd: gpmi: fix a dereferencing freed memory error mtd: fix the wrong timeo for panic_nand_wait() ...
-rw-r--r--Documentation/devicetree/bindings/mtd/elm.txt16
-rw-r--r--Documentation/devicetree/bindings/mtd/mtd-physmap.txt3
-rw-r--r--drivers/mtd/Kconfig4
-rw-r--r--drivers/mtd/ar7part.c6
-rw-r--r--drivers/mtd/bcm47xxpart.c49
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0002.c217
-rw-r--r--drivers/mtd/cmdlinepart.c47
-rw-r--r--drivers/mtd/devices/Makefile4
-rw-r--r--drivers/mtd/devices/bcm47xxsflash.c55
-rw-r--r--drivers/mtd/devices/bcm47xxsflash.h15
-rw-r--r--drivers/mtd/devices/elm.c404
-rw-r--r--drivers/mtd/devices/m25p80.c100
-rw-r--r--drivers/mtd/maps/Kconfig2
-rw-r--r--drivers/mtd/maps/physmap_of.c9
-rw-r--r--drivers/mtd/maps/uclinux.c30
-rw-r--r--drivers/mtd/nand/atmel_nand.c141
-rw-r--r--drivers/mtd/nand/bcm47xxnflash/bcm47xxnflash.h4
-rw-r--r--drivers/mtd/nand/bcm47xxnflash/main.c14
-rw-r--r--drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c4
-rw-r--r--drivers/mtd/nand/davinci_nand.c24
-rw-r--r--drivers/mtd/nand/fsl_ifc_nand.c233
-rw-r--r--drivers/mtd/nand/gpmi-nand/bch-regs.h22
-rw-r--r--drivers/mtd/nand/gpmi-nand/gpmi-lib.c9
-rw-r--r--drivers/mtd/nand/gpmi-nand/gpmi-nand.c63
-rw-r--r--drivers/mtd/nand/gpmi-nand/gpmi-nand.h4
-rw-r--r--drivers/mtd/nand/mxc_nand.c11
-rw-r--r--drivers/mtd/nand/nand_base.c8
-rw-r--r--drivers/mtd/nand/nand_ecc.c5
-rw-r--r--drivers/mtd/nand/nandsim.c6
-rw-r--r--drivers/mtd/nand/omap2.c583
-rw-r--r--drivers/mtd/ofpart.c7
-rw-r--r--drivers/mtd/tests/mtd_nandecctest.c10
-rw-r--r--drivers/mtd/tests/mtd_stresstest.c8
-rw-r--r--drivers/mtd/tests/mtd_torturetest.c25
-rw-r--r--drivers/mtd/ubi/debug.h6
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h1
-rw-r--r--include/linux/mtd/map.h9
-rw-r--r--include/linux/platform_data/elm.h54
38 files changed, 1881 insertions, 331 deletions
diff --git a/Documentation/devicetree/bindings/mtd/elm.txt b/Documentation/devicetree/bindings/mtd/elm.txt
new file mode 100644
index 000000000000..8c1528c421d4
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/elm.txt
@@ -0,0 +1,16 @@
1Error location module
2
3Required properties:
4- compatible: Must be "ti,am33xx-elm"
5- reg: physical base address and size of the registers map.
6- interrupts: Interrupt number for the elm.
7
8Optional properties:
9- ti,hwmods: Name of the hwmod associated to the elm
10
11Example:
12elm: elm@0 {
13 compatible = "ti,am3352-elm";
14 reg = <0x48080000 0x2000>;
15 interrupts = <4>;
16};
diff --git a/Documentation/devicetree/bindings/mtd/mtd-physmap.txt b/Documentation/devicetree/bindings/mtd/mtd-physmap.txt
index dab7847fc800..61c5ec850f2f 100644
--- a/Documentation/devicetree/bindings/mtd/mtd-physmap.txt
+++ b/Documentation/devicetree/bindings/mtd/mtd-physmap.txt
@@ -26,6 +26,9 @@ file systems on embedded devices.
26 - linux,mtd-name: allow to specify the mtd name for retro capability with 26 - linux,mtd-name: allow to specify the mtd name for retro capability with
27 physmap-flash drivers as boot loader pass the mtd partition via the old 27 physmap-flash drivers as boot loader pass the mtd partition via the old
28 device name physmap-flash. 28 device name physmap-flash.
29 - use-advanced-sector-protection: boolean to enable support for the
30 advanced sector protection (Spansion: PPB - Persistent Protection
31 Bits) locking.
29 32
30For JEDEC compatible devices, the following additional properties 33For JEDEC compatible devices, the following additional properties
31are defined: 34are defined:
diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index 03f2eb5627ec..557bec599f4f 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -74,8 +74,8 @@ config MTD_REDBOOT_PARTS_READONLY
74endif # MTD_REDBOOT_PARTS 74endif # MTD_REDBOOT_PARTS
75 75
76config MTD_CMDLINE_PARTS 76config MTD_CMDLINE_PARTS
77 bool "Command line partition table parsing" 77 tristate "Command line partition table parsing"
78 depends on MTD = "y" 78 depends on MTD
79 ---help--- 79 ---help---
80 Allow generic configuration of the MTD partition tables via the kernel 80 Allow generic configuration of the MTD partition tables via the kernel
81 command line. Multiple flash resources are supported for hardware where 81 command line. Multiple flash resources are supported for hardware where
diff --git a/drivers/mtd/ar7part.c b/drivers/mtd/ar7part.c
index 7c057a05adb6..ddc0a4287a4b 100644
--- a/drivers/mtd/ar7part.c
+++ b/drivers/mtd/ar7part.c
@@ -142,7 +142,13 @@ static int __init ar7_parser_init(void)
142 return register_mtd_parser(&ar7_parser); 142 return register_mtd_parser(&ar7_parser);
143} 143}
144 144
145static void __exit ar7_parser_exit(void)
146{
147 deregister_mtd_parser(&ar7_parser);
148}
149
145module_init(ar7_parser_init); 150module_init(ar7_parser_init);
151module_exit(ar7_parser_exit);
146 152
147MODULE_LICENSE("GPL"); 153MODULE_LICENSE("GPL");
148MODULE_AUTHOR( "Felix Fietkau <nbd@openwrt.org>, " 154MODULE_AUTHOR( "Felix Fietkau <nbd@openwrt.org>, "
diff --git a/drivers/mtd/bcm47xxpart.c b/drivers/mtd/bcm47xxpart.c
index 6a1180502cc1..63feb75cc8e0 100644
--- a/drivers/mtd/bcm47xxpart.c
+++ b/drivers/mtd/bcm47xxpart.c
@@ -19,12 +19,6 @@
19/* 10 parts were found on sflash on Netgear WNDR4500 */ 19/* 10 parts were found on sflash on Netgear WNDR4500 */
20#define BCM47XXPART_MAX_PARTS 12 20#define BCM47XXPART_MAX_PARTS 12
21 21
22/*
23 * Amount of bytes we read when analyzing each block of flash memory.
24 * Set it big enough to allow detecting partition and reading important data.
25 */
26#define BCM47XXPART_BYTES_TO_READ 0x404
27
28/* Magics */ 22/* Magics */
29#define BOARD_DATA_MAGIC 0x5246504D /* MPFR */ 23#define BOARD_DATA_MAGIC 0x5246504D /* MPFR */
30#define POT_MAGIC1 0x54544f50 /* POTT */ 24#define POT_MAGIC1 0x54544f50 /* POTT */
@@ -59,13 +53,21 @@ static int bcm47xxpart_parse(struct mtd_info *master,
59 uint32_t *buf; 53 uint32_t *buf;
60 size_t bytes_read; 54 size_t bytes_read;
61 uint32_t offset; 55 uint32_t offset;
62 uint32_t blocksize = 0x10000; 56 uint32_t blocksize = master->erasesize;
63 struct trx_header *trx; 57 struct trx_header *trx;
58 int trx_part = -1;
59 int last_trx_part = -1;
60 int max_bytes_to_read = 0x8004;
61
62 if (blocksize <= 0x10000)
63 blocksize = 0x10000;
64 if (blocksize == 0x20000)
65 max_bytes_to_read = 0x18004;
64 66
65 /* Alloc */ 67 /* Alloc */
66 parts = kzalloc(sizeof(struct mtd_partition) * BCM47XXPART_MAX_PARTS, 68 parts = kzalloc(sizeof(struct mtd_partition) * BCM47XXPART_MAX_PARTS,
67 GFP_KERNEL); 69 GFP_KERNEL);
68 buf = kzalloc(BCM47XXPART_BYTES_TO_READ, GFP_KERNEL); 70 buf = kzalloc(max_bytes_to_read, GFP_KERNEL);
69 71
70 /* Parse block by block looking for magics */ 72 /* Parse block by block looking for magics */
71 for (offset = 0; offset <= master->size - blocksize; 73 for (offset = 0; offset <= master->size - blocksize;
@@ -80,7 +82,7 @@ static int bcm47xxpart_parse(struct mtd_info *master,
80 } 82 }
81 83
82 /* Read beginning of the block */ 84 /* Read beginning of the block */
83 if (mtd_read(master, offset, BCM47XXPART_BYTES_TO_READ, 85 if (mtd_read(master, offset, max_bytes_to_read,
84 &bytes_read, (uint8_t *)buf) < 0) { 86 &bytes_read, (uint8_t *)buf) < 0) {
85 pr_err("mtd_read error while parsing (offset: 0x%X)!\n", 87 pr_err("mtd_read error while parsing (offset: 0x%X)!\n",
86 offset); 88 offset);
@@ -95,9 +97,16 @@ static int bcm47xxpart_parse(struct mtd_info *master,
95 } 97 }
96 98
97 /* Standard NVRAM */ 99 /* Standard NVRAM */
98 if (buf[0x000 / 4] == NVRAM_HEADER) { 100 if (buf[0x000 / 4] == NVRAM_HEADER ||
101 buf[0x1000 / 4] == NVRAM_HEADER ||
102 buf[0x8000 / 4] == NVRAM_HEADER ||
103 (blocksize == 0x20000 && (
104 buf[0x10000 / 4] == NVRAM_HEADER ||
105 buf[0x11000 / 4] == NVRAM_HEADER ||
106 buf[0x18000 / 4] == NVRAM_HEADER))) {
99 bcm47xxpart_add_part(&parts[curr_part++], "nvram", 107 bcm47xxpart_add_part(&parts[curr_part++], "nvram",
100 offset, 0); 108