[U-Boot] Problems with ext2ls & SD

Hi
I am working on a port of 1.3.4 to the LPC313x and I am having some trouble with the ext2fs. U-Boot reads blocks 0x00, 0x02, 0x08, 0x200. I modified the code to dump the block data as it is read & verified that the data is correct.
The ext2ls command returns nothing, I guess thats because block 0x200 is full of zeros bt that Linux box is quite happy to read the SD card. Can anyone help?
LPC3131EA # mmcinit Card Detection Results: CID: 2475 10000001 53442020 1a505175 CSD: 964000bb 6db7ff9f 5f5983c4 2f0032 card_type: 1 rca: b368 speed: 25000000 block_len: 200 device_size: 3c480000 blocknr: 1e2400 LPC3131EA # ext2ls mmc 0:0 get_dev: mmc Using device mmc 0:0, directory: / ext2fs_set_blk_dev 0 <s:2, o:0, l:204> mci_read_blocks 2 Read 200 bytes 80 F1 00 00 80 C4 03 00 39 30 00 00 1C B4 03 00 75 F1 00 00 00 00 00 00 02 00 00 00 02 00 00 00 00 80 00 00 00 80 00 00 30 1E 00 00 DF AD C3 49 7A C2 C3 49 04 00 25 00 53 EF 00 00 01 00 00 00 6F AD C3 49 00 4E ED 00 00 00 00 00 01 00 00 00 00 00 00 00 0B 00 00 00 00 01 00 00 38 00 00 00 02 00 00 00 03 00 00 00 22 19 EA 74 80 82 4D 8F 82 A0 37 89 42 C3 79 92 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 4E 34 17 16 16 48 46 A2 FD F2 9D D1 86 47 FB 01 00 00 00 00 00 00 00 00 00 00 00 6F AD C3 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1C 00 1C 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ext2fs read inode 1 ext2fs read blockgroup <s:8, o:0, l:32> mci_read_blocks 8 Read 200 bytes 3E 00 00 00 3F 00 00 00 40 00 00 00 D7 7D 25 1E 02 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 3E 80 00 00 3F 80 00 00 40 80 00 00 DD 7D 30 1E 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 01 00 02 00 01 00 1B 7E 30 1E 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 3E 80 01 00 3F 80 01 00 40 80 01 00 DD 7D 30 1E 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 01 00 02 00 02 00 02 00 1B 7E 30 1E 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 3E 80 02 00 3F 80 02 00 40 80 02 00 DD 7D 30 1E 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 00 01 00 03 00 02 00 03 00 1B 7E 30 1E 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 3E 80 03 00 3F 80 03 00 40 80 03 00 5D 42 30 1E 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ext2fs read inode blkno 0 blkoff 1 <s:512, o:128, l:128> mci_read_blocks 200 Read 200 bytes 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 LPC3131EA #

Further debugging reveals UBoot uses a fixed length for inodes (128 bye). The inodes on my 2GB SD card are 256 bytes There was a patch that fizzled out back in January looking at this
http://www.nabble.com/-U-Boot----PATCH--Fix-ext2-non-working-td21742132.html...
The superblock contains the inode length in the function
static int ext2fs_read_inode() ...
inodes_per_block = EXT2_BLOCK_SIZE (data) / __le32_to_cpu(sblock->inode_size); ...
status = ext2fs_devread (((__le32_to_cpu (blkgrp.inode_table_id) + blkno) << LOG2_EXT2_BLOCK_SIZE (data)), __le32_to_cpu(sblock->inode_size) * blkoff, sizeof (struct ext2_inode), /*HACK till I fix up struct size*/ (char *) inode);
This seems to improve matters for me BUT I dont have any other hardware to test on and I am no ext2fs guru. Does anyone else have any ideas?

Dear DVM,
In message 22756563.post@talk.nabble.com you wrote:
Further debugging reveals UBoot uses a fixed length for inodes (128 bye). The inodes on my 2GB SD card are 256 bytes There was a patch that fizzled out back in January looking at this
Do you have a file system image that shows the error, i. e. that could be usedfor testing?
Best regards,
Wolfgang Denk

Dear DVM,
In message 22756563.post@talk.nabble.com you wrote:
Further debugging reveals UBoot uses a fixed length for inodes (128 bye). The inodes on my 2GB SD card are 256 bytes There was a patch that fizzled out back in January looking at this
...
This seems to improve matters for me BUT I dont have any other hardware to test on and I am no ext2fs guru. Does anyone else have any ideas?
If you read my reply to that e-mail you read what I'm replying to you:
|Hm.... I tried the current code without your patch but I could not |find any error case. | |But with your patch applied, I got this: | |=> ext2ls ide 0:4 bin | ** ext2fs_devread() read outside partition sector 536870912 |Failed to mount ext2 filesystem... |** Bad ext2 partition or disk - ide 0:4 ** | | |I tested this on a PowerPC system (big endian). Any chance there might |be some endianess issues with your patch?
Please provide at least a test image!
Best regards,
Wolfgang Denk
participants (2)
-
DVM
-
Wolfgang Denk