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 <d.mueller@elsoft.ch>
 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

即可编译

 

 

posted on 2018-11-03 11:06  风_行者7  阅读(352)  评论(0编辑  收藏  举报

导航