Re: [PATCH v4 1/2] mtd: rawnand: Add Macronix Raw NAND controller

Miquel Raynal
2019-06-28T08:44:39Z

Hi Mason,

masonccyang@mxic.com.tw wrote on Fri, 28 Jun 2019 16:31:16 +0800:

> Hi Miquel,
>
> > >
> > > > > Add a driver for Macronix raw NAND controller.
> > > >
> > > > Could you pass userspace major MTD tests and can you
> attach/mount/edit
> > > > a UBI/UBIFS storage?
> > >
> > > mtd_debug passed and using dd utility to read and write
> > > with md5sum checking passed.
> >
> > Please don't use dd, use nanddump/nandwrite/flasherase/nandbiterrs and
> > run the other tests from the mtd-utils test suite (available in
> > Buildroot for instance).
> >
>
> Got it.
>
> But may I know why 'dd' utility is not preferences ?
> I generate a random data file and write to Flash by
> using dd with bs=page size and read data back from Flash.
> Checking data by md5sum.

Because dd works on block devices. MTD devices are way different. You
cannot write to OOB with dd. You cannot erase before write with dd. And
dd does not know about bad blocks. Please simply avoid using dd.

> The write and read testing data size is easily adjustable.

So are the MTD utils.

Thanks,
Miquèl