u-boot中网口处理--硬件部分
1. 网口硬件方案:
AT91SAM9G10 + DM9000CEP;
DM9000CEP为MAC+PHY解决方案,与MCU链接通过8位或16位数据总线。
内部SRAM为16Kbyte。
2. DM9000CEP硬件接口(略)。
3. DM9000CEP寄存器。
DM9000CEP包含两类寄存器:控制状态寄存器(CSRs)和PHY寄存器。
访问PHY寄存器是通过访问CSRs实现的,相关寄存器有:
1) EPCR:EEPROm&PHY Control Register.
2) EPAR : EEPROM & PHY Address Register.
3) EPDRL: EEPROM & PHY Low Byte Data Register.
4) EPDRH: EEPROM & PHY High Byte Data Register.
此外注意:CSRs中包含MAC地址寄存器:PAR:Physical Address Register.
要发送数据必须填写MAC地址。
4. DM9000CEP数据交互。
DM9000CEP数据和地址共用数据总线,通过CMD线选择。
更准确的说法是:
There are only two addressing ports through the access of the host interface.
One port is the INDEX port and the other is the DATA port.
The INDEX port is decoded by the pin CMD =0 and the DATA port by the pin CMD =1.
The contents of the INDEX port are the register address of the DATA port.
Before the access of any register, the address of the register must be saved in the INDEX port.
创意发生了:
数据(DATA port)或地址(INDEX port)都是通过8位或16位数据总线访问,
在操作总线时同时操作CMD,要把CMD当作普通GPIO控制吗?
CPU要访问网口DM9000CEP,首先要选中该芯片,通过SMC片选CS2或CS4,
CS2地址0x30000000,CS4地址0x50000000。
操作该芯片时,首先选中该芯片,然后控制CMD电平,然后操作数据总线。
这样明显增加了一步,访问速度变慢:我们可以在操作地址的同时操作CMD电平,
即操作地址总线,同时操作数据总线。如选择A2为CMD控制线,访问DATA port,
地址为0x30000004,访问INDEX port,地址为0x30000000。
地址线选取原则:>=A2,偶数地址线。
#define DM9000_IO CONFIG_DM9000_BASE //0x30000000 ;INDEX port
#define DM9000_DATA (CONFIG_DM9000_BASE + 0x04) //0x30000004 ;DATA port.
5. 数据收发。
The internal memory size is 16K bytes. The first location of 3K bytes is used for the data buffer of the
packet transmission. The other 13K bytes are used for the buffer of the receiving packets. So in the write
memory operation, when the bit 7 of IMR is set, the memory address increment will wrap to location 0 if
the end of address (i.e. 3K) is reached. In a similar way, in the read memory operation, when the bit 7 of
IMR is set, the memory address increment will wrap to location 0x0C00 if the end of address (i.e. 16K) is
reached.
数据发送:两包数据循环发送。
There are two packets, sequentially named as index I and index II, can be stored in the TX SRAM at the
same time. The index register 02h controls the insertion of CRC and pads. Their statuses are
recorded at index registers 03h and 04h respectively The start address of transmission is 00h and the
current packet is index I after software or hardware reset. Firstly write data to the TX SRAM using the
DMA port and then write the byte count to byte_ count register at index register 0fch and 0fdh. Set the bit 1 of
control register. The DM9000C starts to transmit the index I packet. Before the transmission of the index I
packet ends, the data of the next (index II) packet can be moved to TX SRAM. After the index I packet ends
the transmission, write the byte count data of the Index II to BYTE_COUNT register and then set the bit
1 of control register to transmit the index II packet. The following packets, named index I, II, I, II,..., use
the same way to be transmitted.
数据接收:循环发送
The RX SRAM is a ring data structure. The start address of RX SRAM is 0C00h after software or
hardware reset. Each packet has a 4-byte header followed with the data of the reception packet which
CRC field is included. The format of the 4-byte header is 01h, status, BYTE_COUNT low and
BYTE_COUNT high. It is noted that the start address of each packet is in the proper address boundary
which depends on the operation mode (the 8-bit or 16-bit ).
u-boot中网口处理--硬件部分的更多相关文章
- (转)Spring Boot 2 (十):Spring Boot 中的响应式编程和 WebFlux 入门
http://www.ityouknow.com/springboot/2019/02/12/spring-boot-webflux.html Spring 5.0 中发布了重量级组件 Webflux ...
- Spring Boot 2 (十):Spring Boot 中的响应式编程和 WebFlux 入门
Spring 5.0 中发布了重量级组件 Webflux,拉起了响应式编程的规模使用序幕. WebFlux 使用的场景是异步非阻塞的,使用 Webflux 作为系统解决方案,在大多数场景下可以提高系统 ...
- spring boot(三):Spring Boot中Redis的使用
spring boot对常用的数据库支持外,对nosql 数据库也进行了封装自动化. redis介绍 Redis是目前业界使用最广泛的内存数据存储.相比memcached,Redis支持更丰富的数据结 ...
- Spring Boot中的事务管理
原文 http://blog.didispace.com/springboottransactional/ 什么是事务? 我们在开发企业应用时,对于业务人员的一个操作实际是对数据读写的多步操作的结合 ...
- Spring Boot中的注解
文章来源:http://www.tuicool.com/articles/bQnMra 在Spring Boot中几乎可以完全弃用xml配置文件,本文的主题是分析常用的注解. Spring最开始是为了 ...
- 在Spring Boot中使用Https
本文介绍如何在Spring Boot中,使用Https提供服务,并将Http请求自动重定向到Https. Https证书 巧妇难为无米之炊,开始的开始,要先取得Https证书.你可以向证书机构申请证书 ...
- Spring Boot中使用Swagger2构建强大的RESTful API文档
由于Spring Boot能够快速开发.便捷部署等特性,相信有很大一部分Spring Boot的用户会用来构建RESTful API.而我们构建RESTful API的目的通常都是由于多终端的原因,这 ...
- Dubbo在Spring和Spring Boot中的使用
一.在Spring中使用Dubbo 1.Maven依赖 <dependency> <groupId>com.alibaba</groupId> <artifa ...
- springboot(十一):Spring boot中mongodb的使用
mongodb是最早热门非关系数据库的之一,使用也比较普遍,一般会用做离线数据分析来使用,放到内网的居多.由于很多公司使用了云服务,服务器默认都开放了外网地址,导致前一阵子大批 MongoDB 因配置 ...
随机推荐
- JavaScript 中定义变量时有无var声明的区别
关于JavaScript中定义变量时有无var声明的区别 var a=5; //正确 a=5; //正确 在javascript中,以上两种方法都是定义变量的正确方法.微软的Script56.CHM中 ...
- 微软解决方案框架 - MSF的团队模型、MSF的开发模型,关于SA系统分析师信息的一篇好帖子
msf中的开发模型 书中关于六个小组的人员的案例: MSF 组队模型 v. 3.1-http://bbs.51cto.com/thread-1171-1.html 微软解决方案框架 - MSF的团队模 ...
- python学习笔记—— 多进程中的 孤儿进程和僵尸进程
1 基本概述 1.1 孤儿进程和僵尸进程 父进程创建子进程后,较为理想状态是子进程结束,父进程回收子进程并释放子进程占有的资源:而实际上,父子进程是异步过程,两者谁先结束是无顺的,一般可以通过父进程调 ...
- Workflow_将一个消息同时发给通过用户(案例)
2014-06-04 Created By BaoXinjian
- 基于配置的Spring MVC3
网上查找的spring mvc3大部分都是基于注射的方式,总感觉注射有点怪怪.不利于后期扩展和项目管理,于是特意写下这篇基于xml配置的Spring MVC3.以供大家參考. 怎么建立web项目和下载 ...
- STM32 可编程电压监测器(PVD)实现数据掉电保存
STM32内部有一个完整的上电复位和掉电复位电路,当供电电压达到2v时系统即能正常工作. STM32内部自带PVD功能,用于对MCU供电电压VDD进行监控.通过电源控制寄存器中的PLS[2:0]位可以 ...
- CTPN - 训练
源码地址:https://github.com/eragonruan/text-detection-ctpn 该地址提供了 CTPN 的 tf 版本的实现,代码文档写得很详细,issue 里面也帮助解 ...
- FAQ系列 | 如何保证主从复制数据一致性(转)
导读 MySQL主从复制环境中,如何才能保证主从数据的一致性呢? 关于主从复制 现在常用的MySQL高可用方案,十有八九是基于 MySQL的主从复制(replication)来设计的,包括常规的一主一 ...
- 将mysql非分区表转换为分区表(转)
查看表的分布状况mysql> select count(*) from justin;+----------+| count(*) |+----------+| 5845246 |+---- ...
- Linux下的ip命令
linux的ip命令和ifconfig类似,但前者功能更强大,并旨在取代后者.使用ip命令,只需一个命令,你就能很轻松地执行一些网络管理任务.ifconfig是net-tools中已被废弃使用的一个命 ...