IPB

Welcome Guest ( Log In | Register )

> [转]移植uboot到ARMer9开发系统上, by lane@www.embeder.com
猫猫草
post 2007-04-27 08:55:56, Fri
Post #1


猫猫猫
***

Group: Power Cat
Posts: 626
Joined: 2006-12-8
Member No.: 2



首先了解ARMer9开发系统硬件设计上和三星原装SMDK2410之间的区别。

让uboot在ARMer9开发系统上跑起来,目前只需要关注如下的硬件区别,解决了下面这个问题,uboot就可以在ARMer9开发系统上正常地从串口输出,进入提示符。很多命令都可以使用,当然有些命令需要做修改。

SMDK2410 : nor flash 是AMD的1M的;
ARMer9: 是Intel E28F128J3A, 两片并联,一共32M Bytes.

下载一个uboot-1.1.1.tar.bz2.;

tar jxvf uboot-1.1.1.tar.bz2;

在uboot目录board/smdk2410 下的flash.c需要修改。这个是Flash的驱动,如何写,需要参考E28F128J3A的Datasheet. 这里我们提供一个我们修改好的flash.c文件,您只需要将这个文件覆盖掉board/smdk2410 下的文件即可。

(注意:你要安装了交叉编译器才行哦)

修改uboot目录下的Makefile,将
ifeq ($(ARCH),arm)
CROSS_COMPILE = arm-linux-
endif

修改成

ifeq ($(ARCH),arm)
CROSS_COMPILE = /opt/host/armv4l/bin/armv4l-unknown-linux-
endif

修改processor.h中:
union debug_insn
{
u32 arm;
u16 thumb;
}
修改成:
union debug_insn
{
u32 arm_mode;
u16 thumb_mode;
}

然后配置板子
make smdk2410_config

然后
make

在uboot目录生成uboot.bin;

通过sjf2410w程序将uboot.bin下载到nor flash中, 地址为0的地方;

串口接在UART0上,uboot的启动信息将输出。

你将发现很多命令都可以使用了。uboot果然强大。
Attached File(s)
Attached File  flash.c.rar ( 5.97k ) Number of downloads: 367
 
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
猫猫草
post 2007-04-27 08:58:26, Fri
Post #2


猫猫猫
***

Group: Power Cat
Posts: 626
Joined: 2006-12-8
Member No.: 2



再将board/mpl/vcma9/vcma9.h中下面代码拷贝到board/smdk2410/ smdk2410.c中来。
#if (CONFIG_COMMANDS & CFG_CMD_NAND)
typedef enum {
NFCE_LOW,
NFCE_HIGH
} NFCE_STATE;

static inline void NF_Conf(u16 conf)
{
S3C2410_NAND * const nand = S3C2410_GetBase_NAND();

nand->NFCONF = conf;
}

static inline void NF_Cmd(u8 cmd)
{
S3C2410_NAND * const nand = S3C2410_GetBase_NAND();

nand->NFCMD = cmd;
}

static inline void NF_CmdW(u8 cmd)
{
NF_Cmd(cmd);
udelay(1);
}

static inline void NF_Addr(u8 addr)
{
S3C2410_NAND * const nand = S3C2410_GetBase_NAND();

nand->NFADDR = addr;
}

static inline void NF_SetCE(NFCE_STATE s)
{
S3C2410_NAND * const nand = S3C2410_GetBase_NAND();

switch (s) {
case NFCE_LOW:
nand->NFCONF &= ~(1<<11);
break;

case NFCE_HIGH:
nand->NFCONF |= (1<<11);
break;
}
}

static inline void NF_WaitRB(void)
{
S3C2410_NAND * const nand = S3C2410_GetBase_NAND();

while (!(nand->NFSTAT & (1<<0)));
}

static inline void NF_Write(u8 data)
{
S3C2410_NAND * const nand = S3C2410_GetBase_NAND();

nand->NFDATA = data;
}

static inline u8 NF_Read(void)
{
S3C2410_NAND * const nand = S3C2410_GetBase_NAND();

return(nand->NFDATA);
}

static inline void NF_Init_ECC(void)
{
S3C2410_NAND * const nand = S3C2410_GetBase_NAND();

nand->NFCONF |= (1<<12);
}

static inline u32 NF_Read_ECC(void)
{
S3C2410_NAND * const nand = S3C2410_GetBase_NAND();

return(nand->NFECC);
}

#endif

再将include/configs/vcma.9中下面代码拷贝到include/configs/smdk2410.h中来。

/*-----------------------------------------------------------------------
* NAND flash settings
*/
#if (CONFIG_COMMANDS & CFG_CMD_NAND)

#define CFG_MAX_NAND_DEVICE 1 /* Max number of NAND devices */
#define SECTORSIZE 512

#define ADDR_COLUMN 1
#define ADDR_PAGE 2
#define ADDR_COLUMN_PAGE 3

#define NAND_ChipID_UNKNOWN 0x00
#define NAND_MAX_FLOORS 1
#define NAND_MAX_CHIPS 1

#define NAND_WAIT_READY(nand) NF_WaitRB()

#define NAND_DISABLE_CE(nand) NF_SetCE(NFCE_HIGH)
#define NAND_ENABLE_CE(nand) NF_SetCE(NFCE_LOW)


#define WRITE_NAND_COMMAND(d, adr) NF_Cmd(d)
#define WRITE_NAND_COMMANDW(d, adr) NF_CmdW(d)
#define WRITE_NAND_ADDRESS(d, adr) NF_Addr(d)
#define WRITE_NAND(d, adr) NF_Write(d)
#define READ_NAND(adr) NF_Read()
/* the following functions are NOP's because S3C24X0 handles this in hardware */
#define NAND_CTL_CLRALE(nandptr)
#define NAND_CTL_SETALE(nandptr)
#define NAND_CTL_CLRCLE(nandptr)
#define NAND_CTL_SETCLE(nandptr)

#define CONFIG_MTD_NAND_VERIFY_WRITE 1
#define CONFIG_MTD_NAND_ECC_JFFS2 1

#endif /* CONFIG_COMMANDS & CFG_CMD_NAND */

在include/configs/smdk2410.h中下面命令定义部分将CFG_CMD_NAND开关放开。

/***********************************************************
* Command definition
***********************************************************/
#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)
Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
5 User(s) are reading this topic (5 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 2024-12-25 02:26