- 22 9月, 2017 8 次提交
-
-
由 Masahiro Yamada 提交于
This driver explains too much about what is apparent from the code. Comments around basic APIs such as init_completion(), spin_lock_init(), etc. seem unneeded lessons to kernel developers. (With those comments dropped, denali_drv_init() is small enough, so it has been merged into the probe function.) Also, NAND driver developers should know the NAND init procedure, so there is no need to explain nand_scan_ident/tail. I removed FSF's address from the license blocks, and added simple comments to struct members. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Masahiro Yamada 提交于
In several places in this driver, the register fields are retrieved as follows: val = reg & FOO_MASK; Then, modified as follows: reg &= ~FOO_MASK; reg |= val; This code relies on its shift is 0, which we will never know until we check the definition of FOO_MASK. Use FIELD_PREP / FIELD_GET where appropriate. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Masahiro Yamada 提交于
All the register offsets and bitfield masks are defined in denali.h, but the driver code ended up with additional crappy macros such as MAKE_ECC_CORRECTION(), ECC_SECTOR(), etc. The reason is apparent - accessing a register field requires mask and shift pair. The denali.h only provides mask. However, defining both is tedious. <linux/bitfield.h> provides a convenient way to get register fields only with a single shifted mask. Now use it. While I am here, I shortened some macros. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Masahiro Yamada 提交于
This function has a local variable "irq_mask" and its value is the same as denali->irq_mask. Clean up the code a little. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Masahiro Yamada 提交于
This helper just sets/clears a flag of DMA_ENABLE register (with register read-back, I do not know why it is necessary). Move the register write code to the caller, and remove the helper. It works for me without the register read-back. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Masahiro Yamada 提交于
Include necessary headers explicitly without relying on indirect header inclusion. Also, sort them alphabetically. <linux/delay.h>, <linux/wait.h>, <linux/mutex.h> turned out bogus, so removed. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Masahiro Yamada 提交于
All functions in this driver are prefixed with denali_ except detect_max_banks(). Rename it for consistency. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Masahiro Yamada 提交于
The setup_ecc_for_xfer() is only called from denali_data_xfer(). This helper is small enough, so squash it into the caller. This looks cleaner to me. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 18 9月, 2017 3 次提交
-
-
由 Masahiro Yamada 提交于
The register TWO_ROW_ADDR_CYCLES specifies the number of row address cycles of the device, but it is fixed to 0 in the driver init code (i.e. always 3 row address cycles). Reflect the result of nand_scan_ident() to the register setting in order to support 2 row address cycle devices. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Masahiro Yamada 提交于
Several drivers check ->chipsize to see if the third row address cycle is needed. Instead of embedding magic sizes such as 32MB, 128MB in drivers, introduce a new flag NAND_ROW_ADDR_3 for clean-up. Since nand_scan_ident() knows well about the device, it can handle this properly. The flag is set if the row address bit width is greater than 16. Delete comments such as "One more address cycle for ..." because intention is now clear enough from the code. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Acked-by: NWenyou Yang <wenyou.yang@microchip.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Miquel Raynal 提交于
Use the core's large page OOB layout functions when not reserving any space for ECC bytes in the OOB layout. Fix ->nand_ooblayout_ecc_lp() to return -ERANGE instead of a zero length in this case. Signed-off-by: NMiquel Raynal <miquel.raynal@free-electrons.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 14 9月, 2017 5 次提交
-
-
由 Uwe Kleine-König 提交于
Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Colin Ian King 提交于
Trivial fix to spelling mistake in ubi_err error message Signed-off-by: NColin Ian King <colin.king@canonical.com> Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Ben Dooks 提交于
In build.c, the following pr_err calls should be terminated with a new-line to avoid other messages being concatenated onto the end. Signed-off-by: NBen Dooks <ben.dooks@codethink.co.uk> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Ben Dooks 提交于
In ubi_attach_mtd_dev() the pr_err() calls should have their messgaes terminated with a new-line to avoid other messages being concatenated onto the end. Signed-off-by: NBen Dooks <ben.dooks@codethink.co.uk> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Ben Dooks 提交于
The ubi_init() function has a few error paths that use the pr_err() to output errors. These should have new lines on them as pr_err() does not automatically do this. This fixes issues where if multiple mtd fail to bind to ubi the console output starts wrapping around. Signed-off-by: NBen Dooks <ben.dooks@codethink.co.uk> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
- 09 9月, 2017 1 次提交
-
-
由 Masahiro Yamada 提交于
This macro is useful to avoid link error on 32-bit systems. We have the same definition in two drivers, so move it to include/linux/kernel.h While we are here, refactor DIV_ROUND_UP_ULL() by using DIV_ROUND_DOWN_ULL(). Link: http://lkml.kernel.org/r/1500945156-12907-1-git-send-email-yamada.masahiro@socionext.comSigned-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Acked-by: NMark Brown <broonie@kernel.org> Cc: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Boris Brezillon <boris.brezillon@free-electrons.com> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Brian Norris <computersforpeace@gmail.com> Cc: Richard Weinberger <richard@nod.at> Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 05 9月, 2017 3 次提交
-
-
由 Ludovic Desroches 提交于
For HSMC controller, the register layout depends on the device i.e. the offset of setup, pulse, cycle, mode and timings registers is not the same. An helper is added to provide the correct register layout. Fixes: fe9d7cb2 ("mfd: syscon: atmel-smc: Add new helpers to ease SMC regs manipulation") Suggested-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NLudovic Desroches <ludovic.desroches@microchip.com> Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NNicolas Ferre <nicolas.ferre@microchip.com> Acked-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: NLee Jones <lee.jones@linaro.org>
-
由 Christoph Hellwig 提交于
Make the position an in/out argument like all the other read/write helpers and and make the buf argument a void pointer. Signed-off-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
-
由 Christoph Hellwig 提交于
Use proper ssize_t and size_t types for the return value and count argument, move the offset last and make it an in/out argument like all other read/write helpers, and make the buf argument a void pointer to get rid of lots of casts in the callers. Signed-off-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
-
- 04 9月, 2017 1 次提交
-
-
由 Hauke Mehrtens 提交于
Do not check which flash type the SoC was booted from before using this driver. Assume that the device tree is correct and use this driver when it was added to device tree. This also removes a build dependency to the SoC code. Signed-off-by: NHauke Mehrtens <hauke@hauke-m.de> Acked-by: NBrian Norris <computersforpeace@gmail.com> Cc: martin.blumenstingl@googlemail.com Cc: john@phrozen.org Cc: robh@kernel.org Cc: andy.shevchenko@gmail.com Cc: p.zabel@pengutronix.de Cc: kishon@ti.com Cc: mark.rutland@arm.com Cc: linux-mips@linux-mips.org Cc: linux-mtd@lists.infradead.org Cc: linux-watchdog@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-spi@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/17117/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
-
- 30 8月, 2017 1 次提交
-
-
由 Lothar Waßmann 提交于
commit c51d0ac5 ("mtd: nand: Move Samsung specific init/detection logic in nand_samsung.c") introduced a regression for Samsung SLC NAND chips. Prior to this commit chip->bits_per_cell was initialized by calling nand_get_bits_per_cell() before using nand_is_slc(). With the offending commit this call is skipped, leaving chip->bits_per_cell cleared to zero when the manufacturer specific '.detect' function calls nand_is_slc() which in turn interprets bits_per_cell != 1 as indication for an MLC chip. The effect is that e.g. a K9F1G08U0F NAND chip is falsely detected as MLC NAND with 4KiB page size rather than SLC with 2KiB page size. Add a call to nand_get_bits_per_cell() before calling the .detect hook function in nand_manufacturer_detect(), so that the nand_is_slc() calls in the manufacturer specific code will return correct results. Fixes: c51d0ac5 ("mtd: nand: Move Samsung specific init/detection logic in nand_samsung.c") Cc: <stable@vger.kernel.org> Signed-off-by: NLothar Waßmann <LW@KARO-electronics.de> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 25 8月, 2017 2 次提交
-
-
由 Boris Brezillon 提交于
Version 4 of the ONFI spec mandates that tADL be at least 400 nanoseconds, but, depending on the master clock rate, 400 ns may not fit in the tADL field of the SMC reg. We need to relax the check and accept the -ERANGE return code. Note that previous versions of the ONFI spec had a lower tADL_min (100 or 200 ns). It's not clear why this timing constraint got increased but it seems most NANDs are fine with values lower than 400ns, so we should be safe. Fixes: f9ce2edd ("mtd: nand: atmel: Add ->setup_data_interface() hooks") Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Tested-by: NQuentin Schulz <quentin.schulz@free-electrons.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Uwe Kleine-König 提交于
The debugfs entries must be removed before an error is returned in the probe function. Otherwise another try to load the module fails and when the debugfs files are accessed without the module loaded, the kernel still tries to call a function in that module. Fixes: 5346c27c ("mtd: nandsim: Introduce debugfs infrastructure") Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: NRichard Weinberger <richard@nod.at> Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 23 8月, 2017 16 次提交
-
-
由 Andrea Adami 提交于
With the introduction of sharpslpart partition parser we can now read the offsets from NAND: we specify the list of the parsers as platform data, with cmdlinepart and ofpart parsers first allowing to override the part. table written in NAND. This is done in the board files using this driver. Use now these parsers. Signed-off-by: NAndrea Adami <andrea.adami@gmail.com> Acked-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Andrea Adami 提交于
With the introduction of sharpslpart partition parser we can now read the offsets from NAND: we specify the list of the parsers as platform data, with cmdlinepart and ofpart parsers first allowing to override the part. table written in NAND. This is done in the board files using this driver. Use now these parsers. Signed-off-by: NAndrea Adami <andrea.adami@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
Add the compatible string for IPQ8074 QPIC NAND controller version 1.5.0 which uses BAM DMA and its FLASH_DEV_CMD registers starting offset is 0x7000. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
Add the compatible string for IPQ4019 QPIC NAND controller version 1.4.0 which uses BAM DMA. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
The FLASH_DEV_CMD registers starting offset is not same in different QPIC NAND controller versions. This patch adds the starting offset in NAND controller properties and uses the same for calculating the actual offset of these registers. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
1. Add the data descriptor preparation function which will be used only by BAM DMA for forming the data SGL’s 2. Add clear BAM transaction and call it before every new request 3. Check DMA mode for ADM or BAM and call the appropriate descriptor formation function. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
1. DM_EN is only required for EBI2 NAND controller which uses ADM 2. BAM mode will be disabled after power on reset which needs to be enabled before starting any BAM transfers. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
The NAND controller returns ECC failure during read of completely erased codeword. The NAND controller has hardware functionality to detect erased codeword in case of BCH ECC algorithm. The NAND_ERASED_CW_DETECT_CFG register controls the erased codeword/page detection controller. This register should be reset before every page read by setting and clearing bit 0 of NAND_ERASED_CW_DETECT_CFG. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
In EBI2, all codeword data will be read in FLASH_BUF_ACC buffer and ADM will copy the data from source (FLASH_BUF_ACC) to destination (memory for data read). In QPIC, there is no FLASH_BUF_ACC and all the codeword data will held in QPIC BAM FIFO buffers. It provides multiple READ_LOCATION registers which will be used for copying the data from FIFO to memory. The READ_LOCATION register will be used to read a specific amount of data from a specific offset within the flash buffer. It supports sequential offset requests. Each request is composed of the following fields: a. Offset within the flash buffer from which data should be read b. Amount of data to be read c. Flag bit specifying the last read request from the flash buffer. Following the last read request the NANDc refers to the buffer as empty. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
The QPIC NAND BAM has multiple flags to control the transfer. This patch adds flags parameter in register and data transfer DMA helper functions and modifies all these functions call with appropriate flags using following rule 1. Read and write can’t go in single command descriptor so separate SGL should be used. 2. For some of the requests, NWD flag should be set in BAM DMA descriptor. 3. For Data write, the BAM has internal buffer for each codeword. All write request will modify the data in internal buffer and this buffer will be flushed to NAND device once EOT flag is set. So for all the write requests in single codeword, the EOT should be cleared for all tx data descriptors except the last one. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
1. prepare_bam_async_desc is the function which will call all the DMA API’s. It will fetch the outstanding scatter gather list for passed channel and will do the DMA descriptor formation. The DMA flag is dependent upon the type of channel. 2. For ADM DMA, the descriptor is being formed for every DMA request so its sgl count will be always 1 while in BAM DMA, the clubbing of descriptor is being done to increase throughput. 3. ADM DMA uses only one channel while in BAM DMA, data descriptors will be submitted to tx channel (for write) or rx channel (for read) and all the registers read/write descriptors in command channel. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
- The BAM transaction is the core data structure which will be used for all the data transfers in QPIC NAND. Since the core framework in nand_base.c is serializing all the NAND requests so allocating BAM transaction before every transfer will be overhead. The memory for it be allocated during probe time and before every transfer, it will be cleared. - The BAM transaction contains the array of command and data scatter gather list and indexes. For every transfer, all the resource will be taken from BAM transaction. - The size of the buffer used for BAM transactions is calculated based on the NAND device with the maximum page size, among all the devices connected to the controller. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
The EBI2 NAND controller directly remaps register read buffer with dma_map_sg and DMA address of this buffer will be passed to DMA API’s. While, on QPIC NAND controller, which uses BAM DMA, we read the controller registers by preparing a BAM command descriptor. This command descriptor requires the - controller register address - the DMA address in which we want to store the value read back from the controller register. This command descriptor will be remapped with dma_map_sg and its DMA address will be passed to DMA API’s. Therefore, it's required that we also map our register read buffer for DMA (using dma_map_single). We use the returned DMA address for preparing entries in our command descriptor. This patch adds the DMA mapping support for register read buffer. This buffer will be DMA mapped during allocation time. Before starting of any operation, this buffer will be synced for device operation and after operation completion, it will be synced again for CPU. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
1. QPIC NAND controller uses 3 BAM channels: command, data tx and data rx while EBI2 NAND controller uses only single ADM channel. 2. CRCI is only required for ADM DMA and it's not required for BAM DMA. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
The current driver only supports EBI2 NAND controller which uses ADM DMA. The latest QCOM SoC uses QPIC NAND controller with BAM DMA. NAND registers and programming sequence are same for EBI2 and QPIC NAND so the same driver can support QPIC NAND also by adding the BAM DMA support. This patch adds the is_bam in NAND property which will be checked for determining the DMA engine type. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
Currently driver data is being assigned directly with ECC modes. Now, the plan is to add more NAND controller versions which will have different properties. This patch reorganizes the current driver data assignment by creating NAND controller properties structure which will contain all properties specific to NAND controller. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-