Chinaunix首页 | 论坛 | 博客
  • 博客访问: 71101
  • 博文数量: 25
  • 博客积分: 116
  • 博客等级: 民兵
  • 技术积分: 135
  • 用 户 组: 普通用户
  • 注册时间: 2012-07-26 11:31
文章分类
文章存档

2013年(1)

2012年(24)

我的朋友

分类:

2012-08-09 10:34:29

移植U-Boot-2010.03到友善之臂mini2440(六)

(1) include/configs/mini2440.h添加对2440的宏定义:

#define CONFIG_ARM920T          1       /* This is an ARM920T Core      */

#define CONFIG_S3C24X0                1     /* in a SAMSUNG S3C24x0-type SoC  */

//#define      CONFIG_S3C2410         1      /* in a SAMSUNG S3C2410 SoC     */

//#define CONFIG_SBC2410X          1      /* on a friendly-arm SBC-2410X Board  */

添加对2440mini2440LED的支持

#define CONFIG_S3C2440          1       /* in a SAMSUNG S3C2410 SoC     */

#define CONFIG_MINI2440         1       /* on a friendly-arm mini2440 Board  */

#define CONFIG_MINI2440_LED     1  /* Use the LED on Board */

#define CONFIG_S3C2410_NAND_SKIP_BAD   1

 

(2)修改网卡的宏定义,注释掉CS8900的部分,添加对DM9000的支持

删除对cs8900的支持:

/* Hardware drivers*/

#if 0

#define CONFIG_NET_MULTI

#define CONFIG_DRIVER_CS8900    1       /* we have a CS8900 on-board */

#define CS8900_BASE             0x19000300

#define CS8900_BUS16            1 /* the Linux driver does accesses as shorts */

#endif

添加对DM9000的支持:

#define CONFIG_DRIVER_DM9000                  1

#define CONFIG_DM9000_USE_16BIT               1

#define CONFIG_DM9000_BASE                    0x20000300

#define DM9000_IO                             0x20000300

#define DM9000_DATA                           0x20000304

#define CONFIG_DM9000_NO_SROM           1

#undef CONFIG_DM9000_DEBUG

#define CONFIG_NET_MULTI                1

#define CONFIG_NET_RETRY_COUNT           20

 

3)添加对nand命令的支持:

#define CONFIG_CMD_ASKENV

#define CONFIG_CMD_CACHE

#define CONFIG_CMD_DATE

#define CONFIG_CMD_DHCP

#define CONFIG_CMD_ELF

#define CONFIG_CMD_PING

#define CONFIG_CMD_NAND

 

4) 修改tftpnfs 下载和挂载内核和文件系统的参数

#define CONFIG_BOOTARGS         "noinitrd root=/dev/nfs rw nfsroot=202.204.53.32:/opt/mini2440/root_qtopia ip=202.204.53.33:202.204.53.32::255.255.255.0 console=ttySAC0,115200 init=/linuxrc mem=64M"

#define CONFIG_ETHADDR          08:00:3e:26:0a:5b

#define CONFIG_NETMASK          255.255.255.0

#define CONFIG_IPADDR           202.204.53.33

#define CONFIG_SERVERIP         202.204.53.32

#define CONFIG_GATEWAYIP        202.204.53.1

/*#define CONFIG_BOOTFILE       "elinos-lart" */

#define CONFIG_BOOTCOMMAND      " tftp 0x30008000 zImage.img;bootm"

#define CONFIG_OVERWRITE_ETHADDR_ONCE

#define  CONFIG_EXTRA_ENV_SETTINGS                                       \

       "xujun=bmp d 70000\0 "                               \

       "stdin=serial\0"                                        \

       "stdout=serial\0"                                       \

       "stderr=serial\0"

 

5)修改载入内存地址:

#define CONFIG_SYS_LOAD_ADDR         0x30008000      /* default load address */

 

6)将环境参数储存在NandFlash里面

#define CONFIG_ENV_IS_IN_NAND    1

#define CONFIG_ENV_OFFSET               0x60000

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

 

7)添加对mini2440板子上的Nor Flash的支持

/* == LENGTH_UBOOT*/

#ifdef CONFIG_SST_VF1601

#define PHYS_FLASH_SIZE        0x00200000 /* 2MB */

#define CONFIG_SYS_MAX_FLASH_SECT      (32) /* max number of sectors on one chip */

#define CONFIG_ENV_ADDR     (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET) /* addr of environment */

#endif

 

8)对NandFlash参数的相关支持

#if defined(CONFIG_CMD_NAND)

#define CONFIG_NAND_S3C2410

#define CONFIG_SYS_MAX_NAND_DEVICE   1     /* Max number of NAND devices        */

 

#define CONFIG_SYS_NAND_BASE 0x4E000000

#define SECTORSIZE 512

#define SECTORSIZE_2K 2048

#define NAND_SECTOR_SIZE SECTORSIZE

#define NAND_SECTOR_SIZE_2K SECTORSIZE_2K

#define NAND_BLOCK_MASK 511

#define NAND_BLOCK_MASK_2K 2047

#define NAND_MAX_CHIPS 1

#define CONFIG_MTD_NAND_VERIFY_WRITE

#define CONFIG_SYS_64BIT_VSPRINTF         /* needed for nand_util.c */

#endif

 

9)分区参数

#define MTDIDS_DEFAULT "nand0=nandflash0"

#define MTDPARTS_DEFAULT "mtdparts=nandflash0:384k(bootloader)," \

                                         "128k(params)," \

                                         "5m(kernel)," \

                                         "-(root)"

10)对YAFFS的支持

#define ENABLE_CMD_NAND_YAFFS   1

#define ENABLE_CMD_NAND_YAFFS_SKIPFB   1

11GPIO  B口的设置

# if defined(CONFIG_MINI2440_LED)

/* GPIO */

#define GPIO_CTL_BASE 0x56000000

#define oGPIO_B 0x10

#define oGPIO_CON 0x0 /* R/W, Configures the pins of the port */

#define oGPIO_DAT 0x4 /* R/W, Data register for port */

#define oGPIO_UP 0x8 /* R/W, Pull-up disable register */

#endif

#endif  /* __CONFIG_H */

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