二、第一阶段启动代码移植
1.首先在include/configs/mini2440.h配置文件中修改S3C2410的宏定义为S3C2440,修改SMDK2410的宏定义为
MINI2440。
diff --git a/include/configs/mini2440.h b/include/configs/mini2440.h
index a473278..41c283e 100644
--- a/include/configs/mini2440.h
+++ b/include/configs/mini2440.h
@@ -34,8 +34,8 @@
* (easy to change)
*/
#define CONFIG_ARM920T 1 /* This is an ARM920T Core */
-#define CONFIG_S3C2410 1 /* in a SAMSUNG S3C2410 SoC */
-#define CONFIG_SMDK2410 1 /* on a SAMSUNG SMDK2410 Board */
+#define CONFIG_S3C2440 1 /* in a SAMSUNG S3C2440 SoC */
+#define CONFIG_MINI2440 1 /* on a FriendlyARM MINI2440 Board */
/* input clock of PLL */
#define CONFIG_SYS_CLK_FREQ 12000000/* the SMDK2410 has 12MHz input clock */
2.修改第一阶段启动代码cpu/arm920t/start.S
Index: start.S
===================================================================
RCS file: /home/tracy/work/cvsroot/u-boot-2009.08/cpu/arm920t/start.S,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- start.S 10 Mar 2012 13:18:21 -0000 1.1
+++ start.S 30 Mar 2012 12:50:01 -0000 1.2
@@ -114,9 +114,6 @@
orr r0,r0,#0xd3
msr cpsr,r0
- bl coloured_LED_init
- bl red_LED_on
-
#if defined(CONFIG_AT91RM9200DK) || defined(CONFIG_AT91RM9200EK)
/*
* relocate exception table
@@ -131,7 +128,7 @@
bne copyex
#endif
-#if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410)
+#if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
/* turn off the watchdog */
# if defined(CONFIG_S3C2400)
@@ -159,14 +156,25 @@
ldr r1, =0x3ff
ldr r0, =INTSUBMSK
str r1, [r0]
+# elif defined(CONFIG_S3C2440)
+ ldr r1, =0x7fff
+ ldr r0, =INTSUBMSK
+ str r1, [r0]
# endif
+# if defined(CONFIG_S3C2440)
+ /* FCLK:HCLK:PCLK = 1:4:8 */
+ ldr r0, =CLKDIVN
+ mov r1, #5
+ str r1, [r0]
+# else
/* FCLK:HCLK:PCLK = 1:2:4 */
/* default FCLK is 120 MHz ! */
ldr r0, =CLKDIVN
mov r1, #3
str r1, [r0]
-#endif /* CONFIG_S3C2400 || CONFIG_S3C2410 */
+#endif
+#endif /* CONFIG_S3C2400 || CONFIG_S3C2410 || CONFIG_S3C2440 */
/*
* we do sys-critical inits only at reboot,
在这里也没有做过多的修改,只是修改了屏蔽中断代码和设置时钟分频比。
3.修改存储控制器初始化代码board/samsung/mini2440/lowlevel_init.S
Index: lowlevel_init.S
===================================================================
RCS file: /home/tracy/work/cvsroot/u-boot-2009.08/board/samsung/mini2440/lowlevel_init.S,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- lowlevel_init.S 10 Mar 2012 13:37:06 -0000 1.1
+++ lowlevel_init.S 30 Mar 2012 12:52:18 -0000 1.2
@@ -110,7 +110,7 @@
#define B5_PMC 0x0 /* normal */
#define B6_MT 0x3 /* SDRAM */
-#define B6_Trcd 0x1
+#define B6_Trcd 0x0 /* 2clk */
#define B6_SCAN 0x1 /* 9bit */
#define B7_MT 0x3 /* SDRAM */
@@ -123,7 +123,7 @@
#define Trp 0x0 /* 2clk */
#define Trc 0x3 /* 7clk */
#define Tchr 0x2 /* 3clk */
-#define REFCNT 1113 /* period=15.6us, HCLK=60Mhz, (2048+1-15.6*60) */
+#define REFCNT 1269 /* period=7.8us, HCLK=100Mhz, (2048+1-7.8*100) */
/**************************************/
_TEXT_BASE:
这里只是修改了SDRAM相关数据,因为u-boot能不能启动起来,这个也是最主要的,我们首先要做的第一步就是要让u-boot启动起来,然后再在这个基础上添加功能。