[U-Boot-Users] fatload'ing kernel image from CF

Are there any partitioning requirements associated with loading files using the fatload command? I have found that if I try to load a file from the 2nd partition and the 1st partition exceeds a certain size, the fatload command fails.
For instance, with part1=8MB and part2=4MB, I see the following error when loading an image from the 2nd partition:
=> fatload ace 0:2 140000 uimage reading uimage Invalid FAT entry
26624 bytes read
However, with part1=4MB and part2=4MB, the same file loads fine from the 2nd partition. If I put the file in the first partition it always loads fine.
Both partitions were formatted using mkfs.msdos.
From linux, I can read and write all partitions to my hearts content
which indicates that the hardware itself is ok.

Dear Jeff,
in message 1113402442.11108.14.camel@nighteyes.localdomain you wrote:
Are there any partitioning requirements associated with loading files using the fatload command? I have found that if I try to load a file from the 2nd partition and the 1st partition exceeds a certain size, the fatload command fails.
Must be a problem on your platform, then.
For instance, with part1=8MB and part2=4MB, I see the following error when loading an image from the 2nd partition:
=> fatload ace 0:2 140000 uimage reading uimage Invalid FAT entry
26624 bytes read
However, with part1=4MB and part2=4MB, the same file loads fine from the 2nd partition. If I put the file in the first partition it always loads fine.
Both partitions were formatted using mkfs.msdos.
Did the same here, and it works without problems:
in Linux:
... Command (m for help): p
Disk /dev/hda: 256 MB, 256376832 bytes 16 heads, 32 sectors/track, 978 cylinders Units = cylinders of 512 * 512 = 262144 bytes
Device Boot Start End Blocks Id System /dev/hda1 1 32 8176 6 FAT16 /dev/hda2 33 48 4096 6 FAT16 /dev/hda3 49 978 238080 6 FAT16 ... bash-2.05b# mkfs.msdos /dev/hda1 mkfs.msdos 2.8 (28 Feb 2001) bash-2.05b# mkfs.msdos /dev/hda2 mkfs.msdos 2.8 (28 Feb 2001) bash-2.05b# mkfs.msdos /dev/hda3 mkfs.msdos 2.8 (28 Feb 2001) bash-2.05b# mount /dev/hda1 /mnt && cp -v /tmp/linux.img /mnt && umount /dev/hda1 `/tmp/linux.img' -> `/mnt/linux.img' bash-2.05b# mount /dev/hda2 /mnt && cp -v /tmp/linux.img /mnt && umount /dev/hda2 `/tmp/linux.img' -> `/mnt/linux.img' bash-2.05b# mount /dev/hda3 /mnt && cp -v /tmp/linux.img /mnt && umount /dev/hda3 `/tmp/linux.img' -> `/mnt/linux.img'
in U-Boot:
=> ide part
Partition Map for IDE device 0 -- Partition Type: DOS
Partition Start Sector Num Sectors Type 1 32 16352 6 2 16384 8192 6 3 24576 476160 6 => fatls ide 0:1 / 990407 linux.img
1 file(s), 0 dir(s)
=> fatload ide 0:1 200000 linux.img ; imi 200000 reading linux.img
990407 bytes read
## Checking Image at 00200000 ... Image Name: Linux + initrd fuer UC-100 Created: 2005-04-13 15:27:32 UTC Image Type: PowerPC Linux Multi-File Image (gzip compressed) Data Size: 990343 Bytes = 967.1 kB Load Address: 00000000 Entry Point: 00000000 Contents: Image 0: 751915 Bytes = 734.3 kB Image 1: 238415 Bytes = 232.8 kB Verifying Checksum ... OK => fatls ide 0:2 / 990407 linux.img
1 file(s), 0 dir(s)
=> fatload ide 0:2 200000 linux.img ; imi 200000 reading linux.img
990407 bytes read
## Checking Image at 00200000 ... Image Name: Linux + initrd fuer UC-100 Created: 2005-04-13 15:27:32 UTC Image Type: PowerPC Linux Multi-File Image (gzip compressed) Data Size: 990343 Bytes = 967.1 kB Load Address: 00000000 Entry Point: 00000000 Contents: Image 0: 751915 Bytes = 734.3 kB Image 1: 238415 Bytes = 232.8 kB Verifying Checksum ... OK => fatls ide 0:3 / 990407 linux.img
1 file(s), 0 dir(s)
=> fatload ide 0:3 200000 linux.img ; imi 200000 reading linux.img
990407 bytes read
## Checking Image at 00200000 ... Image Name: Linux + initrd fuer UC-100 Created: 2005-04-13 15:27:32 UTC Image Type: PowerPC Linux Multi-File Image (gzip compressed) Data Size: 990343 Bytes = 967.1 kB Load Address: 00000000 Entry Point: 00000000 Contents: Image 0: 751915 Bytes = 734.3 kB Image 1: 238415 Bytes = 232.8 kB Verifying Checksum ... OK
On which board / processor is this?
Best regards,
Wolfgang Denk

On Wed, 2005-04-13 at 21:58 +0200, Wolfgang Denk wrote:
Dear Jeff,
in message 1113402442.11108.14.camel@nighteyes.localdomain you wrote:
Are there any partitioning requirements associated with loading files using the fatload command? I have found that if I try to load a file from the 2nd partition and the 1st partition exceeds a certain size, the fatload command fails.
Must be a problem on your platform, then.
Since all of your tests ran fine I would have to agree with you. BTW, thank you for confirming that the fatload command works on your hardware.
On which board / processor is this?
Custom MPC8260 with a Xilinx SystemACE serving up the CF card.

On Wed, 2005-04-13 at 10:27 -0400, Jeff Angielski wrote:
Are there any partitioning requirements associated with loading files using the fatload command? I have found that if I try to load a file from the 2nd partition and the 1st partition exceeds a certain size, the fatload command fails.
U-boot is working correctly.
The problem is due to the fact that the FAT was incorrectly detected when the partition was mounted by the kernel. Even though the partition was formatted as FAT16, when it was mounted, the kernel thought it was FAT12 and updated the FAT accordingly. When u-boot came by later and tried to derefence the clusters from what it [correctly] thought was FAT16, it failed because the cluster numbers were all FAT12.
And depending on the size and location of the 2nd partition dictated whether the kernel/mount autodetection was correct.
The quick solution is to force the kenel to mount the partition as:
# mount -t msdos -o fat=16 /dev/xsysace/disc0/part2 /mnt/xsa
Jeff
participants (2)
-
Jeff Angielski
-
Wolfgang Denk