nand flash emulation in qemu-omap3
Qemu currently supports nand flash emulation in hw/nand.c. But it is for spi flash and it's not ready for big page nand flash, 2k page nand flash for example. I add the big page nand flash emulation to it, but it has some bugs. When I boots jffs2 rootfs from qemu-omap, some error messages appear.
<4>mtd->read(0x1f9f4 bytes from 0x2060c) returned ECC error
<4>mtd->read(0x1f9f4 bytes from 0x2060c) returned ECC error
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020800: 0xb1e0 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020800: 0xb1e0 instead
After hours of debuging, I find that the message is related to bugs of nand flash emulation.But I do not want to change nand.c code too much because I am afraid it will have some sideeffect to other type nand flash emulation. So I decide to wirte a new nand flash emulation for beagle board or other big page nand flash. After that, rootfs can be booted from nand flash.
Hello,
I am pretty new to emulation of devices. Assuming that i have to emulate a NAND device based on a hardware profile, how can i go about it? Could u please give me a pointer to some docs/links/tutorials that can help me out with this?
"...2k page nand flash for example.I add the big page nand flash emulation to it,"
...
"So I decide to wirte a new nand flash emulation for beagle board or other big page nand flash"
Basically i need a way to do the above quoted things that u've done.
I'll really appreciate any help in this regard
Thanks.
Adi
Hi let's take nand flash emulation for example.Here we talk about function emulation, not clock cycle accurate emulation.
The nand devide just receives commands from command port and then outputs data in the data port. So what you need to do is emulating this process. You can find find the process of reading data from nand flash in the nand flash datasheet.
Qemu has provided a good example of nand flash emulation. You can read the source code and find the magic beans.
Hello yajin,
Now to find the magic beans!
Found the QEMU source and am looking into it. Thanks for the pointer...direction for work is clearer now