<?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>ARM11 &#8211; richliu&#039;s blog</title>
	<atom:link href="https://richliu.com/tag/arm11/feed/" rel="self" type="application/rss+xml" />
	<link>https://richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Thu, 01 Dec 2022 08:28:37 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>ARM11 BE8 and BE32</title>
		<link>https://richliu.com/2010/04/08/907/arm11-be8-and-be32/</link>
					<comments>https://richliu.com/2010/04/08/907/arm11-be8-and-be32/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 08 Apr 2010 02:21:07 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[ARM11]]></category>
		<category><![CDATA[BE32]]></category>
		<category><![CDATA[BE8]]></category>
		<category><![CDATA[Big-Endian]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=907</guid>

					<description><![CDATA[<p>What’s difference between BE8 and BE32? BE-32 is suppor [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2010/04/08/907/arm11-be8-and-be32/">ARM11 BE8 and BE32</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></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 0x11223344 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 0x44332211</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 0x00000011</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 0x00000044</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 0x44332211</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 0x00000044</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 0x00000011</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 0x11223344</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 0x00000011</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 0x00000044</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>
<p>The post <a rel="nofollow" href="https://richliu.com/2010/04/08/907/arm11-be8-and-be32/">ARM11 BE8 and BE32</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2010/04/08/907/arm11-be8-and-be32/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ARM11 VFP</title>
		<link>https://richliu.com/2010/03/22/890/arm11-vfp/</link>
					<comments>https://richliu.com/2010/03/22/890/arm11-vfp/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 22 Mar 2010 05:01:33 +0000</pubDate>
				<category><![CDATA[隨手札記]]></category>
		<category><![CDATA[ARM11]]></category>
		<category><![CDATA[GCC]]></category>
		<category><![CDATA[VFP]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=890</guid>

					<description><![CDATA[<p>如果要使用 ARM11 的 VFP 功能, 在 compile 時加上 -mfpu=vfp -mfloat-a [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2010/03/22/890/arm11-vfp/">ARM11 VFP</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></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]  ; 0x24<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   0x3f99999a<br />
3c:   3fa66666        .word   0x3fa66666<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(&#8220;fldmias %0, {s0-s31}\n&#8221;<br />
:<br />
:&#8221;r&#8221;(arrays));<br />
}<br />
void vfp_regs_save(float arrays[32])<br />
{<br />
asm volatile (&#8220;fstmias %0, {s0-s31}&#8221;<br />
:<br />
:&#8221;r&#8221;(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(&#8220;\n&#8221;);<br />
printf(&#8220;%f &#8220;,i, array[i]);<br />
}<br />
printf(&#8220;\n&#8221;);<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 = 0x130000;<br />
asm volatile (&#8220;fmxr fpscr, %0\n&#8221;<br />
:<br />
:&#8221;r&#8221;(fpscr));<br />
asm volatile (&#8220;fmrx %0, fpscr\n&#8221;<br />
:&#8221;=r&#8221;(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(&#8220;\n1:ScalarA op ScalarB-&gt;ScalarD&#8221;);<br />
vfp_regs_load(farrays);<br />
asm volatile(&#8220;fadds s0, s1, s2&#8221;);<br />
vfp_regs_save(farrays2);<br />
print_array(farrays2);<br />
printf(&#8220;\n2:VectorA[?] op ScalarB-&gt;VectorD[?]&#8221;);<br />
vfp_regs_load(farrays);<br />
asm volatile(&#8220;fadds s8,  s24, s0&#8221;);<br />
vfp_regs_save(farrays2);<br />
print_array(farrays2);<br />
printf(&#8220;\n3:VectorA[?] op VectorB[?]-&gt;VectorD[?]&#8221;);<br />
vfp_regs_load(farrays);<br />
asm volatile(&#8220;fadds s8,  s16, s24&#8221;);<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" target="_blank" rel="noopener">ARM VFP的一点体会</a> 寫的不錯, 範例很好, 就.. 照作一次就 OK 了<br />
<a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0274h/index.html" target="_blank" rel="noopener">VFP11 <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" /> VectorFloating-point Coprocessor Technical Reference Manual<br />
for ARM1136JF-S processorr1p5</a></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2010/03/22/890/arm11-vfp/">ARM11 VFP</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2010/03/22/890/arm11-vfp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[ARM][Linux] 建立 ARM 平台的 Debian System</title>
		<link>https://richliu.com/2009/12/25/829/armlinux-%e5%bb%ba%e7%ab%8b-arm-%e5%b9%b3%e5%8f%b0%e7%9a%84-debian-system/</link>
					<comments>https://richliu.com/2009/12/25/829/armlinux-%e5%bb%ba%e7%ab%8b-arm-%e5%b9%b3%e5%8f%b0%e7%9a%84-debian-system/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 25 Dec 2009 05:43:01 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Embedded]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[ARM11]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[debootstrap]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=829</guid>

					<description><![CDATA[<p>在 Embedded system 下, 使用現有的系統驗證 SoC 功能是非常棒的.最大的好處就是不用到處找 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2009/12/25/829/armlinux-%e5%bb%ba%e7%ab%8b-arm-%e5%b9%b3%e5%8f%b0%e7%9a%84-debian-system/">[ARM][Linux] 建立 ARM 平台的 Debian System</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></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/" target="_blank" rel="noopener"><img decoding="async" 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>



<span id="more-829"></span>



<p>首先先裝 debootstrap<br /># apt-get install debootstrap<br />再裝 sid 系統 (現在應該是 unstable)</p>



<pre class="wp-block-preformatted">debootstrap --verbose --foreign --arch armel sid ./sid http://ftp.tw.debian.org/debian
# 若以上連結失效, 可以改用
debootstrap --verbose --foreign --arch armel sid ./sid http://ftp.twaren.net/Debian/debian/
</pre>



<p id="block-a79ce910-9e82-4b55-82ab-0f551c1bfc43">在此一提, 我是用 ARM11MPCore 平台, 用 armel (使用 EABI) 比較好, 記得有些套件在 armel 才會有. arm 己經沒有了

抓完套件下來以後, 將 sid 打包起來, 丟到 target 上去, 再解壓到 /</p>



<p>接下來在 Target board 上下</p>



<pre class="wp-block-preformatted">/debootstrap/debootstrap --second-stage</pre>



<p><br />運氣好就可以解完, 如果解不完就重做一次看看<br />因為我是在 host PC 上做的, 所以在做的時候有一些 information 就會帶過去</p>



<p>修改 /etc/fstab</p>



<pre class="wp-block-preformatted"><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</pre>



<p><br /></p>



<p>因為我是要常常開關測試, 所以不希望 fsck disk,<br />在 format disk 後, 可以考慮下這種參數</p>



<pre class="wp-block-preformatted">
# mke2fs -j /dev/sda
# tune2fs -c 0 -i 0 /dev/sda1
</pre>



<p>/etc/inittab 也要修改, getty 的部份可以全部關掉 (如果有 LCD 可以留 1,2 個下來)</p>



<p></p>



<pre class="wp-block-preformatted">

T0:23:respawn:/sbin/getty -L ttyS0 38400 vt100
#1:2345:respawn:/sbin/getty 38400 tty1
#2:23:respawn:/sbin/getty 38400 tty2
#3:23:respawn:/sbin/getty 38400 tty3
#4:23:respawn:/sbin/getty 38400 tty4
#5:23:respawn:/sbin/getty 38400 tty5
#6:23:respawn:/sbin/getty 38400 tty6
</pre>



<p><br />產生 sources.list</p>



<pre class="wp-block-preformatted"># echo "deb http://ftp.tw.debian.org/debian unstable main non-free contrib" > /etc/apt/sources.list
</pre>



<p><br />設定環境變數</p>



<pre class="wp-block-preformatted">echo LANG=\"C\" >> /etc/environment</pre>



<p></p>



<p><br />接下來就網路設一設, 然後就可以開始安裝環境了</p>



<pre class="wp-block-preformatted"># apt-get update
# apt-get install openssh-server
# apt-get install rcconf
</pre>



<p>接下來有用過 ubuntu 應該就很熟了&#8230;.</p>



<p>Ref.<br /><a title="deboostrap-debian" href="http://emqbit.com/deboostrap-debian" target="_blank" rel="noopener"><br />http://emqbit.com/deboostrap-debian</a><br />Ref. 這個不錯<br />https://help.ubuntu.com/community/Installation/FromLinux</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2009/12/25/829/armlinux-%e5%bb%ba%e7%ab%8b-arm-%e5%b9%b3%e5%8f%b0%e7%9a%84-debian-system/">[ARM][Linux] 建立 ARM 平台的 Debian System</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2009/12/25/829/armlinux-%e5%bb%ba%e7%ab%8b-arm-%e5%b9%b3%e5%8f%b0%e7%9a%84-debian-system/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>ARM 的 Oprofile</title>
		<link>https://richliu.com/2009/12/12/820/arm-%e7%9a%84-oprofile/</link>
					<comments>https://richliu.com/2009/12/12/820/arm-%e7%9a%84-oprofile/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 11 Dec 2009 19:02:18 +0000</pubDate>
				<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">https://richliu.com/?p=820</guid>

					<description><![CDATA[<p>最近在弄 ARM11 的 Oprofile, 結果發現執行 opcontrol 的動作之後, 沒有 log 的 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2009/12/12/820/arm-%e7%9a%84-oprofile/">ARM 的 Oprofile</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></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>
<p>The post <a rel="nofollow" href="https://richliu.com/2009/12/12/820/arm-%e7%9a%84-oprofile/">ARM 的 Oprofile</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2009/12/12/820/arm-%e7%9a%84-oprofile/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
	</channel>
</rss>
