u-boot
是universal bootloader
,也就是通用的
bootloader。
u-boot 原始碼檔案下包括一些目錄檔案和文字檔案,這些檔案可分為
」與平台相關的檔案」和
」與平台無關的檔案
」,其中common
資料夾下的檔案就是與平台無關的檔案;與平台相關的檔案又分為
cpuarch
目錄下的檔案就是與
cpu級相關的檔案,而
board
、drivers
、include
等資料夾下的檔案都是與板級相關的檔案。我們在移植的過程中,需要修改的檔案也就是這些與平台相關的檔案。
記憶體採用了4片
64mbit x 16 i/os
的1gb ddr2 sdram。
①解壓原始碼後進入目錄執行make forlinx_linux_config:
curdir 為 makefile 內嵌變數,即當前路徑 參考
srctree := $(curdir)
mkconfig := $(srctree)/mkconfig
ifneq ($(objtree),$(srctree))
obj := $(objtree)/
src := $(srctree)/
else
obj :=
src :=
endif
export obj src
forlinx_linux_config : unconfig
@$(mkconfig) $(@:_config=) arm s5pc11x smdkc110 samsung s5pc110 linux
@echo "text_base = 0xcc800000" > $(obj)board/samsung/smdkc110/config.mk
等效於mkconfig forlinx_linux arm s5pc11x amdkc110 samsung s5pc110 linux
board/samsung/smdkc110/config.mk中內容為"
text_base = 0xcc800000
"②mkconfig分析:
#$0 $1 $2 $3 $4 $5 $6 $7
#mkconfig forlinx_linux arm s5pc11x smdkc110 samsung s5pc110 linux
board_name="" # name to print in make output
#$#為引數個數,排除掉-- -a -n選項
while [ $# -gt 0 ] ; do
case "$1" in
--) shift ; break ;;
-n) shift ; board_name="$" ; shift ;;
*) break ;;
esac
done
#board_name 設定為 forlinx_linux
[ "$" ] || board_name="$1"
#引數個數即不小於4,也不大於7
[ $# -lt 4 ] && exit 1
[ $# -gt 7 ] && exit 1
echo "configuring for $ board..."
if [ "$srctree" != "$objtree" ] ; then
#執行下方
else
cd ./include #進入include
rm -f asm
ln -s asm-$2 asm #設定asm-arm 指向 asm
firm -f asm-$2/arch
if [ -z "$6" -o "$6" = "null" ] ; then
ln -s $arch-$3 asm-$2/arch
else
ln -s $arch-$6 asm-$2/arch #設定arch-s5pc110 指向 asm-arm/arch
fi# create link for s5pc11x soc
if [ "$3" = "s5pc11x" ] ; then
rm -f regs.h
ln -s $6.h regs.h #s5pc110指向regs.h
rm -f asm-$2/arch
ln -s arch-$3 asm-$2/arch #arch-s5pc11x 指向 asm-arm/arch
fiif [ "$2" = "arm" ] ; then
rm -f asm-$2/proc
ln -s $proc-armv asm-$2/proc #proc-armv指向asm-arm/procfi#
# create include file for make
#echo "arch = $2" > config.mk
echo "cpu = $3" >> config.mk
echo "board = $4" >> config.mk
[ "$5" ] && [ "$5" != "null" ] && echo "vendor = $5" >> config.mk
[ "$6" ] && [ "$6" != "null" ] && echo "soc = $6" >> config.mk
#./include/config.mk中的內容
arch = arm
cpu = s5pc11x
board = smdkc110
vendor = samsung
soc = s5pc110
#then
echo >> config.h #建立config.h
else
> config.h # create new config file
fiecho "/* automatically generated - do not edit */" >>config.h
#forlinx add
if [ "$7" = "linux" ]
then
echo "#define config_linux_forlinx 1" >>config.h
else
echo "#define config_android_forlinx 1" >>config.h #linux下輸入這一句
fi#echo "#include " >>config.h
#forlinx change for linux and android
echo "#include " >>config.h #輸入
#./include/config.h的內容
/* automatically generated - do not edit */
#define config_linux_forlinx 1
#include #
綜上,即:
board_name 設定為 forlinx_linux
設定./include/asm-arm 指向 ./include/asm
設定./include/arch-s5pc110 指向 ./include/asm-arm/arch 後又被替換
s5pc110指向regs.h
arch-s5pc11x 指向 asm-arm/arch
proc-armv指向asm-arm/proc
新建./include/config.mk中的內容
arch = arm
cpu = s5pc11x
board = smdkc110
vendor = samsung
soc = s5pc110
新建./include/config.h的內容
/* automatically generated - do not edit */
#define config_linux_forlinx 1
#include
mini210的uboot編譯使用
或者通過git獲取源 倉庫 git clone git git checkout b mini210 linaro 2011.10 stable origin mini210 linaro 2011.10 stable 2.編譯 2.1 從mini210光碟上獲取交叉編譯工具鏈arm linux g...
ok6410移植u boot 2012 10筆記
1.先根據這個文件移植nandflash,網絡卡部分 其它部分參考下面第四步的文章 2.以上是解決raise signal 8 caught的替換 3.關於nand的移植,文件中還差一步 在 driver mtd nand nand base.c 的 int nand scan tail struc...
嘗試編譯x210的uboot
x210的編譯首先要經過配置,之後才能進行編譯。我這裡使用的是九鼎官方已經做好的x210的uboot 進行編譯得到u boot.bin。uboot的或得路徑可以是從uboot的官方 可以是soc官方 也可以是你用的開發板的廠家。編譯過程 1 在linux源生目錄下配置編譯 1 x210移植過的ubo...