Skip to content

Commit

Permalink
Merge tag 'for-linus-20161216' of git://git.infradead.org/linux-mtd
Browse files Browse the repository at this point in the history
Pull MTD updates from Brian Norris:
 "Nothing enormous here, though notably we have some of the first work
  of a few new maintainers. I think for now I'll still be sending pull
  requests, but that's open to change in the future. Summary:

  Core:

   - dynamic BDI object allocation (resolves some problems when built as
     a module)
   - cleanups in the ooblayout handling

  NAND:

   - new tango NAND controller driver
   - new ox820 NAND controller driver
   - addition of a new full-ID entry in the nand_ids table
   - rework of the s3c240 driver to support DT
   - extension of the nand_sdr_timings to expose tCCS, tPROG and tR
   - addition of a new flag to ask the core to wait for tCCS when
     sending a RNDIN/RNDOUT command
   - addition of a new flag to ask the core to let the controller driver
     send the READ/PROGPAGE command

  Minor fixes/cleanup/cosmetic changes:

   - properly support 512 ECC step size in the sunxi driver
   - improve the error messages in the PXA probe path
   - fix module autoload in the omap2 driver
   - cleanup of several nand drivers to return nand_scan{_tail}() error
     code instead of returning -EIO
   - various cleanups in the denali driver
   - fix an error check in nandsim

  SPI NOR:

   - new flash IDs
   - wait for Spansion flash to be ready after quad-enable
   - error handling fixes for Candence QSPI
   - constify some structures in Freescale QSPI driver"

* tag 'for-linus-20161216' of git://git.infradead.org/linux-mtd: (71 commits)
  mtd: Allocate bdi objects dynamically
  mtd: nand: tango: Add standard legalese header
  mtd: maps: add missing iounmap() in error path
  mtd: spi-nor: constify fsl_qspi_devtype_data
  mtd: spi-nor: Add support for mr25h40
  mtd: spi-nor: Add support for N25Q016A
  mtd: spi-nor: Add at25df321 spi-nor flash support
  mtd: spi-nor: Fix some error codes in cqspi_setup_flash()
  mtd: spi-nor: Off by one in cqspi_setup_flash()
  mtd: spi-nor: add support for s25fl208k
  mtd: spi-nor: fix flags for s25fl128s
  mtd: spi-nor: fix spansion quad enable
  mtd: spi-nor: add Macronix mx25u25635f to list of known devices.
  mtd: mtdswap: fix spelling mistake "erassure" -> "erasure"
  mtd: bcm47xxpart: fix parsing first block after aligned TRX
  mtd: nand: tango: Use nand_to_mtd() instead of directly accessing chip->mtd
  mtd: remove unneeded initializer in mtd_ooblayout_count_bytes()
  mtd: use min_t() to refactor mtd_ooblayout_{get, set}_bytes()
  mtd: remove unneeded initializer in mtd_ooblayout_{get, set}_bytes()
  mtd: nand: nandsim: fix error check
  ...
  • Loading branch information
Linus Torvalds committed Dec 18, 2016
2 parents 135c919 + 445caaa commit c07dee7
Show file tree
Hide file tree
Showing 64 changed files with 1,555 additions and 351 deletions.
41 changes: 41 additions & 0 deletions Documentation/devicetree/bindings/mtd/oxnas-nand.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
* Oxford Semiconductor OXNAS NAND Controller

Please refer to nand.txt for generic information regarding MTD NAND bindings.

Required properties:
- compatible: "oxsemi,ox820-nand"
- reg: Base address and length for NAND mapped memory.

Optional Properties:
- clocks: phandle to the NAND gate clock if needed.
- resets: phandle to the NAND reset control if needed.

Example:

nandc: nand-controller@41000000 {
compatible = "oxsemi,ox820-nand";
reg = <0x41000000 0x100000>;
clocks = <&stdclk CLK_820_NAND>;
resets = <&reset RESET_NAND>;
#address-cells = <1>;
#size-cells = <0>;

nand@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <1>;
nand-ecc-mode = "soft";
nand-ecc-algo = "hamming";

partition@0 {
label = "boot";
reg = <0x00000000 0x00e00000>;
read-only;
};

partition@e00000 {
label = "ubi";
reg = <0x00e00000 0x07200000>;
};
};
};
56 changes: 56 additions & 0 deletions Documentation/devicetree/bindings/mtd/samsung-s3c2410.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
* Samsung S3C2410 and compatible NAND flash controller

Required properties:
- compatible : The possible values are:
"samsung,s3c2410-nand"
"samsung,s3c2412-nand"
"samsung,s3c2440-nand"
- reg : register's location and length.
- #address-cells, #size-cells : see nand.txt
- clocks : phandle to the nand controller clock
- clock-names : must contain "nand"

Optional child nodes:
Child nodes representing the available nand chips.

Optional child properties:
- nand-ecc-mode : see nand.txt
- nand-on-flash-bbt : see nand.txt

Each child device node may optionally contain a 'partitions' sub-node,
which further contains sub-nodes describing the flash partition mapping.
See partition.txt for more detail.

Example:

nand-controller@4e000000 {
compatible = "samsung,s3c2440-nand";
reg = <0x4e000000 0x40>;

#address-cells = <1>;
#size-cells = <0>;

clocks = <&clocks HCLK_NAND>;
clock-names = "nand";

nand {
nand-ecc-mode = "soft";
nand-on-flash-bbt;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
label = "u-boot";
reg = <0 0x040000>;
};

partition@40000 {
label = "kernel";
reg = <0x040000 0x500000>;
};
};
};
};
38 changes: 38 additions & 0 deletions Documentation/devicetree/bindings/mtd/tango-nand.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Sigma Designs Tango4 NAND Flash Controller (NFC)

Required properties:

- compatible: "sigma,smp8758-nand"
- reg: address/size of nfc_reg, nfc_mem, and pbus_reg
- dmas: reference to the DMA channel used by the controller
- dma-names: "nfc_sbox"
- clocks: reference to the system clock
- #address-cells: <1>
- #size-cells: <0>

Children nodes represent the available NAND chips.
See Documentation/devicetree/bindings/mtd/nand.txt for generic bindings.

Example:

nandc: nand-controller@2c000 {
compatible = "sigma,smp8758-nand";
reg = <0x2c000 0x30 0x2d000 0x800 0x20000 0x1000>;
dmas = <&dma0 3>;
dma-names = "nfc_sbox";
clocks = <&clkgen SYS_CLK>;
#address-cells = <1>;
#size-cells = <0>;

nand@0 {
reg = <0>; /* CS0 */
nand-ecc-strength = <14>;
nand-ecc-step-size = <1024>;
};

nand@1 {
reg = <1>; /* CS1 */
nand-ecc-strength = <14>;
nand-ecc-step-size = <1024>;
};
};
1 change: 1 addition & 0 deletions arch/arm/mach-s3c24xx/common-smdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ static struct s3c2410_platform_nand smdk_nand_info = {
.twrph1 = 20,
.nr_sets = ARRAY_SIZE(smdk_nand_sets),
.sets = smdk_nand_sets,
.ecc_mode = NAND_ECC_SOFT,
};

/* devices we initialise */
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c24xx/mach-anubis.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ static struct s3c2410_platform_nand __initdata anubis_nand_info = {
.nr_sets = ARRAY_SIZE(anubis_nand_sets),
.sets = anubis_nand_sets,
.select_chip = anubis_nand_select,
.ecc_mode = NAND_ECC_SOFT,
};

/* IDE channels */
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c24xx/mach-at2440evb.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ static struct s3c2410_platform_nand __initdata at2440evb_nand_info = {
.twrph1 = 40,
.nr_sets = ARRAY_SIZE(at2440evb_nand_sets),
.sets = at2440evb_nand_sets,
.ecc_mode = NAND_ECC_SOFT,
};

/* DM9000AEP 10/100 ethernet controller */
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c24xx/mach-bast.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ static struct s3c2410_platform_nand __initdata bast_nand_info = {
.nr_sets = ARRAY_SIZE(bast_nand_sets),
.sets = bast_nand_sets,
.select_chip = bast_nand_select,
.ecc_mode = NAND_ECC_SOFT,
};

/* DM9000 */
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c24xx/mach-gta02.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ static struct s3c2410_platform_nand __initdata gta02_nand_info = {
.twrph1 = 15,
.nr_sets = ARRAY_SIZE(gta02_nand_sets),
.sets = gta02_nand_sets,
.ecc_mode = NAND_ECC_SOFT,
};


Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c24xx/mach-jive.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ static struct s3c2410_platform_nand __initdata jive_nand_info = {
.twrph1 = 40,
.sets = jive_nand_sets,
.nr_sets = ARRAY_SIZE(jive_nand_sets),
.ecc_mode = NAND_ECC_SOFT,
};

static int __init jive_mtdset(char *options)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c24xx/mach-mini2440.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ static struct s3c2410_platform_nand mini2440_nand_info __initdata = {
.nr_sets = ARRAY_SIZE(mini2440_nand_sets),
.sets = mini2440_nand_sets,
.ignore_unset_ecc = 1,
.ecc_mode = NAND_ECC_SOFT,
};

/* DM9000AEP 10/100 ethernet controller */
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c24xx/mach-osiris.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ static struct s3c2410_platform_nand __initdata osiris_nand_info = {
.nr_sets = ARRAY_SIZE(osiris_nand_sets),
.sets = osiris_nand_sets,
.select_chip = osiris_nand_select,
.ecc_mode = NAND_ECC_SOFT,
};

/* PCMCIA control and configuration */
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c24xx/mach-qt2410.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ static struct s3c2410_platform_nand __initdata qt2410_nand_info = {
.twrph1 = 20,
.nr_sets = ARRAY_SIZE(qt2410_nand_sets),
.sets = qt2410_nand_sets,
.ecc_mode = NAND_ECC_SOFT,
};

/* UDC */
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c24xx/mach-rx1950.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ static struct s3c2410_platform_nand rx1950_nand_info = {
.twrph1 = 15,
.nr_sets = ARRAY_SIZE(rx1950_nand_sets),
.sets = rx1950_nand_sets,
.ecc_mode = NAND_ECC_SOFT,
};

static struct s3c2410_udc_mach_info rx1950_udc_cfg __initdata = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c24xx/mach-rx3715.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ static struct s3c2410_platform_nand __initdata rx3715_nand_info = {
.twrph1 = 15,
.nr_sets = ARRAY_SIZE(rx3715_nand_sets),
.sets = rx3715_nand_sets,
.ecc_mode = NAND_ECC_SOFT,
};

static struct platform_device *rx3715_devices[] __initdata = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c24xx/mach-vstms.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ static struct s3c2410_platform_nand __initdata vstms_nand_info = {
.twrph1 = 20,
.nr_sets = ARRAY_SIZE(vstms_nand_sets),
.sets = vstms_nand_sets,
.ecc_mode = NAND_ECC_SOFT,
};

static struct platform_device *vstms_devices[] __initdata = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c64xx/mach-hmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ static struct s3c2410_platform_nand hmt_nand_info = {
.twrph1 = 40,
.nr_sets = ARRAY_SIZE(hmt_nand_sets),
.sets = hmt_nand_sets,
.ecc_mode = NAND_ECC_SOFT,
};

static struct gpio_led hmt_leds[] = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c64xx/mach-mini6410.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ static struct s3c2410_platform_nand mini6410_nand_info = {
.twrph1 = 40,
.nr_sets = ARRAY_SIZE(mini6410_nand_sets),
.sets = mini6410_nand_sets,
.ecc_mode = NAND_ECC_SOFT,
};

static struct s3c_fb_pd_win mini6410_lcd_type0_fb_win = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c64xx/mach-real6410.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ static struct s3c2410_platform_nand real6410_nand_info = {
.twrph1 = 40,
.nr_sets = ARRAY_SIZE(real6410_nand_sets),
.sets = real6410_nand_sets,
.ecc_mode = NAND_ECC_SOFT,
};

static struct platform_device *real6410_devices[] __initdata = {
Expand Down
10 changes: 4 additions & 6 deletions drivers/mtd/bcm47xxpart.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,10 @@ static int bcm47xxpart_parse(struct mtd_info *master,

last_trx_part = curr_part - 1;

/*
* We have whole TRX scanned, skip to the next part. Use
* roundown (not roundup), as the loop will increase
* offset in next step.
*/
offset = rounddown(offset + trx->length, blocksize);
/* Jump to the end of TRX */
offset = roundup(offset + trx->length, blocksize);
/* Next loop iteration will increase the offset */
offset -= blocksize;
continue;
}

Expand Down
24 changes: 19 additions & 5 deletions drivers/mtd/devices/bcm47xxsflash.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,30 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)
dev_err(dev, "can't request region for resource %pR\n", res);
return -EBUSY;
}
b47s->window = ioremap_cache(res->start, resource_size(res));
if (!b47s->window) {
dev_err(dev, "ioremap failed for resource %pR\n", res);
return -ENOMEM;
}

b47s->bcma_cc = container_of(sflash, struct bcma_drv_cc, sflash);
b47s->cc_read = bcm47xxsflash_bcma_cc_read;
b47s->cc_write = bcm47xxsflash_bcma_cc_write;

/*
* On old MIPS devices cache was magically invalidated when needed,
* allowing us to use cached access and gain some performance. Trying
* the same on ARM based BCM53573 results in flash corruptions, we need
* to use uncached access for it.
*
* It may be arch specific, but right now there is only 1 ARM SoC using
* this driver, so let's follow Broadcom's reference code and check
* ChipCommon revision.
*/
if (b47s->bcma_cc->core->id.rev == 54)
b47s->window = ioremap_nocache(res->start, resource_size(res));
else
b47s->window = ioremap_cache(res->start, resource_size(res));
if (!b47s->window) {
dev_err(dev, "ioremap failed for resource %pR\n", res);
return -ENOMEM;
}

switch (b47s->bcma_cc->capabilities & BCMA_CC_CAP_FLASHT) {
case BCMA_CC_FLASHT_STSER:
b47s->type = BCM47XXSFLASH_TYPE_ST;
Expand Down
8 changes: 7 additions & 1 deletion drivers/mtd/maps/sc520cdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static void sc520cdp_setup_par(void)

static int __init init_sc520cdp(void)
{
int i, devices_found = 0;
int i, j, devices_found = 0;

#ifdef REPROGRAM_PAR
/* reprogram PAR registers so flash appears at the desired addresses */
Expand All @@ -243,6 +243,12 @@ static int __init init_sc520cdp(void)

if (!sc520cdp_map[i].virt) {
printk("Failed to ioremap_nocache\n");
for (j = 0; j < i; j++) {
if (mymtd[j]) {
map_destroy(mymtd[j]);
iounmap(sc520cdp_map[j].virt);
}
}
return -EIO;
}

Expand Down
Loading

0 comments on commit c07dee7

Please sign in to comment.