<?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>richliu&#039;s blog &#187; ARM11</title>
	<atom:link href="http://blog.richliu.com/tag/arm11/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.richliu.com</link>
	<description>Linux, 工作, 生活.</description>
	<lastBuildDate>Fri, 03 Sep 2010 11:41:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ARM11 BE8 and BE32</title>
		<link>http://blog.richliu.com/2010/04/08/907/</link>
		<comments>http://blog.richliu.com/2010/04/08/907/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 02:21:07 +0000</pubDate>
		<dc:creator>richliu</dc:creator>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[ARM11]]></category>
		<category><![CDATA[BE32]]></category>
		<category><![CDATA[BE8]]></category>
		<category><![CDATA[Big-Endian]]></category>

		<guid isPermaLink="false">http://blog.richliu.com/?p=907</guid>
		<description><![CDATA[What’s difference between BE8 and BE32?

BE-32 is supported by ARM cores up to the ARM11 family (v6) (for example ARM7TDMI, ARM926EJ-S, ARM1136JF-S). It is enabled by setting a bit in the CP15 system control coprocessor.
BE-8 is supported by the ARM11 family and later (for example ARM1136JF-S, Cortex-R4, Cortex-A8). Architecture v7 cores do not support BE-32.
It [...]]]></description>
			<content:encoded><![CDATA[<p>What’s difference between BE8 and BE32?</p>
<p><span id="more-907"></span></p>
<p>BE-32 is supported by ARM cores up to the ARM11 family (v6) (for example ARM7TDMI, ARM926EJ-S, ARM1136JF-S). It is enabled by setting a bit in the CP15 system control coprocessor.</p>
<p>BE-8 is supported by the ARM11 family and later (for example ARM1136JF-S, Cortex-R4, Cortex-A8). Architecture v7 cores do not support BE-32.</p>
<p>It is controlled by setting a bit in the CPSR.</p>
<p>Setting both bits is reserved (not a valid configuration).</p>
<p>In terms of data access:</p>
<p>BE-8 is byte invariant endianness</p>
<p>BE-32 is word invariant endianness</p>
<p>This is easiest to see with examples. I&#8217;ve starred **** the important ones:</p>
<p>Basic endianness:</p>
<p>Consider a word stored 0&#215;11223344 where 11 is the most significant byte.</p>
<p>Little endian:</p>
<p>Address    0    1    2    3</p>
<p>Data       44   33   22   11</p>
<p>Big endian:</p>
<p>Address    0    1    2    3</p>
<p>Data       11   22   33   44</p>
<p>BE-32 and BE-8</p>
<p>Now consider data stored like this:</p>
<p>Address    0    1    2    3</p>
<p>Data       11   22   33   44</p>
<p>Core in little-endian mode makes word access to address 0:</p>
<p>LDR r0, [0]</p>
<p>r0 contains 0&#215;44332211</p>
<p>Data loaded to register as little endian</p>
<p>Core in little-endian mode makes byte access to address 0:</p>
<p>LDRB r0, [0]</p>
<p>r0 contains 0&#215;00000011</p>
<p>Data loaded from 0</p>
<p>Core in little-endian mode makes byte access to address 3:</p>
<p>LDRB r0, [3]</p>
<p>r0 contains 0&#215;00000044</p>
<p>Data loaded from 3</p>
<p>Core in BE-32 mode makes word access to address 0:</p>
<p>LDR r0, [0]</p>
<p>r0 contains 0&#215;44332211</p>
<p>Word accesses are endianness-invariant</p>
<p>****Core in BE-32 mode makes word access to address 0:</p>
<p>LDRB r0, [0]</p>
<p>r0 contains 0&#215;00000044</p>
<p>Byte access in BE-32 reads the word as if it was stored big-endian</p>
<p>Core in BE-32 mode makes word access to address 3:</p>
<p>LDRB r0, [1]</p>
<p>r0 contains 0&#215;00000011</p>
<p>As above</p>
<p>****Core in BE-8 mode makes word access to address 0:</p>
<p>LDR r0, [0]</p>
<p>r0 contains 0&#215;11223344</p>
<p>Data loaded to register as big endian</p>
<p>Core in BE-8 mode makes byte access to address 0:</p>
<p>LDRB r0, [0]</p>
<p>r0 contains 0&#215;00000011</p>
<p>Byte at address 0 is loaded, NOT the byte at address 3</p>
<p>Core in BE-8 mode makes byte access to address 3:</p>
<p>LDRB r0, [3]</p>
<p>r0 contains 0&#215;00000044</p>
<p>Byte at address 3 is loaded.</p>
<p>Essentially BE-32 operates by altering the addresses of memory accesses when accessing subword quantities. This gives the appearances of big endian.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.richliu.com/2010/04/08/907/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ARM11 VFP</title>
		<link>http://blog.richliu.com/2010/03/22/890/</link>
		<comments>http://blog.richliu.com/2010/03/22/890/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 05:01:33 +0000</pubDate>
		<dc:creator>richliu</dc:creator>
				<category><![CDATA[隨手札記]]></category>
		<category><![CDATA[ARM11]]></category>
		<category><![CDATA[GCC]]></category>
		<category><![CDATA[VFP]]></category>

		<guid isPermaLink="false">http://blog.richliu.com/?p=890</guid>
		<description><![CDATA[如果要使用 ARM11 的 VFP 功能, 在 compile 時加上 -mfpu=vfp -mfloat-abi=softfp
我是使用 debian for ARM , gcc 4.4.2
[C]# cat f.c
int main()
{
float f1=1.2, f2=1.3;
f1 = f2*f1;
}[/C]
# gcc -mfpu=vfp -mfloat-abi=softfp -c f.c
# objdump -d f.o
f.o:     file format elf32-littlearm
Disassembly of section .text:
00000000 :
0:   e52db004        push   [...]]]></description>
			<content:encoded><![CDATA[<p>如果要使用 ARM11 的 VFP 功能, 在 compile 時加上 -mfpu=vfp -mfloat-abi=softfp</p>
<p>我是使用 debian for ARM , gcc 4.4.2<span id="more-890"></span><br />
[C]# cat f.c<br />
int main()<br />
{</p>
<p>float f1=1.2, f2=1.3;<br />
f1 = f2*f1;<br />
}[/C]<br />
# gcc -mfpu=vfp -mfloat-abi=softfp -c f.c<br />
# objdump -d f.o</p>
<p>f.o:     file format elf32-littlearm</p>
<p>Disassembly of section .text:</p>
<p>00000000 :<br />
0:   e52db004        push    {fp}            ; (str fp, [sp, #-4]!)<br />
4:   e28db000        add     fp, sp, #0<br />
8:   e24dd00c        sub     sp, sp, #12<br />
c:   eddf7a09        vldr    s15, [pc, #36]  ; 0&#215;24<br />
10:   ed4b7a03        vstr    s15, [fp, #-12]<br />
14:   eddf7a08        vldr    s15, [pc, #32]<br />
18:   ed4b7a02        vstr    s15, [fp, #-8]<br />
1c:   ed1b7a03        vldr    s14, [fp, #-12]<br />
20:   ed5b7a02        vldr    s15, [fp, #-8]<br />
24:   ee677a27        vmul.f32        s15, s14, s15<br />
28:   ed4b7a03        vstr    s15, [fp, #-12]<br />
2c:   e28bd000        add     sp, fp, #0<br />
30:   e8bd0800        pop     {fp}<br />
34:   e12fff1e        bx      lr<br />
38:   3f99999a        .word   0&#215;3f99999a<br />
3c:   3fa66666        .word   0&#215;3fa66666<br />
有 vldr, vstr, vmul.f32 等 instruction .</p>
<blockquote><p># cat test2.c<br />
[C]<br />
#include &lt;unistd.h&gt;<br />
#include &lt;stdio.h&gt;<br />
void vfp_regs_load(float arrays[32])<br />
{<br />
asm volatile(『fldmias %0, {s0-s31}\n』<br />
:<br />
:』r』(arrays));<br />
}<br />
void vfp_regs_save(float arrays[32])<br />
{<br />
asm volatile (『fstmias %0, {s0-s31}』<br />
:<br />
:』r』(arrays));<br />
}<br />
void print_array(float array[32])<br />
{<br />
int i;<br />
for(i=0; i&lt;32; i++)<br />
{<br />
if(i%8==0)<br />
printf(『\n』);<br />
printf(『%f 『,i, array[i]);<br />
}<br />
printf(『\n』);<br />
}<br />
int main()<br />
{<br />
unsigned int fpscr;<br />
float f1=1.0, f2=1.0;<br />
float farrays[32], farrays2[32];<br />
int i;<br />
fpscr = 0&#215;130000;<br />
asm volatile (『fmxr fpscr, %0\n』<br />
:<br />
:』r』(fpscr));<br />
asm volatile (『fmrx %0, fpscr\n』<br />
:』=r』(fpscr));<br />
vfp_regs_save(farrays2);<br />
for(i=0; i&lt;32; i++)         farrays[i] = f1+f2*(float) i;     vfp_regs_load(farrays);     vfp_regs_save(farrays2);     printf(『\n1:ScalarA op ScalarB-&gt;ScalarD』);<br />
vfp_regs_load(farrays);<br />
asm volatile(『fadds s0, s1, s2&#8243;);<br />
vfp_regs_save(farrays2);<br />
print_array(farrays2);<br />
printf(『\n2:VectorA[?] op ScalarB-&gt;VectorD[?]『);<br />
vfp_regs_load(farrays);<br />
asm volatile(『fadds s8,  s24, s0&#8243;);<br />
vfp_regs_save(farrays2);<br />
print_array(farrays2);<br />
printf(『\n3:VectorA[?] op VectorB[?]-&gt;VectorD[?]『);<br />
vfp_regs_load(farrays);<br />
asm volatile(『fadds s8,  s16, s24&#8243;);<br />
vfp_regs_save(farrays2);<br />
print_array(farrays2);<br />
}[/C]</p></blockquote>
<p>Vector Instruciton 的範例</p>
<p># ./a.out</p>
<p>1:ScalarA op ScalarB-&gt;ScalarD<br />
5.000000 2.000000 3.000000 4.000000 5.000000 6.000000 7.000000 8.000000<br />
9.000000 10.000000 11.000000 12.000000 13.000000 14.000000 15.000000 16.000000<br />
17.000000 18.000000 19.000000 20.000000 21.000000 22.000000 23.000000 24.000000<br />
25.000000 26.000000 27.000000 28.000000 29.000000 30.000000 31.000000 32.000000</p>
<p>2:VectorA[?] op ScalarB-&gt;VectorD[?]<br />
1.000000 2.000000 3.000000 4.000000 5.000000 6.000000 7.000000 8.000000<br />
26.000000 10.000000 28.000000 12.000000 30.000000 14.000000 32.000000 16.000000<br />
17.000000 18.000000 19.000000 20.000000 21.000000 22.000000 23.000000 24.000000<br />
25.000000 26.000000 27.000000 28.000000 29.000000 30.000000 31.000000 32.000000</p>
<p>3:VectorA[?] op VectorB[?]-&gt;VectorD[?]<br />
1.000000 2.000000 3.000000 4.000000 5.000000 6.000000 7.000000 8.000000<br />
42.000000 10.000000 46.000000 12.000000 50.000000 14.000000 54.000000 16.000000<br />
17.000000 18.000000 19.000000 20.000000 21.000000 22.000000 23.000000 24.000000<br />
25.000000 26.000000 27.000000 28.000000 29.000000 30.000000 31.000000 32.000000</p>
<p>1:ScalarA op ScalarB-&gt;ScalarD<br />
單純的二個浮點運算<br />
2:VectorA[?] op ScalarB-&gt;VectorD[?]<br />
一個 Vector * Scalar 運算<br />
3:VectorA[?] op VectorB[?]-&gt;VectorD[?]<br />
Vector * Vector 運算</p>
<p>Ref.</p>
<p><a href="http://linux.chinaunix.net/bbs/viewthread.php?tid=1125926">ARM VFP的一点体会</a> 寫的不錯, 範例很好, 就.. 照作一次就 OK 了<br />
<a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0274h/index.html">VFP11 ™ VectorFloating-point Coprocessor Technical Reference Manual<br />
for ARM1136JF-S processorr1p5</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.richliu.com/2010/03/22/890/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[ARM][Linux] 建立 ARM 平台的 Debian System</title>
		<link>http://blog.richliu.com/2009/12/25/829/</link>
		<comments>http://blog.richliu.com/2009/12/25/829/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 05:43:01 +0000</pubDate>
		<dc:creator>richliu</dc:creator>
				<category><![CDATA[Embedded]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[ARM11]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[debootstrap]]></category>

		<guid isPermaLink="false">http://blog.richliu.com/?p=829</guid>
		<description><![CDATA[在 Embedded system 下, 使用現有的系統驗證 SoC 功能是非常棒的.
最大的好處就是不用到處找工具編一堆有的沒有的, 時間可以花在更重要的地方
像我將 debian 裝好之後, 就可以跑 wireshark 了
本圖中, 最左邊的是 console, 中間的視窗是 EVB 上的 wireshark, 右邊的視窗是 PC 端的 wireshark

真是超好用的&#8230;&#8230;

首先先裝 debootstrap
# apt-get install debootstrap
再裝 sid 系統 (現在應該是 unstable)
#  debootstrap &#8211;verbose &#8211;foreign &#8211;arch armel sid ./sid   http://ftp.tw.debian.org/debian
在此一提, 我是用 ARM11MPCore 平台, 用 armel (使用 EABI) 比較好, 記得有些套件在 armel 才會有. arm 己經沒有了
抓完套件下來以後, [...]]]></description>
			<content:encoded><![CDATA[<p>在 Embedded system 下, 使用現有的系統驗證 SoC 功能是非常棒的.<br />
最大的好處就是不用到處找工具編一堆有的沒有的, 時間可以花在更重要的地方</p>
<p>像我將 debian 裝好之後, 就可以跑 wireshark 了</p>
<p>本圖中, 最左邊的是 console, 中間的視窗是 EVB 上的 wireshark, 右邊的視窗是 PC 端的 wireshark<br />
<a title="Flickr 上 richliu(有錢劉) 的 使用 wireshark *2 debug tcp stream" href="http://www.flickr.com/photos/richliu_tw/4186338737/"><img src="http://farm3.static.flickr.com/2545/4186338737_04601bbf13_m.jpg" alt="使用 wireshark *2 debug tcp stream" width="240" height="100" /></a></p>
<p>真是超好用的&#8230;&#8230;</p>
<p><span id="more-829"></span></p>
<p>首先先裝 debootstrap</p>
<blockquote><p># apt-get install debootstrap</p></blockquote>
<p>再裝 sid 系統 (現在應該是 unstable)</p>
<blockquote><p>#  debootstrap &#8211;verbose &#8211;foreign &#8211;arch armel sid ./sid   http://ftp.tw.debian.org/debian</p></blockquote>
<p>在此一提, 我是用 ARM11MPCore 平台, 用 armel (使用 EABI) 比較好, 記得有些套件在 armel 才會有. arm 己經沒有了</p>
<p>抓完套件下來以後, 將 sid 打包起來, 丟到 target 上去, 再解壓到 /</p>
<p>接下來在 Target board 上下</p>
<blockquote><p># /debootstrap/debootstrap &#8211;second-stage</p></blockquote>
<p>運氣好就可以解完, 如果解不完就重做一次看看<br />
因為我是在 host PC 上做的, 所以在做的時候有一些 information 就會帶過去</p>
<p>修改 /etc/fstab<br />
/dev/sda1       /          ext3   defaults,noatime,check=none              0 0<br />
proc                 /proc      proc       defaults              0 0<br />
devpts               /dev/pts   devpts     mode=0620,gid=5       0 0</p>
<p>因為我是要常常開關測試, 所以不希望 fsck disk,<br />
在 format disk 後, 可以考慮下這種參數<br />
# mke2fs -j /dev/sda<br />
# tune2fs -c 0 -i 0 /dev/sda1</p>
<p>/etc/inittab 也要修改, getty 的部份可以全部關掉 (如果有 LCD 可以留 1,2 個下來)</p>
<blockquote><p>T0:23:respawn:/sbin/getty -L ttyS0 38400 vt100<br />
#1:2345:respawn:/sbin/getty 38400 tty1<br />
#2:23:respawn:/sbin/getty 38400 tty2<br />
#3:23:respawn:/sbin/getty 38400 tty3<br />
#4:23:respawn:/sbin/getty 38400 tty4<br />
#5:23:respawn:/sbin/getty 38400 tty5<br />
#6:23:respawn:/sbin/getty 38400 tty6</p></blockquote>
<p>產生 sources.list</p>
<blockquote><p># echo 『deb http://ftp.tw.debian.org/debian unstable main non-free contrib』 &gt; /etc/apt/sources.list</p></blockquote>
<p>設定環境變數</p>
<blockquote><p>echo LANG=\』C\』 &gt;&gt; /etc/environment</p></blockquote>
<p>接下來就網路設一設, 然後就可以開始安裝環境了</p>
<blockquote><p># apt-get update<br />
# apt-get install openssh-server<br />
# apt-get install rcconf</p></blockquote>
<p>接下來有用過 ubuntu 應該就很熟了&#8230;.</p>
<p>Ref.<br />
<a title="deboostrap-debian" href="http://emqbit.com/deboostrap-debian"></p>
<p>http://emqbit.com/deboostrap-debian</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.richliu.com/2009/12/25/829/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ARM 的 Oprofile</title>
		<link>http://blog.richliu.com/2009/12/12/820/</link>
		<comments>http://blog.richliu.com/2009/12/12/820/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 19:02:18 +0000</pubDate>
		<dc:creator>richliu</dc:creator>
				<category><![CDATA[Embedded]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[ARM11]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[oprofile]]></category>

		<guid isPermaLink="false">http://blog.richliu.com/?p=820</guid>
		<description><![CDATA[最近在弄 ARM11 的 Oprofile, 結果發現執行 opcontrol 的動作之後, 沒有 log 的動作.
大致上的訊息是這樣的
[Bash]
# opcontrol &#8211;shutdown
Stopping profiling.
Killing daemon.
# Stopping profiling.
Killing daemon.
opreport image:/vmlinux -l -w -g &#62; oprofile.txt
error: no sample files found: profile specification too strict ?
[/Bash]
這時請改用 timer interrupt
在 load oprofile modules 加上 timer=1
若是 static link 時, 就要在 boot_cmd 加上 oprofile.timer=1
似乎目前的 kernel oprofile 不支援 ARM11MPCore.
http://oprofile.sourceforge.net/doc/detailed-parameters.html#timer
]]></description>
			<content:encoded><![CDATA[<p>最近在弄 ARM11 的 Oprofile, 結果發現執行 opcontrol 的動作之後, 沒有 log 的動作.<br />
大致上的訊息是這樣的<br />
[Bash]<br />
# opcontrol &#8211;shutdown<br />
Stopping profiling.<br />
Killing daemon.<br />
# Stopping profiling.<br />
Killing daemon.<br />
opreport image:/vmlinux -l -w -g &gt; oprofile.txt<br />
error: no sample files found: profile specification too strict ?<br />
[/Bash]</p>
<p>這時請改用 timer interrupt</p>
<p>在 load oprofile modules 加上 timer=1<br />
若是 static link 時, 就要在 boot_cmd 加上 oprofile.timer=1</p>
<p>似乎目前的 kernel oprofile 不支援 ARM11MPCore.</p>
<p>http://oprofile.sourceforge.net/doc/detailed-parameters.html#timer</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.richliu.com/2009/12/12/820/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
