Boris Brezillon
d652f3a5bd
mtd: rawnand: toshiba: Set the pairing scheme for TC58TEG5DCLTA00
...
TC58TEG5DCLTA00 uses a stride of 3 between its lower and upper page.
Set the appropriate pairing scheme at init time.
Signed-off-by: Boris Brezillon <bbrezillon@kernel.org >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200503155341.16712-4-miquel.raynal@bootlin.com
2020-05-11 09:51:41 +02:00
Boris Brezillon
18729b1776
mtd: rawnand: Define the "distance 3" MLC pairing scheme
...
Define a new page pairing scheme for MLC NANDs with a distance of 3
pages between the lower and upper page.
Signed-off-by: Boris Brezillon <bbrezillon@kernel.org >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200503155341.16712-3-miquel.raynal@bootlin.com
2020-05-11 09:51:41 +02:00
Boris Brezillon
5338ef99c9
mtd: rawnand: toshiba: Add a specific init for TC58TEG5DCLTA00
...
TC58TEG5DCLTA00 is an MLC NAND which requires scrambling and supports
SDR timings mode 5.
Signed-off-by: Boris Brezillon <bbrezillon@kernel.org >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200503155341.16712-2-miquel.raynal@bootlin.com
2020-05-11 09:51:41 +02:00
Boris Brezillon
51b71ac092
mtd: rawnand: cs553x: Get rid of the legacy interface implementation
...
Now that exec_op() is implemented we no longer need to implement the
legacy hooks.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200501090650.1138200-5-boris.brezillon@collabora.com
2020-05-11 09:51:41 +02:00
Boris Brezillon
b4ed6328b9
mtd: rawnand: cs553x: Implement exec_op()
...
So we can later get rid of the legacy hooks.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200501090650.1138200-4-boris.brezillon@collabora.com
2020-05-11 09:51:41 +02:00
Boris Brezillon
ba03e48339
mtd: rawnand: cs553x: Stop using chip->legacy.IO_ADDR_{R, W}
...
Now that we have our own controller struct we can keep the MMIO pointer
in there and use instead of using the chip->legacy.IO_ADDR_{R,W} fields.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200501090650.1138200-3-boris.brezillon@collabora.com
2020-05-11 09:51:41 +02:00
Boris Brezillon
c9e1817ff9
mtd: rawnand: cs553x: Declare controllers instead of NAND chips
...
The CS553x companion chip embeds 4 NAND controllers. Declare them as
NAND controllers instead of NAND chips. That's done in preparation
of the transition to exec_op().
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200501090650.1138200-2-boris.brezillon@collabora.com
2020-05-11 09:51:41 +02:00
Miquel Raynal
432ab89d30
mtd: rawnand: jedec: Use intermediate variables to improve readability
...
Before reworking a little bit the JEDEC detection code, let's
clean the coding style of an if statement to improve readability.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-10-miquel.raynal@bootlin.com
2020-05-11 09:51:41 +02:00
Miquel Raynal
2e8f56f2a9
mtd: rawnand: jedec: Define the number of parameter pages
...
Use a macro to define the number of parameter page instead of
hardcoding it everywhere.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-9-miquel.raynal@bootlin.com
2020-05-11 09:51:40 +02:00
Miquel Raynal
6e9c65d87c
mtd: rawnand: onfi: Drop a useless parameter page read
...
During detection the logic on the NAND bus is:
/* Regular ONFI detection */
1/ read the three NAND parameter pages
/* Extended parameter page detection */
2/ send "read the NAND parameter page" commands without reading
actual data
3/ move the column pointer to the extended page and read it
If fact, as long as there is nothing happening on the NAND bus between
1/ and 3/, the operation 2/ is redundant so remove it.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-8-miquel.raynal@bootlin.com
2020-05-11 09:51:40 +02:00
Miquel Raynal
7e928263fc
mtd: rawnand: onfi: Avoid doing a copy of the parameter page
...
There is no need for copying the parameter page, playing with
pointers does the trick.
There is not functional change.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-7-miquel.raynal@bootlin.com
2020-05-11 09:51:40 +02:00
Miquel Raynal
dacd1a1297
mtd: rawnand: onfi: Define the number of parameter pages
...
Use a macro to define the number of parameter page instead of
hardcoding it everywhere.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-6-miquel.raynal@bootlin.com
2020-05-11 09:51:40 +02:00
Miquel Raynal
543e34f29d
mtd: rawnand: onfi: Use intermediate variables to improve readability
...
Before reworking a little bit the ONFI detection code, let's
clean the coding style of the if statements to improve readability.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-5-miquel.raynal@bootlin.com
2020-05-11 09:51:40 +02:00
Miquel Raynal
1d5d08ee9b
mtd: rawnand: onfi: Fix redundancy detection check
...
During ONFI detection, the CRC derived from the parameter page and the
CRC supposed to be at the end of the parameter page are compared. If
they do not match, the second then the third copies of the page are
tried.
The current implementation compares the newly derived CRC with the CRC
contained in the first page only. So if this particular CRC area has
been corrupted, then the detection will fail for a wrong reason.
Fix this issue by checking the derived CRC against the right one.
Fixes: 39138c1f4a ("mtd: rawnand: use bit-wise majority to recover the ONFI param page")
Cc: stable@vger.kernel.org
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-4-miquel.raynal@bootlin.com
2020-05-11 09:51:40 +02:00
Miquel Raynal
4d8ec041d9
mtd: rawnand: timings: Fix default tR_max and tCCS_min timings
...
tR and tCCS are currently wrongly expressed in femtoseconds, while we
expect these values to be expressed in picoseconds. Set right
hardcoded values.
Fixes: 6a943386ee mtd: rawnand: add default values for dynamic timings
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-3-miquel.raynal@bootlin.com
2020-05-11 09:51:40 +02:00
Miquel Raynal
83c411c29b
mtd: rawnand: timings: Add mode information to the timings structure
...
Convert the timings union into a structure containing the mode and the
actual values. The values are still a union in prevision of the
addition of the NVDDR modes.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-2-miquel.raynal@bootlin.com
2020-05-11 09:51:40 +02:00
Miquel Raynal
1617942a81
mtd: rawnand: marvell: Rename the ->correct() function
...
There is no correction involved at this point, it is just a matter of
reading registers and checking whether bitflips have occurred or
not. Rename the function to clarify it.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Link: https://lore.kernel.org/linux-mtd/20200424164501.26719-7-miquel.raynal@bootlin.com
2020-05-11 09:51:40 +02:00
Miquel Raynal
82c6c04e96
mtd: rawnand: marvell: Rename a function to clarify
...
Cosmetic change to clarify the purpose of the function.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Link: https://lore.kernel.org/linux-mtd/20200424164501.26719-6-miquel.raynal@bootlin.com
2020-05-11 09:51:40 +02:00
Miquel Raynal
c525b7af96
mtd: rawnand: marvell: Fix probe error path
...
Ensure all chips are deregistered and cleaned in case of error during
the probe.
Fixes: 02f26ecf8c ("mtd: nand: add reworked Marvell NAND controller driver")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Link: https://lore.kernel.org/linux-mtd/20200424164501.26719-5-miquel.raynal@bootlin.com
2020-05-11 09:51:39 +02:00
Miquel Raynal
7a0c18fb5c
mtd: rawnand: marvell: Use nand_cleanup() when the device is not yet registered
...
Do not call nand_release() while the MTD device has not been
registered, use nand_cleanup() instead.
Fixes: 02f26ecf8c ("mtd: nand: add reworked Marvell NAND controller driver")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Link: https://lore.kernel.org/linux-mtd/20200424164501.26719-4-miquel.raynal@bootlin.com
2020-05-11 09:51:39 +02:00
Miquel Raynal
5dcc99763c
mtd: rawnand: marvell: Use devm_platform_ioremap_res()
...
Switch from the old platform_get_resource()/devm_ioremap_resource()
couple to the newer devm_platform_ioremap_resource() helper.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Link: https://lore.kernel.org/linux-mtd/20200424164501.26719-3-miquel.raynal@bootlin.com
2020-05-11 09:51:39 +02:00
Miquel Raynal
c27075772d
mtd: rawnand: marvell: Fix the condition on a return code
...
In a previous fix, I changed the condition on which the timeout of an
IRQ is reached from:
if (!ret)
into:
if (ret && !pending)
While having a non-zero return code is usual in the Linux kernel, here
ret comes from a wait_for_completion_timeout() which returns 0 when
the waiting period is too long.
Hence, the revised condition should be:
if (!ret && !pending)
The faulty patch did not produce any error because of the !pending
condition so this change is finally purely cosmetic and does not
change the actual driver behavior.
Fixes: cafb56dd74 ("mtd: rawnand: marvell: prevent timeouts on a loaded machine")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Link: https://lore.kernel.org/linux-mtd/20200424164501.26719-2-miquel.raynal@bootlin.com
2020-05-11 09:51:39 +02:00
Miquel Raynal
d10b41ba02
mtd: rawnand: Give more information about the ECC weakness
...
When the ECC strength is too weak compared to the NAND chip
requirements, display the values so that it is clear for people how
much they are far from the requirements (and might get in troubles in
the future).
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200421163906.7515-1-miquel.raynal@bootlin.com
2020-05-11 09:51:39 +02:00
Boris Brezillon
806adfbe88
mtd: rawnand: au1550nd: Patch the read/write buf helper prototypes
...
To match the types passed by au1550nd_exec_instr() function.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200419193037.1544035-5-boris.brezillon@collabora.com
2020-05-11 09:51:39 +02:00
Boris Brezillon
b1593f8a43
mtd: rawnand: au1550nd: Get rid of the legacy interface implementation
...
Now that exec_op() is implemented we can get rid of all other hooks.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200419193037.1544035-4-boris.brezillon@collabora.com
2020-05-11 09:51:32 +02:00
Boris Brezillon
a67537ef37
mtd: rawnand: au1550nd: Implement exec_op()
...
So we can later get rid of the legacy interface implementation.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200419193037.1544035-3-boris.brezillon@collabora.com
2020-05-10 21:18:50 +02:00
Boris Brezillon
15770370df
mtd: rawnand: au1550nd: Stop using IO_ADDR_{R, W} in au_{read, write}_buf[16]()
...
We are about to re-use those for the exec_op() implementation which
will not rely on au1550_hwcontrol(). Let's patch those helpers to
simply use the iomem address stored in the context.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200419193037.1544035-2-boris.brezillon@collabora.com
2020-05-10 21:18:48 +02:00
Masahiro Yamada
5756f2e8da
mtd: rawnand: denali: add more delays before latching incoming data
...
The Denali IP have several registers to specify how many clock cycles
should be waited between falling/rising signals. You can improve the
NAND access performance by programming these registers with optimized
values.
Because struct nand_sdr_timings represents the device requirement
in pico seconds, denali_setup_data_interface() computes the register
values by dividing the device timings with the clock period.
Marek Vasut reported this driver in the latest kernel does not work
on his SOCFPGA board. (The on-board NAND chip is mode 5)
The suspicious parameter is acc_clks, so this commit relaxes it.
The Denali NAND Flash Memory Controller User's Guide describes this
register as follows:
acc_clks
signifies the number of bus interface clk_x clock cycles,
controller should wait from read enable going low to sending
out a strobe of clk_x for capturing of incoming data.
Currently, acc_clks is calculated only based on tREA, the delay on the
chip side. This does not include additional delays that come from the
data path on the PCB and in the SoC, load capacity of the pins, etc.
This relatively becomes a big factor on faster timing modes like mode 5.
Before supporting the ->setup_data_interface() hook (e.g. Linux 4.12),
the Denali driver hacks acc_clks in a couple of ways [1] [2] to support
the timing mode 5.
We would not go back to the hard-coded acc_clks, but we need to include
this factor into the delay somehow. Let's say the amount of the additional
delay is 10000 pico sec.
In the new calculation, acc_clks is determined by timings->tREA_max +
data_setup_on_host.
Also, prolong the RE# low period to make sure the data hold is met.
Finally, re-center the data latch timing for extra safety.
[1] https://github.com/torvalds/linux/blob/v4.12/drivers/mtd/nand/denali.c#L276
[2] https://github.com/torvalds/linux/blob/v4.12/drivers/mtd/nand/denali.c#L282
Reported-by: Marek Vasut <marex@denx.de >
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com >
Tested-by: Marek Vasut <marex@denx.de >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200317071821.9916-1-yamada.masahiro@socionext.com
2020-05-10 21:18:46 +02:00
Boris Brezillon
ce446b4b2d
mtd: rawnand: Take check_only into account
...
->exec_op() is passed a check_only argument that encodes when the
controller should just check whether the operation is supported or not
without executing it. Some controllers simply ignore this arguments,
others don't but keep modifying some of the registers before returning.
Let's fix all those drivers.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200418194217.1016060-1-boris.brezillon@collabora.com
2020-05-10 21:16:01 +02:00
YueHaibing
4ba246d7a3
mtd: rawnand: brcmnand: Remove unused including <linux/version.h>
...
Remove including <linux/version.h> that don't need it.
Signed-off-by: YueHaibing <yuehaibing@huawei.com >
Acked-by: Florian Fainelli <f.fainelli@gmail.com >
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com >
Reviewed-by: Kamal Dasu <kdasu.kdev@gmail.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200417101129.35556-1-yuehaibing@huawei.com
2020-05-10 21:15:58 +02:00
YueHaibing
fb0f6f331e
mtd: rawnand: cadence: Make cadence_nand_attach_chip static
...
Fix sparse warning:
drivers/mtd/nand/raw/cadence-nand-controller.c:2595:5:
warning: symbol 'cadence_nand_attach_chip' was not declared. Should it be static?
Reported-by: Hulk Robot <hulkci@huawei.com >
Signed-off-by: YueHaibing <yuehaibing@huawei.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200410115228.30440-1-yuehaibing@huawei.com
2020-05-10 21:15:56 +02:00
YueHaibing
73ab61552e
mtd: rawnand: ingenic: Make qi_lb60_ooblayout_ops static
...
Fix sparse warning:
drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c:105:32:
warning: symbol 'qi_lb60_ooblayout_ops' was not declared. Should it be static?
Reported-by: Hulk Robot <hulkci@huawei.com >
Signed-off-by: YueHaibing <yuehaibing@huawei.com >
Acked-by: Paul Cercueil <paul@crapouillou.net >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200410115121.11852-1-yuehaibing@huawei.com
2020-05-10 21:15:54 +02:00
Fenghua Yu
7c26e6ef96
mtd: rawnand: fsmc: Change to non-atomic bit operations
...
No need to use expensive atomic change_bit() on dat[] and err_idx[]:
1. fsmc_bch8_correct_data() is called while mutex chip->lock is held
2. err_idx[] is a local variable.
To avoid big endian concern due to type cast to unsigned long, directly
change the bit in the specified byte instead of using non-atomic
__change_bit().
Suggested-by: Peter Zijlstra <peterz@infradead.org >
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com >
Reviewed-by: Tony Luck <tony.luck@intel.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/1576886755-9788-1-git-send-email-fenghua.yu@intel.com
2020-05-10 21:15:52 +02:00
Miquel Raynal
025a06c110
mtd: Convert fallthrough comments into statements
...
Use Joe Perches cvt_fallthrough.pl script to convert
/* fallthrough */
comments (and its derivatives) into a
fallthrough;
statement. This automatically drops useless ones.
Do it MTD-wide.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Acked-by: Vignesh Raghavendra <vigneshr@ti.com >
Acked-by: Tudor Ambarus <tudor.ambarus@microchip.com >
Acked-by: Richard Weinberger <richard@nod.at >
Link: https://lore.kernel.org/linux-mtd/20200325212115.14170-1-miquel.raynal@bootlin.com
2020-03-30 10:14:54 +02:00
Miquel Raynal
699274b1a1
Merge tag 'nand/for-5.7' into mtd/next
...
Raw NAND core changes:
* Add support for manufacturer specific suspend/resume operation
* Add support for manufacturer specific lock/unlock operation
* Replace zero-length array with flexible-array member
* Fix a typo ("manufecturer")
* Ensure nand_soft_waitrdy wait period is enough
Raw NAND controller driver changes:
* Brcmnand:
Add support for flash-edu for dma transfers (+ bindings)
* Cadence:
Reinit completion before executing a new command
Change bad block marker size
Fix the calculation of the avaialble OOB size
Get meta data size from registers
* Qualcom:
Use dma_request_chan() instead dma_request_slave_channel()
Release resources on failure within qcom_nandc_alloc()
* Allwinner:
Use dma_request_chan() instead dma_request_slave_channel()
* Marvell:
Use dma_request_chan() instead dma_request_slave_channel()
Release DMA channel on error
* Freescale:
Use dma_request_chan() instead dma_request_slave_channel()
* Macronix:
Add support for Macronix NAND randomizer (+ bindings)
* Ams-delta:
Rename structures and functions to gpio_nand*
Make the driver custom I/O ready
Drop useless local variable
Support custom driver initialisation
Add module device tables
Handle more GPIO pins as optional
Make read pulses optional
Don't hardcode read/write pulse widths
Push inversion handling to gpiolib
Enable OF partition info support
Drop board specific partition info
Use struct gpio_nand_platdata
Write protect device during probe
* Ingenic:
Use devm_platform_ioremap_resource()
Add dependency on MIPS || COMPILE_TEST
* Denali:
Deassert write protect pin
* ST:
Use dma_request_chan() instead dma_request_slave_channel()
Raw NAND chip driver changes:
* Toshiba:
Support reading the number of bitflips for BENAND (Built-in ECC NAND)
* Macronix:
Add support for deep power down mode
Add support for block protection
SPI-NAND core changes:
* Do not erase the block before writing a bad block marker
* Explicitly use MTD_OPS_RAW to write the bad block marker to OOB
* Stop using spinand->oobbuf for buffering bad block markers
* Rework detect procedure for different READ_ID operation
SPI-NAND driver changes:
* Toshiba:
Support for new Kioxia Serial NAND
Rename function name to change suffix and prefix (8Gbit)
Add comment about Kioxia ID
* Micron:
Add new Micron SPI NAND devices with multiple dies
Add M70A series Micron SPI NAND devices
identify SPI NAND device with Continuous Read mode
Add new Micron SPI NAND devices
Describe the SPI NAND device MT29F2G01ABAGD
Generalize the OOB layout structure and function names
2020-03-30 10:14:19 +02:00
Yoshio Furuyama
fca88925d7
mtd: rawnand: toshiba: Support reading the number of bitflips for BENAND (Built-in ECC NAND)
...
Add support vendor specific commands for KIOXIA CORPORATION BENAND.
The actual bitflips number can be retrieved by this command.
Signed-off-by: Yoshio Furuyama <ytc-mb-yfuruyama7@kioxia.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/1585124572-4693-1-git-send-email-ytc-mb-yfuruyama7@kioxia.com
2020-03-25 22:13:04 +01:00
Mason Yang
19301d5499
mtd: rawnand: macronix: Add support for deep power down mode
...
Macronix AD series support deep power down mode for a minimum
power consumption state.
Overload nand_suspend() & nand_resume() in Macronix specific code to
support deep power down mode.
Signed-off-by: Mason Yang <masonccyang@mxic.com.tw >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
2020-03-24 22:51:01 +01:00
Mason Yang
adc6162b9a
mtd: rawnand: Add support for manufacturer specific suspend/resume operation
...
Patch nand_suspend() & nand_resume() to let manufacturers overwrite
suspend/resume operations.
Signed-off-by: Mason Yang <masonccyang@mxic.com.tw >
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/1584517348-14486-2-git-send-email-masonccyang@mxic.com.tw
2020-03-24 22:44:45 +01:00
Kamal Dasu
a5d53ad26a
mtd: rawnand: brcmnand: Add support for flash-edu for dma transfers
...
Legacy mips soc platforms that have controller v5.0 and 6.0 use
flash-edu block for dma transfers. This change adds support for
nand dma transfers using the EDU block.
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200122213313.35820-4-kdasu.kdev@gmail.com
2020-03-11 16:21:38 +01:00
Piotr Sroka
0d7d6c8183
mtd: rawnand: cadence: reinit completion before executing a new command
...
Reing the completion object before executing CDMA command to make sure
the 'done' flag is OK.
Fixes: ec4ba01e89 ("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem")
Cc: stable@vger.kernel.org
Signed-off-by: Piotr Sroka <piotrs@cadence.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/1581328530-29966-4-git-send-email-piotrs@cadence.com
2020-03-11 16:17:55 +01:00
Piotr Sroka
9bf1903bed
mtd: rawnand: cadence: change bad block marker size
...
Increase bad block marker size from one byte to two bytes.
Bad block marker is handled by skip bytes feature of HPNFC.
Controller expects this value to be an even number.
Fixes: ec4ba01e89 ("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem")
Cc: stable@vger.kernel.org
Signed-off-by: Piotr Sroka <piotrs@cadence.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/1581328530-29966-3-git-send-email-piotrs@cadence.com
2020-03-11 16:17:55 +01:00
Piotr Sroka
e4578af035
mtd: rawnand: cadence: fix the calculation of the avaialble OOB size
...
The value of cdns_chip->sector_count is not known at the moment
of the derivation of ecc_size, leading to a zero value. Fix
this by assigning ecc_size later in the code.
Fixes: ec4ba01e89 ("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem")
Cc: stable@vger.kernel.org
Signed-off-by: Piotr Sroka <piotrs@cadence.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/1581328530-29966-2-git-send-email-piotrs@cadence.com
2020-03-11 16:17:55 +01:00
Piotr Sroka
397deafc02
mtd: rawnand: cadence: get meta data size from registers
...
Add checking size of BCH meta data size in capabilities registers
instead of using fixed value. BCH meta data is used to keep data
from NAND flash OOB area.
Signed-off-by: Piotr Sroka <piotrs@cadence.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/1581328530-29966-1-git-send-email-piotrs@cadence.com
2020-03-11 16:17:55 +01:00
Mason Yang
03a539c7a1
mtd: rawnand: Macronix: Add support for block protection
...
Macronix AC/AD series support using SET_FEATURES to change block
protection and unprotection. Block protection support can be checked
with GET_FEATURES.
Signed-off-by: Mason Yang <masonccyang@mxic.com.tw >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/1583220084-10890-3-git-send-email-masonccyang@mxic.com.tw
2020-03-11 16:17:55 +01:00
Mason Yang
92270086b7
mtd: rawnand: Add support for manufacturer specific lock/unlock operation
...
Add nand_lock() & nand_unlock() for manufacturer specific lock & unlock
operation while the device supports Block Portection function.
Signed-off-by: Mason Yang <masonccyang@mxic.com.tw >
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/1583220084-10890-2-git-send-email-masonccyang@mxic.com.tw
2020-03-11 16:17:55 +01:00
Paul Cercueil
e015d72f32
mtd: rawnand: ingenic: Add dependency on MIPS || COMPILE_TEST
...
This driver has no arch-specific instructions but is only ever useful
on MIPS; so disable this driver if we're not compiling for MIPS, unless
the driver is compile-tested.
Signed-off-by: Paul Cercueil <paul@crapouillou.net >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200302184509.10666-1-paul@crapouillou.net
2020-03-11 16:17:55 +01:00
Peter Ujfalusi
b35f79aa46
mtd: rawnand: stm32_fmc2: Use dma_request_chan() instead dma_request_slave_channel()
...
dma_request_slave_channel() is a wrapper on top of dma_request_chan()
eating up the error code.
Use using dma_request_chan() directly and inform user of error in case the
DMA request failed.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200227123749.24064-8-peter.ujfalusi@ti.com
2020-03-11 16:17:54 +01:00
Peter Ujfalusi
92f0f8efbd
mtd: rawnand: qcom: Use dma_request_chan() instead dma_request_slave_channel()
...
dma_request_slave_channel() is a wrapper on top of dma_request_chan()
eating up the error code.
Use using dma_request_chan() directly to return the real error code.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200227123749.24064-7-peter.ujfalusi@ti.com
2020-03-11 16:17:54 +01:00
Peter Ujfalusi
80c3012e12
mtd: rawnand: qcom: Release resources on failure within qcom_nandc_alloc()
...
In case when DMA channel request or alloc_bam_transaction() fails,
dma_unmap_single() and any channels already requested should be released.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200227123749.24064-6-peter.ujfalusi@ti.com
2020-03-11 16:17:54 +01:00
Peter Ujfalusi
ac80c55b46
mtd: rawnand: sunxi: Use dma_request_chan() instead dma_request_slave_channel()
...
dma_request_slave_channel() is a wrapper on top of dma_request_chan()
eating up the error code.
By using dma_request_chan() directly the driver can support deferred
probing against DMA.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com >
Acked-by: Maxime Ripard <mripard@kernel.org >
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com >
Link: https://lore.kernel.org/linux-mtd/20200227123749.24064-5-peter.ujfalusi@ti.com
2020-03-11 16:17:54 +01:00