Incorrect struct onfi_params definition

Kristof Provost kristof at sigsegv.be
Thu Nov 7 08:33:12 UTC 2013


On 2013-11-06 16:59:13 (-0700), Ian Lepore <ian at FreeBSD.org> wrote:
> On Wed, 2013-11-06 at 22:28 +0100, Kristof Provost wrote:
> > The definition of struct onfi_params in sys/dev/nand/nand.h is
> > incorrect. The total structure size should be 256 bytes, but it's only
> > 176 bytes.
> > 
> There's more wrong with the onfi support than just that.  The biggie is
> that it doesn't handle packed/unaligned accesses and the endianess of
> the data in the struct.  I've got patches from like a year ago that I've
> been meaning to dust off and check in.  They address more than just the
> onfi, and they contain a mix of unrelated stuff and style changes, so
> there's some work involved in making them committable.
> 
> I'll attach them here so you can at least get an idea what I'm talking
> about and see if there's anything useful for you in them.
> 
Thanks.

I see these patches also fix the original problem I was chasing. I have
an OpenRD board with a flash chip which claims to be ONFI but isn't. It
replies 'ONFI' when I read the ID, but gives me empty parameters. The
CRC check should at least detect that.

I won't be able to test the ONFI case, but I'll try to pick the patches
apart and submit them.

Regards,
Kristof


More information about the freebsd-embedded mailing list