aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd/nand
AgeCommit message (Collapse)AuthorFilesLines
2018-07-18mtd: rawnand: atmel: Use uintptr_t casts instead of unsigned intBoris Brezillon1-1/+1
When casting a pointer to an unsigned int, uintptr_t should be used to cope with the pointer size differences between 32-bit and 64-bit architectures. This is needed if we want to allow compilation of this driver when COMPILE_TEST=y. Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: hynix: Use ->exec_op() in hynix_nand_reg_write_op()Boris Brezillon1-0/+10
Modern NAND controller drivers implement ->exec_op() instead of ->cmdfunc(), make sure we don't end up with a NULL pointer dereference when hynix_nand_reg_write_op() is called. Fixes: 8878b126df76 ("mtd: nand: add ->exec_op() implementation") Cc: <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: marvell: set reg_clk to NULL if it can't be obtainedDaniel Mack1-11/+11
Don't keep an error-pointer around in the private struct. If this optional clock can't be obtained, simply set the pointer to NULL instead so we can use clk_prepare_enable() on it without further checks, Signed-off-by: Daniel Mack <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: marvell: remove bogus comment in marvell_nfc_select_chip()Daniel Mack1-5/+0
The comment in marvell_nfc_select_chip() about ndtr0 and ndtr1 didn't reflect what the driver was doing. The values of NDTR0 and NDTR1 are read from the registers at probe time and a copy is retained in 'struct marvell_nand_chip'. If keep-config is set in the DT properties, there are no other writers of these timing variables so they can safely be used when the chip is selected. As suggested by Miquel Raynal, simply remove the comment. Signed-off-by: Daniel Mack <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: marvell: add suspend and resume hooksDaniel Mack1-11/+62
This patch restores the suspend and resume hooks that the old driver used to have. Apart from stopping and starting the clocks, the resume callback also nullifies the selected_chip pointer, so the next command that is issued will re-select the chip and thereby restore the timing registers. Factor out some code from marvell_nfc_init() into a new function marvell_nfc_reset() and also call it at resume time to reset some registers that don't retain their contents during low-power mode. Without this patch, a PXA3xx based system would cough up an error similar to the one below after resume. [ 44.660162] marvell-nfc 43100000.nand-controller: Timeout waiting for RB signal [ 44.671492] ubi0 error: ubi_io_write: error -110 while writing 2048 bytes to PEB 102:38912, written 0 bytes [ 44.682887] CPU: 0 PID: 1417 Comm: remote-control Not tainted 4.18.0-rc2+ #344 [ 44.691197] Hardware name: Marvell PXA3xx (Device Tree Support) [ 44.697111] Backtrace: [ 44.699593] [<c0106458>] (dump_backtrace) from [<c0106718>] (show_stack+0x18/0x1c) [ 44.708931] r7:00000800 r6:00009800 r5:00000066 r4:c6139000 [ 44.715833] [<c0106700>] (show_stack) from [<c0678a60>] (dump_stack+0x20/0x28) [ 44.724206] [<c0678a40>] (dump_stack) from [<c0456cbc>] (ubi_io_write+0x3d4/0x630) [ 44.732925] [<c04568e8>] (ubi_io_write) from [<c0454428>] (ubi_eba_write_leb+0x690/0x6fc) ... Fixes: 02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver") Cc: [email protected] Signed-off-by: Daniel Mack <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: mxc: Switch to SPDX identifierFabio Estevam1-14/+1
Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: gpmi: Switch to SPDX identifierFabio Estevam3-38/+3
Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: plat_nand: Kill pdata->ctrl.{hwcontrol, read_byte}()Boris Brezillon1-2/+0
None of the board files are overloading those hooks, so let's drop them from struct platform_nand_ctrl. Signed-off-by: Boris Brezillon <[email protected]> Acked-by: Robert Jarzmik <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: orion_nand: Kill orion_nand_data.dev_ready()Boris Brezillon1-3/+0
None of the boards seem to overload the ->dev_ready() hook, just drop this field from orion_nand_data. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: Kill the chip->scan_bbt() hookBoris Brezillon4-12/+5
None of the existing drivers are overloading the ->scan_bbt() method, let's get rid of it and replace calls to ->scan_bbt() by nand_create_bbt() ones. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: Rename nand_default_bbt() into nand_create_bbt()Boris Brezillon2-5/+10
Rename nand_default_bbt() into nand_create_bbt() and pass it a nand_chip object to prepare removal of the chip->scan_bbt() hook. We add a temporary nand_default_bbt() wrapper which will be dropped after the removal of ->scan_bbt(). Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: Kill cafe_nand_bug()Boris Brezillon1-8/+0
Leaving a function pointer to NULL should be enough to trigger a NULL pointer exception, and anyway, if we want to BUG() when some missing hooks are called, this should be done in the core, so let's drop the cafe_nand_bug() dummy function. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: nuc900: Allow selection of this driver when COMPILE_TEST=yBoris Brezillon1-1/+2
It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having ARCH_W90X900 enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: qcom: Allow selection of this driver when COMPILE_TEST=yBoris Brezillon1-1/+2
It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having ARCH_QCOM enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: mxc: Allow selection of this driver when COMPILE_TEST=yBoris Brezillon1-1/+2
It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having ARCH_MXC enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: mxc: Avoid inclusion of asm/mach headersBoris Brezillon1-2/+0
asm/mach/flash.h does not seem to be needed, drop this #include to make the code completely machine and arch independent and allow one to compile it when COMPILE_TEST=y. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: brcmnand: Allow selection of this driver when COMPILE_TEST=yBoris Brezillon1-1/+2
It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having ARM, ARM64 or MIPS enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: lpc32xx: Allow selection of these drivers when COMPILE_TEST=yBoris Brezillon1-2/+4
It just makes NAND maintainers' life easier by allowing them to compile-test these drivers without having ARCH_LPC32XX enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: sharpsl: Allow selection of this driver when COMPILE_TEST=yBoris Brezillon1-1/+2
It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having ARCH_PXA enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: sharpsl: Remove inclusion of mach and asm headersBoris Brezillon1-4/+1
We don't need mach/hardware.h and sm/mach-types.h, and asm/io.h can be replaced by linux/io.h. Now that we removed those inclusions, we're ready to allow selection of this driver when COMPILE_TEST=y. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: omap2: Allow selection of this driver when COMPILE_TEST=yBoris Brezillon1-1/+2
It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having ARCH_OMAP2PLUS or ARCH_KEYSTONE enabled. We also need to add a dependency on HAS_IOMEM to make sure the driver compiles correctly. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: Add 'depends on HAS_IOMEM' where missingBoris Brezillon1-0/+4
When COMPILE_TEST is allowed and the platform needs uses the iomem API we need to add an explicit dependency on HAS_IOMEM to avoid selection of these drivers when building for an arch that has no iomem support (this is the case of arch/um). Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: gpmi: Remove useless dependency on MTD_NANDBoris Brezillon1-1/+1
The MTD_NAND_GPMI_NAND entry is already defined in an 'if MTD_NAND' block, no need to add an extra "depends on MTD_NAND". Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: qcom: erased page bitflips detectionAbhishek Sahu1-37/+89
NAND parts can have bitflips in an erased page due to the process technology used. In this case, QCOM NAND controller is not able to identify that page as an erased page. Currently the driver calls nand_check_erased_ecc_chunk() for identifying the erased pages but this won’t work always since the checking is being with ECC engine returned data. In case of bitflips, the ECC engine tries to correct the data and then it generates the uncorrectable error. Now, this data is not equal to original raw data. For erased CW identification, the raw data should be read again from NAND device and this nand_check_erased_ecc_chunk function() should be called for raw data only. Now following logic is being added to identify the erased codeword bitflips. 1. In most of the cases, not all the codewords will have bitflips and only single CW will have bitflips. So, there is no need to read the complete raw page data. The NAND raw read can be scheduled for any CW in page. The NAND controller works on CW basis and it will update the status register after each CW read. Maintain the bitmask for the CW which generated the uncorrectable error. 2. Do raw read for all the CW's which generated the uncorrectable error. 3. Both DATA and OOB need to be checked for number of 0. The top-level API can be called with only data buf or OOB buf so use chip->databuf if data buf is null and chip->oob_poi if OOB buf is null for copying the raw bytes temporarily. 4. For each CW, check the number of 0 in cw_data and usable oob bytes, The bbm and spare (unused) bytes bit flip won’t affect the ECC so don’t check the number of bitflips in this area. Signed-off-by: Abhishek Sahu <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: gpmi: remove redundant variable payload_virtColin Ian King1-3/+0
Variable payload_virt is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'payload_virt' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: docg4: fix the probe function error pathMiquel Raynal1-10/+12
nand_release() should not be called on an MTD device that has not been registered. While it should work thanks to the checks done in mtd_device_unregister() it's a bad practice to cleanup/release something that has not previously been initialized/allocated. Rework the error path to follow this rule. Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: denali: optimize timing parameters for data interfaceMasahiro Yamada4-25/+28
This commit improves the ->setup_data_interface() hook. The denali_setup_data_interface() needs the frequency of clk_x and the ratio of clk_x / clk. The latter is currently hardcoded in the driver, like this: #define DENALI_CLK_X_MULT 6 The IP datasheet requires that clk_x / clk be 4, 5, or 6. I just chose 6 because it is the most defensive value, but it is not optimal. By getting the clock rate of both "clk" and "clk_x", the driver can compute the timing values more precisely. To not break the existing platforms, the fallback value, 50 MHz is provided. It is true for all upstreamed platforms. Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Richard Weinberger <[email protected]> Tested-by: Richard Weinberger <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: denali_dt: add more clocks based on IP datasheetMasahiro Yamada1-8/+45
Currently, denali_dt.c requires a single anonymous clock, but the Denali User's Guide requires three clocks for this IP: - clk: controller core clock - clk_x: bus interface clock - ecc_clk: clock at which ECC circuitry is run This commit supports these named clocks to represent the real hardware. For the backward compatibility, the driver still accepts a single clock just as before. The clk_x_rate is taken from the clock driver again if the named clock "clk_x" is available. This will happen only for future DT, hence the existing DT files are not affected. Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Richard Weinberger <[email protected]> Tested-by: Richard Weinberger <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: denali_dt: use dev as a shorthand of &pdev->devMasahiro Yamada1-8/+9
The probe function references &pdev->dev many times, and I will add more soon. Add 'dev' as a shorthand. Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Richard Weinberger <[email protected]> Tested-by: Richard Weinberger <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: mxc: remove __init qualifier from mxcnd_probe_dtMartin Kaiser1-2/+2
Using the sysfs unbind, bind nodes, mxcnd_probe and mxcnd_probe_dt can potentially be called at any time. After the __init functions are cleaned, mxcnd_probe_dt is no longer available. Calling it anyway causes a crash. mxcnd_probe used to be marked as __init, this was removed years ago. Remove the __init qualifier from from mxcnd_probe_dt as well. Fixes: 06f255106923 ("mtd: remove use of __devinit") Signed-off-by: Martin Kaiser <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: spinand: macronix: Add support for MX35LF2GE4ABMiquel Raynal1-0/+8
MX35LF2GE4AB is almost identical to MX35LF1GE4AB except it has 2 times more eraseblocks per LUN and exposes 2 planes instead of 1. Signed-off-by: Miquel Raynal <[email protected]> Signed-off-by: Boris Brezillon <[email protected]>
2018-07-18mtd: spinand: Add initial support for the MX35LF1GE4AB chipBoris Brezillon3-1/+138
Add minimal support for the MX35LF1GE4AB SPI NAND chip. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: spinand: Add initial support for Winbond W25M02GVFrieder Schrempf3-1/+143
Add support for the W25M02GV chip. Signed-off-by: Frieder Schrempf <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: spinand: Add initial support for Micron MT29F2G01ABAGDPeter Pan3-1/+151
Add a basic driver for Micron SPI NANDs. Only one device is supported right now, but the driver will be extended to support more devices afterwards. Signed-off-by: Peter Pan <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: nand: Add core infrastructure to support SPI NANDsPeter Pan5-0/+1148
Add a SPI NAND framework based on the generic NAND framework and the spi-mem infrastructure. In its current state, this framework supports the following features: - single/dual/quad IO modes - on-die ECC Signed-off-by: Peter Pan <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: provide only single helper function for ECC confAbhishek Sahu1-24/+15
Function nand_ecc_choose_conf() will be help for all the cases, so other helper functions can be made static. nand_check_ecc_caps(): Invoke nand_ecc_choose_conf() with both chip->ecc.size and chip->ecc.strength value set. nand_maximize_ecc(): Invoke nand_ecc_choose_conf() with NAND_ECC_MAXIMIZE flag. nand_match_ecc_req(): Invoke nand_ecc_choose_conf() with either chip->ecc.size or chip->ecc.strength value set and without NAND_ECC_MAXIMIZE flag. CC: Masahiro Yamada <[email protected]> Signed-off-by: Abhishek Sahu <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: qcom: code reorganization for raw readAbhishek Sahu1-68/+78
Make separate function to perform raw read for one codeword and call this function multiple times for each codeword in case of raw page read. This separate function will help in subsequent patches related with erased codeword bitflip detection. It will decrease throughput for raw page read. Raw page read is used for debug purpose so it won't affect normal flash operations. Signed-off-by: Abhishek Sahu <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: qcom: check for operation errors in case of raw readAbhishek Sahu1-18/+40
Currently there is no error checking for raw read. For raw reads, there won’t be any ECC failure but the operational failures are possible, so schedule the NAND_FLASH_STATUS read after each codeword. Signed-off-by: Abhishek Sahu <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: qcom: fix return value for raw page readAbhishek Sahu1-1/+1
Fix value returned by ->read_page_raw() to be the actual operation status, instead of always 0. Signed-off-by: Abhishek Sahu <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: qcom: modify write_oob to remove read codeword partAbhishek Sahu1-12/+4
QCOM NAND controller layout protects available OOB data bytes with ECC also so when ecc->write_oob() is being called then it can't update just OOB bytes. Currently, it first reads the last codeword which includes old OOB bytes. Then it updates the old OOB bytes with new ones and then again writes the codeword back. The reading codeword is unnecessary since user is responsible to have these bytes cleared to 0xFF. This patch removes the read part and updates the OOB bytes with data area padded with OxFF. Signed-off-by: Abhishek Sahu <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: qcom: parse read errors for read oob alsoAbhishek Sahu1-17/+9
read_page and read_oob both calls the read_page_ecc function. The QCOM NAND controller protect the OOB available bytes with ECC so read errors should be checked for read_oob also. This patch moves the error checking code inside read_page_ecc so caller does not have to check explicitly for read errors. Signed-off-by: Abhishek Sahu <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: qcom: fix null pointer access for erased page detectionAbhishek Sahu1-3/+15
parse_read_errors can be called with only oob_buf in which case data_buf will be NULL. If data_buf is NULL, then don’t treat this page as completely erased in case of ECC uncorrectable error for RS ECC. For BCH ECC, the controller itself tells regarding erased page in status register. Signed-off-by: Abhishek Sahu <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: qcom: erased page detection for uncorrectable errors onlyAbhishek Sahu1-23/+44
Following is the flow in the HW if controller tries to read erased page: 1. First ECC uncorrectable error will be generated from ECC engine since ECC engine first calculates the ECC with all 0xff and match the calculated ECC with ECC code in OOB (which is again all 0xff). 2. After getting ECC error, erased CW detection logic will be applied which is different for BCH and RS ECC a. For BCH, HW checks if all the bytes in page are 0xff and then it updates the status in separate register NAND_ERASED_CW_DETECT_STATUS. b. For RS ECC, the HW reports the same error when reading an erased CW, but it notifies that it is an erased CW by placing special characters at certain offsets in the buffer. So the erased CW detect status should be checked only if ECC engine generated the uncorrectable error. Currently for all other operational errors also (like TIMEOUT, MPU errors, etc.), the erased CW detect logic is being applied so fix this and return EIO for other operational errors. Signed-off-by: Abhishek Sahu <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: qcom: wait for desc completion in all BAM channelsAbhishek Sahu1-1/+52
The BAM has 3 channels - tx, rx and command. command channel is used for register read/writes, tx channel for data writes and rx channel for data reads. Currently, the driver assumes the transfer completion once it gets all the command descriptors completed. Sometimes, there is race condition between data channel (tx/rx) and command channel completion. In these cases, the data present in buffer is not valid during small window between command descriptor completion and data descriptor completion. This patch generates NAND transfer completion when both (Data and Command) DMA channels have completed all its DMA descriptors. It assigns completion callback in last DMA descriptors of that channel and wait for completion. Fixes: 8d6b6d7e135e ("mtd: nand: qcom: support for command descriptor formation") Cc: [email protected] Signed-off-by: Abhishek Sahu <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: qcom: use the ecc strength from device parameterAbhishek Sahu1-8/+21
Currently the driver uses the ECC strength specified in DT. The QPIC/EBI2 NAND supports 4 or 8-bit ECC correction. The same kind of board can have different NAND parts so use the ECC strength from device parameters if it is not specified in DT. Signed-off-by: Abhishek Sahu <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: qcom: remove dt property nand-ecc-step-sizeAbhishek Sahu1-9/+2
QCOM NAND controller supports only one step size (512) so nand-ecc-step-size DT property is redundant. This property can be removed and ecc step size can be assigned with 512 value. Signed-off-by: Abhishek Sahu <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: denali: use helper function for ecc setupAbhishek Sahu1-28/+2
Use the NAND core helper function nand_ecc_choose_conf to tune the ECC parameters instead of the function locally defined. Signed-off-by: Abhishek Sahu <[email protected]> Acked-by: Masahiro Yamada <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-18mtd: rawnand: helper function for setting up ECC configurationAbhishek Sahu1-0/+33
commit 2c8f8afa7f92 ("mtd: nand: add generic helpers to check, match, maximize ECC settings") provides generic helpers which drivers can use for setting up ECC parameters. Since same board can have different ECC strength nand chips so following is the logic for setting up ECC strength and ECC step size, which can be used by most of the drivers. 1. If both ECC step size and ECC strength are already set (usually by DT) then just check whether this setting is supported by NAND controller. 2. If NAND_ECC_MAXIMIZE is set, then select maximum ECC strength supported by NAND controller. 3. Otherwise, try to match the ECC step size and ECC strength closest to the chip's requirement. If available OOB size can't fit the chip requirement then select maximum ECC strength which can be fit with available OOB size. This patch introduces nand_ecc_choose_conf function which calls the required helper functions for the above logic. The drivers can use this single function instead of calling the 3 helper functions individually. Signed-off-by: Abhishek Sahu <[email protected]> Reviewed-by: Masahiro Yamada <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
2018-07-16Merge 4.18-rc5 into char-misc-nextGreg Kroah-Hartman5-15/+48
We want the char-misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-07-07headers: separate linux/mod_devicetable.h from linux/platform_device.hRandy Dunlap1-0/+1
At over 4000 #includes, <linux/platform_device.h> is the 9th most #included header file in the Linux kernel. It does not need <linux/mod_devicetable.h>, so drop that header and explicitly add <linux/mod_devicetable.h> to source files that need it. 4146 #include <linux/platform_device.h> After this patch, there are 225 files that use <linux/mod_devicetable.h>, for a reduction of around 3900 times that <linux/mod_devicetable.h> does not have to be read & parsed. 225 #include <linux/mod_devicetable.h> This patch was build-tested on 20 different arch-es. It also makes these drivers SubmitChecklist#1 compliant. Signed-off-by: Randy Dunlap <[email protected]> Reported-by: kbuild test robot <[email protected]> # drivers/media/platform/vimc/ Reported-by: kbuild test robot <[email protected]> # drivers/pinctrl/pinctrl-u300.c Signed-off-by: Greg Kroah-Hartman <[email protected]>