Skip to content

Commit 623ff77

Browse files
committed
Merge tag 'for-linus-3.4' of git://git.infradead.org/mtd-2.6
Pull MTD changes from David Woodhouse: - Artem's cleanup of the MTD API continues apace. - Fixes and improvements for ST FSMC and SuperH FLCTL NAND, amongst others. - More work on DiskOnChip G3, new driver for DiskOnChip G4. - Clean up debug/warning printks in JFFS2 to use pr_<level>. Fix up various trivial conflicts, largely due to changes in calling conventions for things like dmaengine_prep_slave_sg() (new inline wrapper to hide new parameter, clashing with rewrite of previously last parameter that used to be an 'append' flag, and is now a bitmap of 'unsigned long flags'). (Also some header file fallout - like so many merges this merge window - and silly conflicts with sparse fixes) * tag 'for-linus-3.4' of git://git.infradead.org/mtd-2.6: (120 commits) mtd: docg3 add protection against concurrency mtd: docg3 refactor cascade floors structure mtd: docg3 increase write/erase timeout mtd: docg3 fix inbound calculations mtd: nand: gpmi: fix function annotations mtd: phram: fix section mismatch for phram_setup mtd: unify initialization of erase_info->fail_addr mtd: support ONFI multi lun NAND mtd: sm_ftl: fix typo in major number. mtd: add device-tree support to spear_smi mtd: spear_smi: Remove default partition information from driver mtd: Add device-tree support to fsmc_nand mtd: fix section mismatch for doc_probe_device mtd: nand/fsmc: Remove sparse warnings and errors mtd: nand/fsmc: Add DMA support mtd: nand/fsmc: Access the NAND device word by word whenever possible mtd: nand/fsmc: Use dev_err to report error scenario mtd: nand/fsmc: Use devm routines mtd: nand/fsmc: Modify fsmc driver to accept nand timing parameters via platform mtd: fsmc_nand: add pm callbacks to support hibernation ...
2 parents c39e8ed + 7b0e67f commit 623ff77

152 files changed

Lines changed: 6063 additions & 2493 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
* FSMC NAND
2+
3+
Required properties:
4+
- compatible : "st,spear600-fsmc-nand"
5+
- reg : Address range of the mtd chip
6+
- reg-names: Should contain the reg names "fsmc_regs" and "nand_data"
7+
- st,ale-off : Chip specific offset to ALE
8+
- st,cle-off : Chip specific offset to CLE
9+
10+
Optional properties:
11+
- bank-width : Width (in bytes) of the device. If not present, the width
12+
defaults to 1 byte
13+
- nand-skip-bbtscan: Indicates the the BBT scanning should be skipped
14+
15+
Example:
16+
17+
fsmc: flash@d1800000 {
18+
compatible = "st,spear600-fsmc-nand";
19+
#address-cells = <1>;
20+
#size-cells = <1>;
21+
reg = <0xd1800000 0x1000 /* FSMC Register */
22+
0xd2000000 0x4000>; /* NAND Base */
23+
reg-names = "fsmc_regs", "nand_data";
24+
st,ale-off = <0x20000>;
25+
st,cle-off = <0x10000>;
26+
27+
bank-width = <1>;
28+
nand-skip-bbtscan;
29+
30+
partition@0 {
31+
...
32+
};
33+
};
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
* SPEAr SMI
2+
3+
Required properties:
4+
- compatible : "st,spear600-smi"
5+
- reg : Address range of the mtd chip
6+
- #address-cells, #size-cells : Must be present if the device has sub-nodes
7+
representing partitions.
8+
- interrupt-parent: Should be the phandle for the interrupt controller
9+
that services interrupts for this device
10+
- interrupts: Should contain the STMMAC interrupts
11+
- clock-rate : Functional clock rate of SMI in Hz
12+
13+
Optional properties:
14+
- st,smi-fast-mode : Flash supports read in fast mode
15+
16+
Example:
17+
18+
smi: flash@fc000000 {
19+
compatible = "st,spear600-smi";
20+
#address-cells = <1>;
21+
#size-cells = <1>;
22+
reg = <0xfc000000 0x1000>;
23+
interrupt-parent = <&vic1>;
24+
interrupts = <12>;
25+
clock-rate = <50000000>; /* 50MHz */
26+
27+
flash@f8000000 {
28+
st,smi-fast-mode;
29+
...
30+
};
31+
};

‎arch/arm/mach-omap1/flash.c‎

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,12 @@
1717

1818
void omap1_set_vpp(struct platform_device *pdev, int enable)
1919
{
20-
static int count;
2120
u32 l;
2221

23-
if (enable) {
24-
if (count++ == 0) {
25-
l = omap_readl(EMIFS_CONFIG);
26-
l |= OMAP_EMIFS_CONFIG_WP;
27-
omap_writel(l, EMIFS_CONFIG);
28-
}
29-
} else {
30-
if (count && (--count == 0)) {
31-
l = omap_readl(EMIFS_CONFIG);
32-
l &= ~OMAP_EMIFS_CONFIG_WP;
33-
omap_writel(l, EMIFS_CONFIG);
34-
}
35-
}
22+
l = omap_readl(EMIFS_CONFIG);
23+
if (enable)
24+
l |= OMAP_EMIFS_CONFIG_WP;
25+
else
26+
l &= ~OMAP_EMIFS_CONFIG_WP;
27+
omap_writel(l, EMIFS_CONFIG);
3628
}

‎arch/arm/mach-s3c24xx/simtec-nor.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535
static void simtec_nor_vpp(struct platform_device *pdev, int vpp)
3636
{
3737
unsigned int val;
38-
unsigned long flags;
3938

40-
local_irq_save(flags);
4139
val = __raw_readb(BAST_VA_CTRL3);
4240

4341
printk(KERN_DEBUG "%s(%d)\n", __func__, vpp);
@@ -48,7 +46,6 @@ static void simtec_nor_vpp(struct platform_device *pdev, int vpp)
4846
val &= ~BAST_CPLD_CTRL3_ROMWEN;
4947

5048
__raw_writeb(val, BAST_VA_CTRL3);
51-
local_irq_restore(flags);
5249
}
5350

5451
static struct physmap_flash_data simtec_nor_pdata = {

‎arch/arm/mach-shmobile/board-mackerel.c‎

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <linux/mtd/mtd.h>
4040
#include <linux/mtd/partitions.h>
4141
#include <linux/mtd/physmap.h>
42+
#include <linux/mtd/sh_flctl.h>
4243
#include <linux/pm_clock.h>
4344
#include <linux/smsc911x.h>
4445
#include <linux/sh_intc.h>
@@ -956,6 +957,50 @@ static struct platform_device fsi_ak4643_device = {
956957
},
957958
};
958959

960+
/* FLCTL */
961+
static struct mtd_partition nand_partition_info[] = {
962+
{
963+
.name = "system",
964+
.offset = 0,
965+
.size = 128 * 1024 * 1024,
966+
},
967+
{
968+
.name = "userdata",
969+
.offset = MTDPART_OFS_APPEND,
970+
.size = 256 * 1024 * 1024,
971+
},
972+
{
973+
.name = "cache",
974+
.offset = MTDPART_OFS_APPEND,
975+
.size = 128 * 1024 * 1024,
976+
},
977+
};
978+
979+
static struct resource nand_flash_resources[] = {
980+
[0] = {
981+
.start = 0xe6a30000,
982+
.end = 0xe6a3009b,
983+
.flags = IORESOURCE_MEM,
984+
}
985+
};
986+
987+
static struct sh_flctl_platform_data nand_flash_data = {
988+
.parts = nand_partition_info,
989+
.nr_parts = ARRAY_SIZE(nand_partition_info),
990+
.flcmncr_val = CLK_16B_12L_4H | TYPESEL_SET
991+
| SHBUSSEL | SEL_16BIT | SNAND_E,
992+
.use_holden = 1,
993+
};
994+
995+
static struct platform_device nand_flash_device = {
996+
.name = "sh_flctl",
997+
.resource = nand_flash_resources,
998+
.num_resources = ARRAY_SIZE(nand_flash_resources),
999+
.dev = {
1000+
.platform_data = &nand_flash_data,
1001+
},
1002+
};
1003+
9591004
/*
9601005
* The card detect pin of the top SD/MMC slot (CN7) is active low and is
9611006
* connected to GPIO A22 of SH7372 (GPIO_PORT41).
@@ -1259,6 +1304,7 @@ static struct platform_device *mackerel_devices[] __initdata = {
12591304
&fsi_device,
12601305
&fsi_ak4643_device,
12611306
&fsi_hdmi_device,
1307+
&nand_flash_device,
12621308
&sdhi0_device,
12631309
#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
12641310
&sdhi1_device,
@@ -1488,6 +1534,30 @@ static void __init mackerel_init(void)
14881534
gpio_request(GPIO_FN_MMCCMD0, NULL);
14891535
gpio_request(GPIO_FN_MMCCLK0, NULL);
14901536

1537+
/* FLCTL */
1538+
gpio_request(GPIO_FN_D0_NAF0, NULL);
1539+
gpio_request(GPIO_FN_D1_NAF1, NULL);
1540+
gpio_request(GPIO_FN_D2_NAF2, NULL);
1541+
gpio_request(GPIO_FN_D3_NAF3, NULL);
1542+
gpio_request(GPIO_FN_D4_NAF4, NULL);
1543+
gpio_request(GPIO_FN_D5_NAF5, NULL);
1544+
gpio_request(GPIO_FN_D6_NAF6, NULL);
1545+
gpio_request(GPIO_FN_D7_NAF7, NULL);
1546+
gpio_request(GPIO_FN_D8_NAF8, NULL);
1547+
gpio_request(GPIO_FN_D9_NAF9, NULL);
1548+
gpio_request(GPIO_FN_D10_NAF10, NULL);
1549+
gpio_request(GPIO_FN_D11_NAF11, NULL);
1550+
gpio_request(GPIO_FN_D12_NAF12, NULL);
1551+
gpio_request(GPIO_FN_D13_NAF13, NULL);
1552+
gpio_request(GPIO_FN_D14_NAF14, NULL);
1553+
gpio_request(GPIO_FN_D15_NAF15, NULL);
1554+
gpio_request(GPIO_FN_FCE0, NULL);
1555+
gpio_request(GPIO_FN_WE0_FWE, NULL);
1556+
gpio_request(GPIO_FN_FRB, NULL);
1557+
gpio_request(GPIO_FN_A4_FOE, NULL);
1558+
gpio_request(GPIO_FN_A5_FCDE, NULL);
1559+
gpio_request(GPIO_FN_RD_FSC, NULL);
1560+
14911561
/* enable GPS module (GT-720F) */
14921562
gpio_request(GPIO_FN_SCIFA2_TXD1, NULL);
14931563
gpio_request(GPIO_FN_SCIFA2_RXD1, NULL);
@@ -1532,6 +1602,7 @@ static void __init mackerel_init(void)
15321602
sh7372_add_device_to_domain(&sh7372_a4mp, &fsi_device);
15331603
sh7372_add_device_to_domain(&sh7372_a3sp, &usbhs0_device);
15341604
sh7372_add_device_to_domain(&sh7372_a3sp, &usbhs1_device);
1605+
sh7372_add_device_to_domain(&sh7372_a3sp, &nand_flash_device);
15351606
sh7372_add_device_to_domain(&sh7372_a3sp, &sh_mmcif_device);
15361607
sh7372_add_device_to_domain(&sh7372_a3sp, &sdhi0_device);
15371608
#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)

‎arch/arm/mach-shmobile/clock-sh7372.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ enum { MSTP001, MSTP000,
511511
MSTP223,
512512
MSTP218, MSTP217, MSTP216, MSTP214, MSTP208, MSTP207,
513513
MSTP206, MSTP205, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
514-
MSTP328, MSTP323, MSTP322, MSTP314, MSTP313, MSTP312,
514+
MSTP328, MSTP323, MSTP322, MSTP315, MSTP314, MSTP313, MSTP312,
515515
MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP407, MSTP406,
516516
MSTP405, MSTP404, MSTP403, MSTP400,
517517
MSTP_NR };
@@ -553,6 +553,7 @@ static struct clk mstp_clks[MSTP_NR] = {
553553
[MSTP328] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR3, 28, 0), /* FSI2 */
554554
[MSTP323] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 23, 0), /* IIC1 */
555555
[MSTP322] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 22, 0), /* USB0 */
556+
[MSTP315] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 15, 0), /* FLCTL*/
556557
[MSTP314] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 14, 0), /* SDHI0 */
557558
[MSTP313] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 13, 0), /* SDHI1 */
558559
[MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMC */
@@ -653,6 +654,7 @@ static struct clk_lookup lookups[] = {
653654
CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[MSTP322]), /* USB0 */
654655
CLKDEV_DEV_ID("r8a66597_udc.0", &mstp_clks[MSTP322]), /* USB0 */
655656
CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[MSTP322]), /* USB0 */
657+
CLKDEV_DEV_ID("sh_flctl.0", &mstp_clks[MSTP315]), /* FLCTL */
656658
CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */
657659
CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */
658660
CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMC */

‎arch/arm/mach-u300/core.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,6 +1544,8 @@ static struct fsmc_nand_platform_data nand_platform_data = {
15441544
.nr_partitions = ARRAY_SIZE(u300_partitions),
15451545
.options = NAND_SKIP_BBTSCAN,
15461546
.width = FSMC_NAND_BW8,
1547+
.ale_off = PLAT_NAND_ALE,
1548+
.cle_off = PLAT_NAND_CLE,
15471549
};
15481550

15491551
static struct platform_device nand_device = {

‎arch/arm/mach-u300/include/mach/u300-regs.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
/* NFIF */
2525
#define U300_NAND_IF_PHYS_BASE 0x9f800000
2626

27+
/* ALE, CLE offset for FSMC NAND */
28+
#define PLAT_NAND_CLE (1 << 16)
29+
#define PLAT_NAND_ALE (1 << 17)
30+
31+
2732
/* AHB Peripherals */
2833
#define U300_AHB_PER_PHYS_BASE 0xa0000000
2934
#define U300_AHB_PER_VIRT_BASE 0xff010000

‎arch/mips/cavium-octeon/flash_setup.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static int __init flash_init(void)
6060
if (mymtd) {
6161
mymtd->owner = THIS_MODULE;
6262
mtd_device_parse_register(mymtd, part_probe_types,
63-
0, NULL, 0);
63+
NULL, NULL, 0);
6464
} else {
6565
pr_err("Failed to register MTD device for flash\n");
6666
}

‎drivers/dma/mxs-dma.c‎

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
#include <linux/platform_device.h>
2323
#include <linux/dmaengine.h>
2424
#include <linux/delay.h>
25+
#include <linux/fsl/mxs-dma.h>
2526

2627
#include <asm/irq.h>
2728
#include <mach/mxs.h>
28-
#include <mach/dma.h>
2929
#include <mach/common.h>
3030

3131
#include "dmaengine.h"
@@ -337,17 +337,40 @@ static void mxs_dma_free_chan_resources(struct dma_chan *chan)
337337
clk_disable_unprepare(mxs_dma->clk);
338338
}
339339

340+
/*
341+
* How to use the flags for ->device_prep_slave_sg() :
342+
* [1] If there is only one DMA command in the DMA chain, the code should be:
343+
* ......
344+
* ->device_prep_slave_sg(DMA_CTRL_ACK);
345+
* ......
346+
* [2] If there are two DMA commands in the DMA chain, the code should be
347+
* ......
348+
* ->device_prep_slave_sg(0);
349+
* ......
350+
* ->device_prep_slave_sg(DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
351+
* ......
352+
* [3] If there are more than two DMA commands in the DMA chain, the code
353+
* should be:
354+
* ......
355+
* ->device_prep_slave_sg(0); // First
356+
* ......
357+
* ->device_prep_slave_sg(DMA_PREP_INTERRUPT [| DMA_CTRL_ACK]);
358+
* ......
359+
* ->device_prep_slave_sg(DMA_PREP_INTERRUPT | DMA_CTRL_ACK); // Last
360+
* ......
361+
*/
340362
static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
341363
struct dma_chan *chan, struct scatterlist *sgl,
342364
unsigned int sg_len, enum dma_transfer_direction direction,
343-
unsigned long append, void *context)
365+
unsigned long flags, void *context)
344366
{
345367
struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
346368
struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
347369
struct mxs_dma_ccw *ccw;
348370
struct scatterlist *sg;
349371
int i, j;
350372
u32 *pio;
373+
bool append = flags & DMA_PREP_INTERRUPT;
351374
int idx = append ? mxs_chan->desc_count : 0;
352375

353376
if (mxs_chan->status == DMA_IN_PROGRESS && !append)
@@ -374,7 +397,6 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
374397
ccw->bits |= CCW_CHAIN;
375398
ccw->bits &= ~CCW_IRQ;
376399
ccw->bits &= ~CCW_DEC_SEM;
377-
ccw->bits &= ~CCW_WAIT4END;
378400
} else {
379401
idx = 0;
380402
}
@@ -389,7 +411,8 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
389411
ccw->bits = 0;
390412
ccw->bits |= CCW_IRQ;
391413
ccw->bits |= CCW_DEC_SEM;
392-
ccw->bits |= CCW_WAIT4END;
414+
if (flags & DMA_CTRL_ACK)
415+
ccw->bits |= CCW_WAIT4END;
393416
ccw->bits |= CCW_HALT_ON_TERM;
394417
ccw->bits |= CCW_TERM_FLUSH;
395418
ccw->bits |= BF_CCW(sg_len, PIO_NUM);
@@ -420,7 +443,8 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
420443
ccw->bits &= ~CCW_CHAIN;
421444
ccw->bits |= CCW_IRQ;
422445
ccw->bits |= CCW_DEC_SEM;
423-
ccw->bits |= CCW_WAIT4END;
446+
if (flags & DMA_CTRL_ACK)
447+
ccw->bits |= CCW_WAIT4END;
424448
}
425449
}
426450
}

0 commit comments

Comments
 (0)