dm9000 终于跑起来 - weibing.htm
来自「Dm9000网络接口驱动大全」· HTM 代码 · 共 568 行 · 第 1/2 页
HTM
568 行
'width=480,height=480,scrollbars=yes,status=yes');
}
</SCRIPT>
<SCRIPT type=text/javascript>
<!--
function resizeImg() {
var imageAll=document.getElementById("content").getElementsByTagName("img");
if (imageAll !=null) {
for (i=0; i<imageAll.length; i++) {
if (imageAll[i].width>480) {
imageAll[i].style.width="100%";
imageAll[i].onclick=function(){window.open(this.src)};
imageAll[i].style.cursor="pointer";
imageAll[i].alt="点击查看原始尺寸";
}
}
}
}
if (window.addEventListener)
window.addEventListener("load", resizeImg, false);
else if (window.attachEvent)
window.attachEvent("onload", resizeImg);
else
window.onload=resizeImg;
-->
</SCRIPT>
<META content="MSHTML 6.00.2900.3132" name=GENERATOR></HEAD>
<BODY>
<DIV id=container>
<DIV id=header>
<H1><A title=返回首页 href="http://weibing.blogbus.com/">WeiBing</A></H1></DIV>
<DIV id=sidebar>
<DIV id=calendar>
<SCRIPT>var _blogid=1223936;var iCY=2007;var iCM=06;var iCD=23;var iCS=false;var sDCP = "";var sDCN = "";var LDWD = new Array();</SCRIPT>
<SCRIPT src="DM9000 终于跑起来 - WeiBing.files/calendar.js"></SCRIPT>
</DIV>
<P id=description>懵懂网工飘过CCNA,误落MCSE,捡起NCRE4欲越系分小山 ^_^</P>
<DIV id=search>
<FORM name=search_form action=http://www.blogbus.com/public/search.php
method=post><INPUT
style="BACKGROUND: none transparent scroll repeat 0% 0%; WIDTH: 120px"
name=search_input> <INPUT class=button type=submit value="搜 索" name=Submit>
</FORM></DIV>
<DIV id=update>
<H2>最新更新</H2>
<UL>
<LI><A href="http://weibing.blogbus.com/logs/5445315.html">家里的床还是不错的</A>
<LI><A href="http://weibing.blogbus.com/logs/5331712.html">linux开发环境的快速搭建</A>
<LI><A href="http://weibing.blogbus.com/logs/5322618.html">单片机变频pwm实验</A>
<LI><A href="http://weibing.blogbus.com/logs/5235924.html">又一次站起来...</A>
<LI><A href="http://weibing.blogbus.com/logs/5117772.html">php thttpd
cross-compile for arm</A>
<LI><A href="http://weibing.blogbus.com/logs/5035974.html">odd bug on struct
device_driver</A>
<LI><A href="http://weibing.blogbus.com/logs/4971465.html">busybox mount
nfs</A>
<LI><A href="http://weibing.blogbus.com/logs/4965139.html">暴风雨过后</A>
<LI><A href="http://weibing.blogbus.com/logs/4884174.html">疯狂一周</A>
<LI><A href="http://weibing.blogbus.com/logs/4796485.html">kubuntu install
from iso</A></LI></UL></DIV>
<DIV id=lastComments>
<H2>最新评论</H2>
<UL>
<LI><A href="mailto:">weibing</A>:<A
href="http://weibing.blogbus.com/logs/5445315.html#cmt">呵呵,考完试再加上去:)...</A>
<LI><A href="mailto:peepee1112@163.com">风碎飘零</A>:<A
href="http://weibing.blogbus.com/logs/5445315.html#cmt">站长,你好,看了你的博客觉得很不错,想申请与贵站交换友情...</A>
<LI><A href="mailto:">weibing</A>:<A
href="http://weibing.blogbus.com/logs/4418970.html#cmt">^_^,下周2考完试,考试万岁啊...</A>
<LI><A href="mailto:">7v</A>:<A
href="http://weibing.blogbus.com/logs/4418970.html#cmt">看来博主好久没有来了!和第一个问题类似,uboot引...</A>
<LI><A href="mailto:">7v</A>:<A
href="http://weibing.blogbus.com/logs/4418970.html#cmt">第二个问题解决了,原来我的串口的结构体定义有问题。我...</A>
<LI><A href="mailto:">7v</A>:<A
href="http://weibing.blogbus.com/logs/4418970.html#cmt">您好,首先谢谢您以前的热心指教!问题1:我用以下...</A>
<LI><A href="mailto:qingfengxiao6110@sina.com">idolum</A>:<A
href="http://weibing.blogbus.com/logs/4474252.html#cmt">请教为什么我配置好寄存器后
LCD时钟信号会变化,...</A>
<LI><A href="mailto:">zhulizhong</A>:<A
href="http://weibing.blogbus.com/logs/4418970.html#cmt">thanks you for your
help. y...</A>
<LI><A href="mailto:lee_jingfeng@hotmail.com">lee_jingfeng</A>:<A
href="http://weibing.blogbus.com/logs/4418970.html#cmt">还是在u-boot中配置sst39vf3201 flas...</A>
<LI><A href="mailto:">weibing</A>:<A
href="http://weibing.blogbus.com/logs/3325905.html#cmt">现在我已经有这个能力了,迟些再去找这本书
:)...</A></LI></UL></DIV>
<DIV id=reply>
<H2>有话要说</H2>
<FORM action=http://www.blogbus.com/public/comment.php method=post><INPUT
onfocus="this.value=''" value=姓名 name=name><BR><INPUT onfocus="this.value=''"
value=E-mail name=email><BR><INPUT onfocus="this.value=''" value="地址/your blog"
name=homepage><BR><TEXTAREA style="BACKGROUND: none transparent scroll repeat 0% 0%; FONT-FAMILY: " onfocus="this.value=''" name=cmt rows=10 cols=18 padding:3px? font-weight:500; font-size:12px; sans-serif; Helvetica, Verdana, Arial, Grande?, Lucida>留言内容</TEXTAREA><BR><INPUT
type=hidden value=2913888 name=parentid> <INPUT type=hidden
value=diary.php?diaryid=2913888 name=jumpto> <INPUT class=button type=submit value=Say name=addsub> </FORM><BR></DIV>
<DIV id=misc>
<P><BR>访问统计:
<SCRIPT src="DM9000 终于跑起来 - WeiBing.files/counter_show.js.htm"></SCRIPT>
</P><BR>
<DIV id=subscribe>
<SCRIPT language=javascript src="DM9000 终于跑起来 - WeiBing.files/486530.js"
type=text/javascript></SCRIPT>
<NOSCRIPT><A href="http://www.51.la/?486530" target=_blank><IMG
style="BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none"
alt=我要啦免费统计 src="DM9000 终于跑起来 - WeiBing.files/s.gif"></A></NOSCRIPT> <A
href="http://weibing.blogbus.com/index.rdf"><IMG alt="RSS 1.0"
src="DM9000 终于跑起来 - WeiBing.files/rss100.gif"></A></DIV>
<DIV id=AdSense><BR>
<SCRIPT type=text/javascript><!--
google_ad_client = "pub-9384696853643128";
google_ad_width = 120;
google_ad_height = 60;
google_ad_format = "120x60_as_rimg";
google_cpa_choice = "CAAQpJ7UlAIaCCGWP6yzH3JiKODy9IMB";
google_ad_channel = "";
//--></SCRIPT>
<SCRIPT src="DM9000 终于跑起来 - WeiBing.files/show_ads.js" type=text/javascript>
</SCRIPT>
<BR>
<SCRIPT type=text/javascript><!--
google_ad_client = "pub-9384696853643128";
google_ad_width = 125;
google_ad_height = 125;
google_ad_format = "125x125_as_rimg";
google_cpa_choice = "CAAQ5fifnAIaCE93wD3uKY5rKN2_93M";
google_ad_channel = "";
//--></SCRIPT>
<SCRIPT src="DM9000 终于跑起来 - WeiBing.files/show_ads.js" type=text/javascript>
</SCRIPT>
<BR>
<SCRIPT type=text/javascript><!--
google_ad_client = "pub-9384696853643128";
google_ad_width = 120;
google_ad_height = 240;
google_ad_format = "120x240_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "336699";
google_color_bg = "D0D0D0";
google_color_link = "0066CC";
google_color_text = "0000FF";
google_color_url = "008000";
//--></SCRIPT>
<SCRIPT src="DM9000 终于跑起来 - WeiBing.files/show_ads.js" type=text/javascript>
</SCRIPT>
</DIV></DIV></DIV>
<DIV id=content>
<DIV id=context><A
href="http://weibing.blogbus.com/logs/4418970.html"><< u-boot
1.1.5 移植成功</A> | <A href="http://weibing.blogbus.com/">首 页</A> | <A
href="http://weibing.blogbus.com/logs/4453804.html">BusyBox v1.4.1 移植
s3c2410 >></A></DIV>
<DIV class=entry>
<DIV id=entryHeader>
<H2><A href="http://weibing.blogbus.com/logs/4437246.html#">DM9000
终于跑起来</A></H2>
<DIV class=date>2007-02-02</DIV></DIV><BR>
<DIV class=entryBody>
<P>
一个数字问题,花费两天时间,真顶不顺。如果这个所谓的革新公司提供实验板的原理图就好了,可惜...我怀疑他们的板都不知从那里抄来的,也确实佩服他们的销售和我们学校的领导,多么成功的交易啊...</P>
<P> 好,问题解决,留下笔记。Linux 2.6.19.2 ,参考 mach-vr1000.c
和网上众多例子... </P>
<P>vi arch/arm/mach-s3c2410/mach-smdk2410.c ,加入:</P>
<P>static struct resource s3c_d9k_resource[] =
{<BR> [0] =
{<BR>
.start = 0x0A000000 +
0x300,<BR>
.end = 0x0A000000 + 0x300 +
0x03,<BR>
.flags = IORESOURCE_MEM<BR>
},<BR> [1] =
{<BR>
.start = 0x0A000000 + 0x300 + <FONT
color=#ff0000>0x4</FONT>,<BR>
.end = 0x0A000000 + 0x300 + <FONT color=#ff0000>0x4</FONT> +
0x7f,<BR>
.flags = IORESOURCE_MEM<BR>
},<BR> [2] =
{<BR>
.start =
IRQ_EINT0,<BR>
.end =
IRQ_EINT0,<BR>
.flags = IORESOURCE_IRQ<BR>
}<BR>};<BR>static struct dm9000_plat_data s3c_device_d9k_platdata =
{<BR> .flags=
DM9000_PLATF_16BITONLY<BR>};</P>
<P>struct platform_device s3c_device_d9k =
{<BR> .name=
"dm9000",<BR> .id=
0,<BR> .num_resources=
ARRAY_SIZE(s3c_d9k_resource),<BR>
.resource= s3c_d9k_resource,<BR> .dev=
{<BR>
.platform_data =
&s3c_device_d9k_platdata,<BR>
}<BR>};</P>
<P>修改static struct platform_device *smdk2410_devices[] __initdata =
{<BR>
&s3c_device_usb,<BR>
&s3c_device_lcd,<BR>
&s3c_device_wdt,<BR>
&s3c_device_i2c,<BR>
&s3c_device_iis,<BR> <FONT
color=#ffcc00><FONT
color=#ff9900>&s3c_device_d9k</FONT><BR></FONT>};<BR>
红色部分是关键,网上的 vr1000.c
和网上大多例子此处都为0x40。经查证,是因为DM9000A的地址线和数据线是复用的,它是通过92脚(CMD)来区分。如果CMD接到s3c2410的A2脚, 则数据端口的地址
= 地址端口 + 0x04 。那如果是0x40的话,他的CMD应该是接到s3c2410的A7脚。</P>
<P> 奇怪的是 DM9000
在u-boot下也算工作正常,翻查代码,原来有这么两句:</P>
<P>#define DM9000_IO CONFIG_DM9000_BASE<BR>#define
DM9000_DATA (CONFIG_DM9000_BASE+4)</P>
<P>唉,一切只能怪自己不仔细,客观的说,是经验不足 ^_^</P>
<P> 哈哈,无论如何,终于摆脱 read wrong id 的恶梦,可是,马上又遇到可恶的
IRQ_EINT0 ,一申请0号中断就死机...</P><BR>
<TABLE cellSpacing=0 cellPadding=0 width=468 align=center border=0>
<TBODY>
<TR>
<TD>
<SCRIPT src="DM9000 终于跑起来 - WeiBing.files/ads.js"
type=text/javascript></SCRIPT>
</TD></TR></TBODY></TABLE><BR></DIV>
<DIV class=tags>Tag: <A href="http://weibing.blogbus.com/s1013244/">ARM</A> <A
href="http://weibing.blogbus.com/s23857/">嵌入式</A> </DIV><BR>
<DIV class=entryFooter><A href="mailto:besto@21cn.net">weibing</A> @ 21:04:47 |
<A onclick="OpenTrackback(this.href); return false"
href="http://weibing.blogbus.com/logs/t4437246.html">引用 0</A> | <A
href="http://www.blogbus.com/user/?mm=Article&aa=Edit&blogid=1223936&id=4437246">编辑</A></DIV></DIV><BR>
<DIV id=comments>
<H2>评论</H2>
<UL>
<LI>
<P class=commentBody>老兄:你在调dm9000,那太好了<BR>我的dm9000接的是nGCS1<BR>CMD
接的是A2,<BR>BASE = 0X0200 0000<BR>IO = 0X0200 0300 <BR>DATA = 0X0200
0304<BR>没错把,连线是32位的,dm9000的EEDO<BR>pin也上拉了,在include/configs 中的头文件里也定义了
DM9000_USE_32BUS 1<BR>可现在只能发现dm9000,但认为是16bit的,然后说,not link of
ethernet<BR>无语了,没有头绪,支个招吧,老兄<BR>
<DIV
class=recmtBody>weibing 回复 philip 说:<BR>呵呵,这个是几个月之前的事了,nGCS1不会是0X0200
0000吧? <BR>硬件我不是很熟,在U-BOOT里我的也是16bit的,也会提示not link of
ethernet,但可以使用,可能与之前实验箱的连线有关。现在改用了朗成的开发板,一直都很好,就没有再跳过了...<BR><SPAN
class=time>(2007-05-31 17:12:11)</SPAN></DIV>
<P></P>
<DIV class=commentPost><A href="mailto:">philip</A> (<A href="http:///"></A>)
发表于 2007-05-31 14:21:09</DIV>
<LI>
<P class=commentBody>怎么看到不完整<BR>
<DIV
class=recmtBody>weibing 回复 gclu 说:<BR>唉,确实不完整,申请irq0仍然有问题,跟踪了很多天,发现问题与其他人不同,我的intmod是正常的,但一request_irq就死在unmask的死循环里...<BR><SPAN
class=time>(2007-03-07 23:25:35)</SPAN></DIV>
<P></P>
<DIV class=commentPost><A href="mailto:lgcgc">gclu</A> (<A
href="http:///"></A>) 发表于 2007-03-07 19:02:49</DIV></LI></UL></DIV>
<DIV id=commentForm>
<H2>发表评论</H2>
<FORM action=http://www.blogbus.com/public/comment.php method=post>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD vAlign=center noWrap align=left> 姓名:</TD>
<TD vAlign=bottom align=left><INPUT name=name></TD></TR>
<TR>
<TD vAlign=center noWrap align=left> E-mail:</TD>
<TD vAlign=bottom align=left><INPUT name=email></TD></TR>
<TR>
<TD vAlign=center noWrap align=left> 地址:</TD>
<TD vAlign=bottom align=left><INPUT name=homepage></TD></TR>
<TR>
<TD vAlign=top align=left> </TD>
<TD vAlign=bottom align=left><TEXTAREA style="BACKGROUND: none transparent scroll repeat 0% 0%; FONT-FAMILY: " name=cmt rows=8 cols=40 padding:3px? font-weight:500; font-size:12px; sans-serif; Helvetica, Verdana, Arial, Grande?, Lucida></TEXTAREA>
<INPUT type=hidden value=4437246_1d26947856a15f8c6d19693733ea872a
name=parentid> <INPUT type=hidden value=http:///4437246.html name=jumpto> <INPUT class=button type=submit value="提 交" name=addsub> <INPUT class=button type=reset value="重 置" name=重置>
</TD></TR></TBODY></TABLE></FORM><BR><BR></DIV></DIV>
<DIV id=footer><BR>
<P id=copyright><SPAN class=red>激情</SPAN> <SPAN class=yellow>信心</SPAN> <SPAN
class=fuchsia>魄力</SPAN></< p> </P></DIV></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?