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 ).

时间: 2024-08-08 20:14:28

u-boot中网口处理--硬件部分的相关文章

3.Spring Boot中使用Swagger2构建强大的RESTful API文档

原文:http://www.jianshu.com/p/8033ef83a8ed 由于Spring Boot能够快速开发.便捷部署等特性,相信有很大一部分Spring Boot的用户会用来构建RESTful API.而我们构建RESTful API的目的通常都是由于多终端的原因,这些终端会共用很多底层业务逻辑,因此我们会抽象出这样一层来同时服务于多个移动端或者Web前端. 这样一来,我们的RESTful API就有可能要面对多个开发人员或多个开发团队:IOS开发.Android开发或是Web开发

spring-boot实战【10】【转】:Spring Boot中使用@Async实现异步调用

什么是"异步调用"? "异步调用"对应的是"同步调用",同步调用指程序按照定义顺序依次执行,每一行程序都必须等待上一行程序执行完成之后才能执行:异步调用指程序在顺序执行时,不等待异步调用的语句返回结果就执行后面的程序. 同步调用 下面通过一个简单示例来直观的理解什么是同步调用: 定义Task类,创建三个处理函数分别模拟三个执行任务的操作,操作消耗时间随机取(10秒内) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

spring-boot实战【07】【转】:Spring Boot中Web应用的统一异常处理

我们在做Web应用的时候,请求处理过程中发生错误是非常常见的情况.Spring Boot提供了一个默认的映射:/error,当处理中抛出异常之后,会转到该请求中处理,并且该请求有一个全局的错误页面用来展示异常内容. 选择一个之前实现过的Web应用(Chapter3-1-2)为基础,启动该应用,访问一个不存在的URL,或是修改处理内容,直接抛出异常,如: 1 2 3 4 @RequestMapping("/hello") public String hello() throws Exce

spring-boot实战【09】【转】:Spring Boot中使用@Scheduled创建定时任务

我们在编写Spring Boot应用中经常会遇到这样的场景,比如:我需要定时地发送一些短信.邮件之类的操作,也可能会定时地检查和监控一些标志.参数等. 创建定时任务 在Spring Boot中编写定时任务是非常简单的事,下面通过实例介绍如何在Spring Boot中创建定时任务,实现每过5秒输出一下当前时间. 在Spring Boot的主类中加入@EnableScheduling注解,启用定时任务的配置 1 2 3 4 5 6 7 8 9 10 @SpringBootApplication @E

spring-boot实战【12】:Spring Boot中使用JavaMailSender发送邮件

相信使用过Spring的众多开发者都知道Spring提供了非常好用的JavaMailSender接口实现邮件发送.在Spring Boot的Starter模块中也为此提供了自动化配置.下面通过实例看看如何在Spring Boot中使用JavaMailSender发送邮件. 快速入门 在Spring Boot的工程中的pom.xml中引入spring-boot-starter-mail依赖: 1 2 3 4 <dependency> <groupId>org.springframew

再谈Spring Boot中的乱码和编码问题

编码算不上一个大问题,即使你什么都不管,也有很大的可能你不会遇到任何问题,因为大部分框架都有默认的编码配置,有很多是UTF-8,那么遇到中文乱码的机会很低,所以很多人也忽视了. Spring系列产品大量运用在网站开发中,而Spring Boot是为了简化配置而出现的,理论上讲Spring Boot应该默认配置UTF-8为默认编码,但是网络上依然可以看到很多关于Spring Boot乱码的文章,大部分解决方案沿用Spring MVC的方案,自定义EncodingFilter. 但是仔细查看Spri

Spring Boot中的注解

文章来源:http://www.tuicool.com/articles/bQnMra 在Spring Boot中几乎可以完全弃用xml配置文件,本文的主题是分析常用的注解. Spring最开始是为了解决EJB等大型企业框架对应用程序的侵入性,因此大量依靠配置文件来“非侵入式”得给POJO增加功能,然而,从Spring 3.x开始,Spring被外界最为诟病的一点就是配置繁多,号称“配置地狱”,各种xml文件,出了问题非常难排查.从Spring 4.x开始,Spring.io提供了三种方式编织B

Spring Boot中使用Swagger2生成RESTful API文档(转)

效果如下图所示: 添加Swagger2依赖 在pom.xml中加入Swagger2的依赖 <!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 --> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <versi

SpringBoot(三) :Spring boot 中 Redis 的使用

前言: 这一篇讲的是Spring Boot中Redis的运用,之前没有在项目中用过Redis,所以没有太大的感觉,以后可能需要回头再来仔细看看. 原文出处: 纯洁的微笑 SpringBoot对常用的数据库支持外,对NoSQL 数据库也进行了封装自动化. redis介绍 Redis是目前业界使用最广泛的内存数据存储.相比memcached,Redis支持更丰富的数据结构,例如hashes, lists, sets等,同时支持数据持久化.除此之外,Redis还提供一些类数据库的特性,比如事务,HA,