<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>vm-kernel &#187; OMAP</title>
	<atom:link href="http://vm-kernel.org/blog/category/omap/feed/" rel="self" type="application/rss+xml" />
	<link>http://vm-kernel.org/blog</link>
	<description>All about emulation and virtualization</description>
	<lastBuildDate>Sat, 17 Apr 2010 03:51:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Current status of qemu-omap3</title>
		<link>http://vm-kernel.org/blog/2009/01/05/current-status-of-qemu-omap3/</link>
		<comments>http://vm-kernel.org/blog/2009/01/05/current-status-of-qemu-omap3/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 08:46:52 +0000</pubDate>
		<dc:creator>yajin</dc:creator>
				<category><![CDATA[OMAP]]></category>
		<category><![CDATA[emulation]]></category>
		<category><![CDATA[qemu-omap3]]></category>

		<guid isPermaLink="false">http://vm-kernel.org/blog/2009/01/05/current-status-of-qemu-omap3/</guid>
		<description><![CDATA[1. u-boot and linux kernel can boot from mmc image
2. Because twl4030 emulation is not complete, mmc device can not be found in linux kernel.
Next step:
1. twl4030 emulation. Big effort is needed.
2. dss/dma emulation
3. usb
]]></description>
			<content:encoded><![CDATA[<p>1. u-boot and linux kernel can boot from mmc image</p>
<p>2. Because twl4030 emulation is not complete, mmc device can not be found in linux kernel.</p>
<p>Next step:</p>
<p>1. twl4030 emulation. Big effort is needed.</p>
<p>2. dss/dma emulation</p>
<p>3. usb</p>
]]></content:encoded>
			<wfw:commentRss>http://vm-kernel.org/blog/2009/01/05/current-status-of-qemu-omap3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nand flash emulation in qemu-omap3</title>
		<link>http://vm-kernel.org/blog/2008/12/24/nand-flash-emulation-in-qemu-omap3/</link>
		<comments>http://vm-kernel.org/blog/2008/12/24/nand-flash-emulation-in-qemu-omap3/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 04:44:43 +0000</pubDate>
		<dc:creator>yajin</dc:creator>
				<category><![CDATA[OMAP]]></category>
		<category><![CDATA[emulation]]></category>
		<category><![CDATA[nand flash]]></category>
		<category><![CDATA[qemu-omap3]]></category>

		<guid isPermaLink="false">http://vm-kernel.org/blog/2008/12/24/nand-flash-emulation-in-qemu-omap3/</guid>
		<description><![CDATA[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.
&#60;4&#62;mtd-&#62;read(0x1f9f4 [...]]]></description>
			<content:encoded><![CDATA[<p>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.</p>
<blockquote><p>&lt;4&gt;mtd-&gt;read(0x1f9f4 bytes from 0x2060c) returned ECC error</p>
<p>&lt;4&gt;mtd-&gt;read(0x1f9f4 bytes from 0x2060c) returned ECC error</p>
<p>&lt;5&gt;jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020800: 0xb1e0 instead</p>
<p>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020800: 0xb1e0 instead</p>
</blockquote>
<p>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.</p>
]]></content:encoded>
			<wfw:commentRss>http://vm-kernel.org/blog/2008/12/24/nand-flash-emulation-in-qemu-omap3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>code reorder of x-loader using arm-none-linux-gnueabi-gcc</title>
		<link>http://vm-kernel.org/blog/2008/12/22/code-reorder-of-x-loader-using-arm-none-linux-gnueabi-gcc/</link>
		<comments>http://vm-kernel.org/blog/2008/12/22/code-reorder-of-x-loader-using-arm-none-linux-gnueabi-gcc/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 02:34:00 +0000</pubDate>
		<dc:creator>yajin</dc:creator>
				<category><![CDATA[OMAP]]></category>
		<category><![CDATA[beagle board]]></category>
		<category><![CDATA[qemu-omap3]]></category>
		<category><![CDATA[x-loader]]></category>

		<guid isPermaLink="false">http://vm-kernel.org/blog/2008/12/22/code-reorder-of-x-loader-using-arm-none-linux-gnueabi-gcc/</guid>
		<description><![CDATA[I meet a strange problem when doing MMC emulation. The x-loader code is downloaded from http://beagleboard.googlecode.com/files/x-load_beagle_revb.tar.gz.
In function mmc_send_cmd(cpu/omap3/mmc.c)
145         OMAP_HSMMC_BLK = BLEN_512BYTESLEN &#124; NBLK_STPCNT;
146         OMAP_HSMMC_STAT = 0xFFFFFFFF;
147         OMAP_HSMMC_ARG = arg;
148   [...]]]></description>
			<content:encoded><![CDATA[<p>I meet a strange problem when doing MMC emulation. The x-loader code is downloaded from <a title="http://beagleboard.googlecode.com/files/x-load_beagle_revb.tar.gz" href="http://beagleboard.googlecode.com/files/x-load_beagle_revb.tar.gz">http://beagleboard.googlecode.com/files/x-load_beagle_revb.tar.gz</a>.</p>
<p>In function mmc_send_cmd(cpu/omap3/mmc.c)</p>
<blockquote><pre>145         OMAP_HSMMC_BLK = BLEN_512BYTESLEN | NBLK_STPCNT;
146         OMAP_HSMMC_STAT = 0xFFFFFFFF;
147         OMAP_HSMMC_ARG = arg;
148         OMAP_HSMMC_CMD = cmd | CMD_TYPE_NORMAL | CICE_NOCHECK |
149             CCCE_NOCHECK | MSBS_SGLEBLK | ACEN_DISABLE | BCE_DISABLE |
150             DE_DISABLE;</pre>
</blockquote>
<pre>That means cpu write to OMAP3 MMC register in the sequence of BLK-&gt;STAT-&gt;ARG-&gt;CMD. But the compiler reorder the register write order.</pre>
<blockquote>
<pre>40201d7c:&#160;&#160;&#160; e5821108&#160;&#160;&#160;&#160; str&#160;&#160;&#160; r1, [r2, #264]&#160;&#160;&#160;&#160;&#160;&#160; &lt;- ARG&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 40201d80:&#160;&#160;&#160; e5823104&#160;&#160;&#160;&#160; str&#160;&#160;&#160; r3, [r2, #260]&#160;&#160;&#160;&#160;&#160;&#160; &lt;-BLK
40201d84:&#160;&#160;&#160; e582010c&#160;&#160;&#160;&#160; str&#160;&#160;&#160; r0, [r2, #268]&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;-CMD
40201d88:&#160;&#160;&#160; e3e03000&#160;&#160;&#160;&#160; mvn&#160;&#160;&#160; r3, #0&#160;&#160;&#160; ; 0x0
40201d8c:&#160;&#160;&#160; e5823130&#160;&#160;&#160;&#160; str&#160;&#160;&#160; r3, [r2, #304]&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;-STAT</pre>
</blockquote>
<p>The register access order becomes ARG-&gt;BLK-&gt;CMD-&gt;STAT. It will confuse MMC emulation. According to the datasheet of omap3 mmc, write to stat register 0xffffffff will clear the stat register. But x-loader will check the stat register untile it is not 0.</p>
<blockquote>
<pre>153                 do {
154                         mmc_stat = OMAP_HSMMC_STAT;
155                 } while (mmc_stat == 0);</pre>
</blockquote>
<p>I <a href="http://groups.google.com/group/beagleboard/browse_thread/thread/14988091de9c80cf/cb5da7bc73774b93?tvc=2#cb5da7bc73774b93" target="_blank">post a message</a> on the beagle board group. That's because when the compiler believes that the semantics are the same since the memory operations are being done to different&#160; <br />locations, it will reorder code for the sake of performance. If you do not want the compiler to do so, tell him using the 'volatile' keyword.</p>
<p>Change the macro from </p>
<blockquote>
<pre>#define OMAP_HSMMC_STAT&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (*(unsigned int *) 0x4809C130)</pre>
</blockquote>
<p>to</p>
<blockquote>
<pre>#define OMAP_HSMMC_STAT&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (*(volatile unsigned int *) 0x4809C130)</pre>
</blockquote>
<p>The compiler do not reorder the memory operation order if it is volatile.</p>
<p>Another stupid way to solve the problem is turn off the optimization option. Remove -Os from compiler flag of x-loader.</p>
<blockquote>
<p>OPTFLAGS= #-Os #-fomit-frame-pointer</p>
</blockquote>
<p>The compiler will generate stupid but right order register operation asm code.</p>
<blockquote>
<pre>40202b44:&#160;&#160;&#160; e59f20f4&#160;&#160;&#160;&#160; ldr&#160;&#160;&#160; r2, [pc, #244]&#160;&#160;&#160; ; 40202c40 &lt;mmc_send_cmd+0x134&gt;
40202b48:&#160;&#160;&#160; e3e03000&#160;&#160;&#160;&#160; mvn&#160;&#160;&#160; r3, #0&#160;&#160;&#160; ; 0x0
40202b4c:&#160;&#160;&#160; e5823000&#160;&#160;&#160;&#160; str&#160;&#160;&#160; r3, [r2]
40202b50:&#160;&#160;&#160; e59f20ec&#160;&#160;&#160;&#160; ldr&#160;&#160;&#160; r2, [pc, #236]&#160;&#160;&#160; ; 40202c44 &lt;mmc_send_cmd+0x138&gt;
40202b54:&#160;&#160;&#160; e51b300c&#160;&#160;&#160;&#160; ldr&#160;&#160;&#160; r3, [fp, #-12]
40202b58:&#160;&#160;&#160; e5823000&#160;&#160;&#160;&#160; str&#160;&#160;&#160; r3, [r2]
40202b5c:&#160;&#160;&#160; e59f20e4&#160;&#160;&#160;&#160; ldr&#160;&#160;&#160; r2, [pc, #228]&#160;&#160;&#160; ; 40202c48 &lt;mmc_send_cmd+0x13c&gt;
40202b60:&#160;&#160;&#160; e51b3008&#160;&#160;&#160;&#160; ldr&#160;&#160;&#160; r3, [fp, #-8]
40202c38:&#160;&#160;&#160; 4809c124&#160;&#160;&#160;&#160; .word&#160;&#160;&#160; 0x4809c124
40202c3c:&#160;&#160;&#160; 4809c104&#160;&#160;&#160;&#160; .word&#160;&#160;&#160; 0x4809c104
40202c40:&#160;&#160;&#160; 4809c130&#160;&#160;&#160;&#160; .word&#160;&#160;&#160; 0x4809c130
40202c44:&#160;&#160;&#160; 4809c108&#160;&#160;&#160;&#160; .word&#160;&#160;&#160; 0x4809c108
40202c48:&#160;&#160;&#160; 4809c10c&#160;&#160;&#160;&#160; .word&#160;&#160;&#160; 0x4809c10c
40202c4c:&#160;&#160;&#160; 4809c110&#160;&#160;&#160;&#160; .word&#160;&#160;&#160; 0x4809c110
40202c50:&#160;&#160;&#160; 4809c114&#160;&#160;&#160;&#160; .word&#160;&#160;&#160; 0x4809c114
40202c54:&#160;&#160;&#160; 4809c118&#160;&#160;&#160;&#160; .word&#160;&#160;&#160; 0x4809c118
40202c58:&#160;&#160;&#160; 4809c11c&#160;&#160;&#160;&#160; .word&#160;&#160;&#160; 0x4809c11c
<pre></pre>
</pre>
</blockquote>
<p>You can refer the disscussion in beagle board group for more information.</p>
<p>[1]<a title="http://groups.google.com/group/beagleboard/browse_thread/thread/14988091de9c80cf/cb5da7bc73774b93?tvc=2#cb5da7bc73774b93" href="http://groups.google.com/group/beagleboard/browse_thread/thread/14988091de9c80cf">code reorder of x-loader using arm-none-linux-gnueabi-gcc</a></p>
<p>[2]<a href="http://groups.google.com/group/beagleboard/browse_frm/thread/44dab63132e2575b" target="_blank">OMAP3: X-Loader: Make MMC register macros volatile</a></p>
<p>[3]<a href="http://groups.google.com/group/beagleboard/browse_frm/thread/ea54279950a2b69d" target="_blank">U-Boot v1: Clean up MMC code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://vm-kernel.org/blog/2008/12/22/code-reorder-of-x-loader-using-arm-none-linux-gnueabi-gcc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux is running on qemu-omap3</title>
		<link>http://vm-kernel.org/blog/2008/12/15/linux-is-running-on-qemu-omap3/</link>
		<comments>http://vm-kernel.org/blog/2008/12/15/linux-is-running-on-qemu-omap3/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 09:05:36 +0000</pubDate>
		<dc:creator>yajin</dc:creator>
				<category><![CDATA[OMAP]]></category>
		<category><![CDATA[emulation]]></category>
		<category><![CDATA[beagle board]]></category>
		<category><![CDATA[qemu]]></category>
		<category><![CDATA[qemu-omap3]]></category>

		<guid isPermaLink="false">http://vm-kernel.org/blog/2008/12/15/linux-is-running-on-qemu-omap3/</guid>
		<description><![CDATA[Hi everyone, a good news for you. Linux in running successfully on qemu-omap3. Following is the screenshot.

However, MMC/USB/audio/LCD display/keyboard emulation are not ok . I will work on it.
In the following I will give you some informations of how to run qemu-omap3.
1. checkout qemu-omap3 from svn. Tag v0.01 is working.
svn checkout http://qemu-omap3.googlecode.com/svn/tags/v0.01 qemu-omap3
Or you can [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone, a good news for you. Linux in running successfully on qemu-omap3. Following is the screenshot.</p>
<p><a href="http://picasaweb.google.com/lh/photo/SG8C2_rqSfuuH_xMvqTiLg"><img src="http://lh4.ggpht.com/_vf_uV7bji2A/SUYcM3m6jLI/AAAAAAAAANo/9nKq87MosAg/s400/bb2.jpg" alt="" /></a></p>
<p>However, MMC/USB/audio/LCD display/keyboard emulation are not ok . I will work on it.</p>
<p>In the following I will give you some informations of how to run qemu-omap3.</p>
<p>1. checkout qemu-omap3 from svn. Tag v0.01 is working.</p>
<blockquote><p>svn checkout <a href="http://qemu-omap3.googlecode.com/svn/tags/v0.01">http://qemu-omap3.googlecode.com/svn/tags/v0.01</a> qemu-omap3</p></blockquote>
<p>Or you can download it from <a title="http://qemu-omap3.googlecode.com/files/qemu-omap3-v0.01.tar.bz2" href="http://qemu-omap3.googlecode.com/files/qemu-omap3-v0.01.tar.bz2">http://qemu-omap3.googlecode.com/files/qemu-omap3-v0.01.tar.bz2</a> .</p>
<p>2. make qemu-omap3</p>
<blockquote><p>cd qemu-omap3<br />
./configure --target-list=arm-softmmu<br />
make</p></blockquote>
<p>qemu-system-arm will be generated in directory qemu-omap3/arm-softmmu.</p>
<p>3. download the x-loader/u-boot/kernel image.</p>
<blockquote><p>cd qemu-omap3/arm-softmmu<br />
wget <a href="http://qemu-omap3.googlecode.com/files/image-v0.01.tar.bz2">http://qemu-omap3.googlecode.com/files/image-v0.01.tar.bz2</a><br />
tar jxvf image-v0.01.tar.bz2</p></blockquote>
<p>4. download the rootfs from beagle board site.</p>
<blockquote><p>wget <a title="http://beagleboard.googlecode.com/files/rd-ext2-8M.bin" href="http://beagleboard.googlecode.com/files/rd-ext2-8M.bin">http://beagleboard.googlecode.com/files/rd-ext2-8M.bin</a></p></blockquote>
<p>5. make nand flash image</p>
<blockquote><p>cd qemu-omap3/arm-softmmu<br />
cp ../bb_nandflash.sh .<br />
cp ../bb_nandflash_ecc .<br />
./bb_nandflash.sh x-load.bin.ift beagle-nand.bin x-loader<br />
./bb_nandflash.sh u-boot.bin beagle-nand.bin u-boot<br />
./bb_nandflash.sh uImage beagle-nand.bin kernel<br />
./bb_nandflash.sh rd-ext2-8M.bin  beagle-nand.bin  rootfs<br />
./bb_nandflash_ecc beagle-nand.bin 0x0 0xe80000</p></blockquote>
<p>6. run qemu-omap3</p>
<blockquote><p>./qemu-system-arm -M beagle -mtdblock beagle-nand.bin</p></blockquote>
<p>7. During the graphical emulation, you can use the following keys:<br />
Ctrl-Alt-f<br />
Toggle full screen<br />
Ctrl-Alt-n<br />
Switch to virtual console 'n'. Standard console mappings are:<br />
1<br />
Target system display<br />
2<br />
Monitor<br />
3<br />
Serial port<br />
Ctrl-Alt<br />
Toggle mouse and keyboard grab.</p>
<p>Using Ctrl-Alt-3 to switch to beagle board serial port. You can see x-loader and u-boot booting message. When u-boot command line appears, type the following commands.</p>
<blockquote><p>OMAP3 beagleboard.org # nand read 0x80000000 0x280000 0x400000<br />
NAND read: device 0 offset 0x280000, size 0x400000<br />
4194304 bytes read: OK<br />
OMAP3 beagleboard.org # nand read 0x81600000 0x680000 0x800000<br />
NAND read: device 0 offset 0x680000, size 0x800000<br />
8388608 bytes read: OK<br />
OMAP3 beagleboard.org # setenv bootargs 'console=ttyS2,115200n8 ramdisk_size=8192 root=/dev/ram0 rw rootfstype=ext2 initrd=0x81600000,8M nohz=0ff'<br />
OMAP3 beagleboard.org # bootm 0x80000000</p></blockquote>
<p>Linux will boot with some debug information of qemu-omap3. Enjoy it.</p>
<p>Update: 2010-02-20</p>
<p>I am too busy to do omap3 emulation these days. The guy at maemo has made great improvement in qemu omap3 emulation. Go to <a rel="nofollow" href="https://garage.maemo.org/scm/?group_id=877">this page</a> for more information. I do not know whether the steps in this artilcle can be used in the new version of qemu-omap3.</p>
]]></content:encoded>
			<wfw:commentRss>http://vm-kernel.org/blog/2008/12/15/linux-is-running-on-qemu-omap3/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>low level debug of linux omap</title>
		<link>http://vm-kernel.org/blog/2008/12/12/low-level-debug-of-linux-omap/</link>
		<comments>http://vm-kernel.org/blog/2008/12/12/low-level-debug-of-linux-omap/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 05:02:28 +0000</pubDate>
		<dc:creator>yajin</dc:creator>
				<category><![CDATA[OMAP]]></category>
		<category><![CDATA[emulation]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[low level debug]]></category>
		<category><![CDATA[printascii]]></category>
		<category><![CDATA[qemu-omap3]]></category>

		<guid isPermaLink="false">http://vm-kernel.org/blog/2008/12/12/low-level-debug-of-linux-omap/</guid>
		<description><![CDATA[Working on qmeu-omap3. A starange problem. If I use the kernel image downloaded from http://beagleboard.googlecode.com/files/uImage_OTG, some kernel boot informations can be displayed in uart3. But when I use the kernel source from linux omap git and build it by myself, there are NO linux kernel boot informations at all.
Linux kernel uses printk to output informations [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">Working on qmeu-omap3. A starange problem. If I use the kernel image downloaded from <a title="http://beagleboard.googlecode.com/files/uImage_OTG" href="http://beagleboard.googlecode.com/files/uImage_OTG">http://beagleboard.googlecode.com/files/uImage_OTG</a>, some kernel boot informations can be displayed in uart3. But when I use the kernel source from <a href="http://source.mvista.com/git/gitweb.cgi?p=linux-omap-2.6.git;a=summary" target="_blank">linux omap git</a> and build it by myself, there are NO linux kernel boot informations at all.</p>
<p align="justify">Linux kernel uses printk to output informations to console and the console struct is initialized in function console_init(). So why the linux can be displayed before function console_init()?</p>
<p align="justify">The answer is that there is another way to output informations to console. That is low level debug. It uses printascii to print informations. The following is the code in vprintk.</p>
<pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #e9e9e9">
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">556 #ifdef  CONFIG_DEBUG_LL
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">557         printascii(printk_buf);
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">558 #endif</pre>
</pre>
<p>So if we want to output debug information as early as possible, define CONFIG_DEBUG_LL first. </p>
<p>The default configuration of beagle board in <a title="http://www.beagleboard.org/uploads/2.6_kernel_revb-v2.tar.gz" href="http://www.beagleboard.org/uploads/2.6_kernel_revb-v2.tar.gz">http://www.beagleboard.org/uploads/2.6_kernel_revb-v2.tar.gz</a> defines this macro while the source code from&#160; <a href="http://source.mvista.com/git/gitweb.cgi?p=linux-omap-2.6.git;a=summary" target="_blank">linux omap git</a> does not define this macro.</p>
<p>Function printascii is defined in include/asm-arm/arch-omap/debug-macro.S.</p>
]]></content:encoded>
			<wfw:commentRss>http://vm-kernel.org/blog/2008/12/12/low-level-debug-of-linux-omap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>add ecc value to nand flash image</title>
		<link>http://vm-kernel.org/blog/2008/12/06/add-ecc-value-to-nand-flash-image/</link>
		<comments>http://vm-kernel.org/blog/2008/12/06/add-ecc-value-to-nand-flash-image/#comments</comments>
		<pubDate>Sat, 06 Dec 2008 06:38:59 +0000</pubDate>
		<dc:creator>yajin</dc:creator>
				<category><![CDATA[OMAP]]></category>
		<category><![CDATA[emulation]]></category>
		<category><![CDATA[beagle board]]></category>
		<category><![CDATA[qemu-omap3]]></category>

		<guid isPermaLink="false">http://vm-kernel.org/blog/2008/12/06/add-ecc-value-to-nand-flash-image/</guid>
		<description><![CDATA[I use qemu-omap3 to boot linux kernel from nand. The linux image is downloaded from http://beagleboard.googlecode.com/files/uImage_OTG.

OMAP3 beagleboard.org #
OMAP3 beagleboard.org # nand read 0x80000000 0x280000 0x400000
NAND read: device 0 offset 0x280000, size 0x400000
 4194304 bytes read: ERROR
OMAP3 beagleboard.org # bootm 0x80000000
## Booting kernel from Legacy Image at 80000000 ...
   Image Name:   Linux-2.6.22.18-omap3
 [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">I use qemu-omap3 to boot linux kernel from nand. The linux image is downloaded from <a href="http://beagleboard.googlecode.com/files/uImage_OTG">http://beagleboard.googlecode.com/files/uImage_OTG</a>.</p>
<pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #e9e9e9">
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">OMAP3 beagleboard.org #</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">OMAP3 beagleboard.org # nand <span style="color: #0000ff;">read</span> 0x80000000 0x280000 0x400000</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">NAND <span style="color: #0000ff;">read</span>: device 0 offset 0x280000, size 0x400000</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;"> 4194304 bytes <span style="color: #0000ff;">read</span>: ERROR</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">OMAP3 beagleboard.org # bootm 0x80000000</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">## Booting kernel from Legacy Image at 80000000 ...</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">   Image Name:   Linux-2.6.22.18-omap3</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">   Image Type:   ARM Linux Kernel Image (uncompressed)</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">   Data Size:    1856616 Bytes =  1.8 MB</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">   Load Address: 80008000</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">   Entry Point:  80008000</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">   Verifying Checksum ... Bad Data CRC</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">ERROR: can't get kernel image!</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">OMAP3 beagleboard.org #</pre>
</pre>
<p align="justify">It means crc error in linux image. I use qemu console command 'memsave' to dump the data from address 0x80000000 to a file and compare it to uImage_OTG. The result is that linux image in ram(from 0x80000000) is different from uImage_OTG. In every block(256 bytes), there is one bit different from uImage_OTG. The linux image is changed when using 'nand read' command to read it from nand flash image to sram.</p>
<p align="justify">What has happened when reading linux image from nand flash image into sram??</p>
<p>After debuging about half a day, I find that the data are changed by the correct_data function. I <strong>*DID NOT*</strong> save ecc value in nand flash image so u-boot thinks the ecc value in oob is wrong and correct it. Ecc can only correct one bit in an block, that is why a bit has been changed in 256 bytes.</p>
<pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #e9e9e9">
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">ecc_status = this-&gt;correct_data(mtd, &amp;data_poi[datidx], &amp;ecc_code[j], &amp;ecc_calc[j]);</pre>
</pre>
<p>I write a file(<a href="http://code.google.com/p/qemu-omap3/source/browse/trunk/bb_nandflash_ecc.c" target="_blank">bb_nandflash_ecc.c</a>) to generate ecc value for nand flash image. Now I can boot linux image using u-boot command.</p>
<pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #e9e9e9">
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">OMAP3 beagleboard.org # nand <span style="color: #0000ff;">read</span> 0x80000000 0x280000 0x400000</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">NAND <span style="color: #0000ff;">read</span>: device 0 offset 0x280000, size 0x400000</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;"> 4194304 bytes <span style="color: #0000ff;">read</span>: OK</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">OMAP3 beagleboard.org # bootm 0x80000000</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">## Booting kernel from Legacy Image at 80000000 ...</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">   Image Name:   Linux-2.6.22.18-omap3</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">   Image Type:   ARM Linux Kernel Image (uncompressed)</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">   Data Size:    1856616 Bytes =  1.8 MB</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">   Load Address: 80008000</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">   Entry Point:  80008000</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">   Verifying Checksum ... OK</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">   Loading Kernel Image ... OK</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">OK</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">Starting kernel ...</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">smc 80e80414  insn 1600070</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">Uncompressing Linux.......................................................................................................................... done, booting the kernel.</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">&lt;5&gt;Linux version 2.6.22.18-omap3 (root@fedoraserver) (gcc version 4.2.1 (CodeSourcery Sourcery G++ Lite 2007q3-51)) #1 Thu Jul 24 15:29:36 IST 2008</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">CPU: ARMv7 Processor [411fc082] revision 2 (ARMv7), cr=00003837</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">Machine: OMAP3 Beagle board</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">Memory policy: ECC disabled, Data cache writeback</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">&lt;7&gt;On node 0 totalpages: 32768</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">&lt;7&gt;  DMA zone: 256 pages used <span style="color: #0000ff;">for</span> memmap</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">&lt;7&gt;  DMA zone: 0 pages reserved</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">&lt;7&gt;  DMA zone: 32512 pages, LIFO batch:7</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">&lt;7&gt;  Normal zone: 0 pages used <span style="color: #0000ff;">for</span> memmap</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">Unassigned mem readl 4830a204</pre>
</pre>
<p align="justify">Because of omap3 emulation is not complete, linux kernel will stop after linux kernel booting. I will work on it.</p>
]]></content:encoded>
			<wfw:commentRss>http://vm-kernel.org/blog/2008/12/06/add-ecc-value-to-nand-flash-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LCD is working in qemu-omap3</title>
		<link>http://vm-kernel.org/blog/2008/12/04/lcd-is-working-in-qemu-omap3/</link>
		<comments>http://vm-kernel.org/blog/2008/12/04/lcd-is-working-in-qemu-omap3/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 12:31:45 +0000</pubDate>
		<dc:creator>yajin</dc:creator>
				<category><![CDATA[OMAP]]></category>
		<category><![CDATA[emulation]]></category>
		<category><![CDATA[beagle board]]></category>
		<category><![CDATA[qemu]]></category>
		<category><![CDATA[qemu-omap3]]></category>

		<guid isPermaLink="false">http://vm-kernel.org/blog/2008/12/04/lcd-is-working-in-qemu-omap3/</guid>
		<description><![CDATA[Good news. LCD is working in qemu-omap3
Beagle board has an DVI transmitter TFP 410 and it outputs ditigal signal to LCD panel which has DVI connector. However, we do not care TFP 410 because it is just a pipe for LCD output data. What we care about is the LCD output data itself.
According to the [...]]]></description>
			<content:encoded><![CDATA[<p>Good news. LCD is working in <a href="http://code.google.com/p/qemu-omap3" target="_blank">qemu-omap3</a></p>
<p align="justify">Beagle board has an DVI transmitter TFP 410 and it outputs ditigal signal to LCD panel which has DVI connector. However, we do not care TFP 410 because it is just a pipe for LCD output data. What we care about is the LCD output data itself.</p>
<p align="justify">According to the datasheet of OMAP3530, it has three interfaces for LCD output:Parellel Interface, SDI interface and DSI interface. In the case of parellel interface, it can work in two modes: RFBI mode and RFBI bypass mode.</p>
<p align="justify">In RFBI mode, the datapath for LCD output data is display controller and RFBI chip. In RFBI bypass mode, the data is output to LCD panel or other interfaces directly. Beagle board uses TFP 410 to receive 24 bit LCD data and then transmits the data to LCD through DVI interface.</p>
<p align="justify">Qemu already has omap dss emulation. But it is not complete and only for RFBI mode(Nokia N800 uses RFBI). I just follow the Blizzard template and write my own omap3_lcd_panel_template. And then add the sdl update function omap3_lcd_panel_update_display to omap_dss.c. Also some other utility functions are needed. It works now, the beagle and penguin are displayed in my LCD panel. The following is the screenshot.</p>
<p align="justify">
<table style="width:auto;">
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/jGNZQCmgvq2cbOTImFntqA"><img src="http://lh4.ggpht.com/_vf_uV7bji2A/STfwNadnFHI/AAAAAAAAANE/BxfA_n1ZBkM/s288/omap3-dss.JPG" /></a></td>
</tr>
</table>
<p align="justify">I have tested the LCD emulation speed and the result is not bad. It can reach about 20-30 frames per second. I think it is good enough for an emulator.</p>
<p align="justify">The next steps for qemu-omaps are: running linux kernel and distribution(Ångström for example). However the most exciting part is the 3D virtualization for OMAP3. That is you can run 3D application in qemu by using the host 3D accelerator hardware.</p>
<p align="justify">Please be patient. I am working on it.</p>
<p align="justify">
]]></content:encoded>
			<wfw:commentRss>http://vm-kernel.org/blog/2008/12/04/lcd-is-working-in-qemu-omap3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Qemu omap gp-timer bug</title>
		<link>http://vm-kernel.org/blog/2008/11/28/qemu-omap-gp-timer-bug/</link>
		<comments>http://vm-kernel.org/blog/2008/11/28/qemu-omap-gp-timer-bug/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 11:48:39 +0000</pubDate>
		<dc:creator>yajin</dc:creator>
				<category><![CDATA[OMAP]]></category>
		<category><![CDATA[emulation]]></category>

		<guid isPermaLink="false">http://vm-kernel.org/blog/2008/11/28/qemu-omap-gp-timer-bug/</guid>
		<description><![CDATA[在u-boot中，采用函数udelay来进行延时。这是一个单纯等待的算法。在beagle board的u-boot中，udelay会不断去读OMAP general purpose timer的count值，然后根据general purpose timer的输入时钟来得到已经经过的时间。
在u-boot中，gp timer2的输入时钟为系统时钟，beagle board中为13MHZ。并且时钟经过了256分频。因此，每一秒钟的时间，gp timer2的count的值会增加1*(13MHZ/256)。
对于qemu来说，必须要保证当u-boot去读gptimer寄存器值的时候，返回的count值是正确的。也就是说，必须是实际经过的时间*13MHZ/256。
在qemu中，ticks_per_sec的值为1000000000。函数qemu_get_clock可以得到当前时间的ticks。因此，当u-boot来读gptimer寄存器值的时候，返回的count值应该为：

(qemu_get_clock/ticks_per_sec)*(13MHZ/256)

也就是

(qemu_get_clock*13MHZ)/(ticks_per_sec*256)

见函数omap_gp_timer_read

distance = muldiv64(distance, timer-&#62;rate, timer-&#62;ticks_per_sec);

这里，timer-&#62;ticks_per_sec= ticks_per_sec*256。
可是问题的关键在于，函数muldiv64的原型为

/* compute with 96 bit intermediate result: (a*b)/c */
uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)

也就是说，参数b和c都是32bit的。而timer-&#62;ticks_per_sec已经超过了32bit。导致distance的计算出错，后果是u-boot中的延时函数是不准的。
解决方法：
首先判断一下ticks_per_secis有没有超过32bit，然后根据情况分别计算。

/*if ticks_per_secis bigger than 32bit, we can not use muldiv64 anymore!*/
if (timer-&#62;ticks_per_sec&#62;0xffffffff){
  distance = distance/(ticks_per_sec/1000);  /*distance ms*/
  rate = timer-&#62;rate &#62;&#62; (timer-&#62;pre ? timer-&#62;ptv [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">在u-boot中，采用函数udelay来进行延时。这是一个单纯等待的算法。在beagle board的u-boot中，udelay会不断去读OMAP general purpose timer的count值，然后根据general purpose timer的输入时钟来得到已经经过的时间。</p>
<p align="justify">在u-boot中，gp timer2的输入时钟为系统时钟，beagle board中为13MHZ。并且时钟经过了256分频。因此，每一秒钟的时间，gp timer2的count的值会增加1*(13MHZ/256)。</p>
<p align="justify">对于qemu来说，必须要保证当u-boot去读gptimer寄存器值的时候，返回的count值是正确的。也就是说，必须是实际经过的时间*13MHZ/256。<br />
在qemu中，ticks_per_sec的值为1000000000。函数qemu_get_clock可以得到当前时间的ticks。因此，当u-boot来读gptimer寄存器值的时候，返回的count值应该为：</p>
<pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #e9e9e9">
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">(qemu_get_clock/ticks_per_sec)*(13MHZ/256)</pre>
</pre>
<p>也就是</p>
<pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #e9e9e9">
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">(qemu_get_clock*13MHZ)/(ticks_per_sec*256)</pre>
</pre>
<p>见函数omap_gp_timer_read</p>
<pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #e9e9e9">
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">distance = muldiv64(distance, timer-&gt;rate, timer-&gt;ticks_per_sec);</pre>
</pre>
<p>这里，timer-&gt;ticks_per_sec= ticks_per_sec*256。</p>
<p>可是问题的关键在于，函数muldiv64的原型为</p>
<pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #e9e9e9">
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;"><span style="color: #008000;">/* compute with 96 bit intermediate result: (a*b)/c */</span></pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)</pre>
</pre>
<p>也就是说，参数b和c都是32bit的。而timer-&gt;ticks_per_sec已经超过了32bit。导致distance的计算出错，后果是u-boot中的延时函数是不准的。</p>
<p>解决方法：</p>
<p>首先判断一下ticks_per_secis有没有超过32bit，然后根据情况分别计算。</p>
<pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #e9e9e9">
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;"><span style="color: #008000;">/*if ticks_per_secis bigger than 32bit, we can not use muldiv64 anymore!*/</span></pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;"><span style="color: #0000ff;">if</span> (timer-&gt;ticks_per_sec&gt;0xffffffff){</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">  distance = distance/(ticks_per_sec/1000);  <span style="color: #008000;">/*distance ms*/</span></pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">  rate = timer-&gt;rate &gt;&gt; (timer-&gt;pre ? timer-&gt;ptv + 1 : 0);</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">  distance = muldiv64(distance, rate, 1000);</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;"> }</pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;"><span style="color: #0000ff;">else</span></pre>
<pre style="margin: 0em; font-size: 12px; width: 100%; font-family: consolas,'Courier New',courier,monospace; background-color: #e9e9e9;">  distance = muldiv64(distance, timer-&gt;rate, timer-&gt;ticks_per_sec);</pre>
</pre>
<p>现在U-boot中的时间是准确的了。</p>
]]></content:encoded>
			<wfw:commentRss>http://vm-kernel.org/blog/2008/11/28/qemu-omap-gp-timer-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>qemu-omap3 信号丢失问题的解决</title>
		<link>http://vm-kernel.org/blog/2008/11/25/qemu-omap3-%e4%bf%a1%e5%8f%b7%e4%b8%a2%e5%a4%b1%e9%97%ae%e9%a2%98%e7%9a%84%e8%a7%a3%e5%86%b3/</link>
		<comments>http://vm-kernel.org/blog/2008/11/25/qemu-omap3-%e4%bf%a1%e5%8f%b7%e4%b8%a2%e5%a4%b1%e9%97%ae%e9%a2%98%e7%9a%84%e8%a7%a3%e5%86%b3/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 04:54:59 +0000</pubDate>
		<dc:creator>yajin</dc:creator>
				<category><![CDATA[OMAP]]></category>
		<category><![CDATA[emulation]]></category>

		<guid isPermaLink="false">http://vm-kernel.org/blog/2008/11/25/qemu-omap3-%e4%bf%a1%e5%8f%b7%e4%b8%a2%e5%a4%b1%e9%97%ae%e9%a2%98%e7%9a%84%e8%a7%a3%e5%86%b3/</guid>
		<description><![CDATA[
经过几天的debug，在很多地方加入 判断是否有SIG pending的语句，结果都是没有信号pending。那么唯一的可能就根本没有产生SIGALRM信号！    继续追踪。Qemu中提供了很多中定时器的实现方法，见数组alarm_timers。

1: static struct qemu_alarm_timer alarm_timers[] = {

2: #ifndef _WIN32

3: #ifdef __linux__

4:     {&#34;dynticks&#34;, ALARM_FLAG_DYNTICKS, dynticks_start_timer,

5:      dynticks_stop_timer, dynticks_rearm_timer, NULL},

6:     /* HPET - if available - is preferred */

7:     {&#34;hpet&#34;, 0, hpet_start_timer, hpet_stop_timer, NULL, NULL},

8: [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">
<p align="justify">经过几天的debug，在很多地方加入 判断是否有SIG pending的语句，结果都是没有信号pending。那么唯一的可能就根本没有产生SIGALRM信号！    <br />继续追踪。Qemu中提供了很多中定时器的实现方法，见数组alarm_timers。</p>
<pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #e9e9e9">
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">1: <span style="color: #0000ff">static</span> <span style="color: #0000ff">struct</span> qemu_alarm_timer alarm_timers[] = {
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">2: #ifndef _WIN32
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">3: #ifdef __linux__
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">4:     {&quot;<span style="color: #8b0000">dynticks</span>&quot;, ALARM_FLAG_DYNTICKS, dynticks_start_timer,
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">5:      dynticks_stop_timer, dynticks_rearm_timer, NULL},
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">6:     <span style="color: #008000">/* HPET - if available - is preferred */</span>
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">7:     {&quot;<span style="color: #8b0000">hpet</span>&quot;, 0, hpet_start_timer, hpet_stop_timer, NULL, NULL},
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">8:     <span style="color: #008000">/* ...otherwise try RTC */</span>
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">9:     {&quot;<span style="color: #8b0000">rtc</span>&quot;, 0, rtc_start_timer, rtc_stop_timer, NULL, NULL},
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">10: #endif
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">11:     {&quot;<span style="color: #8b0000">unix</span>&quot;, 0, unix_start_timer, unix_stop_timer, NULL, NULL},
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">12: #<span style="color: #0000ff">else</span>
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">13:     {&quot;<span style="color: #8b0000">dynticks</span>&quot;, ALARM_FLAG_DYNTICKS, win32_start_timer,
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">14:      win32_stop_timer, win32_rearm_timer, &amp;alarm_win32_data},
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">15:     {&quot;<span style="color: #8b0000">win32</span>&quot;, 0, win32_start_timer,
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">16:      win32_stop_timer, NULL, &amp;alarm_win32_data},
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">17: #endif
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">18:     {NULL, }
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">19: };</pre>
</pre>
<p align="justify">
  <br />在初始化的时候，qemu会依次读取这个数组中所有的timer类型，只到某一个timer被初始化成功。在qemu-omap3中，dyntics会被初始化成功。也就是说，负责产生SIGALRM信号的就是dynticks。其启动timer和重新设置超时时间的是函数 dynticks_start_timer和dynticks_rearm_timer。</p>
<p align="justify">在dynticks_rearm_timer中会计算并设置超时时间，函数为qemu_next_deadline_dyntick。问题就在 qemu_next_deadline_dyntick中。</p>
<p align="justify">这个函数一开始计算virtualtime的超时时间，然后在存在 realtime的timer的时候，才计算realtime的超时时间，然后取两者最小值。关键在于当没有realtime的timer的时候，得到的 virtualtimer值过大，然后设置了这个很多的值作为下一次的超时时间。导致很长时间都不会出现超时信号。现在在函数 qemu_next_deadline_dyntick中增加了一个最大值的限制。</p>
<pre style="border-right: #cecece 1px solid; padding-right: 5px; border-top: #cecece 1px solid; padding-left: 5px; min-height: 40px; padding-bottom: 5px; overflow: auto; border-left: #cecece 1px solid; padding-top: 5px; border-bottom: #cecece 1px solid; background-color: #e9e9e9">
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">1: <span style="color: #0000ff">if</span> (delta&gt;MAX_TIMER_REARM_US)
</pre>
<pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: #e9e9e9">2:  delta = MAX_TIMER_REARM_US;</pre>
</pre>
<p align="justify">问题解决了。现在qemu-omap3可以接收键盘输入了。</p>
]]></content:encoded>
			<wfw:commentRss>http://vm-kernel.org/blog/2008/11/25/qemu-omap3-%e4%bf%a1%e5%8f%b7%e4%b8%a2%e5%a4%b1%e9%97%ae%e9%a2%98%e7%9a%84%e8%a7%a3%e5%86%b3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>qemu中信号丢失</title>
		<link>http://vm-kernel.org/blog/2008/11/18/qemu%e4%b8%ad%e4%bf%a1%e5%8f%b7%e4%b8%a2%e5%a4%b1/</link>
		<comments>http://vm-kernel.org/blog/2008/11/18/qemu%e4%b8%ad%e4%bf%a1%e5%8f%b7%e4%b8%a2%e5%a4%b1/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 04:53:28 +0000</pubDate>
		<dc:creator>yajin</dc:creator>
				<category><![CDATA[OMAP]]></category>
		<category><![CDATA[emulation]]></category>

		<guid isPermaLink="false">http://vm-kernel.org/blog/2008/11/18/qemu%e4%b8%ad%e4%bf%a1%e5%8f%b7%e4%b8%a2%e5%a4%b1/</guid>
		<description><![CDATA[那在qemu中，有一个gui timer会定时刷新gui的信息。现在gui的tile没有变化，就说明这个gui timer 根本没有被触发。
而在qemu中的定时器是通过函数host_alarm_handler来触发运行的，函数host_alarm_handler又是通过信号来进行触发的。那么问题的根源就是信号没有被发送或者被block(还没有查出具体原因)。
我尝试在终端中向qemu发生SIGALRM信号，果然，qemu接收到SIGALRM信号后，执行host_alarm_handler然后会执行所有注册了的定时器的超时函数(包括display_state.gui_timer)。
kill-bill: # ps aux &#124; grep qemu
root&#160;&#160;&#160;&#160;&#160; 2945&#160; 101&#160; 3.2 196468&#160; 8404 pts/1&#160;&#160;&#160; R+&#160;&#160; 09:36&#160;&#160; 0:14 ./qemu-system-arm -M beagle -mtdblock beagle-nand.bin
root&#160;&#160;&#160;&#160;&#160; 2947&#160; 0.0&#160; 0.2&#160;&#160; 2996&#160;&#160; 692 pts/0&#160;&#160;&#160; R+&#160;&#160; 09:36&#160;&#160; 0:00 grep qemu
kill-bill: # kill -s SIGALRM 2945

多次发送SIGALRM信号后，qemu可以正常接受终端的输入。下面是qemu运行u-boot的截图。

接下来就需要查找为什么qemu没有收到SIGALRM！
]]></description>
			<content:encoded><![CDATA[<p align="justify">那在qemu中，有一个gui timer会定时刷新gui的信息。现在gui的tile没有变化，就说明这个gui timer 根本没有被触发。</p>
<p align="justify">而在qemu中的定时器是通过函数host_alarm_handler来触发运行的，函数host_alarm_handler又是通过信号来进行触发的。那么问题的根源就是信号没有被发送或者被block(还没有查出具体原因)。</p>
<p align="justify">我尝试在终端中向qemu发生SIGALRM信号，果然，qemu接收到SIGALRM信号后，执行host_alarm_handler然后会执行所有注册了的定时器的超时函数(包括display_state.gui_timer)。</p>
<blockquote><p align="justify">kill-bill: # ps aux | grep qemu</p>
<p align="justify">root&#160;&#160;&#160;&#160;&#160; 2945&#160; 101&#160; 3.2 196468&#160; 8404 pts/1&#160;&#160;&#160; R+&#160;&#160; 09:36&#160;&#160; 0:14 ./qemu-system-arm -M beagle -mtdblock beagle-nand.bin</p>
<p align="justify">root&#160;&#160;&#160;&#160;&#160; 2947&#160; 0.0&#160; 0.2&#160;&#160; 2996&#160;&#160; 692 pts/0&#160;&#160;&#160; R+&#160;&#160; 09:36&#160;&#160; 0:00 grep qemu</p>
<p align="justify">kill-bill: # kill -s SIGALRM 2945</p>
</blockquote>
<p align="justify">多次发送SIGALRM信号后，qemu可以正常接受终端的输入。下面是qemu运行u-boot的截图。</p>
<p align="justify"><a href="http://lh5.ggpht.com/_vf_uV7bji2A/SSI_SCSiFmI/AAAAAAAAAGQ/1eym01yahqk/s1600-h/qemu%5B2%5D.jpg"><img height="156" alt="qemu" src="http://lh3.ggpht.com/_vf_uV7bji2A/SSI_S3IVKmI/AAAAAAAAAGU/buYzUck-FTI/qemu_thumb.jpg?imgmax=800" width="244" border="0" /></a></p>
<p align="justify">接下来就需要查找为什么qemu没有收到SIGALRM！</p>
]]></content:encoded>
			<wfw:commentRss>http://vm-kernel.org/blog/2008/11/18/qemu%e4%b8%ad%e4%bf%a1%e5%8f%b7%e4%b8%a2%e5%a4%b1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First step of qemu-omap3</title>
		<link>http://vm-kernel.org/blog/2008/11/15/first-step-of-qemu-omap3/</link>
		<comments>http://vm-kernel.org/blog/2008/11/15/first-step-of-qemu-omap3/#comments</comments>
		<pubDate>Sat, 15 Nov 2008 04:52:49 +0000</pubDate>
		<dc:creator>yajin</dc:creator>
				<category><![CDATA[OMAP]]></category>
		<category><![CDATA[emulation]]></category>

		<guid isPermaLink="false">http://vm-kernel.org/blog/2008/11/15/first-step-of-qemu-omap3/</guid>
		<description><![CDATA[x-load 已经可以在qemu-omap3中运行起来。对x-load主要做了两个地方的修改:
1. 对判断外部输入时钟频率的部分，做了修改。x-load判断外部时钟频率的方法是先设置32KHZ的基准时钟，然后设置GP1的时钟源为SYS_CLK。然后读取GP1 Timer在20个cycle内的差值，进而判断时钟。这个方法在emulator中有的时候并不是很准。因为emulator除了执行指令外，还需要做其他事情。有的时候，emulator去读取GP1 Timer 的时候，实际上运行的时间已经不止ARM 20个cycle的时间，因此读取出来的counter值偏大。而x-load仍然认为刚才是跑了20个cycle。因此，得到的频率比实际的频率大。在 qemu-omap3中，目前认为外部时钟的频率是12MHZ13MHZ,因此，去掉了x-load中判断外部时钟频率的部分，在x-load中直接赋值外部时钟频率12MHZ13MHZ.
2. 去掉了nand flash中进入ECC检查的部分。也就是注释掉drivers/k9f1g08r0a.c中的宏ECC_CKECK_ENABLE


//57 #define ECC_CHECK_ENABLE



&#160;


下面是x-load运行的信息：


&#160;



# ./qemu-system-arm -M beagle -mtdblock beagle-nand.bin -serial stdio -nographic

Texas Instruments X-Loader 1.41

Starting OS Bootloader...



&#160;


运行到u-boot的时候还有点问题。go on working.

]]></description>
			<content:encoded><![CDATA[<p align="justify">x-load 已经可以在qemu-omap3中运行起来。对x-load主要做了两个地方的修改:
<p align="justify">1. 对判断外部输入时钟频率的部分，做了修改。x-load判断外部时钟频率的方法是先设置32KHZ的基准时钟，然后设置GP1的时钟源为SYS_CLK。然后读取GP1 Timer在20个cycle内的差值，进而判断时钟。这个方法在emulator中有的时候并不是很准。因为emulator除了执行指令外，还需要做其他事情。有的时候，emulator去读取GP1 Timer 的时候，实际上运行的时间已经不止ARM 20个cycle的时间，因此读取出来的counter值偏大。而x-load仍然认为刚才是跑了20个cycle。因此，得到的频率比实际的频率大。在 qemu-omap3中，目前认为外部时钟的频率是<strike>12MHZ</strike><font color="#ff0000">13MHZ</font>,因此，去掉了x-load中判断外部时钟频率的部分，在x-load中直接赋值外部时钟频率<strike>12MHZ</strike><font color="#ff0000">13MHZ</font>.
<p align="justify">2. 去掉了nand flash中进入ECC检查的部分。也就是注释掉drivers/k9f1g08r0a.c中的宏ECC_CKECK_ENABLE<br />
<blockquote>
<div align="justify">
<pre>//<a href="http://192.168.23.128/lxr/http/source/drivers/k9f1g08r0a.c#L57" name="L57">57</a> #define <a href="http://192.168.23.128/lxr/http/ident?i=ECC_CHECK_ENABLE">ECC_CHECK_ENABLE</a></pre>
</div>
</blockquote>
<div align="justify">
<pre>&nbsp;</pre>
</div>
<div align="justify">
<pre>下面是x-load运行的信息：</pre>
</div>
<div align="justify">
<pre>&nbsp;</pre>
</div>
<blockquote>
<div align="justify">
<pre># ./qemu-system-arm -M beagle -mtdblock beagle-nand.bin -serial stdio -nographic</pre>
</div>
<p align="justify">Texas Instruments X-Loader 1.41</p>
<div align="justify">
<pre>Starting OS Bootloader...</pre>
</div>
</blockquote>
<div align="justify">
<pre>&nbsp;</pre>
</div>
<div align="justify">
<pre>运行到u-boot的时候还有点问题。go on working.</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://vm-kernel.org/blog/2008/11/15/first-step-of-qemu-omap3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>编译x-load</title>
		<link>http://vm-kernel.org/blog/2008/10/22/%e7%bc%96%e8%af%91x-load/</link>
		<comments>http://vm-kernel.org/blog/2008/10/22/%e7%bc%96%e8%af%91x-load/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 16:39:39 +0000</pubDate>
		<dc:creator>yajin</dc:creator>
				<category><![CDATA[OMAP]]></category>

		<guid isPermaLink="false">http://vm-kernel.org/blog/2008/10/22/%e7%bc%96%e8%af%91x-load/</guid>
		<description><![CDATA[x-load本质是一个U-BOOT的精简版。为什么需要x-load这个玩意呢，而不是直接用u-boot呢？那是因为U-boot太大了，塞不进内部的RAM？那为啥要把X-LOAD塞进内部的RAM，而不是load到外部的RAM呢？
问题就在这里了。当OMAP3530上电的时候，memory controller还没有初始化，怎么去读写外部的RAM呢？必须要有人能先初始化memory controller啊。任务就交给x-Load了。它必须负责初始化外部的RAM控制器，把u-boot从NAND或者MMC中读出到外部RAM，然后跳到u-boot的入口处执行。
问题又来了，那么x-load又是由谁来load的呢？OMAP3530里面带了一个内部RAM，大小为64K。当OMAP3530上电后，会从NAND Flash或者MMC中读取x-load到内部的RAM。然后执行x-load，x-load然后执行上面所说的任务，最后把控制入口交给u-boot。
要编译x-load，先安装toolchain。然后
In file include/configs/omap3530beagle.h 
/* For X-loader to be flashed on to NAND disable the below macro */     //#define CFG_CMD_MMC      Comiple the x-loader as shown below       make CROSS_COMPILE=arm-none-linux-gnueabi- distclean      make CROSS_COMPILE=arm-none-linux-gnueabi- omap3530beagle_config  [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">x-load本质是一个U-BOOT的精简版。为什么需要x-load这个玩意呢，而不是直接用u-boot呢？那是因为U-boot太大了，塞不进内部的RAM？那为啥要把X-LOAD塞进内部的RAM，而不是load到外部的RAM呢？</p>
<p align="justify">问题就在这里了。当OMAP3530上电的时候，memory controller还没有初始化，怎么去读写外部的RAM呢？必须要有人能先初始化memory controller啊。任务就交给x-Load了。它必须负责初始化外部的RAM控制器，把u-boot从NAND或者MMC中读出到外部RAM，然后跳到u-boot的入口处执行。</p>
<p align="justify">问题又来了，那么x-load又是由谁来load的呢？OMAP3530里面带了一个内部RAM，大小为64K。当OMAP3530上电后，会从NAND Flash或者MMC中读取x-load到内部的RAM。然后执行x-load，x-load然后执行上面所说的任务，最后把控制入口交给u-boot。</p>
<p align="justify">要编译x-load，先安装toolchain。然后</p>
<blockquote><p align="justify">In file include/configs/omap3530beagle.h </p>
<p align="justify">/* For X-loader to be flashed on to NAND disable the below macro */     <br />//#define CFG_CMD_MMC      <br />Comiple the x-loader as shown below       <br />make CROSS_COMPILE=arm-none-linux-gnueabi- distclean      <br />make CROSS_COMPILE=arm-none-linux-gnueabi- omap3530beagle_config      <br />make CROSS_COMPILE=arm-none-linux-gnueabi-</p>
</blockquote>
<p align="justify">会生成x-loader.bin。然后用SignGP工具生成可以被OMAP3530 load的bin 文件。 </p>
<blockquote><p align="justify">./singGP x-load.bin </p>
</blockquote>
<p align="justify">生成x-load.bin.ift。 这个文件和x-load.bin的区别在于增加了一个4个字节的header。header的内容是4个字节的x-loader的长度和x-load被load到什么地方的地址(4个字节)。</p>
<p align="justify">
]]></content:encoded>
			<wfw:commentRss>http://vm-kernel.org/blog/2008/10/22/%e7%bc%96%e8%af%91x-load/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>一个新项目 omap3emu</title>
		<link>http://vm-kernel.org/blog/2008/10/10/%e4%b8%80%e4%b8%aa%e6%96%b0%e9%a1%b9%e7%9b%ae-omap3emu/</link>
		<comments>http://vm-kernel.org/blog/2008/10/10/%e4%b8%80%e4%b8%aa%e6%96%b0%e9%a1%b9%e7%9b%ae-omap3emu/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 16:10:12 +0000</pubDate>
		<dc:creator>yajin</dc:creator>
				<category><![CDATA[OMAP]]></category>
		<category><![CDATA[emulation]]></category>

		<guid isPermaLink="false">http://vm-kernel.org/blog/2008/10/10/%e4%b8%80%e4%b8%aa%e6%96%b0%e9%a1%b9%e7%9b%ae-omap3emu/</guid>
		<description><![CDATA[计划一个新的项目omap3emu:OMAP3的emulator。
等会等会，怎么又要做一个emulator啊？现在的emulator已经够多的了。
确实。qemu，skyeye，armware都有非常不错的ARM支持。其中以qemu的支持最为广泛。那么为什么还需要omap3emu呢？
1. 虽然已经有蛮多的ARM Emulator，但是，还没有能模拟ARM V7架构的Opensource的emulator。
2. 在上一篇文章中也提到，通过这个模拟器，可以进一步熟悉了解ARM的体系结构，为Lguest移植到ARM打下基础。我认为，学习一个新的体系结构最好的方法就是写一个emulator。 
3. QEMU的执行速度虽然很快，但是由于其采用了JIT的方法来生成代码，导致不能了解每一步的代码执行情况，或者说debug的时候，比较困难。而 omap3emu打算先提供一个step by step的解释型的执行引擎，虽然很慢，但是对于调试emulator本身和上面的软件都是比较方便的。
4. 打算通过这个omap3emu来验证&#60;虚拟机-系统与进程的通用平台&#62;中介绍的各种优化方法到底有多大的用途，能获得多大的性能提升。在目前硬件发展越来越快的今天，也许其中所介绍的优化方法已经不再适用。 
5. omap3emu作为移植lguest到OMAP3上面的前期工具。 
6. 3D虚拟化方面的尝试。目前，多数的Emulator对于显卡的处理方式多为模拟。尝试采用虚拟化的方式来加速emulator中guest的3D/2D应用。 GUEST 3D/2D Application -- 虚拟化 -- host的3D加速。
omap3emu需要能在Linux和XP上运行，采用SDL作为LCD的模拟。编译系统采用scons。 
编译器:&#160; Linux：gcc&#160; XP: VS2008 Express edition 
项目的主页在googlecode上面。
目前的重点还是放在了qemu-omap3上面。从头开始做omap3emu 所需要的时间/精力太大。不是我目前能承受的。
]]></description>
			<content:encoded><![CDATA[<p>计划一个新的项目omap3emu:OMAP3的emulator。</p>
<p>等会等会，怎么又要做一个emulator啊？现在的emulator已经够多的了。</p>
<p>确实。qemu，skyeye，armware都有非常不错的ARM支持。其中以qemu的支持最为广泛。那么为什么还需要omap3emu呢？</p>
<p>1. 虽然已经有蛮多的ARM Emulator，但是，还没有能模拟ARM V7架构的Opensource的emulator。</p>
<p>2. 在<a href="http://vm-kernel.org/blog/2008/10/07/from-emulation-to-virtualization/">上一篇文章</a>中也提到，通过这个模拟器，可以进一步熟悉了解ARM的体系结构，为Lguest移植到ARM打下基础。我认为，学习一个新的体系结构最好的方法就是写一个emulator。 </p>
<p>3. QEMU的执行速度虽然很快，但是由于其采用了JIT的方法来生成代码，导致不能了解每一步的代码执行情况，或者说debug的时候，比较困难。而 omap3emu打算先提供一个step by step的解释型的执行引擎，虽然很慢，但是对于调试emulator本身和上面的软件都是比较方便的。</p>
<p>4. 打算通过这个omap3emu来验证&lt;虚拟机-系统与进程的通用平台&gt;中介绍的各种优化方法到底有多大的用途，能获得多大的性能提升。在目前硬件发展越来越快的今天，也许其中所介绍的优化方法已经不再适用。 </p>
<p>5. omap3emu作为移植lguest到OMAP3上面的前期工具。 </p>
<p>6. 3D虚拟化方面的尝试。目前，多数的Emulator对于显卡的处理方式多为模拟。尝试采用虚拟化的方式来加速emulator中guest的3D/2D应用。 GUEST 3D/2D Application -- 虚拟化 -- host的3D加速。</p>
<p>omap3emu需要能在Linux和XP上运行，采用SDL作为LCD的模拟。编译系统采用scons。 </p>
<p>编译器:&#160; Linux：gcc&#160; XP: VS2008 Express edition </p>
<p><strike><font color="#ff0000">项目的主页在</font><a href="http://omap3emu.googlecode.com/"><font color="#ff0000">googlecode上面</font></a><font color="#ff0000">。</font></strike></p>
<p><font color="#ff0000">目前的重点还是放在了</font><a href="http://qemu-omap3.googlecode.com/"><font color="#ff0000">qemu-omap3</font></a><font color="#ff0000">上面。从头开始做omap3emu 所需要的时间/精力太大。不是我目前能承受的。</font></p>
]]></content:encoded>
			<wfw:commentRss>http://vm-kernel.org/blog/2008/10/10/%e4%b8%80%e4%b8%aa%e6%96%b0%e9%a1%b9%e7%9b%ae-omap3emu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
