1. 程式人生 > >u-boot-2014.10移植(1)

u-boot-2014.10移植(1)

 1 /***************************************************
 2 
 3 *u-boot版本 :u-boot-2014.10
 4 
 5 *gcc版本    :/home/flinn/tools/4.4.3/bin/arm-none-linux-gnueabi-
 6 
 7 *
 8 
 9 *伺服器     :ubuntu14.05
10 
11 *
12 
13 *編譯命令   :make smdk2440_config;make
14 
15 *Note(s)    : 不要使用gcc-4.3.2(坑)
16 
17 **************************************************
*/

 

建立單板

 tar xvf u-boot-2014.10.tar.bz2
    cd u-boot-2014.10/
   
    cp -r board/samsung/smdk2410/ board/samsung/smdk2440/
    mv board/samsung/smdk2440/smdk2410.c board/samsung/smdk2440/smdk2440.c
    vim board/samsung/smdk2440/Makefile

1
obj-y := smdk2440.o

cp include/configs/smdk2410.h include/configs/smdk2440.h
    
vim board/samsung/smdk2440/MAINTAINERS

 1 SMDK2440 BOARD
 2 
 3             M:      David Müller <[email protected]>
 4 
 5             S:      Maintained
 6 
 7             F:      board/samsung/smdk2440/
 8
9 F: include/configs/smdk2440.h 10 11 F: configs/smdk2440_defconfig

vim board/samsung/smdk2440/Kconfig

 1  if TARGET_SMDK2440
 2 
 3             config SYS_CPU
 4 
 5                     default "arm920t"            
 6 
 7             config SYS_BOARD
 8 
 9                     default "smdk2440"            
10 
11             config SYS_VENDOR
12 
13                     default "samsung"            
14 
15             config SYS_SOC
16 
17                     default "s3c24x0"            
18 
19             config SYS_CONFIG_NAME
20 
21                     default "smdk2440"            
22 
23             endif

vim arch/arm/Kconfig

1 config TARGET_SMDK2440
2          bool "Support smdk2440"
3 
4  
5 
6          source "board/samsung/smdk2440/Kconfig"

cp configs/smdk2410_defconfig configs/smdk2440_defconfig
            CONFIG_ARM=y
            CONFIG_TARGET_SMDK2440=y
    

    修改頂層Makefile

CROSS_COMPILE ?= /home/flinn/tools/4.4.3/bin/arm-none-linux-gnueabi-

修改配置檔案include/configs/smdk2440.h


   -#define CONFIG_S3C2410                /* specifically a SAMSUNG S3C2410 SoC */    -#define CONFIG_SMDK2410               /* on a SAMSUNG SMDK2410 Board */    +#define CONFIG_S3C2440    +#define CONFIG_SMDK2440   編譯
        make smdk2440_defconfig
        make (如果要看到詳細資訊, 比如連結地址,-pie等, 執行make V=1)
   
    如果修改smdk2440.h後編譯報錯 u-boot.lds:1: ignoring invalid character `#' in expression
        vim arch/arm/cpu/u-boot.lds
-#include <config.h>

以上單板建立完成, 初次編譯會報錯NAND和YAFFS相關的, 在smdk2440.h裡面去掉相關巨集
    編譯出來的u-boot.bin 約370K,前面的分割槽256K顯然不夠, 先作裁剪
    去掉:
        USB相關的

 //#define CONFIG_USB_OHCI

 //#define CONFIG_USB_OHCI_S3C24XX

 //#define CONFIG_USB_KEYBOARD

 //#define CONFIG_USB_STORAGE

 //#define CONFIG_DOS_PARTITION

 //#define CONFIG_CMD_USB

解壓格式

//#define CONFIG_BZIP2

//#define CONFIG_LZO

//#define CONFIG_LZMA

檔案系統相關的

//#define CONFIG_CMD_FAT

//#define CONFIG_CMD_EXT2

//#define CONFIG_CMD_UBI

//#define CONFIG_CMD_UBIFS

//#define CONFIG_CMD_MTDPARTS

//#define CONFIG_MTD_DEVICE

//#define CONFIG_MTD_PARTITIONS

//#define CONFIG_YAFFS2

//#define CONFIG_RBTREE

再次編譯後u-boot.bin檔案才160K左右,滿足我們的需求

執行:

make smdk2440_defconfig

make

即可編譯