- 09 12月, 2015 1 次提交
-
-
由 Boris BREZILLON 提交于
mtd_to_nand() was recently introduced to avoid direct accesses to the mtd->priv field. Update all NAND drivers to use it. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 21 11月, 2015 1 次提交
-
-
由 LABBE Corentin 提交于
All atmel_nand_caps are never modified, consitify them. Signed-off-by: NLABBE Corentin <clabbe.montjoie@gmail.com> Acked-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 12 11月, 2015 1 次提交
-
-
由 Brian Norris 提交于
All of these drivers set up a parser data struct just to communicate DT partition data. This field has been deprecated and is instead supported by telling nand_scan_ident() about the 'flash_node'. This patch: * sets chip->flash_node for those drivers that didn't already (but used OF partitioning) * drops the parser data * switches to the simpler mtd_device_register() where possible, now that we've eliminated one of the auxiliary parameters Now that we've assigned chip->flash_node for these drivers, we can probably rely on nand_dt_init() to do more of the DT parsing for us, but for now, I don't want to fiddle with each of these drivers. The parsing is done in duplicate for now on some drivers. I don't think this should break things. (Famous last words.) (Rolled in some changes by Boris Brezillon) Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 14 10月, 2015 2 次提交
-
-
由 Boris BREZILLON 提交于
The ->read_xxx() methods are all passed the page number the NAND controller is supposed to read, but ->write_xxx() do not have such a parameter. This is a problem if we want to properly implement data scrambling/randomization in order to mitigate MLC sensibility to repeated pattern: to prevent bitflips in adjacent pages in the same block we need to avoid repeating the same pattern at the same offset in those pages, hence the randomizer/scrambler engine need to be passed the page value in order to adapt its seed accordingly. Moreover, adding the page parameter to the ->write_xxx() methods add some consistency to the current API. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> CC: Josh Wu <josh.wu@atmel.com> CC: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> CC: Maxime Ripard <maxime.ripard@free-electrons.com> CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org> CC: Huang Shijie <shijie.huang@arm.com> CC: Stefan Agner <stefan@agner.ch> CC: devel@driverdev.osuosl.org CC: linux-arm-kernel@lists.infradead.org CC: linux-kernel@vger.kernel.org Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Frans Klaver 提交于
Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Signed-off-by: NFrans Klaver <fransklaver@gmail.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 06 4月, 2015 2 次提交
-
-
由 Wu, Josh 提交于
if atmel,pmecc-lookup-table-offset is not found in DT node, we don't need to map the ROM table as we will build a runtime gf table anyway. Reported-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NJosh Wu <josh.wu@atmel.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Josh Wu 提交于
It's better to use a macro instead of just a number. Signed-off-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 12 3月, 2015 1 次提交
-
-
由 Boris Brezillon 提交于
Currently the driver read NFC command registers to get NFC busy flag. Actually this flag also can be get by reading HSMC_SR register. Use the read NFC command registers need mapping a huge memory region. To save the mapped memory region, we change to check NFC busy flag by reading HSMC_SR register. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 03 3月, 2015 1 次提交
-
-
由 Colin Ian King 提交于
Fix typo, "Unkown" -> "Unknown" Signed-off-by: NColin Ian King <colin.king@canonical.com> Acked-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 21 1月, 2015 2 次提交
-
-
由 Wu, Josh 提交于
Since in SAMA5D4 chip, the PMECC can correct bit flips in erased page. So we add a DT property to indicate this hardware character. If the PMECC support correct bitflip erased page (all data are 0xff). Then we can use the PMECC correct the page and skip the erased page check. Signed-off-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Wu, Josh 提交于
atmel_nand_pmecc_read_page() will return the total bitflips in this page. This is incorrect. As one nand page includes multiple ecc sectors, that will cause the returned total bitflips exceed ecc capablity. So this patch will make pmecc_correct() return the max bitflips of all sectors in the page. That also makes atmel_nand_pmecc_read_page() return the max bitflips. Signed-off-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 26 11月, 2014 1 次提交
-
-
由 Wu, Josh 提交于
There is no need to use memcpy32_toio/memcpy32_fromio to transfer data between memory and NFC sram. As the NFC sram is a also a memory space not an I/O space, we can just use memcpy(). We remove the __iomem prefix for NFC sram to avoid sparse warnings. Signed-off-by: NJosh Wu <josh.wu@atmel.com> Reviewed-by: NBrian Norris <computersforpeace@gmail.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 06 11月, 2014 1 次提交
-
-
由 Josh Wu 提交于
If there is no PMECC lookup table stored in ROM, or lookup table offset is not specified, PMECC driver should build it in DDR by itself. That make the PMECC driver work for some board which doesn't have PMECC lookup table in ROM. The PMECC use the BCH algorithm, so based on the build_gf_tables() function in lib/bch.c, we can build the Galois Field lookup table. For more information can refer to section 5.4 of PMECC controller application note: http://www.atmel.com/images/doc11127.pdfSigned-off-by: NJosh Wu <josh.wu@atmel.com> Cc: devicetree@vger.kernel.org Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 20 10月, 2014 1 次提交
-
-
由 Wolfram Sang 提交于
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 18 9月, 2014 2 次提交
-
-
由 Wu, Josh 提交于
For PMECC, the pmecc_bytes_per_sector has same meaning as ecc.bytes. So remove pmecc_bytes_per_sector and use ecc.bytes instead. Signed-off-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Wu, Josh 提交于
For PMECC, the pmecc_sector_number has same meaning as ecc.steps. So use ecc.steps to replace the pmecc_sector_number. Signed-off-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 17 9月, 2014 1 次提交
-
-
由 Boris BREZILLON 提交于
Retrieve the NFC clock to make sure it is enabled. Make that optional to ensure compatibility with previous device trees but document it as mandatory so newer device trees will include it. Signed-off-by: NBoris BREZILLON <boris.brezillon@free-electrons.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 20 8月, 2014 4 次提交
-
-
由 Wu, Josh 提交于
When enable NFC sram write, it will failed the mtd_nandbiterrs.ko test. As in driver's nfc_sram_write_page(), if ops->mode equal to MTD_OSP_RAW, driver assumes the data buffer contains one page data and one oob data followed. And driver will write the page data and oob data to nand. But this is wrong implementation. Since the data buffer don't contains the oob data to write. We should write the chip->oob_poi to nand's oob. So this patch fix it by writing the oob data from chip->oob_poi. Signed-off-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Wei Yongjun 提交于
There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Wu, Josh 提交于
PMECC can support 512, 1k, 2k, 4k, 8k page size. The driver currently only support 2k page size nand flash. So this patch add support to 512, 1k, 4k and 8k page size nand flash. Signed-off-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Raphaël Poggi 提交于
Some nand with 8k page size like Micron MT29F32G08ABAAAWP need more than 20us. Signed-off-by: NRaphaël Poggi <poggi.raph@gmail.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 22 7月, 2014 4 次提交
-
-
由 Josh Wu 提交于
Fix the following error, which sometimes happens during the NFC data transfer: atmel_nand 80000000.nand: Time out to wait for interrupt: 0x00010000 atmel_nand 80000000.nand: something wrong, No XFR_DONE interrupt comes. The root cause is that in the interrupt handler, we read the ISR but only handle one interrupt. If more than one interrupt arrive at the same time, then the second one will be lost. During the NFC data transfer. Two NFC interrupts (NFC_CMD_DONE and NFC_XFR_DONE) may come at the same time. NFC_CMD_DONE means NFC command is sent, and NFC_XFR_DONE means NFC data is transferred. This patch can handle multiple NFC interrupts at the same time. During the NFC data transfer, we need to wait for two NFC interrupts: NFC_CMD_DONE and NFC_XFR_DONE. Also we separate the completion initialization code to a nfc_prepare_interrupt(), which is paired with nfc_wait_interrupt(). We call nfc_prepare_interrupt() before sending out nfc commands, to make sure no interrupt lost. Reported-by: NMatthieu CRAPET <Matthieu.CRAPET@ingenico.com> Tested-by: NMatthieu Crapet <Matthieu.Crapet@ingenico.com> Signed-off-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Wu, Josh 提交于
In nfc_device_ready(), it's more reasonable to check R/B bit in NFC_SR than waiting for the R/B interrupt. It cost less time. Signed-off-by: NJosh Wu <josh.wu@atmel.com> Tested-by: NMatthieu Crapet <Matthieu.Crapet@ingenico.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Wu, Josh 提交于
Add a new function to read the NFC status. Meantime, this function will check if there is any errors in NFC. Signed-off-by: NJosh Wu <josh.wu@atmel.com> Tested-by: NMatthieu Crapet <Matthieu.Crapet@ingenico.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Bo Shen 提交于
If the ecc parameter is not the same as definition, when the mtd core check these parameters, it will give the error result. Take the following as an example: Calculate how many bits can be corrected in one page. According to the ecc parameters definition, one page correct bits = (mtd->writesize * ecc->strength) / ecc->size take the following use case as an example: mtd->writesize = 2048 bytes ecc->strength = 4 bytes (for 512 bytes) before this patch, the ecc->size = 2048, so the result is 4 bytes. after this patch, the ecc->size = 512, so the result is 16 bytes. So, align the ecc parameters the same as definition to correct this kind of error. Signed-off-by: NBo Shen <voice.shen@atmel.com> Acked-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 11 3月, 2014 3 次提交
-
-
由 Herve Codina 提交于
Crash detected on sam5d35 and its pmecc nand ecc controller. The problem was a call to chip->ecc.hwctl from nand_write_subpage_hwecc (nand_base.c) when we write a sub page. chip->ecc.hwctl function is not set when we are using PMECC controller. As a workaround, set NAND_NO_SUBPAGE_WRITE for PMECC controller in order to disable sub page access in nand_write_page. Signed-off-by: NHerve Codina <Herve.CODINA@celad.com> Acked-by: NJosh Wu <josh.wu@atmel.com> Cc: stable@vger.kernel.org Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Nicolas Ferre 提交于
PIO fall back is not an issue, so don't make this much noise. Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Brian Norris 提交于
The NAND command helpers tend to automatically shift the column address for x16 bus devices, since most commands expect a word address, not a byte address. The Read ID command, however, expects an 8-bit address (i.e., 0x00, 0x20, or 0x40 should not be translated to 0x00, 0x10, or 0x20). This fixes the column address for a few drivers which imitate the nand_base defaults. Note that I don't touch sh_flctl.c, since it already handles this problem slightly differently (note its comment "READID is always performed using an 8-bit bus"). I have not tested this patch, as I only have x8 parts up for testing at this point. Hopefully that can change soon... Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Tested-by: NEzequiel Garcia <ezequiel.garcia@free-electrons.com> Tested-By: NPekon Gupta <pekon@ti.com>
-
- 08 1月, 2014 1 次提交
-
-
由 Jingoo Han 提交于
Use dev_err() instead of printk() to provide a better message to userspace. Signed-off-by: NJingoo Han <jg1.han@samsung.com> Acked-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 04 1月, 2014 1 次提交
-
-
由 Jingoo Han 提交于
The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: NJingoo Han <jg1.han@samsung.com> Acked-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 15 11月, 2013 1 次提交
-
-
Remove no longer needed DMA unmap flags: - DMA_COMPL_SKIP_SRC_UNMAP - DMA_COMPL_SKIP_DEST_UNMAP - DMA_COMPL_SRC_UNMAP_SINGLE - DMA_COMPL_DEST_UNMAP_SINGLE Cc: Vinod Koul <vinod.koul@intel.com> Cc: Tomasz Figa <t.figa@samsung.com> Cc: Dave Jiang <dave.jiang@intel.com> Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com> Acked-by: NJon Mason <jon.mason@intel.com> Acked-by: NMark Brown <broonie@linaro.org> [djbw: clean up straggling skip unmap flags in ntb] Signed-off-by: NDan Williams <dan.j.williams@intel.com>
-
- 08 11月, 2013 1 次提交
-
-
由 Josh Wu 提交于
In the atmel driver probe function, the code shows like following: atmel_nand_probe(...) { ... err_nand_ioremap: platform_driver_unregister(&atmel_nand_nfc_driver); return res; } If no nand flash detected, the driver probe function will goto err_nand_ioremap label. Then platform_driver_unregister() will be called. It will get the lock of atmel_nand device since it is parent of nfc_device. The problem is the lock is already hold by atmel_nand_probe itself. So system will be in a dead lock. This patch just simply removed to platform_driver_unregister() call. When atmel_nand driver is quit the platform_driver_unregister() will be called in atmel_nand_remove(). [Brian: the NAND platform probe really has no business registering/unregistering another driver; this fixes the deadlock, but we should follow up the likely racy behavior here with a better architecture] Signed-off-by: NJosh Wu <josh.wu@atmel.com> Cc: <stable@vger.kernel.org> # 3.12 Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 28 10月, 2013 3 次提交
-
-
由 Josh Wu 提交于
Since ecc_{strength,step}_ds is introduced in nand_chip structure for minimum ecc requirements. So we can use them directly and remove our own get_onfi_ecc_param function. Signed-off-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Josh Wu 提交于
This patch also add a const keyword for the of_device_id of nfc. Signed-off-by: NJosh Wu <josh.wu@atmel.com> Acked-by: NEzequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Josh Wu 提交于
Since the of specific code are declared in <linux/of_mtd.h> regardless of CONFIG_OF. Remove the #if defined(CONFIG_OF) guard and use an IS_ENABLED(CONFIG_OF) instead. Thanks to Ezequiel Garcia's for this protype. Signed-off-by: NJosh Wu <josh.wu@atmel.com> Acked-by: NEzequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 27 9月, 2013 1 次提交
-
-
由 Johan Hovold 提交于
Move probe out of __init section and don't use platform_driver_probe which cannot be used with deferred probing. Since commit e9354576 ("gpiolib: Defer failed gpio requests by default") this driver might return -EPROBE_DEFER if a gpio_request fails. Cc: David Woodhouse <dwmw2@infradead.org> Cc: Josh Wu <josh.wu@atmel.com> Signed-off-by: NJohan Hovold <jhovold@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 31 8月, 2013 4 次提交
-
-
由 Wei Yongjun 提交于
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
-
由 Josh Wu 提交于
The PMECC use BCH algorithm to correct error. In BCH algorithm, the primitive polynomial value is GF(2^13) for 512-bytes sector size. And it is GF(2^14) for 1024-bytes sector size. This patch will choose correct degree of the remainders (13 or 14) for different sector size. Tested in AT91SAM9X5-EK with MLC nand flash. More detail can be found in §5.4.1 of: AT91SAM ARM-based Embedded MPU Application Note <http://www.atmel.com/Images/doc11127.pdf> Signed-off-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
-
由 Josh Wu 提交于
It is better to do the sanity check for the parameter before any hardware operation. Signed-off-by: NJosh Wu <josh.wu@atmel.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
-
由 Jingoo Han 提交于
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: NJingoo Han <jg1.han@samsung.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
-