Boris Brezillon
d4092d76a4
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.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com >
Signed-off-by: Peter Pan <peterpandong@micron.com >
Acked-by: Vladimir Zapolskiy <vz@mleia.com >
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com >
Acked-by: Wenyou Yang <wenyou.yang@microchip.com >
Acked-by: Krzysztof Kozlowski <krzk@kernel.org >
Acked-by: Han Xu <han.xu@nxp.com >
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com >
Acked-by: Shawn Guo <shawnguo@kernel.org >
Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com >
Acked-by: Neil Armstrong <narmstrong@baylibre.com >
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com >
Acked-By: Harvey Hunt <harveyhuntnexus@gmail.com >
Acked-by: Tony Lindgren <tony@atomide.com >
Acked-by: Krzysztof Halasa <khalasa@piap.pl >
2017-08-13 10:11:49 +02:00
Boris Brezillon
0b2f93dc00
mtd: nand: jz4780: Use mtd_set_ooblayout() to set the ooblayout
...
The mtd_set_ooblayout() accesor has been added to hide internals of
mtd_info and ease future refactoring. Call mtd_set_ooblayout() instead of
directly accessing mtd->ooblayout.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com >
Acked-by: Harvey Hunt <harveyhuntnexus@gmail.com >
2017-05-15 12:00:36 +02:00
Marc Gonzalez
d45bc58dd3
mtd: nand: import nand_hw_control_init()
...
The code to initialize a struct nand_hw_control is duplicated across
several drivers. Factorize it using an inline function.
Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com >
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com >
2016-09-23 09:35:16 +02:00
Harvey Hunt
8490c03bd9
mtd: nand: jz4780: Update MODULE_AUTHOR email address
...
Emails will bounce from my imgtec address, so update it to a new one.
Signed-off-by: Harvey Hunt <harvey.hunt@imgtec.com >
Cc: Harvey Hunt <harveyhuntnexus@gmail.com >
Cc: linux-mtd@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com >
2016-07-11 08:40:19 +02:00
Rafał Miłecki
e4225ae823
mtd: mtd: drop NAND_ECC_SOFT_BCH enum value
...
This value should not be part of nand_ecc_modes_t as it specifies
algorithm not a mode. We successfully managed to introduce new "algo"
field which is respected now.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com >
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com >
2016-05-05 23:55:13 +02:00
Boris Brezillon
36886be7dd
mtd: nand: jz4780: switch to mtd_ooblayout_ops
...
Implementing the mtd_ooblayout_ops interface is the new way of exposing
ECC/OOB layout to MTD users.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com >
Tested-by: Harvey Hunt <harvey.hunt@imgtec.com >
2016-05-05 23:51:44 +02:00
Boris Brezillon
24d990e237
mtd: nand: remove unneeded of_mtd.h inclusions
...
Some drivers are including linux/of_mtd.h even if they don't use any of
the of_get_nand_xxx() helpers.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com >
Acked-by: Harvey Hunt <harvey.hunt@imgtec.com >
2016-04-19 22:04:53 +02:00
Brian Norris
9146cbd52b
mtd: jz4780_nand: replace if/else blocks with switch/case
...
Using switch/case helps make this logic more clear and more robust. With
this structure:
* it's clear that this driver only support ECC_{HW,SOFT,SOFT_BCH}; and
* we can sanely handle new ECC unsupported modes (right now, this code
makes incorrect assumptions about the possible values in the
nand_ecc_modes_t enum; e.g., what happens with NAND_ECC_HW_OOB_FIRST?)
Signed-off-by: Brian Norris <computersforpeace@gmail.com >
Cc: Alex Smith <alex@alex-smith.me.uk >
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com >
Tested-by: Harvey Hunt <harvey.hunt@imgtec.com >
Acked-by: Harvey Hunt <harvey.hunt@imgtec.com >
2016-01-08 09:49:03 -08:00
Brian Norris
f118902490
mtd: jz4780_nand: remove useless mtd->priv = chip assignment
...
As of commit 2d3b77bac3
("mtd: nand: update mtd_to_nand()"), this
assignment isn't necessary, since struct mtd_info is embedded in struct
nand_chip.
Signed-off-by: Brian Norris <computersforpeace@gmail.com >
Cc: Harvey Hunt <harvey.hunt@imgtec.com >
Cc: Alex Smith <alex@alex-smith.me.uk >
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com >
2016-01-07 12:25:39 -08:00
Alex Smith
ae02ab00aa
mtd: nand: jz4780: driver for NAND devices on JZ4780 SoCs
...
Add a driver for NAND devices connected to the NEMC on JZ4780 SoCs, as
well as the hardware BCH controller. DMA is not currently implemented.
While older 47xx SoCs also have a BCH controller, they are incompatible
with the one in the 4780 due to differing register/bit positions, which
would make implementing a common driver for them quite messy.
Signed-off-by: Alex Smith <alex.smith@imgtec.com >
Cc: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com >
Cc: David Woodhouse <dwmw2@infradead.org >
Cc: linux-mtd@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Harvey Hunt <harvey.hunt@imgtec.com >
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com >
[Brian: fixed a few small mistakes]
Signed-off-by: Brian Norris <computersforpeace@gmail.com >
2016-01-07 09:35:11 -08:00