移植U-Boot-2009.08到友善之臂mini2440(五)
5.1在文件中添加“CONFIG_S
(1)/include/common.h文件的第496行:
#if defined(CONFIG_S || defined(CONFIG_S)
(2)/include/s3c24x0.h文件的第85、95、99、110、148、404行:
将“#ifdef CONFIG_S3C2410”改为 #if defined(CONFIG_S3C2410) || defined (CONFIG_S3C2440)
顺便在其中加入2440 的NAND FLASH 寄存器定义(第160行附近)和CAMDIVN定义(第128行附近):
120 /* CLOCK & POWER MANAGEMENT (see S
121 /* (see S
122 typedef struct {
123 S
124 S
125 S
126 S
127 S
128 S
#if defined (CONFIG_S
S
#endif
132
133 } /*__attribute__((__packed__))*/ S
#if defined(CONFIG_S
/* NAND FLASH (see S
typedef struct {
S
S
S
S
S
S
} /*__attribute__((__packed__))*/ S
#endif
#if defined (CONFIG_S
/* NAND FLASH (see S
typedef struct {
S
S
S
S
S
S
S
S
S
S
S
S
S
S
S
S
} /*__attribute__((__packed__))*/ S
#endif
(3))/cpu/arm920t/s3c24x0/interrupts.c文件的第36行
34 #if defined(CONFIG_S
35 #include 3c2400.h>
36 #elif defined(CONFIG_S
37 #include 3c2410.h>
(4)cpu/arm920t/s3c24x0/timer.c文件的33、37添加|| defined (CONFIG_S3C2440)
在180行添加||defined(CONFIG_MINI2440)
(5)/drivers/serial/serial_s3c24x0.c,原来的位置在/cpu/arm920t/s3c24x0/serial.c
在24行添加|| defined (CONFIG_S3C2440)
(6)cpu/arm920t/s3c24x0/speed.c
头文件对S3C2440的支持:
在文件的的33、37行添加、|| defined (CONFIG_S
由于S3C2410和S3C2440的MPLL、UPLL计算公式不一样,所以get_PLLCLK函数也需要修改
m = ((r & 0xFF000) >> 12) + 8;
p = ((r & 0x
s = r & 0x3;
#if defined(CONFIG_S
if (pllreg == MPLL)
return((CONFIG_SYS_CLK_FREQ * m * 2) / (p << s));
else if (pllreg == UPLL)
#endif
return((CONFIG_SYS_CLK_FREQ * m ) / (p << s));
由于S3C2410和S3C2440的设置方法也不一样,所以get_HCLK函数也需要修改
/* return HCLK frequency */
ulong get_HCLK(void)
{
S#if defined(CONFIG_S if (clk_power->CLKDIVN & 0x6) { if ((clk_power->CLKDIVN & 0x6)==2) return(get_FCLK()/2); if ((clk_power->CLKDIVN & 0x6)==6) return((clk_power->CAMDIVN & 0x100) ? get_FCLK()/6 : get_FCLK()/3); if ((clk_power->CLKDIVN & 0x6)==4) return((clk_power->CAMDIVN & 0x200) ? get_FCLK()/8 : get_FCLK()/4); return(get_FCLK()); } else return(get_FCLK());#else
return((clk_power->CLKDIVN & 0x2) ? get_FCLK()/2 : get_FCLK());#endif}
(7)/cpu/arm920t/s3c24x0/usb_ohci.c文件的第43行: #elif defined(CONFIG_S3C2410) || defined (CONFIG_S3C2440)
(8)drivers/rtc/s3c24x0_rtc.c文件的第35行: #elif defined(CONFIG_S3C2410) || defined (CONFIG_S3C2440)
(9)/cpu/arm920t/s3c24x0/usb.c文件的第27、31行: #elif defined(CONFIG_S3C2410) || defined (CONFIG_S3C2440)
(10)修改/drivers/i2c/s3c24x0_i2c.c文件,其原来的位置/cpu/arm920t/s3c24x0/i2c.c
第32行: #elif defined(CONFIG_S3C2410) || defined (CONFIG_S3C2440)
第63、82、139、147、171行:
将“#ifdef CONFIG_S3C2410”改为 #if defined(CONFIG_S3C2410) || defined (CONFIG_S3C2440)