A: U-boot to build your own platform before the transplant:
Related documents:
1.u-boot-2010.03/board/samsung///This directory needs to create its own board-level directory fsc100
Cp–a smdkc100 fsc100//Direct copy files need to be modified and renamed
2./U-BOOT-2010.03/BOARD/SAMSUNG/FSC100//Enter the directory you just copied, create the necessary C files
MV smdkc100.c fsc100.c//Direct renaming of available files inside
3. Vim Makefile//Compile the new C file and modify the Makefile in the Development Board directory
Cobjs-y: = FSC100.O//Configure the. O in
4. CD include/configs//configuration header file required to build the development Board in include/configs/
CP smdkc100.h Fsc100.h//Make a copy of the original available header file.
5.u-boot-2010.03/makefile//Change the Makefile file in the top-level directory, configure cross-tool chaining and Development Board-related configurations
5.1:ifeq ($ (Hostarch), $ (ARCH))//modified into the following form, where Hostarch can be configured in Config.mk in u-boot-2010.03 directory
Cross_compile? =
endif
Ifeq (ARM, $ (ARCH))
Cross_compile? = arm-cortex_a8-linux-gnueabi-
endif
5.2:fsc100_config:unconfig//Add fsc100 configuration information
@$ (mkconfig) $ (@:_config=) arm arm_cortexa8 fsc100 Samsung
S5pc1xx
Mkconfig =./mkconfig fsc100 arm arm_cortexa8 fsc100 Samsung S5PC1XX
$ $4 $ $6
Mkconfig =./mkconfig indicates that all files in the current directory can be seen
Three main parts of the work: (The resolution of the relevant parameters above is in the main directory: mkconfig), the definition of the above parameters are: include/config.mk, decided to compile those directories, eventually run in makefile
A. Creating a soft link
CD include
ASM---> Asm-arm
Asm/arch---> asm/arch-s5pc1xx
Asm-arm/proc---> ASM/PROC-ARMV
Cases:
Command.c
#include <asm-i386/config.h>
#include <asm/config.h>
B. Created include/config.mk decide which directories to compile
obj + = cpu/$ (CPU)/START.O
C. created Include/config.h to put some of the default things in,
In the Include/configs/fsc100.h decided u-boot to compile those things, for example: #define CONFIG_CMD_NET 1
Comments on the above:
Fsc100_config: The name used when configuring the board//The following parsing of the relevant parameters is in the main directory: Mkconfig
Architecture of the ARM:CPU (ARCH)
The type of ARM_CORTEXA8:CPU (CPU), which corresponds to the CPU/ARM_CORTEXA8 subdirectory
FSC100: Model number of the Board (BOARD), corresponding to: board/samsung/fsc100, or the subsequent compilation does not pass
Samsung: Developer/Reseller (vender)
S5PC1XX: On-chip system (SOC)
6.u-boot-2010.03//Back to the source code after the extraction of the main directory compiled, only the compilation through the next migration,
At this point the platform has been set up, note: Source extract do not put in the root directory, remember, this will cause permissions issues
$ make Distclean
$ make Fsc100_config
$ make
II: How to add a driver (function) in U-boot
Cases:
Drivers/net/dm9000x.c
Drivers/net/makefile
|-cobjs-$ (config_driver_dm9000) + = DM9000X.O
You need to configure the config_driver_dm9000 value to Y by trying to get the dm9000x.c compiled link in.
*************************************************************
* Change Include/configs/fsc100.h
* Plus # define config_driver_dm9000
*
* *.h is included in the source code #ifdef config_driver_dm9000
Dm9000_init ();
#endif
**************************************************************
Synchronous generation when make creates uboot (primary makefile)
$ (obj) include/autoconf.mk: $ (obj) include/config.h
446 @$ (Xecho) generating [email protected]; \
447 set-e; \
448:extract the config macros; \
449 $ (CPP) $ (CFLAGS)-DDO_DEPS_ONLY-DM Include/common.h | \
Sed-n-F tools/scripts/define2mk.sed > [email protected] && \
451 MV [email protected] [email protected]
*************************************************************
*include/autoconf.mk
*|-config_driver_dm9000=y
*
* *.mk is makefile contains cobjs-$ (config_driver_dm9000) + = DM9000X.O
**************************************************************
Set up an index file in Ubuntu: tags
$ make tags//this creates the Ctags
[Email protected]:~/u-boot-2010.03$ make tags
Ctags-w-o ctags ' Find Tools Examples/standv .....
...................
..................
-name ' *. [ChS] '-print '
[Email protected]:~/u-boot-2010.03$ ls-l ctags
-rw-rw-r--1 Linux linux 17325816 Mar 06:03 ctags
[Email protected]:~/u-boot-2010.03$
With the index file, we can trace it in a very good way.
To be able to use ctags every time, you need to configure:
Vim/home/linux/.vimrc
Add at the bottom: set tags=/home/linux/u-boot-2010.03/ctags
Comment out directly in front add ", column as:" Set Tags=/home/linux/u-boot-2010.03/ctags
Then you want to find it in the VIM editor using the command: Vim-t < find name >---> Vim-t main_loop
In the vim inside the index jump method: Hold down the CTRL mouse left click, or CTRL + '] '
Return time: CTRL + ' t '
U-boot's command mechanism
U_boot_cmd (
Myled, Config_sys_maxargs, 1, do_myled,
"Myled-my Command",
"myled [on/off]"
42);
#define U_BOOT_CMD (NAME,MAXARGS,REP,CMD,USAGE,HELP) \
113 cmd_tbl_t __u_boot_cmd_# #name struct_section = {#name, Maxargs, rep, cmd, usage)
#define Struct_section __attribute__ ((Unused,section (". U_boot_cmd"))
cmd_tbl_t __u_boot_cmd_my_led struct_section = {
"Myled",
Config_sys_maxargs,
1,
Do_myled,
"Myled-my Command",
"myled [on/off]"
}
Understand the U-boot start-up process: Start.s,nand flash,iram,dram Relationship!
*************************************************************************************************************** ************************************************
*************************************************************************************************************** ************************************************
*************************************************************************************************************** ************************************************
*************************************************************************************************************** ************************************************
The establishment of the U-boot platform, the addition of the driver, the creation of the index and the implementation of the command mechanism.