您的位置:首页 > 其它

移植U-Boot-2008.10到友善之臂mini2440(七 完)

2011-09-23 13:49 531 查看
1.2.14 搜索以下文件,把支持S3C2410的宏定义改成同时支持S3C2410和S3C2440


(1) 文件 u-boot-2008.10/cpu/arm920t/s3c24x0/i2c.c :
#include <s3c2400.h>
//#elif defined(CONFIG_S3C2410)
#elif defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
#include <s3c2410.h>
......
S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
//#ifdef CONFIG_S3C2410
#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
return (gpio->GPEDAT & 0x8000) >> 15;
......
S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
//#ifdef CONFIG_S3C2410
#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
gpio->GPEDAT = (gpio->GPEDAT & ~0x4000) | (x&1) << 14;
#endif
......
if ((status & I2CSTAT_BSY) || GetI2CSDA () == 0) {
//#ifdef CONFIG_S3C2410
#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
ulong old_gpecon = gpio->GPECON;
#endif
......
/* bus still busy probably by (most) previously interrupted transfer */
//#ifdef CONFIG_S3C2410
#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
/* set I2CSDA and I2CSCL (GPE15, GPE14) to GPIO */
......
/* restore pin functions */
//#ifdef CONFIG_S3C2410
#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
gpio->GPECON = old_gpecon;
#endif

(2)文件u-boot-2008.10/cpu/arm920t/s3c24x0/serial.c :
#include <common.h>
//#if defined(CONFIG_S3C2400) || defined (CONFIG_S3C2410) || defined (CONFIG_TRAB)
#if defined(CONFIG_S3C2400) || defined (CONFIG_S3C2410) || defined (CONFIG_TRAB) || defined(CONFIG_S3C2440)

#if defined(CONFIG_S3C2400) || defined(CONFIG_TRAB)
#include <s3c2400.h>
//#elif defined(CONFIG_S3C2410)
#elif defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
#include <s3c2410.h>
#endif

(3) 以下三个文件的修改相同:
u-boot-2008.10/cpu/arm920t/s3c24x0/usb.c u-boot-2008.10/cpu/arm920t/s3c24x0/usb_ohci.c u-boot-2008.10/drivers/rtc/s3c24x0_rtc.c

修改头文件的引用:
#if defined(CONFIG_S3C2400)
# include <s3c2400.h>
//#elif defined(CONFIG_S3C2410)
#elif defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
# include <s3c2410.h>
#endif

(4)文件u-boot-2008.10/include/common.h :

ulong get_OPB_freq (void);
ulong get_PCI_freq (void);
#endif
//#if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) || \
//defined(CONFIG_LH7A40X) || defined(CONFIG_S3C6400)
#if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) || \
defined(CONFIG_LH7A40X) || defined(CONFIG_S3C6400) || defined(CONFIG_S3C2440)
void s3c2410_irq(void);
#define ARM920_IRQ_CALLBACK s3c2410_irq
ulong get_FCLK (void);

(5) 文件u-boot-2008.10/include/s3c24x0.h :
S3C24X0_REG32 PRIORITY;
S3C24X0_REG32 INTPND;
S3C24X0_REG32 INTOFFSET;
//#ifdef CONFIG_S3C2410
#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
S3C24X0_REG32 SUBSRCPND;
S3C24X0_REG32 INTSUBMSK;
#endif
……
/* DMAS (see manual chapter 8) */
typedef struct {
S3C24X0_REG32 DISRC;
//#ifdef CONFIG_S3C2410
#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
S3C24X0_REG32 DISRCC;
#endif
S3C24X0_REG32 DIDST;
//#ifdef CONFIG_S3C2410
#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
S3C24X0_REG32 DIDSTC;
#endif
S3C24X0_REG32 DCON;
……
#ifdef CONFIG_S3C2400
S3C24X0_REG32 res[1];
#endif
//#ifdef CONFIG_S3C2410
#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
S3C24X0_REG32 res[7];
#endif
} /*__attribute__((__packed__))*/ S3C24X0_DMA;
……
S3C24X0_REG32 CLKCON;
S3C24X0_REG32 CLKSLOW;
S3C24X0_REG32 CLKDIVN;

#if defined (CONFIG_S3C2440)
S3C24X0_REG32 CAMDIVN;
#endif
} /*__attribute__((__packed__))*/ S3C24X0_CLOCK_POWER;
……
S3C24X0_REG32 res[8];
S3C24X0_REG32 DITHMODE;
S3C24X0_REG32 TPAL;
//#ifdef CONFIG_S3C2410
#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
S3C24X0_REG32 LCDINTPND;
S3C24X0_REG32 LCDSRCPND;
S3C24X0_REG32 LCDINTMSK;
……
S3C24X0_REG32 MISCCR;
S3C24X0_REG32 EXTINT;
#endif
//#ifdef CONFIG_S3C2410
#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
S3C24X0_REG32 GPACON;
S3C24X0_REG32 GPADAT;
S3C24X0_REG32 res1[2];

移植成功后,U-BOOT在嵌入式系统中运行良好。同时支持 Nand Flash 和 Nor Flash 启动(仍需改进)。
附:U-Boot各个版本的下载地址 ftp://ftp.denx.de/pub/u-boot/

参考博文:
http://blog.csdn.net/hugerat/archive/2009/01/21/3847025.aspx
http://expowinzax.blog.163.com/blog/static/12408013200922222038567/
http://blog.chinaunix.net/u1/34474/showart.php?id=1808274

非常感谢以上文章的帮助!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: