mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [RFC] S3C24xx: Fixing the NAND handling
@ 2011-03-07 13:24 Juergen Beisert
  2011-03-08  2:08 ` Zoltán Kócsi
  2011-03-12 19:37 ` Juergen Beisert
  0 siblings, 2 replies; 4+ messages in thread
From: Juergen Beisert @ 2011-03-07 13:24 UTC (permalink / raw)
  To: barebox

Hi,

anyone here with an idea how to fix this:

The NAND support for the S3C24xx CPU seems totally broken in the current 
kernel:

 - the driver's local OOB layout for small page NANDs overwrites the vendors
   bad block marker (a really bad idea!)
 - the ECC setup for large page NANDs violates NANDs partial write count (it
   forces 8 partial writes instead of allowed 4 per 2048 byte page)

How to adapt barebox according to the kernel? If we do OOB and ECC setup 
correctly in barebox, the mainline kernel cannot work with this data. If we 
do it in the same way than the kernel, we lose the bad block markers or do 
more writes than the manufacturer allows for reliable data security.

Changing the kernel is also hard to do, because it breaks existing software 
installations which should just run with more recent kernels.

jbe

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | Phone: +49-8766-939 228     |
Vertretung Sued/Muenchen, Germany             | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686              | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] S3C24xx: Fixing the NAND handling
  2011-03-07 13:24 [RFC] S3C24xx: Fixing the NAND handling Juergen Beisert
@ 2011-03-08  2:08 ` Zoltán Kócsi
  2011-03-08  2:44   ` Jean-Christophe PLAGNIOL-VILLARD
  2011-03-12 19:37 ` Juergen Beisert
  1 sibling, 1 reply; 4+ messages in thread
From: Zoltán Kócsi @ 2011-03-08  2:08 UTC (permalink / raw)
  To: barebox

On Mon, 7 Mar 2011 14:24:13 +0100
Juergen Beisert <jbe@pengutronix.de> wrote:


>  - the driver's local OOB layout for small page NANDs overwrites the
> vendors bad block marker (a really bad idea!)
>  - the ECC setup for large page NANDs violates NANDs partial write
> count (it forces 8 partial writes instead of allowed 4 per 2048 byte
> page)
> 
> How to adapt barebox according to the kernel? If we do OOB and ECC
> setup correctly in barebox, the mainline kernel cannot work with this
> data. If we do it in the same way than the kernel, we lose the bad
> block markers or do more writes than the manufacturer allows for
> reliable data security.
> 
> Changing the kernel is also hard to do, because it breaks existing
> software installations which should just run with more recent kernels.

I believe that kernel has to be fixed. If it is broken and violates the
chip manufacturer's speifications, then you can't (or shouldn't) use it
on the field anyway. In that case you have to accept that upgrading the
kernel will mean that you also have to rewrite whatever code you have
which depends on the *incorrect* treatment of the hardware. 

Prolonging the existence of mistreatment of hardware in the name of
backward compatibility is not a good thing, I believe.

Zoltan

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] S3C24xx: Fixing the NAND handling
  2011-03-08  2:08 ` Zoltán Kócsi
@ 2011-03-08  2:44   ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-03-08  2:44 UTC (permalink / raw)
  To: Zoltán Kócsi; +Cc: barebox

On 13:08 Tue 08 Mar     , Zoltán Kócsi wrote:
> On Mon, 7 Mar 2011 14:24:13 +0100
> Juergen Beisert <jbe@pengutronix.de> wrote:
> 
> 
> >  - the driver's local OOB layout for small page NANDs overwrites the
> > vendors bad block marker (a really bad idea!)
> >  - the ECC setup for large page NANDs violates NANDs partial write
> > count (it forces 8 partial writes instead of allowed 4 per 2048 byte
> > page)
> > 
> > How to adapt barebox according to the kernel? If we do OOB and ECC
> > setup correctly in barebox, the mainline kernel cannot work with this
> > data. If we do it in the same way than the kernel, we lose the bad
> > block markers or do more writes than the manufacturer allows for
> > reliable data security.
> > 
> > Changing the kernel is also hard to do, because it breaks existing
> > software installations which should just run with more recent kernels.
> 
> I believe that kernel has to be fixed. If it is broken and violates the
> chip manufacturer's speifications, then you can't (or shouldn't) use it
> on the field anyway. In that case you have to accept that upgrading the
> kernel will mean that you also have to rewrite whatever code you have
> which depends on the *incorrect* treatment of the hardware. 
> 
> Prolonging the existence of mistreatment of hardware in the name of
> backward compatibility is not a good thing, I believe.
I agree but you may have device on the market that use it and depond on it to
boot as you can not change the bootloader so you do need to detect it

or make the old way optionnal at least and use the correct one as default

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] S3C24xx: Fixing the NAND handling
  2011-03-07 13:24 [RFC] S3C24xx: Fixing the NAND handling Juergen Beisert
  2011-03-08  2:08 ` Zoltán Kócsi
@ 2011-03-12 19:37 ` Juergen Beisert
  1 sibling, 0 replies; 4+ messages in thread
From: Juergen Beisert @ 2011-03-12 19:37 UTC (permalink / raw)
  To: barebox

Hi,

sorry for the noise, but:

Juergen Beisert wrote:
> The NAND support for the S3C24xx CPU seems totally broken in the current
> kernel:

No, it isn't.

>  - the driver's local OOB layout for small page NANDs overwrites the
> vendors bad block marker (a really bad idea!)

It does not. I mixed it up with large page NANDs. :-(

>  - the ECC setup for large page NANDs violates NANDs partial write count
> (it forces 8 partial writes instead of allowed 4 per 2048 byte page)

It does not. The MTD framework writes the data in 8 pieces in this case. But 
from the NANDs point of view it is a single write only.

So, no need to fix anything in the kernel. Maybe only in my brain....

jbe

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-12 19:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-07 13:24 [RFC] S3C24xx: Fixing the NAND handling Juergen Beisert
2011-03-08  2:08 ` Zoltán Kócsi
2011-03-08  2:44   ` Jean-Christophe PLAGNIOL-VILLARD
2011-03-12 19:37 ` Juergen Beisert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox