免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 934 | 回复: 0
打印 上一主题 下一主题

移植U-Boot.2008.10到友善之臂mini2440(七完)【转】 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-12-05 00:26 |只看该作者 |倒序浏览

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


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

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


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/107284/showart_2111621.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP