Application of Gigabit Network Interface in S3C2440A System

Publisher:dfdiqcLatest update time:2012-07-31 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Embedded systems are widely used in many fields such as industrial measurement and control, intelligent instruments, and smart homes. With the continuous expansion of the application scope of embedded systems and the increasing popularity of network applications, more and more embedded systems require network functions. Samsung's S3C2440A is one of the most widely used embedded microprocessors in China. In the S3C2440A application system, it currently only supports 10/100M network interface, which has great practical value. It can not only expand the application field of S3C2440A, but also provide a simple and easy reference for other embedded systems to access the network at high speed.

Design

This system is mainly composed of S3C2440A, memory, AX88180, Gigabit PHY chip 88E1111, embedded Linux, network driver, etc. (see Figure 1). The embedded Linux kernel is responsible for the management of system tasks and integrates TCP/IP protocol to facilitate the control of network functions. S3C2440A is responsible for the control of the entire system. It is connected to AX88180 in bus mode and is the main body of communication control. S3C2440A programs the internal registers of AX88180 through the network driver to realize the sending and receiving of Ethernet data, thereby completing the data transmission between the network and the system. AX88180 and 88E1111 are interconnected by RGMII interface, which is responsible for the implementation of the underlying protocol for data transmission.

Here is a brief introduction to the S3C2440A and AX88180 devices, which are the main bodies of communication control.

S3C2440A is a 16/32-bit RISC microprocessor based on ARM920T core, running at a frequency of up to 500MHz. It is mainly aimed at handheld devices and cost-effective, low-power applications. It is suitable for the development of various high-end handheld, small terminals and network application products. It has very rich on-chip resources, such as LCD, SDRAM, NAND FLASH, DMA, AD, PWM controllers, as well as UART, USB, camera, touch screen, IIC, IIS, SPI, SD, MMC, AC97 and other interfaces.

AX88180 is a Non-PCI Gigabit Ethernet control chip launched by AsiaInfo Corporation of Taiwan. It has a built-in 1000Mbps Ethernet media access controller (MAC); a 40KBytes SRAM network packet buffer; and hardware support for IP/TCP/UDP checksum offloads. It can be easily connected to a general 16/32-bit microprocessor and can be accessed like SRAM. It complies with IEEE 802.3/lEEE 802.3u/IEEE 802.3ab protocols and is suitable for streaming media, multimedia networks, high-bandwidth transmission, and other fields, such as digital media, home gateways, and IP TV.

Hardware Design

Since the hardware circuit is relatively complex, only the core circuit connection is given here, as shown in Figure 2. The S3C2440A and AX88180 are connected in bus mode. The address bus A2-A15, data bus D0-D31, read and write signals, etc. can be directly connected. The 40M~100M clock signal of AX88180 is provided by S3C2440A. The AX88180 interrupt signal is connected to S3C2440A EINT11. The entire interface circuit does not require an external circuit; the simplified Gigabit Media Independent Interface RGMII interface is used between AX88180 and the PHY chip, and the signals can be directly connected one by one.

Software Design

From an overall perspective, the Linux network system can be divided into the hardware layer, device driver layer, network protocol layer and application layer. The S3C2440A system has embedded Linux, integrated TCP/IP and other protocol stacks. The application layer program can be written by yourself or transplanted. Here we mainly analyze the implementation of the device driver.

In embedded Linux, the entire network driver framework can be divided into four layers, namely protocol interface layer, network device interface layer, device driver function layer, network device and network media layer. This framework has been built in the kernel network module. When designing the driver, the main work to be done is to complete the device driver function according to the device structure defined by the upper network device interface layer and the specific hardware characteristics of the bottom layer. The driver mainly consists of initialization, opening, closing, data receiving and sending functions.

Initialization function

The initialization function completes the initialization of the network device and is called by the init function pointer in the data structure device. After loading the AX88180 driver module, the initialization process will be called. This first detects the existence of the network physical device by detecting the hardware characteristics of the physical device, and then configures the resources required by the device, such as interrupts. After these processes are completed, the device data structure is constructed, and its related variables are initialized with the detected data. Finally, the device is registered with the Linux kernel and memory space is requested.

Open Function

The open function in the network device driver is called when the network device status changes from down to up, that is, when it is activated. A lot of AX88180 and 88E1111 initialization work can be done here. When the driver is loaded as a module, the open function also prevents the device from being in the open state when the module is unloaded. [page]

Close Function

The close function does the opposite of the open function and is called when the device status changes from up to down. It is used to release resources to reduce the system burden. When the driver is loaded as a module, the close function also reduces the number of times the device is referenced in order to uninstall the driver.

Send Function

The send function is one of the key processes of the network driver. It is connected to dev->hard_start_xmit and is called when the kernel sends data out through the device. The system allocates a 64K address space to AX88180, with 8000H-FBFFH as the send buffer address. When the system calls the driver's xmit, the sent data is placed in a sk_buff structure, sent to the data buffer address, and then sent to the network by AX88180. If the transmission is successful, hard_start_xmit releases sk_buff and returns 0; if the device cannot process it temporarily, it returns 1. The hardware generates an interrupt after the transmission is completed.

Interrupt and receive functions

The interrupt and receive function is also one of the key processes of the driver. If data is received, AX88180 will generate an interrupt notification system. In the interrupt handler, the driver applies for a sk_buff(), reads data from AX88180 and places it in the receive buffer address 0000H~7000H, and then fills some information in sk_buff. The protocol type of the received frame is determined by skb->dev=dev, and skb->protocol is filled in. Then the pointer skb->mac.raw points to the hardware data, and then the frame header is discarded. After that, skb->pkt_type must be set to indicate the link layer data type, and finally netif_rX() is called to transmit the data to the protocol layer.

The following is part of the sending function code:

Conclusion

The application scheme of the Gigabit network interface introduced in this article has been realized in the S3C2440A system. In the 1000 Full-duplex mode, the data transmission rate can reach 200Mbp. When using FTP to download data, the speed can reach more than 4Mbps, which is 5 to 6 times that of using a 100M network interface. If other higher-speed microprocessors are used, the speed of the network interface will be even higher.

Reference address:Application of Gigabit Network Interface in S3C2440A System

Previous article:Design of Industrial Ultrasonic Flaw Detector Based on S3C2440 Microprocessor
Next article:Design of Data Acquisition System Based on AD7762 and FPGA

Recommended ReadingLatest update time:2024-11-16 21:01

Samsung S3C2440A processor initialization file - with CPSR register related function bits turned on
;========================================== ; NAME: 2440INIT.S ; DESC: C start up codes ; Configure memory, ISR, stacks ; Initialize C-variables ; HISTORY: ; 2002.02.25:kwtark: ver 0.0 ; 2002.03.20:purnnamu: Add some functions for testing STOP,Sleep mode ; 2003.03.14:DonGo: Modified for 2440. ;========================
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号