| d52265b7 | 28-Feb-2018 |
Miquel Raynal <miquel.raynal@bootlin.com> |
UPSTREAM: spl: nand: sunxi: introduce the nand_wait_int() helper
The pattern of polling on a status register until a bit is set or a timeout occurs is repeated multiple times in the driver. Mutualiz
UPSTREAM: spl: nand: sunxi: introduce the nand_wait_int() helper
The pattern of polling on a status register until a bit is set or a timeout occurs is repeated multiple times in the driver. Mutualize the code by introducing the nand_wait_int() helper that does wait for the bit to flip or returns an error in case of timeout.
Change-Id: Id41d445462a0fab357d9582d0560b77a07e5ac1c Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 28f7a9d375c8bc7a30563b8d995b9baa355c7e41)
show more ...
|
| 49509060 | 28-Feb-2018 |
Miquel Raynal <miquel.raynal@bootlin.com> |
UPSTREAM: spl: nand: sunxi: fix typo on register name
Change NFC_SEND_ADR to NFC_SEND_ADDR.
Change-Id: I7042369a3de14534a0fb3f25ebed9d5b3234e774 Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.
UPSTREAM: spl: nand: sunxi: fix typo on register name
Change NFC_SEND_ADR to NFC_SEND_ADDR.
Change-Id: I7042369a3de14534a0fb3f25ebed9d5b3234e774 Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 802f766994ded5afc9d89e93556011063a430e0d)
show more ...
|
| cd306391 | 28-Feb-2018 |
Miquel Raynal <miquel.raynal@bootlin.com> |
UPSTREAM: spl: nand: sunxi: fix second case of modulo by zero error
In the nand_read_buffer() step, the seed is calculated by doing a modulo by conf->nseeds which is always zero when not using the r
UPSTREAM: spl: nand: sunxi: fix second case of modulo by zero error
In the nand_read_buffer() step, the seed is calculated by doing a modulo by conf->nseeds which is always zero when not using the randomizer (most of SLC NANDs).
This situation turns out to lead to a run time freeze with certain toolchains.
Derive this seed only when the randomizer is enabled (and conf->nseeds logically not zero), exactly like what has been done before with an identical situation, see commit ea3f750c73e3 ("nand: sunxi: Fix modulo by zero error").
Change-Id: Ie3fdf32e1636b16a60b92ed90e965007ef29369c Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit a0a984e14a41bf07f6b3f563a2a8bd22c03aea3a)
show more ...
|
| 9612de70 | 28-Feb-2018 |
Miquel Raynal <miquel.raynal@bootlin.com> |
UPSTREAM: mtd: nand: sunxi: fix ECC strength choice
When the requested ECC strength does not exactly match the strengths supported by the ECC engine, the driver is selecting the closest strength mee
UPSTREAM: mtd: nand: sunxi: fix ECC strength choice
When the requested ECC strength does not exactly match the strengths supported by the ECC engine, the driver is selecting the closest strength meeting the 'selected_strength > requested_strength' constraint. Fix the fact that, in this particular case, ecc->strength value was not updated to match the 'selected_strength'.
For instance, one can encounter this issue when no ECC requirement is filled in the device tree while the NAND chip minimum requirement is not a strength/step_size combo natively supported by the ECC engine.
Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com> Change-Id: I1a0f337fc5241ad6d994219979ac4c5588ab1784 Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit f3aff376892a5af55a090d29e53e10391f886d80)
show more ...
|
| bc9b85f9 | 05-Mar-2018 |
Vipul Kumar <vipul.kumar@xilinx.com> |
UPSTREAM: arm64: zynqmp: nand: Fixed NAND erase issue for size 1GiB or more
NAND erase was not happening for size 1GiB or more. Erase command was executing successfully but in actual, it was not era
UPSTREAM: arm64: zynqmp: nand: Fixed NAND erase issue for size 1GiB or more
NAND erase was not happening for size 1GiB or more. Erase command was executing successfully but in actual, it was not erasing. This patch fixed erase issue for 1 GiB or more size nand.
Change-Id: Iee50e5a07ab1d4f65fa0c826c248864449b50ef7 Signed-off-by: Vipul Kumar <vipulk@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 2453c695185f8fd8257f370b746acdfe5ee56408)
show more ...
|
| 32fcc595 | 13-Mar-2018 |
Stefan Roese <sr@denx.de> |
UPSTREAM: nand: Remove unused ppc4xx NAND driver and references
ppc4xx support was removed some time ago. Lets remove the now unused NAND driver and all its references for this platform as well.
Si
UPSTREAM: nand: Remove unused ppc4xx NAND driver and references
ppc4xx support was removed some time ago. Lets remove the now unused NAND driver and all its references for this platform as well.
Signed-off-by: Stefan Roese <sr@denx.de> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Scott Wood <oss@buserror.net> Change-Id: I18d36aa6b1529d608acb7d39f886c3b45a791c22 Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit ec9c80d643a3e5ff35c5d24d675cb1feaa440c9d)
show more ...
|
| 6a35a5ca | 06-Feb-2018 |
Adam Ford <aford173@gmail.com> |
UPSTREAM: Convert CONFIG_APBH_DMA et al to Kconfig
This converts the following to Kconfig: CONFIG_APBH_DMA CONFIG_APBH_DMA_BURST CONFIG_APBH_DMA_BURST8
Signed-off-by: Adam Ford <aford173@g
UPSTREAM: Convert CONFIG_APBH_DMA et al to Kconfig
This converts the following to Kconfig: CONFIG_APBH_DMA CONFIG_APBH_DMA_BURST CONFIG_APBH_DMA_BURST8
Signed-off-by: Adam Ford <aford173@gmail.com> Reviewed-by: Stefan Agner <stefan.agner@toradex.com> [trini: Add in MMC as well] Change-Id: I45b919ab747aa414ba23f1e165c11dd8aff44c44 Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 99bec1aead5927c54f4364bfe10823a86fe0dad2)
show more ...
|
| fd70bba7 | 06-Feb-2018 |
Stefan Agner <stefan.agner@toradex.com> |
UPSTREAM: Convert CONFIG_NAND_MXS to Kconfig
This converts CONFIG_NAND_MXS to Kconfig.
Change-Id: I217ef77c1e7a11072e08f84d2ab4720e98df9b3f Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Si
UPSTREAM: Convert CONFIG_NAND_MXS to Kconfig
This converts CONFIG_NAND_MXS to Kconfig.
Change-Id: I217ef77c1e7a11072e08f84d2ab4720e98df9b3f Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit c87c81186cf7e5073dbc7c5f46ad256a84f5ed22)
show more ...
|
| 55bb5553 | 15-Jan-2018 |
Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> |
UPSTREAM: nand: arasan: Select CONFIG_SYS_NAND_SELF_INIT
The Arasan NFC driver requires the self-init mode, so it should select it.
Instead of having the config header define the macro, it's cleane
UPSTREAM: nand: arasan: Select CONFIG_SYS_NAND_SELF_INIT
The Arasan NFC driver requires the self-init mode, so it should select it.
Instead of having the config header define the macro, it's cleaner to select the option at the Kconfig level.
Change-Id: I7071edaf3c1bc6defd7772319c15a15df2030938 Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit d55c8159bddd133610e18174b4c4d02a3484a173)
show more ...
|
| 8fa19e0e | 04-Jan-2018 |
Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> |
UPSTREAM: nand: arasan_nfc: Use the calculated ecc address for updating ecc register
This patch corrects the ecc address calculation before updating to ecc register. The ecc address has to be calcul
UPSTREAM: nand: arasan_nfc: Use the calculated ecc address for updating ecc register
This patch corrects the ecc address calculation before updating to ecc register. The ecc address has to be calculated based on page, oob and ecc sizes of the device.
Change-Id: Ic783dd586a2080fb1697457abf3d30eaee173b3c Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit f25ac66c528553a38d349c563d67d0eebbdd77f9)
show more ...
|
| aa06c3b0 | 04-Jan-2018 |
Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> |
UPSTREAM: nand: arasan_nfc: Add support for ondie ecc
This patch adds support for ondie ecc. As of now this adds support for micron parts which supports ondie ecc. Didn't found any better way to det
UPSTREAM: nand: arasan_nfc: Add support for ondie ecc
This patch adds support for ondie ecc. As of now this adds support for micron parts which supports ondie ecc. Didn't found any better way to detect ondie ecc support by a device except sorting out with manufacture and device id's.
Change-Id: Iab408d7af047d9de530c6ccc0fb4c9ca2a7d83b4 Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit cacb8a029fa1d1c140625f18e01663817a2d1b7f)
show more ...
|
| 4eb19ef1 | 04-Jan-2018 |
Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> |
UPSTREAM: nand: arasan_nfc: Move common ecc struct initialization init routine
Move common part of ecc structure initialization to arasan_nand_init() routine.
Change-Id: I78d78b0468f69a7c25101ddc22
UPSTREAM: nand: arasan_nfc: Move common ecc struct initialization init routine
Move common part of ecc structure initialization to arasan_nand_init() routine.
Change-Id: I78d78b0468f69a7c25101ddc224e9bbd60954cba Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit b08fc34f3f778600bd2098f480f60674793dc0e2)
show more ...
|
| 02621bf7 | 05-Jan-2018 |
Jagan Teki <jagan@amarulasolutions.com> |
UPSTREAM: mtd: nand: mxs_nand_spl: Remove nand size print
It is not much needed to print nand size in SPL during nand boot, and most of nand spl drivers doesn't print the same.
Change-Id: I1b7893d1
UPSTREAM: mtd: nand: mxs_nand_spl: Remove nand size print
It is not much needed to print nand size in SPL during nand boot, and most of nand spl drivers doesn't print the same.
Change-Id: I1b7893d1cbd880b7e5640f5ecb12910dd7f40fae Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit ca9d211e2c7801bc3e194d325ece0d3b583b32d2)
show more ...
|
| 0cced741 | 06-Dec-2017 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
UPSTREAM: mtd: nand: denali: make NAND_DENALI unconfigurable option
denali.c has no driver entry in itself. It makes sense only when compiled together with denali_dt.c
Let NAND_DENALI_DT select NA
UPSTREAM: mtd: nand: denali: make NAND_DENALI unconfigurable option
denali.c has no driver entry in itself. It makes sense only when compiled together with denali_dt.c
Let NAND_DENALI_DT select NAND_DENALI, and hide NAND_DENALI from the Kconfig menu.
Change-Id: I6b1299b7995b7f2481f0c3a69599ee11e7be3779 Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit dc774e69bb72a3d8ff4c2af7a280a655f395530b)
show more ...
|
| f03218eb | 30-Nov-2017 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
UPSTREAM: mtd: nand: denali: consolidate include directives
Include necessary headers explicitly without relying on indirect header inclusion.
<common.h>, <malloc.h> are unneeded.
Change-Id: Iba15
UPSTREAM: mtd: nand: denali: consolidate include directives
Include necessary headers explicitly without relying on indirect header inclusion.
<common.h>, <malloc.h> are unneeded.
Change-Id: Iba154c7a088925f1aee9669c7433d1be05225004 Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 0faef2eba946a95f9c78d2b3db47e15bac04b52e)
show more ...
|
| 0e8b5665 | 30-Nov-2017 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
UPSTREAM: mtd: nand: denali_dt: replace printf() with pr_err()
The Linux derived log functions can be used anywhere and easily turned on/off by CONFIG_LOGLEVEL.
Change-Id: I74a94091a9eddd56567fff0b
UPSTREAM: mtd: nand: denali_dt: replace printf() with pr_err()
The Linux derived log functions can be used anywhere and easily turned on/off by CONFIG_LOGLEVEL.
Change-Id: I74a94091a9eddd56567fff0b218f576b31d28d5e Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 681ed4d0d5096b16f81c54c3e5a5efdc9f5f0bc1)
show more ...
|
| 331c2375 | 30-Nov-2017 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
UPSTREAM: mtd: nand: Rename nand.h into rawnand.h
This header was renamed to rawnand.h in Linux.
The following is the corresponding commit in Linux.
commit d4092d76a4a4e57b65910899948a83cc8646c5
UPSTREAM: mtd: nand: Rename nand.h into rawnand.h
This header was renamed to rawnand.h in Linux.
The following is the corresponding commit in Linux.
commit d4092d76a4a4e57b65910899948a83cc8646c5a5 Author: Boris Brezillon <boris.brezillon@free-electrons.com> Date: Fri Aug 4 17:29:10 2017 +0200
mtd: nand: Rename nand.h into rawnand.h
We are planning to share more code between different NAND based devices (SPI NAND, OneNAND and raw NANDs), but before doing that we need to move the existing include/linux/mtd/nand.h file into include/linux/mtd/rawnand.h so we can later create a nand.h header containing all common structure and function prototypes.
Change-Id: Ia387c26297c268a449e3451c7adfabcd6417b278 Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 6ae3900a86b52429bf7a73ad832f0ad02acc2282)
show more ...
|
| 7be88841 | 29-Nov-2017 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
UPSTREAM: mtd: nand: denali: remove ad-hoc board_nand_init() entry
This driver is highly dependent on the configuration from denali_dt.c Please enable CONFIG_NAND_DENALI_DT if you use this driver.
UPSTREAM: mtd: nand: denali: remove ad-hoc board_nand_init() entry
This driver is highly dependent on the configuration from denali_dt.c Please enable CONFIG_NAND_DENALI_DT if you use this driver.
Change-Id: I9c63239a11f0687332f71728ef2d45db9c3687f8 Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 57f9bb9404e0578b4701ff900fdfa884d84c74b0)
show more ...
|
| 9a0651a2 | 29-Nov-2017 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
UPSTREAM: mtd: nand: denali: remove bogus __maybe_unused
denali_setup_data_interface() is always used.
I put __maybe_unused for a temporal use, then forgot to delete it.
Change-Id: I32d8161d39b8bf
UPSTREAM: mtd: nand: denali: remove bogus __maybe_unused
denali_setup_data_interface() is always used.
I put __maybe_unused for a temporal use, then forgot to delete it.
Change-Id: I32d8161d39b8bf76331afafb797d47870475d852 Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 1a7e176d27eb54cf75b2c54dfe1a351cc434d1d5)
show more ...
|
| 3eefe4d1 | 22-Nov-2017 |
Sean Nyekjaer <sean.nyekjaer@prevas.dk> |
UPSTREAM: fix: nand: pxa3xx: fix defined but not used warnings
bbt_mirror_descr and bbt_main_descr is defined but not used when compiling without CONFIG_SYS_NAND_USE_FLASH_BBT set.
Change-Id: Id434
UPSTREAM: fix: nand: pxa3xx: fix defined but not used warnings
bbt_mirror_descr and bbt_main_descr is defined but not used when compiling without CONFIG_SYS_NAND_USE_FLASH_BBT set.
Change-Id: Id43418ec556c803a7ddb85733e1ae18a5d52cef3 Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk> Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit e13921a9514be6a82f328a8633ab695f2d953b83)
show more ...
|
| 40fb869c | 07-Nov-2017 |
Joe Hershberger <joe.hershberger@ni.com> |
UPSTREAM: mtd: nand: zynq: Add support for the NAND lock/unlock operation
Zynq NAND driver is not support for NAND lock or unlock operation. Hence, accidentally write into the critical NAND region m
UPSTREAM: mtd: nand: zynq: Add support for the NAND lock/unlock operation
Zynq NAND driver is not support for NAND lock or unlock operation. Hence, accidentally write into the critical NAND region might cause data corruption to occur.
This commit is to add NAND lock/unlock command into NAND SMC register set for NAND lock/unlock operaion.
Change-Id: Ia62c8d977f1b3e66790823a837e3faa021f0078a Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Keng Soon Cheah <keng.soon.cheah@ni.com> Cc: Chen Yee Chew <chen.yee.chew@ni.com> Cc: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Scott Wood <oss@buserror.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 6d3fa0dfdd3cc0e5067785fcb9ca6267b1501fa4)
show more ...
|
| 113f18a1 | 15-Nov-2017 |
Wilson Lee <wilson.lee@ni.com> |
UPSTREAM: mtd: zynq: nand: Move board_nand_init() function to board.c
Putting board_nand_init() function inside NAND driver was not appropriate due to it doesn't allow board vendor to customise thei
UPSTREAM: mtd: zynq: nand: Move board_nand_init() function to board.c
Putting board_nand_init() function inside NAND driver was not appropriate due to it doesn't allow board vendor to customise their NAND initialization code such as adding NAND lock/unlock code.
This commit was to move the board_nand_init() function from NAND driver to board.c file. This allow customization of board_nand_init() function.
Change-Id: Idb5c0dd35aa1368009f93b33c9d77ff44da4991b Signed-off-by: Wilson Lee <wilson.lee@ni.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Keng Soon Cheah <keng.soon.cheah@ni.com> Cc: Chen Yee Chew <chen.yee.chew@ni.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Cc: Scott Wood <oss@buserror.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 310995d9f91ae56082b49be06fe8c3d01424f8f6)
show more ...
|
| d99779a7 | 21-Nov-2017 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
UPSTREAM: mtd: nand: denali: sync with Linux 4.15-rc1
I largely reworked the Denali NAND controller driver in Linux. This commit imports the improvements from Linux. The code is almost synced with
UPSTREAM: mtd: nand: denali: sync with Linux 4.15-rc1
I largely reworked the Denali NAND controller driver in Linux. This commit imports the improvements from Linux. The code is almost synced with Linux 4.15-rc1.
Change-Id: I095cb46a2d500567e053196ff05061e16ca2dc98 Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 350d052dab99986571c03951f0aed621dacfb9d9)
show more ...
|
| b48ce100 | 21-Nov-2017 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
UPSTREAM: mtd: nand: introduce NAND_ROW_ADDR_3 flag
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
UPSTREAM: mtd: nand: introduce NAND_ROW_ADDR_3 flag
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.
Change-Id: I46c6ce88e75faf27564297bcd8f69f34407feff7 Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Wenyou Yang <wenyou.yang@microchip.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> [Linux commit: 14157f861437ebe2d624b0a845b91bbdf8ca9a2d] Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit e6001371d1603f00a98af9e6dd73abdbbffd2784)
show more ...
|
| 2416d1a3 | 21-Nov-2017 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
UPSTREAM: mtd: nand: add generic helpers to check, match, maximize ECC settings
Driver are responsible for setting up ECC parameters correctly. Those include: - Check if ECC parameters specified (
UPSTREAM: mtd: nand: add generic helpers to check, match, maximize ECC settings
Driver are responsible for setting up ECC parameters correctly. Those include: - Check if ECC parameters specified (usually by DT) are valid - Meet the chip's ECC requirement - Maximize ECC strength if NAND_ECC_MAXIMIZE flag is set
The logic can be generalized by factoring out common code.
This commit adds 3 helpers to the NAND framework: nand_check_ecc_caps - Check if preset step_size and strength are valid nand_match_ecc_req - Match the chip's requirement nand_maximize_ecc - Maximize the ECC strength
To use the helpers above, a driver needs to provide: - Data array of supported ECC step size and strength - A hook that calculates ECC bytes from the combination of step_size and strength.
By using those helpers, code duplication among drivers will be reduced.
Change-Id: I74551caae9c08de925327b8550221e5c75d123c2 Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> [Linux commit: 2c8f8afa7f92acb07641bf95b940d384ed1d0294] Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 470c29d1c28d23bdd86456bc431b8f26f8727903)
show more ...
|