Chinaunix首页 | 论坛 | 博客
  • 博客访问: 152671
  • 博文数量: 22
  • 博客积分: 1456
  • 博客等级: 上尉
  • 技术积分: 252
  • 用 户 组: 普通用户
  • 注册时间: 2010-04-25 00:08
个人简介

ddd

文章存档

2011年(1)

2010年(21)

我的朋友

分类: 嵌入式

2010-05-29 18:34:01

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

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

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

//#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_S3C2440_NAND_BOOT       1

#define CONFIG_S3C2410_NAND_SKIP_BAD   1

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

 

删除对cs8900的支持:

/* Hardware drivers*/

#if 0

#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

 

添加对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

//#define CONFIG_CMD_REGINFO

//#define CONFIG_CMD_FAT

 

#define CONFIG_BOOTARGS         "noinitrd root=/dev/nfs rw nfsroot=202.204.53.32:/opt/mini2440/nfs  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.182

#define CONFIG_SERVERIP         202.204.53.181

#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"

 

修改载入内存地址:

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

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

 

#define CONFIG_ENV_IS_IN_NAND 1

#define CONFIG_ENV_OFFSET               0X60000

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

 

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

                                              "128k(params)," \

                                              "5m(kernel)," \

                                              "-(root)"

 

#define NAND_MAX_CHIPS 1

#define CONFIG_MTD_NAND_VERIFY_WRITE

 

 

# 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

 

#define STACK_BASE 0x33f00000

#define STACK_SIZE 0x10000

 

/* NAND Flash Controller */

#define CONFIG_SYS_NAND_BASE 0x4E000000

#define NAND_CTL_BASE 0x4E000000

#define bINT_CTL(Nb) __REG(INT_CTL_BASE + (Nb))

/* Offset */

#define oNFCONF 0x00

 

# if defined(CONFIG_S3C2440)

#define CONFIG_S3C2440_NAND_BOOT 1

/* Offset */

#define oNFCONT 0x04

#define oNFCMD 0x08

#define oNFADDR 0x0c

#define oNFDATA 0x10

#define oNFSTAT 0x20

#define oNFECC 0x2c

#define rNFCONF (*(volatile unsigned int *)0x4e000000)

#define rNFCONT (*(volatile unsigned int *)0x4e000004)

#define rNFCMD (*(volatile unsigned char *)0x4e000008)

#define rNFADDR (*(volatile unsigned char *)0x4e00000c)

#define rNFDATA (*(volatile unsigned char *)0x4e000010)

#define rNFSTAT (*(volatile unsigned int *)0x4e000020)

#define rNFECC (*(volatile unsigned int *)0x4e00002c)

#endif

 

# if defined(CONFIG_S3C2410)

#define CONFIG_S3C2410_NAND_BOOT 1

/* Offset */

#define oNFCONF 0x00

#define oNFCMD 0x04

#define oNFADDR 0x08

#define oNFDATA 0x0c

#define oNFSTAT 0x10

#define oNFECC 0x14

#define rNFCONF (*(volatile unsigned int *)0x4e000000)

#define rNFCMD (*(volatile unsigned char *)0x4e000004)

#define rNFADDR (*(volatile unsigned char *)0x4e000008)

#define rNFDATA (*(volatile unsigned char *)0x4e00000c)

#define rNFSTAT (*(volatile unsigned int *)0x4e000010)

#define rNFECC (*(volatile unsigned int *)0x4e000014)

#define rNFECC0 (*(volatile unsigned char *)0x4e000014)

#define rNFECC1 (*(volatile unsigned char *)0x4e000015)

#define rNFECC2 (*(volatile unsigned char *)0x4e000016)

#endif

 

 

#endif  /* __CONFIG_H */

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