diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-22 15:00:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-22 15:00:44 -0400 |
commit | a62d016cece2fce1d5e4eedf36b17f03a7a5c78e (patch) | |
tree | ac37b4835be5f4fe0e04611fdb40c85abb98ec78 /drivers/mtd/nand/atmel_nand.c | |
parent | 7c034dfd58bbc056280262887acf5b7a98944d0a (diff) | |
parent | 3e550d2396d9deef77328237ed992e19dcfefca5 (diff) |
Merge tag 'for-linus-20150422' of git://git.infradead.org/linux-mtd
Pull MTD updates from Brian Norris:
"Common MTD:
- Add Kconfig option for keeping both the 'master' and 'partition'
MTDs registered as devices. This would really make a better
default if we could do it over, as it allows a lot more flexibility
in (1) determining the flash topology of the system from user-space
and (2) adding temporary partitions at runtime (ioctl(BLKPG)).
Unfortunately, this would possibly cause user-space breakage, as it
will cause renumbering of the /dev/mtdX devices. We'll see if we
can change this in the future, as there have already been a few
people looking for this feature, and I know others have just been
working around our current limitations instead of fixing them this
way.
- Along with the previous change, add some additional information to
sysfs, so user-space can read the offset of each partition within
its master device
SPI NOR:
- add new device tree compatible binding to represent the
mostly-compatible class of SPI NOR flash which can be detected by
their extended JEDEC ID bytes, cutting down the duplication of our
ID tables
- misc. new IDs
Various other miscellaneous fixes and changes"
* tag 'for-linus-20150422' of git://git.infradead.org/linux-mtd: (53 commits)
mtd: spi-nor: Add support for Macronix mx25u6435f serial flash
mtd: spi-nor: Add support for Winbond w25q64dw serial flash
mtd: spi-nor: add support for the Winbond W25X05 flash
mtd: spi-nor: support en25s64 device
mtd: m25p80: bind to "nor-jedec" ID, for auto-detection
Documentation: devicetree: m25p80: add "nor-jedec" binding
mtd: Make MTD tests cancelable
mtd: mtd_oobtest: Fix bitflip_limit usage in test case 3
mtd: docg3: remove invalid __exit annotations
mtd: fsl_ifc_nand: use msecs_to_jiffies for time conversion
mtd: atmel_nand: don't map the ROM table if no pmecc table offset in DT
mtd: atmel_nand: add a definition for the oob reserved bytes
mtd: part: Remove partition overlap checks
mtd: part: Add sysfs variable for offset of partition
mtd: part: Create the master device node when partitioned
mtd: ts5500_flash: Fix typo in MODULE_DESCRIPTION in ts5500_flash.c
mtd: denali: Disable sub-page writes in Denali NAND driver
mtd: pxa3xx_nand: cleanup wait_for_completion handling
mtd: nand: gpmi: Check for scan_bbt() error
mtd: nand: gpmi: fixup return type of wait_for_completion_timeout
...
Diffstat (limited to 'drivers/mtd/nand/atmel_nand.c')
-rw-r--r-- | drivers/mtd/nand/atmel_nand.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index d93c849b70b5..46010bd895b1 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c | |||
@@ -485,7 +485,7 @@ static void pmecc_config_ecc_layout(struct nand_ecclayout *layout, | |||
485 | for (i = 0; i < ecc_len; i++) | 485 | for (i = 0; i < ecc_len; i++) |
486 | layout->eccpos[i] = oobsize - ecc_len + i; | 486 | layout->eccpos[i] = oobsize - ecc_len + i; |
487 | 487 | ||
488 | layout->oobfree[0].offset = 2; | 488 | layout->oobfree[0].offset = PMECC_OOB_RESERVED_BYTES; |
489 | layout->oobfree[0].length = | 489 | layout->oobfree[0].length = |
490 | oobsize - ecc_len - layout->oobfree[0].offset; | 490 | oobsize - ecc_len - layout->oobfree[0].offset; |
491 | } | 491 | } |
@@ -1204,14 +1204,14 @@ static int atmel_pmecc_nand_init_params(struct platform_device *pdev, | |||
1204 | goto err; | 1204 | goto err; |
1205 | } | 1205 | } |
1206 | 1206 | ||
1207 | regs_rom = platform_get_resource(pdev, IORESOURCE_MEM, 3); | 1207 | if (!host->has_no_lookup_table) { |
1208 | host->pmecc_rom_base = devm_ioremap_resource(&pdev->dev, regs_rom); | 1208 | regs_rom = platform_get_resource(pdev, IORESOURCE_MEM, 3); |
1209 | if (IS_ERR(host->pmecc_rom_base)) { | 1209 | host->pmecc_rom_base = devm_ioremap_resource(&pdev->dev, |
1210 | if (!host->has_no_lookup_table) | 1210 | regs_rom); |
1211 | /* Don't display the information again */ | 1211 | if (IS_ERR(host->pmecc_rom_base)) { |
1212 | dev_err(host->dev, "Can not get I/O resource for ROM, will build a lookup table in runtime!\n"); | 1212 | dev_err(host->dev, "Can not get I/O resource for ROM, will build a lookup table in runtime!\n"); |
1213 | 1213 | host->has_no_lookup_table = true; | |
1214 | host->has_no_lookup_table = true; | 1214 | } |
1215 | } | 1215 | } |
1216 | 1216 | ||
1217 | if (host->has_no_lookup_table) { | 1217 | if (host->has_no_lookup_table) { |
@@ -1254,7 +1254,8 @@ static int atmel_pmecc_nand_init_params(struct platform_device *pdev, | |||
1254 | nand_chip->ecc.steps = mtd->writesize / sector_size; | 1254 | nand_chip->ecc.steps = mtd->writesize / sector_size; |
1255 | nand_chip->ecc.total = nand_chip->ecc.bytes * | 1255 | nand_chip->ecc.total = nand_chip->ecc.bytes * |
1256 | nand_chip->ecc.steps; | 1256 | nand_chip->ecc.steps; |
1257 | if (nand_chip->ecc.total > mtd->oobsize - 2) { | 1257 | if (nand_chip->ecc.total > |
1258 | mtd->oobsize - PMECC_OOB_RESERVED_BYTES) { | ||
1258 | dev_err(host->dev, "No room for ECC bytes\n"); | 1259 | dev_err(host->dev, "No room for ECC bytes\n"); |
1259 | err_no = -EINVAL; | 1260 | err_no = -EINVAL; |
1260 | goto err; | 1261 | goto err; |
@@ -1719,7 +1720,7 @@ static int nfc_wait_interrupt(struct atmel_nand_host *host, u32 flag) | |||
1719 | comp[index++] = &host->nfc->comp_cmd_done; | 1720 | comp[index++] = &host->nfc->comp_cmd_done; |
1720 | 1721 | ||
1721 | if (index == 0) { | 1722 | if (index == 0) { |
1722 | dev_err(host->dev, "Unkown interrupt flag: 0x%08x\n", flag); | 1723 | dev_err(host->dev, "Unknown interrupt flag: 0x%08x\n", flag); |
1723 | return -EINVAL; | 1724 | return -EINVAL; |
1724 | } | 1725 | } |
1725 | 1726 | ||
@@ -1752,11 +1753,10 @@ static int nfc_send_command(struct atmel_nand_host *host, | |||
1752 | cmd, addr, cycle0); | 1753 | cmd, addr, cycle0); |
1753 | 1754 | ||
1754 | timeout = jiffies + msecs_to_jiffies(NFC_TIME_OUT_MS); | 1755 | timeout = jiffies + msecs_to_jiffies(NFC_TIME_OUT_MS); |
1755 | while (nfc_cmd_readl(NFCADDR_CMD_NFCBUSY, host->nfc->base_cmd_regs) | 1756 | while (nfc_readl(host->nfc->hsmc_regs, SR) & NFC_SR_BUSY) { |
1756 | & NFCADDR_CMD_NFCBUSY) { | ||
1757 | if (time_after(jiffies, timeout)) { | 1757 | if (time_after(jiffies, timeout)) { |
1758 | dev_err(host->dev, | 1758 | dev_err(host->dev, |
1759 | "Time out to wait CMD_NFCBUSY ready!\n"); | 1759 | "Time out to wait for NFC ready!\n"); |
1760 | return -ETIMEDOUT; | 1760 | return -ETIMEDOUT; |
1761 | } | 1761 | } |
1762 | } | 1762 | } |