Chinaunix首页 | 论坛 | 博客
  • 博客访问: 78371
  • 博文数量: 11
  • 博客积分: 1401
  • 博客等级: 上尉
  • 技术积分: 115
  • 用 户 组: 普通用户
  • 注册时间: 2009-05-12 16:16
文章分类
文章存档

2011年(1)

2009年(10)

我的朋友

分类: LINUX

2009-05-21 02:34:39


1.2.14 搜索以下文件,把支持S3C2410的宏定义改成同时支持S3C2410S3C2440


(1) 文件 u-boot-2008.10/cpu/arm920t/s3c24x0/i2c.c

 #include

//#elif defined(CONFIG_S3C2410)

#elif defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)

#include

 ......

        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

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

//#elif defined(CONFIG_S3C2410)

#elif defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)

#include

 #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

//#elif defined(CONFIG_S3C2410)

#elif defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)

# include

 #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各个版本的下载地址

 

参考博文:

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

 

    非常感谢以上文章的帮助!

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