diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-30 20:31:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-30 20:31:56 -0400 |
commit | 623ff7739e7c00fa3d55dbfd42a492a68298fd7a (patch) | |
tree | 0b7461753a1b13b27ea2958a7d48c6efb47bba54 /drivers/mtd/nand/gpmi-nand | |
parent | c39e8ede284f469971589f2e04af78216e1a771d (diff) | |
parent | 7b0e67f604e1829e5292e1ad7743eb18dc42ea7c (diff) |
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
...
Diffstat (limited to 'drivers/mtd/nand/gpmi-nand')
-rw-r--r-- | drivers/mtd/nand/gpmi-nand/gpmi-lib.c | 26 | ||||
-rw-r--r-- | drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 14 | ||||
-rw-r--r-- | drivers/mtd/nand/gpmi-nand/gpmi-nand.h | 2 |
3 files changed, 26 insertions, 16 deletions
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c index 590dd5cceed..e8ea7107932 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c | |||
@@ -848,7 +848,10 @@ int gpmi_send_command(struct gpmi_nand_data *this) | |||
848 | 848 | ||
849 | sg_init_one(sgl, this->cmd_buffer, this->command_length); | 849 | sg_init_one(sgl, this->cmd_buffer, this->command_length); |
850 | dma_map_sg(this->dev, sgl, 1, DMA_TO_DEVICE); | 850 | dma_map_sg(this->dev, sgl, 1, DMA_TO_DEVICE); |
851 | desc = dmaengine_prep_slave_sg(channel, sgl, 1, DMA_MEM_TO_DEV, 1); | 851 | desc = dmaengine_prep_slave_sg(channel, |
852 | sgl, 1, DMA_MEM_TO_DEV, | ||
853 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | ||
854 | |||
852 | if (!desc) { | 855 | if (!desc) { |
853 | pr_err("step 2 error\n"); | 856 | pr_err("step 2 error\n"); |
854 | return -1; | 857 | return -1; |
@@ -889,7 +892,8 @@ int gpmi_send_data(struct gpmi_nand_data *this) | |||
889 | /* [2] send DMA request */ | 892 | /* [2] send DMA request */ |
890 | prepare_data_dma(this, DMA_TO_DEVICE); | 893 | prepare_data_dma(this, DMA_TO_DEVICE); |
891 | desc = dmaengine_prep_slave_sg(channel, &this->data_sgl, | 894 | desc = dmaengine_prep_slave_sg(channel, &this->data_sgl, |
892 | 1, DMA_MEM_TO_DEV, 1); | 895 | 1, DMA_MEM_TO_DEV, |
896 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | ||
893 | if (!desc) { | 897 | if (!desc) { |
894 | pr_err("step 2 error\n"); | 898 | pr_err("step 2 error\n"); |
895 | return -1; | 899 | return -1; |
@@ -925,7 +929,8 @@ int gpmi_read_data(struct gpmi_nand_data *this) | |||
925 | /* [2] : send DMA request */ | 929 | /* [2] : send DMA request */ |
926 | prepare_data_dma(this, DMA_FROM_DEVICE); | 930 | prepare_data_dma(this, DMA_FROM_DEVICE); |
927 | desc = dmaengine_prep_slave_sg(channel, &this->data_sgl, | 931 | desc = dmaengine_prep_slave_sg(channel, &this->data_sgl, |
928 | 1, DMA_DEV_TO_MEM, 1); | 932 | 1, DMA_DEV_TO_MEM, |
933 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | ||
929 | if (!desc) { | 934 | if (!desc) { |
930 | pr_err("step 2 error\n"); | 935 | pr_err("step 2 error\n"); |
931 | return -1; | 936 | return -1; |
@@ -970,8 +975,10 @@ int gpmi_send_page(struct gpmi_nand_data *this, | |||
970 | pio[4] = payload; | 975 | pio[4] = payload; |
971 | pio[5] = auxiliary; | 976 | pio[5] = auxiliary; |
972 | 977 | ||
973 | desc = dmaengine_prep_slave_sg(channel, (struct scatterlist *)pio, | 978 | desc = dmaengine_prep_slave_sg(channel, |
974 | ARRAY_SIZE(pio), DMA_TRANS_NONE, 0); | 979 | (struct scatterlist *)pio, |
980 | ARRAY_SIZE(pio), DMA_TRANS_NONE, | ||
981 | DMA_CTRL_ACK); | ||
975 | if (!desc) { | 982 | if (!desc) { |
976 | pr_err("step 2 error\n"); | 983 | pr_err("step 2 error\n"); |
977 | return -1; | 984 | return -1; |
@@ -1035,7 +1042,8 @@ int gpmi_read_page(struct gpmi_nand_data *this, | |||
1035 | pio[5] = auxiliary; | 1042 | pio[5] = auxiliary; |
1036 | desc = dmaengine_prep_slave_sg(channel, | 1043 | desc = dmaengine_prep_slave_sg(channel, |
1037 | (struct scatterlist *)pio, | 1044 | (struct scatterlist *)pio, |
1038 | ARRAY_SIZE(pio), DMA_TRANS_NONE, 1); | 1045 | ARRAY_SIZE(pio), DMA_TRANS_NONE, |
1046 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | ||
1039 | if (!desc) { | 1047 | if (!desc) { |
1040 | pr_err("step 2 error\n"); | 1048 | pr_err("step 2 error\n"); |
1041 | return -1; | 1049 | return -1; |
@@ -1052,9 +1060,11 @@ int gpmi_read_page(struct gpmi_nand_data *this, | |||
1052 | | BF_GPMI_CTRL0_ADDRESS(address) | 1060 | | BF_GPMI_CTRL0_ADDRESS(address) |
1053 | | BF_GPMI_CTRL0_XFER_COUNT(geo->page_size); | 1061 | | BF_GPMI_CTRL0_XFER_COUNT(geo->page_size); |
1054 | pio[1] = 0; | 1062 | pio[1] = 0; |
1063 | pio[2] = 0; /* clear GPMI_HW_GPMI_ECCCTRL, disable the BCH. */ | ||
1055 | desc = dmaengine_prep_slave_sg(channel, | 1064 | desc = dmaengine_prep_slave_sg(channel, |
1056 | (struct scatterlist *)pio, 2, | 1065 | (struct scatterlist *)pio, 3, |
1057 | DMA_TRANS_NONE, 1); | 1066 | DMA_TRANS_NONE, |
1067 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | ||
1058 | if (!desc) { | 1068 | if (!desc) { |
1059 | pr_err("step 3 error\n"); | 1069 | pr_err("step 3 error\n"); |
1060 | return -1; | 1070 | return -1; |
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index 493ec2fcf97..75b1dde1635 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c | |||
@@ -1124,7 +1124,7 @@ static int gpmi_block_markbad(struct mtd_info *mtd, loff_t ofs) | |||
1124 | chip->bbt[block >> 2] |= 0x01 << ((block & 0x03) << 1); | 1124 | chip->bbt[block >> 2] |= 0x01 << ((block & 0x03) << 1); |
1125 | 1125 | ||
1126 | /* Do we have a flash based bad block table ? */ | 1126 | /* Do we have a flash based bad block table ? */ |
1127 | if (chip->options & NAND_BBT_USE_FLASH) | 1127 | if (chip->bbt_options & NAND_BBT_USE_FLASH) |
1128 | ret = nand_update_bbt(mtd, ofs); | 1128 | ret = nand_update_bbt(mtd, ofs); |
1129 | else { | 1129 | else { |
1130 | chipnr = (int)(ofs >> chip->chip_shift); | 1130 | chipnr = (int)(ofs >> chip->chip_shift); |
@@ -1155,7 +1155,7 @@ static int gpmi_block_markbad(struct mtd_info *mtd, loff_t ofs) | |||
1155 | return ret; | 1155 | return ret; |
1156 | } | 1156 | } |
1157 | 1157 | ||
1158 | static int __devinit nand_boot_set_geometry(struct gpmi_nand_data *this) | 1158 | static int nand_boot_set_geometry(struct gpmi_nand_data *this) |
1159 | { | 1159 | { |
1160 | struct boot_rom_geometry *geometry = &this->rom_geometry; | 1160 | struct boot_rom_geometry *geometry = &this->rom_geometry; |
1161 | 1161 | ||
@@ -1182,7 +1182,7 @@ static int __devinit nand_boot_set_geometry(struct gpmi_nand_data *this) | |||
1182 | } | 1182 | } |
1183 | 1183 | ||
1184 | static const char *fingerprint = "STMP"; | 1184 | static const char *fingerprint = "STMP"; |
1185 | static int __devinit mx23_check_transcription_stamp(struct gpmi_nand_data *this) | 1185 | static int mx23_check_transcription_stamp(struct gpmi_nand_data *this) |
1186 | { | 1186 | { |
1187 | struct boot_rom_geometry *rom_geo = &this->rom_geometry; | 1187 | struct boot_rom_geometry *rom_geo = &this->rom_geometry; |
1188 | struct device *dev = this->dev; | 1188 | struct device *dev = this->dev; |
@@ -1239,7 +1239,7 @@ static int __devinit mx23_check_transcription_stamp(struct gpmi_nand_data *this) | |||
1239 | } | 1239 | } |
1240 | 1240 | ||
1241 | /* Writes a transcription stamp. */ | 1241 | /* Writes a transcription stamp. */ |
1242 | static int __devinit mx23_write_transcription_stamp(struct gpmi_nand_data *this) | 1242 | static int mx23_write_transcription_stamp(struct gpmi_nand_data *this) |
1243 | { | 1243 | { |
1244 | struct device *dev = this->dev; | 1244 | struct device *dev = this->dev; |
1245 | struct boot_rom_geometry *rom_geo = &this->rom_geometry; | 1245 | struct boot_rom_geometry *rom_geo = &this->rom_geometry; |
@@ -1322,7 +1322,7 @@ static int __devinit mx23_write_transcription_stamp(struct gpmi_nand_data *this) | |||
1322 | return 0; | 1322 | return 0; |
1323 | } | 1323 | } |
1324 | 1324 | ||
1325 | static int __devinit mx23_boot_init(struct gpmi_nand_data *this) | 1325 | static int mx23_boot_init(struct gpmi_nand_data *this) |
1326 | { | 1326 | { |
1327 | struct device *dev = this->dev; | 1327 | struct device *dev = this->dev; |
1328 | struct nand_chip *chip = &this->nand; | 1328 | struct nand_chip *chip = &this->nand; |
@@ -1391,7 +1391,7 @@ static int __devinit mx23_boot_init(struct gpmi_nand_data *this) | |||
1391 | return 0; | 1391 | return 0; |
1392 | } | 1392 | } |
1393 | 1393 | ||
1394 | static int __devinit nand_boot_init(struct gpmi_nand_data *this) | 1394 | static int nand_boot_init(struct gpmi_nand_data *this) |
1395 | { | 1395 | { |
1396 | nand_boot_set_geometry(this); | 1396 | nand_boot_set_geometry(this); |
1397 | 1397 | ||
@@ -1401,7 +1401,7 @@ static int __devinit nand_boot_init(struct gpmi_nand_data *this) | |||
1401 | return 0; | 1401 | return 0; |
1402 | } | 1402 | } |
1403 | 1403 | ||
1404 | static int __devinit gpmi_set_geometry(struct gpmi_nand_data *this) | 1404 | static int gpmi_set_geometry(struct gpmi_nand_data *this) |
1405 | { | 1405 | { |
1406 | int ret; | 1406 | int ret; |
1407 | 1407 | ||
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h index e023bccb778..ec6180d4ff8 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <linux/mtd/nand.h> | 20 | #include <linux/mtd/nand.h> |
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
22 | #include <linux/dma-mapping.h> | 22 | #include <linux/dma-mapping.h> |
23 | #include <mach/dma.h> | 23 | #include <linux/fsl/mxs-dma.h> |
24 | 24 | ||
25 | struct resources { | 25 | struct resources { |
26 | void *gpmi_regs; | 26 | void *gpmi_regs; |