Introduction U-BOOT is a boot loader
developed by the German DENX team for a variety of embedded microprocessors. It is the first program code that runs after the system is powered on. It is used to initialize the target board hardware, provide the target board hardware configuration information for the embedded operating system, and load, boot and run the embedded operating system. U-BooT supports network functions. When downloading operating system kernels and large file systems, it is faster and more convenient than other boot loaders that do not support the network. At present, U-BOOT only supports 10M/100M network functions. With the development of science and technology, gigabit network functions will inevitably be widely used in embedded systems. This article introduces a method to enable U-BOOT to support gigabit network functions, which can make U-BOOT more powerful and easier to use.
Introduction to U-BOOT
The full name of U-BOOT is Universal Boot Loader. It is an open source project that complies with the terms of the GPL. It supports a variety of processors, such as ARM, PowerPC, MIPS, etc. It also supports
U-BOOT includes two different working modes: boot loading mode and download mode. Boot loading mode is also called autonomous mode, which means that U-BOOT loads the operating system from a solid-state storage device on the target machine into RAM for operation. This mode is the normal working mode of U-BOOT. Download mode means that during the development or production process, U-BOOT downloads the operating system kernel and file system from the host to the RAM of the target machine through communication means such as network connection, and then writes them to the FLASH solid-state storage device on the target machine. U-BOOT allows users to switch between these two working modes. The system will wait for a while when it starts. If the user does not press a button at this time, U-BOOT will enter the boot loading mode by default.
Hardware Platform
The hardware platform used in this article is a development board based on S3C2440A and an embedded network card based on the non-PCI Gigabit Ethernet control chip AX88180, as shown in Figure 2. S3C2440A is a 16/32-bit RISC embedded microprocessor based on the ARM920T core, with an operating frequency of up to 500MHz. The development board has 64M NAND flash memory and 64M SDRAM; the network card is composed of MAC chip AX88180, PHY chip 88E1111, RJ45 and other circuits; the S3C2440A target board and the network card are connected by the target board 32-bit expansion bus, and these two parts can also be designed on the same board during product design. [page]
The driver
needs to design a gigabit network card driver to embed the gigabit network function in U-BOOT, and then transplant it in U-BOOT to realize functions such as downloading through the gigabit network port on the corresponding hardware platform. The network card driver mainly consists of the initialization program eth_init(bd_t*bd), the network device shutdown program eth_halt(void), the data packet sending program eth_send(volatilevoid*packet, intlength), and the data packet receiving program inteth_rx(void). The work of the initialization program is mainly to configure and initialize the hardware. In the initialization program, the configuration of the network control chip AX88180 and the PHY chip can be completed, such as setting the interface to 1000Mbps, full-duplex mode, etc. Data transmission is to put the data packaged by the upper layer protocol in the sending data buffer, and then the network card sends it to the network; data reception is to take out the data from the buffer and hand it over to the upper layer protocol program for unpacking after the network card receives the data packet from the network and generates an interrupt. The interrupt service program handles the interrupts generated after the network card sends and receives the data packet, as well as the interrupts generated by the PHY.
The network card initialization program is as follows:
int eth_init(bd_t*bd)
{
memset(&axlocal, 0, sizeof(AX88180_PRIVATE));
RESET_MAC;
DISABLE_INTERRUPT;
WRITE_
tmp16=bd->bi_enetaddr[1];
macid0_val=(tmp16<<8) │ bd>bi_enetaddr[0];
tmp16=bd->bi_enetaddr[3];
macid1_val=(tmp16<<8 )│ bd>bi_enetaddr[2];
tmp16=bd->bi_enetaddr[5];
macid2_val=(tmpl6<<8)│ bd>bi_enetaddr[4];
WRITE_MACREG(MACID0, macid0_val);
WRITE_MACREG(MACID1, macid1_val);
WRITE_MACREG (MACID2, macid2_val);
ax88180_PHY_initial();
ax88180_meida_config();
WRITE_MACREG(RXFILTER,DEFAULT_RXFILTER);
INT TXRX VARIABLES;
READ_MACREG(ISR,tmp_regval);
PRINTK(INIT_MSG,"ax88180;The interrupt status="0x"%081x\n".tmp_regval);
if(tmp_regval)
WRITE_MACREG(ISR,tmp_regval );
WRITE_MACREO(CMD,RXEN │ TXEN │ WAKEMOD);
return0;}
Driver transplantation
Driver transplantation is to add driver code and related configuration in U-BooT based on S3C2440A hardware platform, as follows:
1. Add the network port device drivers ax88180.c and ax88180.h in the drivers/directory.
2. Add the following code to the corresponding position in lib_arm/board.c (refer to CS8900):
#ifdef CONFIG_DRIVER_AX88180
extern Void ax88180_get_enetaddr(uchar*addr);
#endif
#ifdef CONFIG_DRIVER_AX88180
ax88180_get_enetaddr(gd_bd>bi_enetaddr)
;
3. Add the following code to the corresponding position in include/configs/smdk2440.h (refer to CS8900):
#define CONFIG_DRIVER_AX88180 1 #define AX88180_BASE
Ox08000000
4. Finally, add ax88180.o to drivers/Makefile and recompile to generate U-BooT.
Conclusion
U-BOOT is widely used in embedded systems. The method described in this article can make U-BOOT more powerful and more convenient to use. The hardware platform introduced in this article provides some guidance for the design of gigabit network functions in embedded systems. Although this design is based on the S3C2440A platform, it also has a good reference for other similar systems. The method introduced in this article has been applied in products with good results.
Previous article:Development of embedded applications based on μClinux
Next article:Research and System Design of VoIP Dual-mode Gateway
Recommended ReadingLatest update time:2024-11-16 15:39
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 【ST NUCLEO-H743ZI Review】 (4) - DCMI OV7620 Collection
- stm32f1 plays badaplle routine, modify the atomic routine, use vs1053 to decode audio, ucosII to do dual thread
- [New Year's Taste Competition] + Share your New Year's Eve dinner, wishing everyone a happy New Year! All the best!
- High integration, high measurement speed, high precision, how does a flow cytometer achieve maximum performance?
- The msp430 microcontroller sends floating point numbers to the host computer through the serial port
- MTK7686 serial port transparent transmission
- The amplifier has a high PSRR, so there is no need to worry about power supply variations?
- How to design the mobile phone power-on circuit
- Request expert explanation
- C2000 floating point calculation notes - differences between CPU and CLA and error handling techniques