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

H. Nikolaus Schaller hns at goldelico.com
Sat Jul 21 13:56:24 CEST 2018


Hi Josua,
I have now applied your U-Boot patches and have not found any problems.

Then I tried to read the u-boot environment from Linux, but it fails:

root at letux:~# fw_printenv 
Warning: Bad CRC, using default environment
bootargs=
bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm
bootdelay=3
baudrate=115200
stdin=serial,cros-ec-keyb
stdout=serial,lcd
stderr=serial,lcd
root at letux:~# 

Config uses the mtd2 partition and defines the correct size.

root at letux:~# more /etc/fw_env.config
# Configuration file for fw_(printenv/setenv) utility.
# Up to two entries are valid, in this case the redundant
# environment sector is assumed present.
# MTD device name       Device offset   Env. size       Flash sector size
/dev/mtd2               0x0000          0x40000         0x40000
root at letux:~# 

And the kernel knows about the correct location:

[    2.506378] 5 ofpart partitions found on MTD device 4000000.onenand
[    2.512908] Creating 5 MTD partitions on "4000000.onenand":
[    2.518768] 0x000000000000-0x000000080000 : "X-Loader"
[    2.525787] 0x000000080000-0x000000240000 : "U-Boot"
[    2.532745] 0x000000240000-0x000000280000 : "U-Boot Env"
[    2.540161] 0x000000280000-0x000000880000 : "Kernel"
[    2.547332] 0x000000880000-0x000020000000 : "File System"

Note: this is all on GTA04A5 wth OneNAND. And kernel:

root at letux:~# uname -a
Linux letux 4.16.17-letux+ #2514 SMP PREEMPT Tue Jun 26 00:37:53 CEST 2018 armv7l GNU/Linux
root at letux:~# 

It looks as if reading NAND is completely broken - at least with letux-4.16.17.

root at letux:~# xxd /dev/mtd2 | head -8
0000000: ffff ffff ffff ffff ffff ffff ffff ffff  ................
0000010: ffff ffff ffff ffff ffff ffff ffff ffff  ................
0000020: ffff ffff ffff ffff ffff ffff ffff ffff  ................
0000030: ffff ffff ffff ffff ffff ffff ffff ffff  ................
0000040: ffff ffff ffff ffff ffff ffff ffff ffff  ................
0000050: ffff ffff ffff ffff ffff ffff ffff ffff  ................
0000060: ffff ffff ffff ffff ffff ffff ffff ffff  ................
0000070: ffff ffff ffff ffff ffff ffff ffff ffff  ................
root at letux:~# 

Next, I plan to do the same tests on GTA04A4 with NAND and other kernels.

BR,
Nikolaus



More information about the Letux-kernel mailing list