diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-02 19:33:54 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-02 19:33:54 -0500 |
| commit | 48476df99894492a0f7239f2f3c9a2dde4ff38e2 (patch) | |
| tree | 5a1b80f20449968f0de6e5bfbcda5e360e31ba1f | |
| parent | 37cae6ad4c484030fa972241533c32730ec79b7d (diff) | |
| parent | 24dea0c9feccf699749f860fa2f4ccd84d30390d (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()
...
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 @@ | |||
| 1 | Error location module | ||
| 2 | |||
| 3 | Required 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 | |||
| 8 | Optional properties: | ||
| 9 | - ti,hwmods: Name of the hwmod associated to the elm | ||
| 10 | |||
| 11 | Example: | ||
| 12 | elm: 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 | ||
| 30 | For JEDEC compatible devices, the following additional properties | 33 | For JEDEC compatible devices, the following additional properties |
| 31 | are defined: | 34 | are 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 | |||
| 74 | endif # MTD_REDBOOT_PARTS | 74 | endif # MTD_REDBOOT_PARTS |
| 75 | 75 | ||
| 76 | config MTD_CMDLINE_PARTS | 76 | config 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 | ||
| 145 | static void __exit ar7_parser_exit(void) | ||
| 146 | { | ||
| 147 | deregister_mtd_parser(&ar7_parser); | ||
| 148 | } | ||
| 149 | |||
| 145 | module_init(ar7_parser_init); | 150 | module_init(ar7_parser_init); |
| 151 | module_exit(ar7_parser_exit); | ||
| 146 | 152 | ||
| 147 | MODULE_LICENSE("GPL"); | 153 | MODULE_LICENSE("GPL"); |
| 148 | MODULE_AUTHOR( "Felix Fietkau <nbd@openwrt.org>, " | 154 | MODULE_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 | |
