One of the DaVinci U-boot series: U-boot Introduction

Source: Internet
Author: User
The DM series of TI's digital multimedia platform integrates the arm and DSP dual-core processor: the DSP processor runs the DSP/BIOS operating system, and is responsible for audio/video coding and decoding algorithms and other graphics processing algorithms; the ARM processor runs the montavista
Linux operating system, responsible for device initialization and graphical user interface management. ARM processor-end montavista
Linux loading and startup requires bootloader to load the kernel from the flash space to the DDR space and start the Linux system. Bootloader is a program that runs before the OS Kernel runs. Through this Bootstrap program, hardware devices are initialized and memory space ing diagrams are established to make the system's hardware and software environment in a proper state, prepare for OS Kernel startup. At present, TI's dm6446 platform uses U-boot as the bootloader boot program.
I. Introduction to U-boot
U-boot, full name of universal boot loader, follows GPL (general public
License. U-boot not only supports embedded Linux system boot, but also supports NetBSD, VxWorks, QNX, RTEMS, Artos, and lynxos embedded operating systems. U-boot supports the processors of PowerPC, MIPS, x86, arm, NiO, XScale, and many other common systems. The development goal of the U-boot project is to support as many embedded processors and operating systems as possible.
Features of U-boot:
> Open source code;
> Supports multiple embedded operating system kernels, such as linuxnetbsd, VxWorks, QNX, RTEMS, Artos, and lynxos;
> Supports multiple processor generations, such as PowerPC, MIPS, x86, arm, Nios, and XScale;
> High reliability and stability;
> Highly flexible feature settings are suitable for U-boot debugging and different operating system boot requirements;
> Rich device driver source code, such as serial port, Ethernet, SDRAM, Flash, EEPROM, RTC, and keyboard;
> Rich development and debugging documents and powerful network technical support.
Ii. U-boot directory structure
> Board: Target Board-related files, mainly including SDRAM and flash drives;
> Common: General Code independent from the processor architecture, such as memory size detection and fault detection;
> CPU:
> Processor-related files. Such as the serial port, network port, LCD driver, and interrupt initialization files under the mpc8xx subdirectory;
> DRIVER: a general-purpose device driver, such as a CFI Flash Driver (which currently supports intel flash );
> DOC: U-boot instructions;
> Examples: instance programs running under U-boot, such as hello_world.c and timer. C;
> Include:
> The U-boot header file. The configuration header file related to the target board in the configs subdirectory is a file that is frequently modified during transplantation;
> Lib_xxx:
> The file related to the processor system, such as the lib_ppc and lib_arm directories, contains files related to the PowerPC and arm architectures;
> Net: file directories related to network functions, such as BOOTP, NFS, and TFTP;
> Post: directory of the self-check file for power-on, which has yet to be further improved;
> RTC: RTC driver;
> Tools: a tool used to create the U-boot S-RECORD and bin image files;
U-boot currently supports TI's dm6446 platform. In the Board/DaVinci directory, it contains devem target board files, including network and flash drivers.
DaVinci U-boot Series II: Application of U-boot on SEED-DVS6446 Platform
SEED-DVS6446 platform with U-Boot-1.2.0 version, for Nand
Flash, net, and DDR drivers are modified, and more U-boot commands are supported. The following uses the SEED-DVS6446 platform as an example to describe the common configuration of U-boot on this platform.
I. U-boot startup
1. Software Configuration
Open the serial Super Terminal (PC Super Terminal, HyperTerminal, teraterm) and configure the following parameters:
> Baud rate: 115200
> Data bit: 8
> Parity verification: None
> Stop bit: 1
> Data Stream Control: None
2. hardware configuration
> One end of the DB9 serial line is connected to the serial port of the DaVinci platform, and the other end is connected to the serial port of the PC;
> The Video Acquisition port of the DaVinci platform is connected to the camera or DVD as the video input;
> The video output port of the DaVinci platform is connected to the display device;
> The Network Interface of DaVinci platform is connected to a vro or other network interfaces through a network cable, or
PC network port connection;
> The DaVinci platform uses a 5v-5a power supply to start the system.
At this time, you can see some information about the dvs6446 platform on the serial port Super Terminal, such as arm, DDR clock frequency, and U-boot version.
Ii. U-boot download the kernel through TFTP and mount the Network File System
TFTP downloads the kernel and starts mounting the Network File System. That is, you can download the kernel boot through the TFTP server. The file system is mounted to the/opt/nfs file system directory that has been set up under the Linux server. The process is as follows:
1. The SEED-DVS6446 is powered on and displays the above startup information when "hit any key to stop" is displayed
Autoboot:
3 "press the Enter key, interrupt the system to automatically start, start parameter configuration, the following prompt is displayed: SEED-DVS6446_v1.2 #:
;
2. Configure the startup parameters and enter the following configuration parameters at the prompt: setenv bootargs mem = 120 m
Console = ttys0, 115200n8 root =/dev/nfs noinitrd rw ip = DHCP nfsroot = NFS
IP =/opt/nfs Video = dm64xxfbutput = pal
3. Set the IP address of the TFTP server and the IP address of dvs6446, and enter the following configuration at the prompt (the IP address of the TFTP server and the IP address of dvs6446 are configured according to the actual application ):
Setenv serverip _._._._
Setenv ipaddr _._._._
4. Download and start the kernel (by default, you have copied the Kernel File uimage to the root directory of the TFTP service), and configure download and start at the prompt:
TFTP 0x80800000 uimage, bootm 0x80800000
5. After the system is started, the Network File System is automatically mounted. After the system is started, the waiting for logon information is displayed.
Iii. configuration of VGA video output and compound video output through U-boot configuration parameters
SEED-DVS6446 supports compound video and VGA video output display, the default uses compound video output, the user can achieve VGA output through U-boot parameter configuration. Take the TFTP download kernel as an example to start the Mount Network File System. The detailed steps are as follows:
1. SEED-DVS6446 U-boot, display startup information, when show "hit any key to stop
Autoboot:
3 "press the Enter key, interrupt the system to automatically start, start parameter configuration, the following prompt is displayed: SEED-DVS6446_v1.2 #:
;
2. Configure the startup parameters and enter the following configuration parameters at the prompt: setenv bootargs mem = 120 m
Console = ttys0, 115200n8 root =/dev/nfs noinitrd rw ip = DHCP nfsroot = NFS
IP =/opt/nfs Video = dm64xxfb format = vgautput = pal
3. Set the IP address of the TFTP server and the IP address of dvs6446, and enter the following configuration at the prompt:
Setenv serverip _._._._
Setenv ipaddr _._._._
4. Download and start the kernel, and configure download and start at the prompt:
TFTP 0x80800000 uimage, bootm 0x80800000
5. The system is started after the configuration is completed, and the Network File System is automatically mounted. The VGA interface is connected to the VGA output port of the SEED-DVS6446 platform.
Vista Linux icon.
4. if u-boot is not required for direct installation from CCS to DDR, the general script file of CMD is as follows:
-Lrts32e. Lib
-L... \ CSL \ Arm \ Lib \ debug \ csl_davinciarm9.lib
-L... \ .. \ Lib \ davincievmbsl. Lib
-Stack 0x00000800
-Heap 0x00000800
Memory
{
Iram: O = 0x00000000 L = 0x00004000
DRAM: O = 0x00008000 L = 0x00004000
Aemif: O = 0x02000000 L = 0x02000000
DDR2: O = 0x80000000 L = 0x08000000
}
Sections
{
. BSS> DDR2
. Cinit> DDR2
. CIO> DDR2
. Const> DDR2
. Stack> DDR2
. Sysmem> DDR2
. Text> DDR2
. DDR2> DDR2
}
DaVinci U-boot Series 3: common U-boot commands and common environment variables
Common U-boot commands
? :
Obtain the help list of all commands or list a command.
Usage :? [Command...]
Note: lists the help information of commands. If no parameters are provided, lists all commands and brief descriptions.
Help:
Same?
Printenv:
Print environment variables.
Usage: printenv [name]
Note: The name is generally the name of the hiboot environment variable, or a user-defined variable. When the value is empty, delete the variable.
"Name". Otherwise, set the variable "name" and the value to "value ".
Saveenv:
Save the variable.
Usage: saveenv
Note: Save the variables and their values to flash.
Ping:
It is used to determine the network status of the target machine or the working status of the local machine.
TFTP:
Download files from the TFTP server to Ram or flash.
Usage: tftp addr File
Note: download the file to the RAM or flash Address ADDR. Note: When using TFTP, you must first set the network configuration and use setenv to configure ipaddr, netmask, and serverip parameters.
CP:
Copy memory.
Usage: CP [. B,. W,. L] Source Target count.
Note: copy the value of the memory region with the address source to the memory region of the address target. The size of the region is count. Source and target can be accessed by the address of SDRAM, it can also be the address range of flash. The actual copy size varies with commands. CP. B copy 1 xcount
Bytes. When CP is used, the default value is 4 xcount bytes.
Go:
Jump to the specified address and run the code.
Usage: Go ADDR [arg...]
Note: run the binary code at the ADDR address to pass the ARG parameter.
Reset:
Reset CPY Processor
Usage: reset
Bootm:
Set the runtime environment and run the binary code.
Usage: bootm [ADDR [arg...]
Note: The Code at ADDR must be a binary file processed by mkimage.
Erase:
Erased Flash content.
Usage 1: erase start end.
Description: deletes the content from start to end.
Note: The Flash erasure operation must be block-based, so the address start must be the actual address of a block, and the end address is the end address of a block, if the base address of Flash is 0x34000000 and the block size is 0x20000, the erase
0x34000000 0x3401ffff is operable, while erase 0x34000003 0x3401ffff or erase
0x34000000 0x3401ff00 cannot be operated.
Usage 2: erase N: SF [-Sl].
Description: deletes the content of Block N flash from the slice SF to the SL slice.
Usage 3: erase Bank N.
Erase the content of Block N flash.
Usage 4: erase all
Description: erased all flash contents.
Nand erase:
Erase NAND Flash Content
Usage: NAND erase start size
Nand write:
Used to write memory data into NAND Flash
Usage: NAND write sram_addr start size
Description: writes data from sram_addr to NAND Flash.
The space starting from the start address. The write size is size.
Common U-boot Environment Variables
Ipaddr:
Set the IP address of the dvs6446 Platform
Set: setenv ipaddr 192.168.253.53
Serverip:
Set the Server IP address, mostly used in TFTP
Note: setenv serverip 192.168.253.33
Bootargs:
OS startup parameters
Set: setenv bootargs mem = 120 m console = ttys0, 115200n8...
Explanation: Set transfer parameters, such as memory size, console, and root file system.
Bootcmd:
Set automatic and execute commands. The START delay is based on the value of bootdelay. If no bootdelay is set, the default delay is 3 seconds.
Note: setenv bootcmd bootm
0x23450000, that is, the code at 0x23450000 is automatically executed after startup.
Bootdelay:
Sets the auto-start delay time in seconds. This variable is valid only when the bootcmd variable is set. The value range is changed to an integer greater than or equal to-1. When it is set to-1, the auto-start function is disabled.
Note: setenv bootdelay 4; sets the auto-start latency of 4 seconds.
Note: setenv bootdelay-1; disable the auto-start function.
Tip: you can press any key to switch to the command line mode during the delay period. Note: Do not set the latency to 0 during product development and debugging. If you set the latency, you can use Ctrl + C to interrupt the program and enter the command line mode at the moment of startup.
Netmask:
Set the subnet mask.
Set: setenv netmask 255.255.255.0
Gatewayip:
Set the gateway.
Note: setenv gatewayip 192.168.253.1
Ethaddr:
Set the MAC address of the Ethernet NIC.
Set: setenv ethaddr XX: xx
Note: After setting ethaddr, run saveenv and restart to make the MAC Address Configuration valid.
Statement: the above article from http://www.tichinese.com/bbs/viewthread.php? Tid = 151 & extra = Page % 3d9, which is used only for learning.
Appendix:
Common uboot commands
Display environment variable: printenv
Save environment variable: saveenv
Set the Kernel File Name: setenv bootfile
UImage-dm355 where the uImage-dm355 is the corresponding file name
Set the kernel Startup Mode:
1. Start from the Network: setenv bootcmd 'tftp; boott'
2. Start from flash
For dm355: setenv bootcmd 'nboot 0x80700000 0
0x400000; bootm'
For dm6446: setenv bootcmd 'bootm 0x2040000'
Set bootargs:
Dm355:
File System: NFS; File System Path: nfsroot = 192.168.1.55:/home/filesys; IP: DHCP; input: analog input; Output NTSC
Setenv bootargs console = ttys0, 115200n8 noinitrd rw ip = DHCP
Root =/dev/nfs
Nfsroot = 192.168.1.55:/home/filesys, nolock mem = 100 m
V4l2_video_capture =: Device = tvp5146
Video = dm64xxfb: Output = NTSC
File System: NFS. File System Path: nfsroot = 192.168.1.55:/home/filesys; IP: DHCP; input: digital CMOS input; Output pal
Setenv bootargs console = ttys0, 115200n8 noinitrd rw ip = DHCP
Root =/dev/nfs
Nfsroot = 192.168.1.55:/home/filesys, nolock mem = 100 m
V4l2_video_capture =: Device = mt9t001
Video = dm64xxfb: Output = pal
File System: local flash; IP: fixed IP; input: digital CMOS input; Output pal
Setenv bootargs console = ttys0, 115200n8 noinitrd RW
Rootfstype = yaffs2
IP = 192.168.1.11: 192.168.1.55: 192.168.1.1: 255.255.255.0: 192.168.1.11: Off
Root =/dev/mtdblock3 nolock
Mem = 90 m v4l2_video_capture =: Device = mt9t001
Video = dm64xxfb: Output = pal
Dm6446:
File System: NFS; File System Path: nfsroot = 192.168.1.55:/home/filesys; IP: DHCP; input: analog input; Output pal
Setenv bootargs console = ttys0, 115200n8 noinitrd rw ip = DHCP
Root =/dev/nfs
Nfsroot = 192.168.1.55:/home/filesys, nolock mem = 38 m
V4l2_video_capture =: Device = tvp5146
Video = dm64xxfb: Output = pal
File System: local hard disk; IP: DHCP; input: analog input; Output pal
Setenv bootargs console = ttys0, 115200n8 noinitrd rw ip = DHCP
Root =/dev/hda1
Nfsroot = 192.168.1.55:/home/filesys, nolock mem = 38 m
V4l2_video_capture =: Device = tvp5146
Video = dm64xxfb: Output = pal
File System: NFS; File System Path: nfsroot = 192.168.1.55:/home/filesys; IP: fixed IP; input: analog input; Output NTSC
Setenv bootargs console = ttys0, 115200n8 noinitrd RW
IP = 192.168.1.240: 192.168.1.2 root =/dev/nfs
Nfsroot = 192.168.1.55:/home/filesys, nolock mem = 38 m
Video = dm64xxfb: Output = NTSC v4l2_video_capture =: Device = tvp5146
File System: local hard disk; IP: fixed IP; input: analog input; Output pal
Setenv bootargs console = ttys0, 115200n8 noinitrd RW
IP = 192.168.1.240: 192.168.1.2 root =/dev/hda1
Nfsroot = 192.168.1.55:/home/filesys, nolock mem = 38 m
V4l2_video_capture =: Device = tvp5146
Video = dm64xxfb: Output = pal
Burn the kernel to flash
Dm355:
TFTP 80700000 uImage-dm355: where the uImage-dm355 is the corresponding file name
Nand erase 400000 200000
Nand write 0x80700000 0x400000 0x200000
Setenv bootcmd 'nboot 0x80700000 0 0x400000; bootm'
Dm6446
TFTP
Erase 0x2040000
+ 0x157fb0 (0x157fb0 indicates the size of the corresponding kernel file, which can be calculated using the TFTP Command)
Setenv bootcmd 'bootm 0x2040000'
CP. B 0x80700000 0x2040000
0x157fb0 (where 0x157fb0 is the size of the corresponding kernel file, which can be measured using the TFTP Command)
Common Linux commands
Path switching command:
Display the current directory path
PWD
Go to the/root/encode directory.
CD/root/encode
If the current directory is/root
Enter:
CD encode to enter the/root/encode directory
Driver mount command:
View mobile devices mounted on the System
Fdisk-l
Mount the USB device (/dev/sda1) to the MNT/USB directory.
Mount/dev/sda1/mnt/USB
Copy command:
Copy a file from directory A (/root/encode) to directory B (mnt/USB)
CP/root/encode/test. MPEG4 MNT/USB
Process Termination command
Display System Process: PS-
Terminate a process: Kill 996 (996 is the current PID Number of a process)
Application Execution command
Execute the application encode
./Encode
Encode
./Encode & (in offline dm355 mode, we recommend that you run the application in this mode. You can run the kill command to terminate the process)
Packaging command
Tar-zcf a.tar.gz B (where B is the directory to be packaged, and a is the name of the compressed package)
Unpacking command
Tar-xzf ti-davinci.tar.gz (where
Name of the ti-davinci.tar.gz to unpackage, decompress in the current directory

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.