Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4389822
  • 博文数量: 1148
  • 博客积分: 25453
  • 博客等级: 上将
  • 技术积分: 11949
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-06 21:14
文章分类

全部博文(1148)

文章存档

2012年(15)

2011年(1078)

2010年(58)

分类: 嵌入式

2011-04-16 15:27:49

主要参考:U-BOOT-2010.06移植到TQ2440.pdf  这个资料

整理的一些资料:
u-boot-2011.03在TQ2440上的移植(3)--支持norflash启动
嵌入式Linux之我行——u-boot-2009.08在2440上的移植详解(二)

EN29LV160AB  nor flash  开发板

1.修改u-boot 提示符


   gedit include/configs/smdk2440.h

  1. /*
  2.  * Miscellaneous configurable options
  3.  */
  4. #define    CONFIG_SYS_LONGHELP                /* undef to save memory        */
  5. #define    CONFIG_SYS_PROMPT        "[SMDK2440]# "    /* Monitor Command Prompt    */  修改
  6. #define    CONFIG_SYS_CBSIZE        256        /* Console I/O Buffer Size    */
  7. #define    CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */

2.配置 nor falsh

发现自己的天嵌TQ2440板子所使用的Nor flash 芯片(NOE的EN29LV160AB)与smdk2410默认使用的芯片(AMD的AM29LV400B或AM29LV400)除了大小不 一样外,其它如命令序列、工作方式等都是一样的。所以U-boot源码中关于nor flash的部分修改的不多。
 
因为已经知道自己板子的Nor flash芯片是Bottom boot模式,分成35个扇区(使用J-LINK烧写板载光盘的映像时,可以看到相应的芯片信息),前4个扇区的大小分别为 16KB,8KB,8KB,32KB,后31个扇区的大小都是64K。所以正好可以使用board/smdk2410目录下的flash.c,直接对芯片 厂商以及ID进行赋值的方式。(当然还有更好的方式就是读取芯片信息,判断出芯片厂商和ID再进行以后相应的操作,以后有空用这种方式)。


gedit include/configs/smdk2440.h

  1. /*-----------------------------------------------------------------------
  2.  * FLASH and environment organization
  3.  */
  4. #if 0   修改为 CONFIG_AMD_LV800
  5. #define CONFIG_AMD_LV400    1    /* uncomment this if you have a LV400 flash */
  6. #endif
  7. #define CONFIG_AMD_LV800    1    /* uncomment this if you have a LV800 flash */


  8. #define CONFIG_SYS_MAX_FLASH_BANKS    1    /* max number of memory banks */
  9. #ifdef CONFIG_AMD_LV800
  10. #define PHYS_FLASH_SIZE        0x00200000 /* 2MB */
  11. #define CONFIG_SYS_MAX_FLASH_SECT    (19)    /* max number of sectors on one chip */
  12. #define CONFIG_ENV_ADDR        (CONFIG_SYS_FLASH_BASE + 0x0F0000) /* addr of environment */
  13. #endif
  14. #ifdef CONFIG_AMD_LV400
  15. #define PHYS_FLASH_SIZE        0x00080000 /* 512KB */
  16. #define CONFIG_SYS_MAX_FLASH_SECT    (11)    /* max number of sectors on one chip */
  17. #define CONFIG_ENV_ADDR        (CONFIG_SYS_FLASH_BASE + 0x070000) /* addr of environment */
  18. #endif

  19. /* timeout values are in ticks */
    #define CONFIG_SYS_FLASH_ERASE_TOUT    (5*CONFIG_SYS_HZ) /* Timeout for Flash Erase */
    #define CONFIG_SYS_FLASH_WRITE_TOUT    (5*CONFIG_SYS_HZ) /* Timeout for Flash Write */

    #define    CONFIG_ENV_IS_IN_FLASH    1
    #define CONFIG_ENV_SIZE        0x20000    /* Total Size of Environment Sector */



3.配置下载
make mrproper
make smdk2440_config
make all

4.显示

  1. Now, Downloading [ADDRESS:33000000h,TOTAL:98790]
  2. RECEIVED FILE SIZE: 98790 (96KB/S, 1S)
  3. ## Starting application at 0x33000000 ...▲

  4. U-Boot 2010.06-rc1 ( 4鏈?16 2011 - 15:23:12)

  5. DRAM: 64 MiB
  6. Flash: 2 MiB
  7. *** Warning - bad CRC, using default environment

  8. In: serial
  9. Out: serial
  10. Err: serial
  11. Net: CS8900-0
  12. [SMDK2440]# ?
  13. ? - alias for 'help'
  14. base - print or set address offset
  15. bdinfo - print Board Info structure
  16. boot - boot default, i.e., run 'bootcmd'
  17. bootd - boot default, i.e., run 'bootcmd'
  18. bootelf - Boot from an ELF image in memory
  19. bootm - boot application image from memory
  20. bootp - boot image via network using BOOTP/TFTP protocol
  21. bootvx - Boot vxWorks from an ELF image
  22. cmp - memory compare
  23. coninfo - print console devices and information


因为使用的是 AM flash 原先的配置

  1. [SMDK2440]# flinfo

  2. Bank # 1: AMD: 1x Amd29LV800BB (8Mbit)  ##这里还是 AMD nor flash 芯片,
  3.   Size: 2 MB in 19 Sectors
  4.   Sector Start Addresses:
  5.     00000000 (RO) 00004000 (RO) 00006000 (RO) 00008000 (RO) 00010000 (RO)
  6.     00020000 00030000 00040000 00050000 00060000
  7.     00070000 00080000 00090000 000A0000 000B0000
  8.     000C0000







阅读(1267) | 评论(0) | 转发(2) |
给主人留下些什么吧!~~