三, s3c2410.h的移植
环境变量部分
这里定义了与环境变量相关的一些配置,因为我的板子上,环境变量是存放在eeprom中的,通过i2c总线进行访问,所以要将其相关配置进行定义
/*
* the next is added by BoySKung 08/11/06
*/
#define CONFIG_DRIVER_S3C24X0_I2C 1
#define CONFIG_HARD_I2C 1 //我们用的是cpu/arm920t/s3c24x0/i2c.c中的驱动
#define CFG_I2C_EEPROM_ADDR 0x50 //FM24CL64铁电存储器 1010000x
#define CFG_I2C_EEPROM_ADDR_LEN 2 //内存地址为13位,占两字节的低13位
#define CFG_I2C_SLAVE 0xFE //The IIC-bus interface address,IICADD寄存的分部:
//slave adderss = [7:1], not mapped = [0]
#define CFG_I2C_SPEED 400000 //the frequency (in Hz) at which you wish your i2c
//bus to run
#define CFG_ENV_OFFSET 0 //环境变量在eeprom内存中的偏移地址
#define CFG_ENV_SIZE 0x400 /*2K*/
Flash 配置部分
#define CONFIG_COMMANDS /
(CONFIG_CMD_DFL | /
CFG_CMD_CACHE | /
/*CFG_CMD_NAND |*/ /
/*CFG_CMD_EEPROM |*/ /
/*CFG_CMD_I2C |*/ /
/*CFG_CMD_USB |*/ /
CFG_CMD_REGINFO | /
CFG_CMD_DATE | /
CFG_CMD_ELF | /
CFG_CMD_FLASH ) /*added by BoySKung 08/11/05 */
这里添加flsah操作命令,如flinfo, erase, protect等
#define CFG_FLASH_BASE PHYS_FLASH_1
#define CFG_MONITOR_BASE CFG_FLASH_BASE /*added by BoySKung 08/11/05 */
这里添加monitor code在flash中的起始地址,也就是uboot编译后代码段和数据段所在位置的起始地址。主要用于保护代码段和数据段所在的sector
/*
*our flash is from intel, added by BoySKung 08/11/06
*/
#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
#define CFG_MAX_FLASH_SECT 128
我的板子用的是interl的flash, 所以添加了这两行对flash的配置,把原来AMD flash的相关配置去掉。
//#define CFG_ENV_IS_IN_FLASH 1
#define CFG_ENV_IS_IN_EEPROM 1 /*our environment variable is in eeprom. modified by BoySKung 08/11/05*/
我的板子上,环境变量在eeprom中
参数标记列表
#define CONFIG_SETUP_MEMORY_TAGS
#define CONFIG_CMDLINE_TAG
#define CONFIG_INITRD_TAG
网卡dm9000 的配置
我的板子上用的是dm9000网卡,所加上如下配置
/*
* Hardware drivers
*/
#define CONFIG_DRIVER_DM9000 1 /* we have a dm9000 on-board added by BoySKung 08/11/06*/
#define CONFIG_DM9000_BASE 0x19000300
#define DM9000_IO CONFIG_DM9000_BASE
#define DM9000_DATA (CONFIG_DM9000_BASE+4)
#define CONFIG_DM9000_USE_16BIT
下面一段文字描述了如何访问dm9000的寄存器,DM9000_IO、DM9000_DATA配置的分别是ADDR_PORT、DATA_PORT的地址
There are only two addressing ports through the access of the host interface. One port is
ADDR_PORT and the other is DATA_PORT. The ADDR_PORT is decoded by the pin CMD=0
and the DATA_PORT is decoded by the pin CMD=1. The content of the ADDR_PORT is the
address of the register to access the DATA_PORT later. Before to access the 8-bit data in any
register or to access the 8/16/32-bit data in RX/TX SRAM (16KB FIFO), the address of the
register must be saved into the ADDR_PORT.
串口
我的板子用的是uart3作为打印输出口所以
#define CONFIG_SERIAL1 1 /* we use SERIAL 1 on SMDK2410 */
改为
#define CONFIG_SERIAL3 1 /* we use SERIAL 1 on SMDK2410 */