[Letux-kernel] gta04 - reading nand from u-boot

Andreas Kemnade andreas at kemnade.info
Mon Jul 23 20:05:12 CEST 2018


On Mon, 23 Jul 2018 18:09:03 +0200
"H. Nikolaus Schaller" <hns at goldelico.com> wrote:

> Hi Josua,
> 
> > Am 23.07.2018 um 17:20 schrieb Josua Mayer <josua.mayer at jm0.eu>:
> > 
> > Hi Nikolaus,
> > 
> > see inline ...
> > 
> > Am 21.07.2018 um 15:23 schrieb H. Nikolaus Schaller:  
> >> Hi Josua,
> >>   
> >>> Am 21.07.2018 um 14:18 schrieb Josua Mayer <josua.mayer at jm0.eu>:
> >>> 
> >>> Hi Nikolaus,
> >>> 
> >>> Am 21.07.2018 um 13:56 schrieb H. Nikolaus Schaller:  
> >>>> Hi Josua,
> >>>> I have now applied your U-Boot patches and have not found any problems.  
> >>> great!  
> >>>> Then I tried to read the u-boot environment from Linux, but it fails:
> >>>> 
> >>>> root at letux:~# fw_printenv   
> >>> If u-boot uses 1-bit ham1 ecc scheme to save environment, and if linux
> >>> uses a different, namely bch8,
> >>> this won't work will it?
> >>> So I checked what the letux-4.17.3 dts does:
> >>> &gpmc {
> >>>    nand at 0,0 {
> >>>        ti,nand-ecc-opt = "bch8";
> >>>    };
> >>> };
> >>> and then near the bottom:
> >>> &gpmc {
> >>>    nand at 0,0 {
> >>>        ti,nand-ecc-opt = "ham1"; /* stay compatible with our old u-boot
> >>> (does not support bch8) */
> >>>    };
> >>> };
> >>> 
> >>> So it should work. I don't think we want to upstream setting this to
> >>> ham1 though.  
> >> The omap3-beagle.dts also has it as default which is IMHO enough argument...  
> > Yes. And it was quietly changed in u-boot to bch8!
> > http://git.denx.de/?p=u-boot.git;a=commitdiff;h=4b37928d3577e1b540b12d709e9b551fee3ccbd6;hp=3ff0d8018105614a466b10265e6dff99de958135
> > +#define CONFIG_NAND_OMAP_ECCSCHEME      OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
> > Which means do bch8 calculations in hardware and correction in software.  
> 
> Interesting. So if someone uses upstream u-boot with upstream kernel they
> are not compatible...
> 
> Maybe u-boot patches are not well reviewed and for kernel changes
> this all might have been split up into ca. 5 separate patches...
> 
hmm, the only resolution I see then is that the kernel should touch
nand as little as possible. So no automatic ubifs attaches or stuff if
not booting from nand. Since you might switch to older kernels with
different settings.

Regards,
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20180723/2e94bad0/attachment-0001.asc>


More information about the Letux-kernel mailing list