- 论坛徽章:
- 0
|
本帖最后由 saiwenth 于 2013-07-01 20:17 编辑
看了几天论坛,这里比较热闹,放在这里看有没有人有建议。感谢大家。
环境是9260ek的板子,spi dataflash 8MB挂在cs0上。dataflash 的page大小是0x420.
在uboot中mtdparts 传参如下:
root=/dev/mtdblock2 mtdparts=spi0.1-ATDB542x:264k(boot)ro,2112k(kernel), -(root) rw rootfstype=cramfs
希望通过uboot的方式将分区传入内核中。
内核在启动的最后输出如下
List of all partitions:
1f00 mtdblock0 driver: mtd_dataflash
1f01 2112 mtdblock1 driver: mtd_dataflash
1f02 6072 mtdblock2 driver: mtd_dataflash
No filesystem could mount root, tired: cramfs
kernel panic - not syncing: VFS: Unable to mount root fs on unkown-block(31,2)
不管是什么格式的分区,只要通过/dev/mtdblock2的方式挂载都挂不了,错误和上面的类似,无法识别分区。已经尝试过cramfs,jffs2,squashfs都不行。
当前,能正常启动的方式有两种:
1.能通过nfs网络启动。
2.mtd2相应的地址里用samba写ext2格式的ramfs,并在uboot里通过cp.b的方式找地址挂载到内核默认的bootline参数地址里是能启动。
使用nfs网络启动后发现通过cat cramfs.bin > /proc/mtd2的方式写入cramfs的文件系统,再次用nfs启动发现,kernel的数据部分被覆盖了,启动失败。
(补充,也不是每次都会覆盖kernel,具有一定的随机性,后续用flash_erase擦出flash时发现也有随机的flash地址没有擦写成0XFF)
nfs网络启动后,运行命令
cat /proc/mtd
dev: size erasesize name
mtd0: 0042000 00000420 "boot"
mtd1: 00210000 00000420 "kernel"
mtd2: 00533000 00000420 "root"
在网络文件系统中执行mtd_debug命令:
- mtd_debug info /dev/mtdblock0
- mtdblock_open
- MTD_NEED_ERASE, cache_size:1056
- ok
- MEMGEmtdblock_release
- Tok
- INFO: Inappropriate ioctl for device
- # mtd_debug info /dev/mtd0
- MTD_open
- MTD_ioctl
- MTD_ioctl
- mtd.type = MTD_DATAFLASH
- MTD_close
- mtd.flags = MTD_CAP_ROM
- mtd.size = 270336 (264K)
- mtd.erasesize = 1056 (1K)
- mtd.writesize = 1056 (1K)
- mtd.oobsize = 0
- regions = 0
- #mtd_debug read /dev/mtdblock0 0 0x1000 a
- mtdblock_open
- MTD_NEED_ERASE, cache_size:1056
- ok
- mtdblock: read on "boot" at 0x0, size 0x200
- spi0.1: read 0x0..0x200
- READ: (0) 0 0 0
- mtdblock: read on "boot" at 0x200, size 0x200
- spi0.1: read 0x200..0x400
- READ: (e8) 0 0 0
- mtdblock: read on "boot" at 0x400, size 0x200
- spi0.1: read 0x400..0x420
- READ: (e8) 0 2 0
- spi0.1: read 0x420..0x600
- READ: (e8) 0 4 0
- mtdblock: read on "boot" at 0x600, size 0x200
- spi0.1: read 0x600..0x800
- READ: (e8) 0 8 0
- mtdblock: read on "boot" at 0x800, size 0x200
- spi0.1: read 0x800..0x840
- READ: (e8) 0 9 e0
- spi0.1: read 0x840..0xa00
- READ: (e8) 0 b e0
- mtdblock: read on "boot" at 0xa00, size 0x200
- spi0.1: read 0xa00..0xc00
- READ: (e8) 0 10 0
- mtdblock: read on "boot" at 0xc00, size 0x200
- spi0.1: read 0xc00..0xc60
- READ: (e8) 0 11 c0
- spi0.1: read 0xc60..0xe00
- READ: (e8) 0 13 c0
- mtdblock: read on "boot" at 0xe00, size 0x200
- spi0.1: read 0xe00..0x1000
- READ: (e8) 0 18 0
- mtdblock: read on "boot" at 0x1000, size 0x200
- spi0.1: read 0x1000..0x1080
- READ: (e8) 0 19 a0
- Copiedspi0.1: read 0x1080..0x1200
- READ: (e8) 0 1b a0
- 4096 mtdblock: read on "boot" at 0x1200, size 0x200
- byspi0.1: read 0x1200..0x1400
- tREAD: (e8) 0 20 0
- es fromtdblock: read on "boot" at 0x1400, size 0x200
- m spi0.1: read 0x1400..0x14a0
- aREAD: (e8) 0 21 80
- ddrspi0.1: read 0x14a0..0x1600
- eREAD: (e8) 0 23 80
- ss 0xmtdblock: read on "boot" at 0x1600, size 0x200
- 00spi0.1: read 0x1600..0x1800
- 0READ: (e8) 0 28 0
- 00000 mtdblock: read on "boot" at 0x1800, size 0x200
- inspi0.1: read 0x1800..0x18c0
- READ: (e8) 0 29 60
- flaspi0.1: read 0x18c0..0x1a00
- sREAD: (e8) 0 2b 60
- h tomtdblock: read on "boot" at 0x1a00, size 0x200
- spi0.1: read 0x1a00..0x1c00
- READ: (e8) 0 30 0
- a
- mtdblock: read on "boot" at 0x1c00, size 0x200
- spi0.1: read 0x1c00..0x1ce0
- READ: (e8) 0 31 40
- spi0.1: read 0x1ce0..0x1e00
- READ: (e8) 0 33 40
- mtdblock: read on "boot" at 0x1e00, size 0x200
- spi0.1: read 0x1e00..0x2000
- READ: (e8) 0 38 0
- mtdblock: read on "boot" at 0x2000, size 0x200
- spi0.1: read 0x2000..0x2100
- READ: (e8) 0 39 20
- spi0.1: read 0x2100..0x2200
- READ: (e8) 0 3b 20
- mtdblock: read on "boot" at 0x2200, size 0x200
- spi0.1: read 0x2200..0x2400
- READ: (e8) 0 40 0
- mtdblock: read on "boot" at 0x2400, size 0x200
- spi0.1: read 0x2400..0x2520
- READ: (e8) 0 41 0
- spi0.1: read 0x2520..0x2600
- READ: (e8) 0 43 0
- mtdblock: read on "boot" at 0x2600, size 0x200
- spi0.1: read 0x2600..0x2800
- READ: (e8) 0 48 0
- mtdblock: read on "boot" at 0x2800, size 0x200
- spi0.1: read 0x2800..0x2940
- READ: (e8) 0 48 e0
- spi0.1: read 0x2940..0x2a00
- READ: (e8) 0 4a e0
- mtdblock: read on "boot" at 0x2a00, size 0x200
- spi0.1: read 0x2a00..0x2c00
- READ: (e8) 0 50 0
- mtdblock: read on "boot" at 0x2c00, size 0x200
- spi0.1: read 0x2c00..0x2d60
- READ: (e8) 0 50 c0
- spi0.1: read 0x2d60..0x2e00
- READ: (e8) 0 52 c0
- mtdblock: read on "boot" at 0x2e00, size 0x200
- spi0.1: read 0x2e00..0x3000
- READ: (e8) 0 58 0
- mtdblock: read on "boot" at 0x3000, size 0x200
- spi0.1: read 0x3000..0x3180
- READ: (e8) 0 58 a0
- spi0.1: read 0x3180..0x3200
- READ: (e8) 0 5a a0
- mtdblock: read on "boot" at 0x3200, size 0x200
- spi0.1: read 0x3200..0x3400
- READ: (e8) 0 60 0
- mtdblock: read on "boot" at 0x3400, size 0x200
- spi0.1: read 0x3400..0x35a0
- READ: (e8) 0 60 80
- spi0.1: read 0x35a0..0x3600
- READ: (e8) 0 62 80
- mtdblock: read on "boot" at 0x3600, size 0x200
- spi0.1: read 0x3600..0x3800
- READ: (e8) 0 68 0
- mtdblock: read on "boot" at 0x3800, size 0x200
- spi0.1: read 0x3800..0x39c0
- READ: (e8) 0 68 60
- spi0.1: read 0x39c0..0x3a00
- READ: (e8) 0 6a 60
- mtdblock: read on "boot" at 0x3a00, size 0x200
- spi0.1: read 0x3a00..0x3c00
- READ: (e8) 0 70 0
- mtdblock: read on "boot" at 0x3c00, size 0x200
- spi0.1: read 0x3c00..0x3de0
- READ: (e8) 0 70 40
- spi0.1: read 0x3de0..0x3e00
- READ: (e8) 0 72 40
- mtdblock: read on "boot" at 0x3e00, size 0x200
- spi0.1: read 0x3e00..0x4000
- READ: (e8) 0 78 0
- mtdblock_release
- ok
- # hexdump -C a
- 00000000 0d 00 00 ea 05 00 00 ea 05 00 00 00 00 00 00 00 |................|
- 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
- *
- 00000200 0e 3f 48 10 24 00 00 00 00 00 00 00 00 00 00 00 |.?H.$...........|
- 00000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
- *
- 00000400 00 3c 00 e5 01 80 88 e2 14 50 85 e2 00 30 95 e5 |.<.......P...0..|
- 00000410 00 00 53 e3 a1 ff ff 1a 08 00 a0 e1 f0 81 bd e8 |..S.............|
- 00000420 00 00 a0 e3 f0 81 bd e8 30 40 2d e9 01 40 a0 e1 |........0@-..@..|
- 00000430 00 50 a0 e1 84 ff ff eb 00 30 e0 e3 5f 00 50 e3 |.P.......0.._.P.|
- 00000440 08 00 00 8a 1f 20 05 e2 01 30 a0 ff ff ff ff ff |..... ...0......|
- 00000450 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
- *
- 00000600 01 30 83 e2 00 30 8d ff ff ff ff ff ff ff ff ff |.0...0..........|
- 00000610 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
- *
- 00000800 00 60 a0 e1 08 d0 4d ff ff ff ff ff ff ff ff ff |.`....M.........|
- 00000810 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
- *
- 00000840 1c 30 9f e5 03 00 55 e1 01 50 85 e2 ee ff ff 1a |.0....U..P......|
- 00000850 04 00 a0 e1 00 00 00 ea 01 00 a0 e3 08 d0 8d e2 |................|
- 00000860 70 80 bd e8 80 96 98 00 f0 4f 2d e9 00 c0 a0 e3 |p........O-.....|
- 00000870 8b df 4d e2 00 40 a0 e1 01 90 a0 e1 00 00 00 00 |..M..@..........|
- 00000880 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
- *
- 00000a00 05 00 a0 e1 ee ff ff 1a 00 00 00 00 00 00 00 00 |................|
- 00000a10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
- *
- 00000c00 a2 2f a0 e1 00 00 00 00 00 00 00 00 00 00 00 00 |./..............|
- 00000c10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
- *
- 00000c60 0a 00 00 2a 01 00 00 ea 01 30 50 e5 01 30 41 e5 |...*.....0P..0A.|
- 00000c70 01 20 42 e2 01 00 72 e3 01 00 80 e2 01 10 81 e2 |. B...r.........|
- 00000c80 f8 ff ff 1a 1e ff 2f e1 00 30 dc e7 01 30 cc ff |....../..0...0..|
- 00000c90 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
- *
- 00001000
- #mtd_debug read /dev/mtdblock0 0 0x1000 a
- # hexdump -C a
- 00000000 00 00 00 00 00 00 63 ff ff ff ff ff ff ff ff ff |......c.........|
- 00000010 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
- *
- 00000200 0e 3f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |.?..............|
- 00000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
- *
- 00000400 00 3c 00 e5 01 80 88 e2 14 50 85 e2 00 30 95 e5 |.<.......P...0..|
- 00000410 00 00 53 e3 a1 ff ff ff ff ff ff ff ff ff ff ff |..S.............|
- 00000420 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
- *
- 00000600 01 30 83 e2 00 30 8d e5 00 20 9d e5 94 30 9f e5 |.0...0... ...0..|
- 00000610 03 00 52 e1 f8 ff ff ff ff ff ff ff ff ff ff ff |..R.............|
- 00000620 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
- *
- 00000800 00 60 a0 e1 08 ff ff ff ff ff ff ff ff ff ff ff |.`..............|
- 00000810 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
- *
- 00000840 1c 30 9f e5 03 00 55 e1 01 50 85 e2 ee ff ff 1a |.0....U..P......|
- 00000850 04 00 a0 ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
- 00000860 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
- *
- 00000a00 05 00 a0 e1 ee ff ff 1a 7b ff ff ff ff ff ff ff |........{.......|
- 00000a10 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
- *
- 00000c00 a2 2f a0 e1 00 00 00 00 00 00 00 00 00 00 00 00 |./..............|
- 00000c10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
- *
- 00000c60 0a 00 00 2a 01 00 00 ea 00 00 00 00 00 00 00 00 |...*............|
- 00000c70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
- *
- 00001000
复制代码 也就是说每次读取dataflash的数据都不相同。上述本来是读取flash中的bootstrap二进制的。正常数据见附件。
连续两次读写的、和正常bootstrap的数据见压缩包。
bin.zip
(2.55 KB, 下载次数: 1)
有谁碰到过这样的问题吗?或者分享一个思路。
感谢。
|
|