Quantcast
Channel: Linux Device Hacking
Viewing all articles
Browse latest Browse all 3247

Changes in SD Card access in U-Boot 2017.07-tld-1? (no replies)

$
0
0
After a few days of learning from failure, I think the only remaining issue is boiled down to uBoot.

Background: Pogoplug V4 was running 2014.07-tld-1 upgraded to 2017.07-tld-1,l SD Card boot

When I was on 2014.07-tld-1, I never have any problems booting up from my Kingston 8GB SD

sudo udevadm info -a -n /dev/root
...
    SUBSYSTEMS=="mmc"
    DRIVERS=="mmcblk"
    ATTRS{manfid}=="0x000041"
...
    ATTRS{type}=="SD"
    ATTRS{date}=="09/2008"
    ATTRS{hwrev}=="0x2"
(SD info for reference)

However, after I upgraded to 2017.07-tld-1, I often encounter problem booting. From netconsole (another great thanks to whoever created this!), seems like it has an issue reading either uImage or uInitrd properly hence it failed to boot. Sometimes issue 'mmc rescan' or 'ext2load' is require. But more likely a few 'boot' after seems to do the job. After it is booted, I don't notice I/O errors.

U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:34:01 -0700)
Pogoplug V4
gcc (Debian 6.3.0-18) 6.3.0 20170516
GNU ld (GNU Binutils for Debian) 2.28
Hit any key to stop autoboot:  0 
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Reset IDE: ide_preinit failed

MMC rescan: current device # 0 initialized OK
## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0
loading envs from usb 0 ...
** Bad device usb 0 **

no IDE devices available

Partition Map for MMC device 0  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
  1	63        	16015297  	00000000-01	83
loading envs from mmc 0 ...
** File not found /boot/uEnv.txt **
running scan_disk ...
Scan device usb
device usb 0:1
** Bad device usb 0 **
device usb 1:1
** Bad device usb 1 **
device usb 2:1
** Bad device usb 2 **
device usb 3:1
** Bad device usb 3 **
Scan device ide

Reset IDE: ide_preinit failed
device ide 0:1
** Bad device ide 0 **
device ide 1:1
** Bad device ide 1 **
device ide 2:1
** Bad device ide 2 **
device ide 3:1
** Bad device ide 3 **
Scan device mmc

MMC rescan: current device # 0 initialized OK
device mmc 0:1
1 bytes read in 22 ms (0 Bytes/s)
Found bootable drive on mmc 0
loading uImage ...
4115496 bytes read in 102 ms (38.5 MiB/s)
loading uInitrd ...
6284094 bytes read in 201 ms (29.8 MiB/s)
loading DTB /boot/dts/kirkwood-pogoplug_v4.dtb ...
9962 bytes read in 39 ms (249 KiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-4.17.2-kirkwood-tld-1
   Created:      2018-08-04  20:46:21 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4115432 Bytes = 3.9 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... Bad Data CRC
ERROR: can't get kernel image!
Pogov4> boot
boot

Reset IDE: ide_preinit failed

MMC rescan: current device # 0 initialized OK
## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0
loading envs from usb 0 ...
** Bad device usb 0 **

no IDE devices available

Partition Map for MMC device 0  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
  1	63        	16015297  	00000000-01	83
loading envs from mmc 0 ...
** File not found /boot/uEnv.txt **
running scan_disk ...
Scan device usb
device usb 0:1
** Bad device usb 0 **
device usb 1:1
** Bad device usb 1 **
device usb 2:1
** Bad device usb 2 **
device usb 3:1
** Bad device usb 3 **
Scan device ide

Reset IDE: ide_preinit failed
device ide 0:1
** Bad device ide 0 **
device ide 1:1
** Bad device ide 1 **
device ide 2:1
** Bad device ide 2 **
device ide 3:1
** Bad device ide 3 **
Scan device mmc

MMC rescan: current device # 0 initialized OK
device mmc 0:1
1 bytes read in 22 ms (0 Bytes/s)
Found bootable drive on mmc 0
loading uImage ...
4115496 bytes read in 112 ms (35 MiB/s)
loading uInitrd ...
6284094 bytes read in 201 ms (29.8 MiB/s)
loading DTB /boot/dts/kirkwood-pogoplug_v4.dtb ...
9962 bytes read in 40 ms (243.2 KiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-4.17.2-kirkwood-tld-1
   Created:      2018-08-04  20:46:21 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4115432 Bytes = 3.9 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... Bad Data CRC
ERROR: can't get kernel image!
Pogov4> boot
boot

Reset IDE: ide_preinit failed

MMC rescan: current device # 0 initialized OK
## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0
loading envs from usb 0 ...
** Bad device usb 0 **

no IDE devices available

Partition Map for MMC device 0  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
  1	63        	16015297  	00000000-01	83
loading envs from mmc 0 ...
** File not found /boot/uEnv.txt **
running scan_disk ...
Scan device usb
device usb 0:1
** Bad device usb 0 **
device usb 1:1
** Bad device usb 1 **
device usb 2:1
** Bad device usb 2 **
device usb 3:1
** Bad device usb 3 **
Scan device ide

Reset IDE: ide_preinit failed
device ide 0:1
** Bad device ide 0 **
device ide 1:1
** Bad device ide 1 **
device ide 2:1
** Bad device ide 2 **
device ide 3:1
** Bad device ide 3 **
Scan device mmc

MMC rescan: current device # 0 initialized OK
device mmc 0:1
1 bytes read in 23 ms (0 Bytes/s)
Found bootable drive on mmc 0
loading uImage ...
4115496 bytes read in 141 ms (27.8 MiB/s)
loading uInitrd ...
6284094 bytes read in 200 ms (30 MiB/s)
loading DTB /boot/dts/kirkwood-pogoplug_v4.dtb ...
9962 bytes read in 40 ms (243.2 KiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-4.17.2-kirkwood-tld-1
   Created:      2018-08-04  20:46:21 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4115432 Bytes = 3.9 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-4.17.2-kirkwood-tld-1
   Created:      2018-08-04  20:46:33 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    6284030 Bytes = 6 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01c00000
   Booting using the fdt blob at 0x1c00000


Starting kernel ...

In the example above, the third boot seems to be successful (no power recycle). So I suspect the timing maybe it is a bit off when reading from SD card with the new uBoot. (again, I didn't have this issue when I was on 2014.07-tld-1)

I also notice a few "## Unknown partition table type 0" after first "MMC rescan: current device # 0 initialized OK" then the second time "MMC rescan: current device # 0 initialized OK" seems to be able to access the SD card. Is that normal?

Is there anyway to 'slow down' MMC access in uBoot? or a quick band aid fix for it 'retry' (instead of manually type in 'boot') when it fails?

Or is it safe to go back to the old uBoot? I understand there were some new 'features' (dts?) were used in the new uBoot/kernel. If so, how to 'downgrade'? (I expect need to rewrite the envs too?)

Thanks

Viewing all articles
Browse latest Browse all 3247

Trending Articles