[linux-sunxi] Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Vinod Koul
On Tue, Mar 08, 2016 at 08:25:47AM +0530, Vinod Koul wrote: > On Mon, Mar 07, 2016 at 09:30:24PM +0100, Maxime Ripard wrote: > > On Mon, Mar 07, 2016 at 04:08:57PM +0100, Boris Brezillon wrote: Also just noticed the subsystem name on this is not correct, pls fix that in subsequent posting --

[linux-sunxi] Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Vinod Koul
On Mon, Mar 07, 2016 at 09:30:24PM +0100, Maxime Ripard wrote: > On Mon, Mar 07, 2016 at 04:08:57PM +0100, Boris Brezillon wrote: > > Hi Vinod, > > > > On Mon, 7 Mar 2016 20:24:29 +0530 > > Vinod Koul wrote: > > > > > On Mon, Mar 07, 2016 at 10:59:31AM +0100, Boris

Re: [linux-sunxi] Re: random decryption errors with sun4i-ss on dm-crypt

2016-03-07 Thread Timo S.
Hi, On Sun, Mar 6, 2016 at 1:32 PM, wrote: > 2016. február 17., szerda 18:16:09 UTC+1 időpontban txsa...@gmail.com a > következőt írta: >> Hi >> >> I have a Cubieboard2 device, is Allwinner A20 SOC, running and Armbian 5.00 >> with kernel 4.4.1. >> >> As in the latest

[linux-sunxi] Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Maxime Ripard
On Mon, Mar 07, 2016 at 04:08:57PM +0100, Boris Brezillon wrote: > Hi Vinod, > > On Mon, 7 Mar 2016 20:24:29 +0530 > Vinod Koul wrote: > > > On Mon, Mar 07, 2016 at 10:59:31AM +0100, Boris Brezillon wrote: > > > +/* Dedicated DMA parameter register layout */ > > > +#define

[linux-sunxi] Re: [PATCH v4 48/52] mtd: nand: vf610: switch to mtd_ooblayout_ops

2016-03-07 Thread Stefan Agner
On 2016-03-07 01:47, Boris Brezillon wrote: > Implementing the mtd_ooblayout_ops interface is the new way of exposing > ECC/OOB layout to MTD users. Hi Boris, Tested this revision, works out of the box now! Thanks! Tested-by: Stefan Agner Acked-by: Stefan Agner

Re: [linux-sunxi] [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Emilio López
Hi, El 07/03/16 a las 12:47, Boris Brezillon escribió: (...) >> Does SPI refer the Serial Peripheral Interface? >> >> If yes, then I would point out that current sun4i SPI driver doesn't >> actually use DMA [1] >> >> http://lists.infradead.org/pipermail/linux-arm-kernel/2016-February/411 >>

[linux-sunxi] Re: [PATCH v3 00/12] pwm: add support for atomic update

2016-03-07 Thread 'Doug Anderson' via linux-sunxi
Thierry, On Thu, Feb 25, 2016 at 3:14 PM, Doug Anderson wrote: > So just to summarize: > > * Add pwm_get_state(), pwm_apply_state(), pwm_get_args(). > pwm_get_state() initially returns 0 for duty cycle if driver doesn't > support readout. > > * Re-implement pwm_get_period()

[linux-sunxi] [PATCH 10/16] mtd: nand: sunxi: fix the NFC_ECC_ERR_CNT() macro

2016-03-07 Thread Boris Brezillon
NFC_ECC_ERR_CNT() is not taking into account the case when the NAND chip contains more than 4 ECC blocks (NANDs with 4kB+ pages). Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sunxi_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[linux-sunxi] [PATCH 15/16] mtd: nand: sunxi: make use of readl_poll_timeout()

2016-03-07 Thread Boris Brezillon
Replace open coded polling loops by readl_poll_timeout() calls. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sunxi_nand.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git

[linux-sunxi] [PATCH 14/16] mtd: nand: sunxi: fix ->dev_ready() implementation

2016-03-07 Thread Boris Brezillon
->dev_ready() is not supposed to wait for busy to ready solution (this is the role of ->waitfunc()). Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sunxi_nand.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/mtd/nand/sunxi_nand.c

[linux-sunxi] [PATCH 08/16] mtd: nand: sunxi: improve ->cmd_ctrl() function

2016-03-07 Thread Boris Brezillon
Try to pack address and command cycles into a single NAND controller command to avoid polling the status register for each single change on the NAND bus. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sunxi_nand.c | 52

[linux-sunxi] [PATCH 16/16] mtd: nand: sunxi: poll for events instead of using interrupts

2016-03-07 Thread Boris Brezillon
Some NAND operations are so fast that it doesn't make any sense to use interrupt based waits (the scheduling overhead is not worth it). Rename sunxi_nfc_wait_int() into sunxi_nfc_wait_events() and add a parameter to specify whether polling should be used or not. Note that all sunxi_nfc_wait_int()

[linux-sunxi] [PATCH 13/16] mtd: nand: enable ECC pipelining

2016-03-07 Thread Boris Brezillon
When the NAND controller operates in DMA mode it can pipeline ECC operations which improves the throughput. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sunxi_nand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[linux-sunxi] [PATCH 11/16] mtd: nand: sunxi: fix NFC_CTL setting

2016-03-07 Thread Boris Brezillon
NFC_PAGE_SHIFT() already takes the real page_shift value and subtract 10 to it. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sunxi_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/sunxi_nand.c

[linux-sunxi] [PATCH 09/16] mtd: nand: sunxi: let the NAND controller control the CE line

2016-03-07 Thread Boris Brezillon
We don't need to manually toggle the CE line since the controller handles it for us. Moreover, keeping the CE line low when interacting with a DDR NAND can be problematic (data loss in some corner cases). Signed-off-by: Boris Brezillon ---

[linux-sunxi] [PATCH 12/16] mtd: nand: sunxi: disable clks on device removal

2016-03-07 Thread Boris Brezillon
mod and ahb clocks are not disabled when the NAND controller device is removed. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sunxi_nand.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mtd/nand/sunxi_nand.c

[linux-sunxi] [PATCH 00/16] mtd: nand: sunxi: various improvements/fixes

2016-03-07 Thread Boris Brezillon
Hi, This patchset aims at fixing a few minor bugs, and improving performances of NAND accesses going through the sunxi NAND controller. Note that patch 5 exports functions provided by the core which are needed in patch 6 to still support raw OOB accesses. Other patches are just fixes or

[linux-sunxi] [PATCH 03/16] mtd: nand: sunxi: fix EDO mode selection

2016-03-07 Thread Boris Brezillon
The ONFI spec says that EDO should be enabled if the host drives tRC less than 30ns, but the code just tests for the tRC_min value extracted from the timings exposed by the NAND chip not the timings actually configured in the NAND controller. Fix that by first rounding down the requested clk_rate

[linux-sunxi] [PATCH 06/16] mtd: nand: sunxi: implement ->read_oob()/->write_oob()

2016-03-07 Thread Boris Brezillon
Allwinner's ECC engine is capable of protecting a few bytes of the OOB area. Implement specific OOB functions to benefit from this capability. Also, when in raw mode, the randomizer is disabled, which means you'll only be able to retrieve randomized data, which is not really useful for most

[linux-sunxi] [PATCH 07/16] mtd: nand: sunxi: implement ->read_subpage()

2016-03-07 Thread Boris Brezillon
Being able to read subpages can greatly improve read performances if the MTD user is only interested in a small section of a NAND page. This is particularly true with large pages (>= 8k). Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sunxi_nand.c | 36

[linux-sunxi] [PATCH 01/16] mtd: nand: sunxi: fix call order in sunxi_nand_chip_init()

2016-03-07 Thread Boris Brezillon
sunxi_nand_chip_set_timings() is extracting a pointer to the nfc from the nand->controller field, but this field is initialized after sunxi_nand_chip_set_timings() call. Reorder the calls to avoid any problem. Signed-off-by: Boris Brezillon ---

[linux-sunxi] [PATCH 04/16] mtd: nand: sunxi: adapt clk_rate to tWB, tADL, tWHR and tRHW timings

2016-03-07 Thread Boris Brezillon
Adapt the NAND controller clk rate to the tWB, tADL, tWHR and tRHW timings instead of returning an error when the maximum clk divisor is not big enough to provide an appropriate timing. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sunxi_nand.c | 12

[linux-sunxi] [PATCH 05/16] mtd: nand: export default read/write oob functions

2016-03-07 Thread Boris Brezillon
Export the default read/write oob functions (for the standard and syndrome scheme), so that drivers can use them for their raw implementation and implement their own functions for the normal oob operation. This is required if your ECC engine is capable of fixing some of the OOB data. In this case

[linux-sunxi] [PATCH 02/16] mtd: nand: sunxi: fix clk rate calculation

2016-03-07 Thread Boris Brezillon
Unlike what is specified in the Allwinner datasheets, the NAND clock rate is not equal to 2/T but 1/T. Fix the clock rate selection accordingly. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sunxi_nand.c | 8 +--- 1 file changed, 1 insertion(+), 7

Re: [linux-sunxi] [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Boris Brezillon
Hi Priit, On Mon, 07 Mar 2016 17:30:41 +0200 Priit Laes wrote: > On Mon, 2016-03-07 at 10:59 +0100, Boris Brezillon wrote: > > Some drivers might need to tweak the block size and wait cycles > > values > > to get better performances. > > Create and export the

[linux-sunxi] Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Boris Brezillon
Hi Vinod, On Mon, 7 Mar 2016 20:24:29 +0530 Vinod Koul wrote: > On Mon, Mar 07, 2016 at 10:59:31AM +0100, Boris Brezillon wrote: > > +/* Dedicated DMA parameter register layout */ > > +#define SUN4I_DDMA_PARA_DST_DATA_BLK_SIZE(n) (((n) - 1) << 24) > > +#define

[linux-sunxi] Re: [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Vinod Koul
On Mon, Mar 07, 2016 at 10:59:31AM +0100, Boris Brezillon wrote: > +/* Dedicated DMA parameter register layout */ > +#define SUN4I_DDMA_PARA_DST_DATA_BLK_SIZE(n) (((n) - 1) << 24) > +#define SUN4I_DDMA_PARA_DST_WAIT_CYCLES(n) (((n) - 1) << 16) > +#define SUN4I_DDMA_PARA_SRC_DATA_BLK_SIZE(n)

[linux-sunxi] [PATCH] dma: sun4i: expose block size and wait cycle configuration to DMA users

2016-03-07 Thread Boris Brezillon
Some drivers might need to tweak the block size and wait cycles values to get better performances. Create and export the sun4i_dma_set_chan_config() to do that. Signed-off-by: Boris Brezillon --- drivers/dma/sun4i-dma.c | 44

[linux-sunxi] [PATCH v4 52/52] mtd: kill the nand_ecclayout struct

2016-03-07 Thread Boris Brezillon
Now that all MTD drivers have moved to the mtd_ooblayout_ops model we can safely remove the struct nand_ecclayout definition, and all the remaining places where it was still used. Signed-off-by: Boris Brezillon --- drivers/mtd/mtdchar.c | 12 ++---

[linux-sunxi] [PATCH v4 47/52] mtd: nand: sunxi: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sunxi_nand.c | 114 +++--- 1 file changed, 52 insertions(+), 62

[linux-sunxi] [PATCH v4 49/52] mtd: onenand: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Modify the onenand drivers to switch to this approach. Signed-off-by: Boris Brezillon --- drivers/mtd/onenand/onenand_base.c | 162

[linux-sunxi] [PATCH v4 51/52] mtd: nand: kill the ecc->layout field

2016-03-07 Thread Boris Brezillon
Now that all NAND drivers have switch to mtd_ooblayout_ops, we can kill the ecc->layout field. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/nand_base.c | 7 --- drivers/mtd/nand/nand_bch.c | 9 - include/linux/mtd/nand.h | 2 -- 3

[linux-sunxi] [PATCH v4 50/52] staging: mt29f_spinand: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Replace the nand_ecclayout definition by the equivalent mtd_ooblayout_ops definition. Signed-off-by: Boris Brezillon --- drivers/staging/mt29f_spinand/mt29f_spinand.c | 48 +-- 1 file changed, 30 insertions(+), 18 deletions(-) diff

[linux-sunxi] [PATCH v4 46/52] mtd: nand: sm_common: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sm_common.c | 93 1 file changed, 77 insertions(+), 16

[linux-sunxi] [PATCH v4 39/52] mtd: nand: jz4780: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon Tested-by: Harvey Hunt --- drivers/mtd/nand/jz4780_nand.c | 19 +-- 1 file changed, 5

[linux-sunxi] [PATCH v4 43/52] mtd: nand: pxa3xx: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/pxa3xx_nand.c | 104 + 1 file changed, 64 insertions(+), 40

[linux-sunxi] [PATCH v4 41/52] mtd: nand: mxc: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/mxc_nand.c | 212 ++-- 1 file changed, 105 insertions(+), 107

[linux-sunxi] [PATCH v4 45/52] mtd: nand: sh_flctl: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sh_flctl.c | 87 ++--- 1 file changed, 67 insertions(+), 20

[linux-sunxi] [PATCH v4 44/52] mtd: nand: s3c2410: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/s3c2410.c | 32 +++- 1 file changed, 27 insertions(+), 5 deletions(-) diff

[linux-sunxi] [PATCH v4 36/52] mtd: nand: fsmc: get rid of the fsmc_nand_eccplace struct

2016-03-07 Thread Boris Brezillon
Now that mtd_ooblayout_ecc() returns the ECC byte position using the OOB free method, we can get rid of the fsmc_nand_eccplace struct. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/fsmc_nand.c | 60 +++-

[linux-sunxi] [PATCH v4 38/52] mtd: nand: hisi504: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/hisi504_nand.c | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff

[linux-sunxi] [PATCH v4 42/52] mtd: nand: omap2: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/omap2.c | 194 +++ 1 file changed, 113 insertions(+), 81

[linux-sunxi] [PATCH v4 37/52] mtd: nand: gpmi: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 52 ++ 1 file changed, 40 insertions(+), 12

[linux-sunxi] [PATCH v4 40/52] mtd: nand: lpc32xx: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/lpc32xx_mlc.c | 50 -- drivers/mtd/nand/lpc32xx_slc.c | 41

[linux-sunxi] [PATCH v4 35/52] mtd: nand: fsmc: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/fsmc_nand.c | 298 --- 1 file changed, 82 insertions(+), 216

[linux-sunxi] [PATCH v4 34/52] mtd: nand: fsl_ifc: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/fsl_ifc_nand.c | 230 1 file changed, 66 insertions(+), 164

[linux-sunxi] [PATCH v4 32/52] mtd: nand: docg4: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/docg4.c | 33 - 1 file changed, 28 insertions(+), 5 deletions(-) diff

[linux-sunxi] [PATCH v4 31/52] mtd: nand: diskonchip: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/diskonchip.c | 60 --- 1 file changed, 45 insertions(+), 15

[linux-sunxi] [PATCH v4 27/52] mtd: nand: brcm: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/brcmnand/brcmnand.c | 258 +-- 1 file changed, 157 insertions(+), 101

[linux-sunxi] [PATCH v4 28/52] mtd: nand: cafe: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/cafe_nand.c | 44 1 file changed, 32 insertions(+), 12

[linux-sunxi] [PATCH v4 26/52] mtd: nand: bf5xx: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/bf5xx_nand.c | 51 --- 1 file changed, 28 insertions(+), 23

[linux-sunxi] [PATCH v4 29/52] mtd: nand: davinci: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/davinci_nand.c | 118 +++- 1 file changed, 44 insertions(+), 74

[linux-sunxi] [PATCH v4 30/52] mtd: nand: denali: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/denali.c | 50 +-- 1 file changed, 35 insertions(+), 15

[linux-sunxi] [PATCH v4 12/52] mtd: nand: omap2: use mtd_ooblayout_xxx() helpers where appropriate

2016-03-07 Thread Boris Brezillon
The mtd_ooblayout_xxx() helper functions have been added to avoid direct accesses to the ecclayout field, and thus ease for future reworks. Use these helpers in all places where the oobfree[] and eccpos[] arrays where directly accessed. Signed-off-by: Boris Brezillon

[linux-sunxi] [PATCH v4 19/52] mtd: create an mtd_ooblayout_ops struct to ease ECC layout definition

2016-03-07 Thread Boris Brezillon
ECC layout definitions are currently exposed using the nand_ecclayout struct which embeds oobfree and eccpos arrays with predefined size. This approach was acceptable when NAND chips were providing relatively small OOB regions, but MLC and TLC now provide OOB regions of several hundreds of bytes,

[linux-sunxi] [PATCH v4 20/52] mtd: docg3: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Replace the nand_ecclayout definition by the equivalent mtd_ooblayout_ops definition. Signed-off-by: Boris Brezillon Acked-by: Robert Jarzmik --- drivers/mtd/devices/docg3.c | 46 ++--- 1 file

[linux-sunxi] [PATCH v4 21/52] mtd: nand: implement the default mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Replace the default nand_ecclayout definitions for large and small page devices with the equivalent mtd_ooblayout_ops. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/nand_base.c | 148 --- include/linux/mtd/nand.h

[linux-sunxi] [PATCH v4 23/52] mtd: nand: sharpsl: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- arch/arm/mach-pxa/spitz.c | 55 - drivers/mtd/nand/sharpsl.c | 2 +-

[linux-sunxi] [PATCH v4 15/52] mtd: use mtd_set_ecclayout() where appropriate

2016-03-07 Thread Boris Brezillon
Use the mtd_set_ecclayout() helper instead of directly assigning the mtd->ecclayout field. Signed-off-by: Boris Brezillon --- drivers/mtd/mtdconcat.c | 2 +- drivers/mtd/mtdpart.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

[linux-sunxi] [PATCH v4 13/52] mtd: onenand: use mtd_ooblayout_xxx() helpers where appropriate

2016-03-07 Thread Boris Brezillon
The mtd_ooblayout_xxx() helper functions have been added to avoid direct accesses to the ecclayout field, and thus ease for future reworks. Use these helpers in all places where the oobfree[] and eccpos[] arrays where directly accessed. Signed-off-by: Boris Brezillon

[linux-sunxi] [PATCH v4 25/52] mtd: nand: atmel: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/atmel_nand.c | 84 --- 1 file changed, 38 insertions(+), 46

[linux-sunxi] [PATCH v4 24/52] mtd: nand: jz4740: switch to mtd_ooblayout_ops

2016-03-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- arch/mips/include/asm/mach-jz4740/jz4740_nand.h | 2 +- arch/mips/jz4740/board-qi_lb60.c| 87

[linux-sunxi] [PATCH v4 16/52] mtd: nand: use mtd_set_ecclayout() where appropriate

2016-03-07 Thread Boris Brezillon
Use the mtd_set_ecclayout() helper instead of directly assigning the mtd->ecclayout field. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/nand_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/nand_base.c

[linux-sunxi] [PATCH v4 17/52] mtd: onenand: use mtd_set_ecclayout() where appropriate

2016-03-07 Thread Boris Brezillon
Use the mtd_set_ecclayout() helper instead of directly assigning the mtd->ecclayout field. Signed-off-by: Boris Brezillon --- drivers/mtd/onenand/onenand_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[linux-sunxi] [PATCH v4 10/52] mtd: nand: gpmi: use mtd_ooblayout_xxx() helpers where appropriate

2016-03-07 Thread Boris Brezillon
The mtd_ooblayout_xxx() helper functions have been added to avoid direct accesses to the ecclayout field, and thus ease for future reworks. Use these helpers in all places where the oobfree[] and eccpos[] arrays where directly accessed. Signed-off-by: Boris Brezillon

[linux-sunxi] [PATCH v4 14/52] mtd: add mtd_set_ecclayout() helper function

2016-03-07 Thread Boris Brezillon
Add an mtd_set_ecclayout() helper function to avoid direct accesses to the mtd->ecclayout field. This will ease future reworks of ECC layout definition. Signed-off-by: Boris Brezillon --- include/linux/mtd/mtd.h | 6 ++ 1 file changed, 6 insertions(+)

[linux-sunxi] [PATCH v4 11/52] mtd: nand: lpc32xx: use mtd_ooblayout_xxx() helpers where appropriate

2016-03-07 Thread Boris Brezillon
The mtd_ooblayout_xxx() helper functions have been added to avoid direct accesses to the ecclayout field, and thus ease for future reworks. Use these helpers in all places where the oobfree[] and eccpos[] arrays where directly accessed. Signed-off-by: Boris Brezillon

[linux-sunxi] [PATCH v4 18/52] mtd: docg3: use mtd_set_ecclayout() where appropriate

2016-03-07 Thread Boris Brezillon
Use the mtd_set_ecclayout() helper instead of directly assigning the mtd->ecclayout field. Signed-off-by: Boris Brezillon Acked-by: Robert Jarzmik --- drivers/mtd/devices/docg3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[linux-sunxi] [PATCH v4 07/52] mtd: nand: core: use mtd_ooblayout_xxx() helpers where appropriate

2016-03-07 Thread Boris Brezillon
The mtd_ooblayout_xxx() helper functions have been added to avoid direct accesses to the ecclayout field, and thus ease for future reworks. Use these helpers in all places where the oobfree[] and eccpos[] arrays where directly accessed. Signed-off-by: Boris Brezillon

[linux-sunxi] [PATCH v4 09/52] mtd: nand: fsl_ifc: use mtd_ooblayout_xxx() helpers where appropriate

2016-03-07 Thread Boris Brezillon
The mtd_ooblayout_xxx() helper functions have been added to avoid direct accesses to the ecclayout field, and thus ease for future reworks. Use these helpers in all places where the oobfree[] and eccpos[] arrays where directly accessed. Signed-off-by: Boris Brezillon

[linux-sunxi] [PATCH v4 02/52] mtd: create an mtd_oobavail() helper and make use of it

2016-03-07 Thread Boris Brezillon
Currently, all MTD drivers/sublayers exposing an OOB area are doing the same kind of test to extract the available OOB size based on the mtd_info and mtd_oob_ops structures. Move this common logic into an inline function and make use of it. Signed-off-by: Boris Brezillon

[linux-sunxi] [PATCH v4 06/52] mtd: use mtd_ooblayout_xxx() helpers where appropriate

2016-03-07 Thread Boris Brezillon
The mtd_ooblayout_xxx() helper functions have been added to avoid direct accesses to the ecclayout field, and thus ease for future reworks. Use these helpers in all places where the oobfree[] and eccpos[] arrays where directly accessed. Signed-off-by: Boris Brezillon

[linux-sunxi] [PATCH v4 00/52] mtd: rework ECC layout definition

2016-03-07 Thread Boris Brezillon
Hello, This patchset aims at getting rid of the nand_ecclayout limitations. struct nand_ecclayout is defining fixed eccpos and oobfree arrays which can only be increased by modifying the MTD_MAX_ECCPOS_ENTRIES_LARGE and MTD_MAX_OOBFREE_ENTRIES_LARGE macros. This approach forces us to modify the

[linux-sunxi] [PATCH v4 01/52] mtd: kill the ecclayout->oobavail field

2016-03-07 Thread Boris Brezillon
ecclayout->oobavail is just redundant with the mtd->oobavail field. Moreover, it prevents static const definition of ecc layouts since the NAND framework is calculating this value based on the ecclayout->oobfree field. Signed-off-by: Boris Brezillon ---

[linux-sunxi] [PATCH v4 05/52] mtd: add mtd_ooblayout_xxx() helper functions

2016-03-07 Thread Boris Brezillon
In order to make the ecclayout definition completely dynamic we need to rework the way the OOB layout are defined and iterated. Create a few mtd_ooblayout_xxx() helpers to ease OOB bytes manipulation and hide ecclayout internals to their users. Signed-off-by: Boris Brezillon

[linux-sunxi] [PATCH v4 04/52] mtd: nand: simplify nand_bch_init() usage

2016-03-07 Thread Boris Brezillon
nand_bch_init() requires several arguments which could directly be deduced from the mtd device. Get rid of those useless parameters. nand_bch_init() is also requiring the caller to provide a proper eccbytes value, while this value could be deduced from the ecc.size and ecc.strength value.

[linux-sunxi] [PATCH v4 03/52] mtd: mtdswap: remove useless if (!mtd->ecclayout) test

2016-03-07 Thread Boris Brezillon
If the MTD device does not have OOB, the mtd->oobsize and mtd->oobavail fields are set to zero, and we are testing those values in the following test. Remove the useless if (!mtd->ecclayout) test. Signed-off-by: Boris Brezillon --- drivers/mtd/mtdswap.c | 8