lkml.org 
[lkml]   [2019]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 8/9] mtd: rawnand: ingenic: Add support for the JZ4725B
Hi Miquel,

Le lun. 4 mars 2019 à 16:09, Miquel Raynal <miquel.raynal@bootlin.com>
a écrit :
> Hi Paul,
>
> Paul Cercueil <paul@crapouillou.net> wrote on Mon, 04 Mar 2019
> 19:30:04
> +0100:
>
>> On Mon, Mar 4, 2019 at 11:35 AM, Miquel Raynal
>> <miquel.raynal@bootlin.com> wrote:
>> > Hi Paul,
>> >
>> > Paul Cercueil <paul@crapouillou.net
>> <mailto:paul@crapouillou.net>> > wrote on Sat, 9 Feb 2019 16:23:04
>> > -0300:
>> >
>> >> The boot ROM of the JZ4725B SoC expects a specific OOB layout
>> on the
>> >> NAND, so we use it unconditionally in the ingenic-nand driver.
>> >> >> Also add the jz4725b-bch driver to support the
>> JZ4725B-specific BCH
>> >> hardware.
>> >> >> Signed-off-by: Paul Cercueil <paul@crapouillou.net >>
>> <mailto:paul@crapouillou.net>>
>> >> ---
>> >> >> Changes:
>> >> >> v2: Instead of forcing the OOB layout, leave it to the board
>> code or
>> >> devicetree to decide if the jz4725b-specific layout should
>> be >> used
>> >> or not.
>> >> >> v3: - Revert the change in v2, as the previous behaviour was
>> >> correct.
>> >> - Also add support for the hardware BCH of the JZ4725B in
>> this
>> >> patch.
>> >> >> v4: - Add MODULE_* macros
>> >> - Add tweaks suggested by upstream feedback
>> >> >> drivers/mtd/nand/raw/ingenic/Kconfig | 10 +
>> >> drivers/mtd/nand/raw/ingenic/Makefile | 1 +
>> >> drivers/mtd/nand/raw/ingenic/ingenic_nand.c | 48 ++++-
>> >> drivers/mtd/nand/raw/ingenic/jz4725b_bch.c | 292 >>
>> ++++++++++++++++++++++++++++
>> >> 4 files changed, 350 insertions(+), 1 deletion(-)
>> >> create mode 100644 drivers/mtd/nand/raw/ingenic/jz4725b_bch.c
>> >> >
>> > [...]
>> >
>> >> +static int jz4725b_calculate(struct ingenic_ecc *bch,
>> >> + struct ingenic_ecc_params *params,
>> >> + const u8 *buf, u8 *ecc_code)
>> >> +{
>> >> + int ret;
>> >> +
>> >> + mutex_lock(&bch->lock);
>> >> + ret = jz4725b_bch_init(bch, params, true);
>> >
>> > I really don't like this bch_init name. A BCH initialization is
>> what > is
>> > supposed to be done only once (probably at boot time), can you
>> find a
>> > better name or a better organization of the correct/calculate
>> path?
>>
>> jz4725b_bch_setup() maybe?
>
> Unless I am not understanding what this does, I don't get why you
> would
> need to do this setup everytime you want to use the ECC engine. Are
> you
> sure this is needed?

It configures the hardware for a new ECC encoding or decoding sequence,
so
yes, it has to be done everytime.

-Paul

\
 
 \ /
  Last update: 2019-03-13 13:47    [W:0.056 / U:1.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site