Skip to content

Commit 511c41d

Browse files
committed
Merge tag 'for-linus-20141015' of git://git.infradead.org/linux-mtd
Pull MTD update from Brian Norris: "Sorry for delaying this a bit later than usual. There's one mild regression from 3.16 that was noticed during the 3.17 cycle, and I meant to send a fix for it along with this pull request. I'll probably try to queue it up for a later pull request once I've had a better look at it, hopefully by -rc2 at the latest. Summary for this pull: NAND - Cleanup for Denali driver - Atmel: add support for new page sizes - Atmel: fix up 'raw' mode support - Atmel: miscellaneous cleanups - New timing mode helpers for non-ONFI NAND - OMAP: allow driver to be (properly) built as a module - bcm47xx: RESET support and other cleanups SPI NOR - Miscellaneous cleanups, to prepare framework for wider use (some further work still pending) - Compile-time configuration to select 4K vs. 64K support for flash that support both (necessary for using UBIFS on some SPI NOR) A few scattered code quality fixes, detected by Coverity See the changesets for more" * tag 'for-linus-20141015' of git://git.infradead.org/linux-mtd: (59 commits) mtd: nand: omap: Correct CONFIG_MTD_NAND_OMAP_BCH help message mtd: nand: Force omap_elm to be built as a module if omap2_nand is a module mtd: move support for struct flash_platform_data into m25p80 mtd: spi-nor: add Kconfig option to disable 4K sectors mtd: nand: Move ELM driver and rename as omap_elm nand: omap2: Replace pr_err with dev_err nand: omap2: Remove horrible ifdefs to fix module probe mtd: nand: add Hynix's H27UCG8T2ATR-BC to nand_ids table mtd: nand: support ONFI timing mode retrieval for non-ONFI NANDs mtd: physmap_of: Add non-obsolete map_rom probe mtd: physmap_of: Fix ROM support via OF MAINTAINERS: add l2-mtd.git, 'next' tree for MTD mtd: denali: fix indents and other trivial things mtd: denali: remove unnecessary parentheses mtd: denali: remove another set-but-unused variable mtd: denali: fix include guard and license block of denali.h mtd: nand: don't break long print messages mtd: bcm47xxnflash: replace some magic numbers mtd: bcm47xxnflash: NAND_CMD_RESET support mtd: bcm47xxnflash: add cmd_ctrl handler ...
2 parents 88ed806 + 8b3d58e commit 511c41d

45 files changed

Lines changed: 757 additions & 562 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/devicetree/bindings/mtd/atmel-nand.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Optional properties:
3636
- reg : should specify the address and size used for NFC command registers,
3737
NFC registers and NFC Sram. NFC Sram address and size can be absent
3838
if don't want to use it.
39+
- clocks: phandle to the peripheral clock
3940
- Optional properties:
4041
- atmel,write-by-sram: boolean to enable NFC write by sram.
4142

@@ -98,6 +99,7 @@ nand0: nand@40000000 {
9899
compatible = "atmel,sama5d3-nfc";
99100
#address-cells = <1>;
100101
#size-cells = <1>;
102+
clocks = <&hsmc_clk>
101103
reg = <
102104
0x70000000 0x10000000 /* NFC Command Registers */
103105
0xffffc000 0x00000070 /* NFC HSMC regs */

‎Documentation/devicetree/bindings/mtd/mtd-physmap.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Flash chips (Memory Technology Devices) are often used for solid state
44
file systems on embedded devices.
55

66
- compatible : should contain the specific model of mtd chip(s)
7-
used, if known, followed by either "cfi-flash", "jedec-flash"
8-
or "mtd-ram".
7+
used, if known, followed by either "cfi-flash", "jedec-flash",
8+
"mtd-ram" or "mtd-rom".
99
- reg : Address range(s) of the mtd chip(s)
1010
It's possible to (optionally) define multiple "reg" tuples so that
1111
non-identical chips can be described in one node.

‎MAINTAINERS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5992,6 +5992,7 @@ L: linux-mtd@lists.infradead.org
59925992
W: http://www.linux-mtd.infradead.org/
59935993
Q: http://patchwork.ozlabs.org/project/linux-mtd/list/
59945994
T: git git://git.infradead.org/linux-mtd.git
5995+
T: git git://git.infradead.org/l2-mtd.git
59955996
S: Maintained
59965997
F: drivers/mtd/
59975998
F: include/linux/mtd/

‎arch/arm/mach-omap2/gpmc.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,6 +1440,8 @@ static int gpmc_probe_nand_child(struct platform_device *pdev,
14401440
break;
14411441
}
14421442

1443+
gpmc_nand_data->flash_bbt = of_get_nand_on_flash_bbt(child);
1444+
14431445
val = of_get_nand_bus_width(child);
14441446
if (val == 16)
14451447
gpmc_nand_data->devsize = NAND_BUSWIDTH_16;

‎drivers/mtd/bcm47xxpart.c‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,17 @@ static int bcm47xxpart_parse(struct mtd_info *master,
199199
continue;
200200
}
201201

202+
/*
203+
* New (ARM?) devices may have NVRAM in some middle block. Last
204+
* block will be checked later, so skip it.
205+
*/
206+
if (offset != master->size - blocksize &&
207+
buf[0x000 / 4] == NVRAM_HEADER) {
208+
bcm47xxpart_add_part(&parts[curr_part++], "nvram",
209+
offset, 0);
210+
continue;
211+
}
212+
202213
/* Read middle of the block */
203214
if (mtd_read(master, offset + 0x8000, 0x4,
204215
&bytes_read, (uint8_t *)buf) < 0) {

‎drivers/mtd/chips/cfi_cmdset_0002.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,6 +2033,8 @@ static int cfi_amdstd_panic_wait(struct map_info *map, struct flchip *chip,
20332033

20342034
udelay(1);
20352035
}
2036+
2037+
retries--;
20362038
}
20372039

20382040
/* the chip never became ready */

‎drivers/mtd/devices/Makefile‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ obj-$(CONFIG_MTD_LART) += lart.o
1212
obj-$(CONFIG_MTD_BLOCK2MTD) += block2mtd.o
1313
obj-$(CONFIG_MTD_DATAFLASH) += mtd_dataflash.o
1414
obj-$(CONFIG_MTD_M25P80) += m25p80.o
15-
obj-$(CONFIG_MTD_NAND_OMAP_BCH) += elm.o
1615
obj-$(CONFIG_MTD_SPEAR_SMI) += spear_smi.o
1716
obj-$(CONFIG_MTD_SST25L) += sst25l.o
1817
obj-$(CONFIG_MTD_BCM47XXSFLASH) += bcm47xxsflash.o

‎drivers/mtd/devices/docg3.c‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,16 +1697,16 @@ static int dbg_asicmode_show(struct seq_file *s, void *p)
16971697

16981698
switch (mode) {
16991699
case DOC_ASICMODE_RESET:
1700-
pos += seq_printf(s, "reset");
1700+
pos += seq_puts(s, "reset");
17011701
break;
17021702
case DOC_ASICMODE_NORMAL:
1703-
pos += seq_printf(s, "normal");
1703+
pos += seq_puts(s, "normal");
17041704
break;
17051705
case DOC_ASICMODE_POWERDOWN:
1706-
pos += seq_printf(s, "powerdown");
1706+
pos += seq_puts(s, "powerdown");
17071707
break;
17081708
}
1709-
pos += seq_printf(s, ")\n");
1709+
pos += seq_puts(s, ")\n");
17101710
return pos;
17111711
}
17121712
DEBUGFS_RO_ATTR(asic_mode, dbg_asicmode_show);
@@ -1745,22 +1745,22 @@ static int dbg_protection_show(struct seq_file *s, void *p)
17451745
pos += seq_printf(s, "Protection = 0x%02x (",
17461746
protect);
17471747
if (protect & DOC_PROTECT_FOUNDRY_OTP_LOCK)
1748-
pos += seq_printf(s, "FOUNDRY_OTP_LOCK,");
1748+
pos += seq_puts(s, "FOUNDRY_OTP_LOCK,");
17491749
if (protect & DOC_PROTECT_CUSTOMER_OTP_LOCK)
1750-
pos += seq_printf(s, "CUSTOMER_OTP_LOCK,");
1750+
pos += seq_puts(s, "CUSTOMER_OTP_LOCK,");
17511751
if (protect & DOC_PROTECT_LOCK_INPUT)
1752-
pos += seq_printf(s, "LOCK_INPUT,");
1752+
pos += seq_puts(s, "LOCK_INPUT,");
17531753
if (protect & DOC_PROTECT_STICKY_LOCK)
1754-
pos += seq_printf(s, "STICKY_LOCK,");
1754+
pos += seq_puts(s, "STICKY_LOCK,");
17551755
if (protect & DOC_PROTECT_PROTECTION_ENABLED)
1756-
pos += seq_printf(s, "PROTECTION ON,");
1756+
pos += seq_puts(s, "PROTECTION ON,");
17571757
if (protect & DOC_PROTECT_IPL_DOWNLOAD_LOCK)
1758-
pos += seq_printf(s, "IPL_DOWNLOAD_LOCK,");
1758+
pos += seq_puts(s, "IPL_DOWNLOAD_LOCK,");
17591759
if (protect & DOC_PROTECT_PROTECTION_ERROR)
1760-
pos += seq_printf(s, "PROTECT_ERR,");
1760+
pos += seq_puts(s, "PROTECT_ERR,");
17611761
else
1762-
pos += seq_printf(s, "NO_PROTECT_ERR");
1763-
pos += seq_printf(s, ")\n");
1762+
pos += seq_puts(s, "NO_PROTECT_ERR");
1763+
pos += seq_puts(s, ")\n");
17641764

17651765
pos += seq_printf(s, "DPS0 = 0x%02x : "
17661766
"Protected area [0x%x - 0x%x] : OTP=%d, READ=%d, "

‎drivers/mtd/devices/m25p80.c‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,14 @@ static int m25p_probe(struct spi_device *spi)
193193
{
194194
struct mtd_part_parser_data ppdata;
195195
struct flash_platform_data *data;
196+
const struct spi_device_id *id = NULL;
196197
struct m25p *flash;
197198
struct spi_nor *nor;
198199
enum read_mode mode = SPI_NOR_NORMAL;
199200
int ret;
200201

202+
data = dev_get_platdata(&spi->dev);
203+
201204
flash = devm_kzalloc(&spi->dev, sizeof(*flash), GFP_KERNEL);
202205
if (!flash)
203206
return -ENOMEM;
@@ -223,11 +226,26 @@ static int m25p_probe(struct spi_device *spi)
223226
mode = SPI_NOR_QUAD;
224227
else if (spi->mode & SPI_RX_DUAL)
225228
mode = SPI_NOR_DUAL;
226-
ret = spi_nor_scan(nor, spi_get_device_id(spi), mode);
229+
230+
if (data && data->name)
231+
flash->mtd.name = data->name;
232+
233+
/* For some (historical?) reason many platforms provide two different
234+
* names in flash_platform_data: "name" and "type". Quite often name is
235+
* set to "m25p80" and then "type" provides a real chip name.
236+
* If that's the case, respect "type" and ignore a "name".
237+
*/
238+
if (data && data->type)
239+
id = spi_nor_match_id(data->type);
240+
241+
/* If we didn't get name from platform, simply use "modalias". */
242+
if (!id)
243+
id = spi_get_device_id(spi);
244+
245+
ret = spi_nor_scan(nor, id, mode);
227246
if (ret)
228247
return ret;
229248

230-
data = dev_get_platdata(&spi->dev);
231249
ppdata.of_node = spi->dev.of_node;
232250

233251
return mtd_device_parse_register(&flash->mtd, NULL, &ppdata,

‎drivers/mtd/maps/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ config MTD_CFI_FLAGADM
249249

250250
config MTD_SOLUTIONENGINE
251251
tristate "CFI Flash device mapped on Hitachi SolutionEngine"
252-
depends on SUPERH && SOLUTION_ENGINE && MTD_CFI && MTD_REDBOOT_PARTS
252+
depends on SOLUTION_ENGINE && MTD_CFI && MTD_REDBOOT_PARTS
253253
help
254254
This enables access to the flash chips on the Hitachi SolutionEngine and
255255
similar boards. Say 'Y' if you are building a kernel for such a board.

0 commit comments

Comments
 (0)