9.1. Find the official transplant Uboot
(1) The original source of Uboot is downloaded on the Uboot official website. The source code may not be available for the ported version of the Development Board we are currently using, and may not even be able to find the ported version of the SOC that we are using on our current Development Board.
(2) After the SOC manufacturer launches a SOC and companion Development Board, the manufacturer's engineers will go to the Uboot website to download the Uboot source code, and then follow their own SOC and supporting development Board for further porting. For example, Samsung's s5pv210 chip supporting the development Board is SMDKV210.
(3) The specific Development Board vendors will first buy Samsung's SMDKV210 Development Board, and then cut, that is, according to the company's business to remove useless interface functions, hardware replacement or reduced configuration. After hardware replacement and feature clipping, the new Development Board is different from the Samsung official SMDKV210, so the uboot is not the same, but because the SOC is the same, the similarity between the two is more than 60%. Therefore, the specific Development Board suppliers will be transplanted in the Samsung SMDKV210 Uboot as a blueprint to transplant their own Development board on the uboot transplant version. General purchase of the Development Board when the manufacturer of the BSP in the Uboot source code is the manufacturer's own transplant.
(4) Summary: Uboot source code generally has 3 ways to obtain, divided into Uboot official, SOC official, the official Development Board.
9.2. Configuring compilation in Linux source directory
(1) The official uboot of the specific Development Board is generally in the BSP that it provides. The BSP is the board support package, which is a board-level supporting pack, typically provided by the Development Board vendor, which is the source code, documentation, tutorials, tools, and so on for the Development Board.
(2) The entire BSP package file to the Linux source directory to extract, do not unzip in the shared folder in Windows. If you need to compile the project, you must not be in the Windws shared folder, otherwise there will be an error. Because the entire project will be configured to compile the use of symbolic links, but the windows of wood symbolic links such things, and the file name of the case, because the differences between the two systems will cause the occurrence of the file name is not found this phenomenon.
(3) It is recommended to maintain a copy of Uboot under Linux and under Windows respectively. We can do uboot compilation in Linux and Uboot Code view analysis in Windows. Because there are good tools such as sourceinsight in Windows that help us to view and edit code, it is cumbersome to edit and view the code under Linux.
9.3. Configuration Uboot
(1) large and complex projects such as Uboot and Linux kernel cannot be compiled directly, they all need to be configured before they can be compiled.
(2) Configure the cross-compilation tool chain path; Enter the uboot source root directory, open the Makfile, configure the cross-compilation tool chain path:
Ifeq ($ (ARCH), arm)
Cross_compile =/usr/local/arm/ arm-2009q3/bin/arm-none-linux-gnueabi-
(3) Configure the GEC210 hardware platform, enter the Uboot source root directory, execute the configuration command "make Gec210_nand_config" in the root directory, if it appears "Configuring for Gec210_nand board ..." indicates that the Uboot configuration is correct, and the GEC210 Development Board is officially uboot using "Make Gec210_nand_config" when the configuration command is properly compiled. The x210 Development Board is required to perform the configuration command "make X210_sd_config", and the correct message is "Configuring for X210_SD board ...".
9.4. Compile Uboot Get Uboot.bin
(1) Before compiling, you must check that the ARM-LINUX-GCC installation is correct, including version checking and installation path checking.
(2) First check that the compilation environment is installed with the appropriate cross-compiler toolchain version, we are using ARM-2009Q3, because it is the official Samsung and GEC210 Development Board manufacturers to develop uboot when used. Unzip the ARM-2009Q3 directly into the "/usr/local/arm/" directory. Next check that the path setting of the cross-compilation toolchain in Makefile in the Uboot root directory is consistent with the path of the cross-compilation tool chain we actually installed, or the compilation will be faulted.
(3) Compile, enter the Uboot source root directory, execute the command "MAKE-J2" that is to do multi-threaded compilation, if the host is a multi-core computer, can improve the speed of the compilation.
(4) To clear the uboot source package; sometimes we need to clean up the source works in order to formally release, you can do "make clean" (light cleanup, equivalent to the reverse operation of make) or "Make Distclean" (heavy purge, equivalent to make Gec210_nand_config of the reverse operation).
9.5. Why Use Sourceinsight
(1) For a real project, there are often hundreds of. c files and. h files, the code is very large, the correlation between the code is very complex, the code reading, analysis is becoming more and more difficult. For example, a function is referenced in the current location, but the implementation of the function is stored in a file in another directory, so that the search and reading of the code is very difficult, we need to have a tool to solve the problem, so there is sourceinsight.
9.6. Building projects and adding documents
(1) First, I first in the target source of the root directory of the new "Si_proj" folder for the SI project file, and then in the SI software new project: "Project->new Project", Enter the project name (corresponding to the proposal and project name) and the location of the project file (the catalog of source code files managed in the project document and project can be different (recommended), such as "Uboot_jiuding" (Project name) and "D:\winshare\uboot\ Uboot_jiuding\si_proj "(Project file storage directory). Then click OK to go to new project settings, accept the default settings and click "OK" to proceed to the next step.
(2) Add files to the project, select "Uboot-jiuding" on the left, then click "Add Tree" on the right sidebar to add 1054 files, then click "Close".
9.7. Fix new type file not recognized add
(1) The SI software can only find the type of file it has identified, and it cannot be seen for file types it does not recognize, such as start. s file is not included, because SI default does not recognize the. s suffix of the file.
(2) The 1th method is to manually configure itself: In the "options->document options", then select "C Source file" in the "Document Type" drop-down option, and then in the right "file filter" text box, enter "* . S ", then click" Close "; the 2nd method is to load the configuration file: The prerequisite is that the configuration file must exist such as" Astonsicfg "," Options->load configration->load ", and then select the appropriate configuration file such as" Astonsicfg ", click" Open ".
(3) After adding the new type configuration, the new type file needs to be added to the project file, in "Project->add and Remove project Files", on the "file Name" input drive letter (such as "D:") and hit enter to switch the drive letter path, Then select "Uboot-jiuding" in the directory below, then click on the right sidebar "add Tree" to add, found that added 19 additional files, and then click "Close".
9.8. Parse the project file
(1) Si working principle is that all the symbols in the source code in advance to all the resolution stored in the database, and then when we do the symbol lookup, SI is not to check the file but to check the database to help us index symbols, so Si search speed is very fast.
(2) Therefore, we use SI to consult the source code before the source code should be pre-parsing. In the menu bar "Project->syneronize Files", select the above 2 options namely "Add new Files automatically" and "Remove missing files from Project", then click "OK" Can.