#endif
#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */ #ifdef CONFIG_AMD_LV800 #define PHYS_FLASH_SIZE 0x00100000 /* 1MB */ #define CFG_MAX_FLASH_SECT (19) /* max number of sectors on one chip */ #define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x0F0000) /* addr of environment */ #elif defined CONFIG_AMD_LV400 #define PHYS_FLASH_SIZE 0x00080000 /* 512KB */ #define CFG_MAX_FLASH_SECT (11) /* max number of sectors on one chip */ #define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x070000) /* addr of environment */ #else #define PHYS_FLASH_SIZE 0x00200000 /* 2MB */ #define CFG_MAX_FLASH_SECT (99) /* max number of sectors on one chip */ #define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x1F0000) /* addr of environment */ #endif2) 在 /board/mini2440/makefile 中COBJS := mini2440.o flash.o去掉flash.o ,再次编译测试,出现错误:
cfi_flash.c:411: error: `CFG_MONITOR_BASE' undeclared (first use in this function)
在mini2440.h中加入宏定义
#define CFG_MONITOR_BASE 0
#define CFG_FLASH_CFI 1
再次编译,通过!烧写至开发板,打印出信息:
Flash: 2 MB
Flash: 2 MB输入命令 flinfo
得到信息:
SMDK2410 # flinfo
Bank # 1: CFI conformant FLASH (16 x 16) Size: 2 MB in 35 Sectors
Erase timeout 8192 ms, write timeout 1 ms, buffer write timeout 1 ms, buffer size 1
Sector Start Addresses:
00000000 (RO) 00004000 (RO) 00006000 (RO) 00008000 (RO) 00010000 (RO)
00020000 00030000 00040000 00050000 00060000
00070000 00080000 00090000 000A0000 000B0000
000C0000 000D0000 000E0000 000F0000 00100000
00110000 00120000 00130000 00140000 00150000
00160000 00170000 00180000 00190000 001A0000
001B0000 001C0000 001D0000 001E0000 001F0000 (RO)
SMDK2410 #
至此nor flash支持移植成功。
6.支持DM9000网卡smdk2410支持cs8900网卡,本开发板使用DM9000网卡,/drivers/dm9000x.c 是对应的网卡驱动。
1) 在mini2440.h中,将以下关于cs8900的宏注释掉,并添加DM9000宏定义:
/*
* 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
#define CONFIG_DRIVER_DM9000 1
编译,出现错误提示:
dm9000x.c:374: error: `DM9000_IO' undeclared (first use in this function)
dm9000x.c:445: error: `DM9000_DATA' undeclared (first use in this function)
dm9000x.c:144: error: `CONFIG_DM9000_BASE' undeclared
以此继续增加宏定义:
#define CONFIG_DM9000_BASE 0x20000000
#define DM9000_IO 0x20000000
#define DM9000_DATA (DM9000_IO + 0x4)
#define CONFIG_DM9000_USE_16BIT 1
查看原理图可得本开发板网卡片选线接在BANK4,故基地址为0x20000000,IO为基地址,DATA与基地址偏移0x04,此外定义16BIT表示网卡使用16BIT模式。
2) 修改默认网络参数,mini2440.h 中修改代码:
#define CONFIG_NETMASK 255.255.255.0
#define CONFIG_IPADDR 192.168.31.111