u-boot2011.12在mini2440上的移植1

来源:互联网 发布:华扬资本长期动态优化 编辑:程序博客网 时间:2024/06/05 04:57
u-boot2011.12在mini2440上的移植1
   
        以u-boot中的smdk240为原型移植到mini2440, gcc版本4.4.3,u-boot版本2011.12
        1. 复制board/samsung/smdk2410 到board/samsung/mini2440; 将board/samsung/mini2440下的smdk2410.c重命名为mini2440.c; 修改board/samsung/mini2440的Makefile,将COBJS    := smdk2410.o改为COBJS    := mini2440.o;
        2. 复制include/configs/smdk2410.h到include/configs/mini2440.h
        3. 在根目录下的boards.cfg中添加一行,如下:

          mini2440                   arm         arm920t     -                   samsung        s3c24x0

          4. 执行

          #make mini2440_config

          #make

          可正常编译


         5. 修改mini2440.h, 将

         #define CONFIG_S3C2410        /* specifically a SAMSUNG S3C2410 SoC */
         #define CONFIG_SMDK2410        /* on a SAMSUNG SMDK2410 Board */

        修改为
        #define CONFIG_S3C2440
        #define CONFIG_MINI2440
        #define CONFIG_SKIP_LOWLEVEL_INIT

       将

        #define CONFIG_SYS_PROMPT    "smdk2410 # "

       修改为
       #define CONFIG_SYS_PROMPT    "mini2440 # "

       在最后添加
       #define DEBUG

       6. 修改时钟
       参照http://blog.csdn.net/reille/article/details/6539735修改start.s和mini2440.c

       7.编译,将出现如下错误:
s3c2410_nand.c: In function 's3c2410_hwcontrol':
s3c2410_nand.c:57: warning: implicit declaration of function 's3c2410_get_base_nand'
s3c2410_nand.c:57: warning: initialization makes pointer from integer without a cast
s3c2410_nand.c:72: error: dereferencing pointer to incomplete type
s3c2410_nand.c:72: error: dereferencing pointer to incomplete type
s3c2410_nand.c:75: error: dereferencing pointer to incomplete type
s3c2410_nand.c:75: error: dereferencing pointer to incomplete type
s3c2410_nand.c: In function 's3c2410_dev_ready':
s3c2410_nand.c:85: warning: initialization makes pointer from integer without a cast
s3c2410_nand.c:87: error: dereferencing pointer to incomplete type
s3c2410_nand.c: In function 'board_nand_init':
s3c2410_nand.c:129: warning: initialization makes pointer from integer without a cast
s3c2410_nand.c:150: error: dereferencing pointer to incomplete type
s3c2410_nand.c:153: error: dereferencing pointer to incomplete type
s3c2410_nand.c:154: error: dereferencing pointer to incomplete type
make[1]: *** [s3c2410_nand.o] 错误 1

        系开启nand命令所致,将#define CONFIG_CMD_NAND注释掉,名注释掉
        #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
    
       为方便ram中执行修改#define CONFIG_SYS_TEXT_BASE    0x0 为
      #define CONFIG_SYS_TEXT_BASE    0x32000000

      编译成功, 将u-boot.bin 下在到ram中(地址
 0x32000000)执行 出现如下效果:

U-Boot 2011.12 (Apr 05 2012 - 23:34:12)

U-Boot code: 32000000 -> 320341F0  BSS: -> 32045E78
monitor len: 00045E78
ramsize: 04000000
TLB table at: 33ff0000
Top of RAM usable for U-Boot at: 33ff0000
Reserving 279k for U-Boot at: 33faa000
Reserving 4160k for malloc() at: 33b9a000
Reserving 24 Bytes for Board Info at: 33b99fe8
Reserving 120 Bytes for Global Data at: 33b99f70
New Stack Pointer is: 33b99f60
RAM Configuration:
Bank #0: 30000000 64 MiB
relocation Offset is: 01faa000
WARNING: Caches not enabled
monitor flash len: 00039A28
dram_bank_mmu_setup: bank: 0
Now running in RAM - U-Boot at: 33faa000
Flash: fwc addr (null) cmd f0 00f0 16bit x 16 bit
fwc addr 0000aaaa cmd aa 00aa 16bit x 16 bit
fwc addr 00005554 cmd 55 0055 16bit x 16 bit
fwc addr 0000aaaa cmd 90 0090 16bit x 16 bit
fwc addr (null) cmd f0 00f0 16bit x 16 bit
JEDEC PROBE: ID 1 2249 0
fwc addr (null) cmd ff 00ff 16bit x 16 bit
fwc addr (null) cmd 90 0090 16bit x 16 bit
fwc addr (null) cmd ff 00ff 16bit x 16 bit
JEDEC PROBE: ID 7e ea00 0
*** failed ***
### ERROR ### Please RESET the board ###


第一阶段修改结束






参考:
http://blog.csdn.net/reille/article/details/6539616
http://blog.csdn.net/reille/article/details/6539735
http://hi.baidu.com/shanruo2008/blog/item/18c8ef2a9a7353275343c18c.html
http://hi.baidu.com/shanruo2008/blog/item/fbe3d80864ae49ce63d98677.html