Make u-boot-2013.04 on tq2440

1. Get the newest uboot from http://www.denx.de/wiki/U-Boot:

light32@zangchao:~$ git clone git://git.denx.de/u-boot.git

Cloning into 'u-boot'...
remote: Counting objects: 210740, done.
remote: Compressing objects: 100% (41883/41883), done.
remote: Total 210740 (delta 169553), reused 206362 (delta 165638)
Receiving objects: 100% (210740/210740), 52.39 MiB | 156 KiB/s, done.
Resolving deltas: 100% (169553/169553), done.

light32@zangchao:~$ 


2. try to make smdk2410 

by cmd: make smdk2410_config, make

light32@zangchao:/opt/bootloader/zangchao/u-boot-2013.04/u-boot$ make

...

arm-linux-objcopy -O srec hello_world hello_world.srec 2>/dev/null
arm-linux-objcopy -O binary hello_world hello_world.bin 2>/dev/null
make[1]: Leaving directory `/opt/bootloader/zangchao/u-boot-2013.04/u-boot/examples/standalone'
make -C examples/api all
make[1]: Entering directory `/opt/bootloader/zangchao/u-boot-2013.04/u-boot/examples/api'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/opt/bootloader/zangchao/u-boot-2013.04/u-boot/examples/api'


light32@zangchao:/opt/bootloader/zangchao/u-boot-2013.04/u-boot$ ls
api    boards.cfg  COPYING  doc      examples  lib          Makefile  net     rules.mk         System.map  u-boot      u-boot.map
arch   common      CREDITS  drivers  fs        MAINTAINERS  mkconfig  post    snapshot.commit  test       u-boot.bin  u-boot.srec
board  config.mk   disk     dts      include   MAKEALL      nand_spl  README  spl              tools       u-boot.lds


light32@zangchao:/opt/bootloader/zangchao/u-boot-2013.04/u-boot$ history

...

  245  cd /opt/
  246  ls
  247  cd bootloader/
  248  ls
  249  cd zangchao/
  250  ls
  251  cd u-boot-2013.04/
  252  ls
  253  cd u-boot/
  254  ls
  255  make smdk2410_config
  256  make
  265  ls
  266  history


3. just check from start.S

3.1 set the cpu to SVC32 mode ok!

mrs r0, cpsr
bic r0, r0, #0x1f
orr r0, r0, #0xd3
msr cpsr, r0


3.2 turn off the watchdog ok!

#  define pWTCON 0x53000000

ldr r0, =pWTCON
mov r1, #0x0
str r1, [r0]


3.3 set system clock not ok!

#  define CLKDIVN 0x4C000014/* clock divisor register */


/* FCLK:HCLK:PCLK = 1:2:4 */
/* default FCLK is 120 MHz ! */
ldr r0, =CLKDIVN
mov r1, #3
str r1, [r0]

pls change to:

/*set sys clk*/
#if 0
/*
  *  f HDIVN is not 0, the CPU bus mode has to be changed from the fast bus mode to the asynchronous
  * bus mode using following instructions(S3C2440 does not support synchronous bus mode).
  */
   mrc p15,0,r0,c1,c0,0
   orr r0,r0,#R1_nF:OR:R1_iA
   mcr p15,0,r0,c1,c0,0
#endif

???
mrc p15, 0, r1, c1, c0, 0             //if HDIVN !=0, set CPU bus fm fast bus mode to asynchronous bus mode
orr r1, r1, #0xc0000000
mcr p15, 0, r1, c1, c0, 0


/* FCLK:HCLK:PCLK = 1:4:8 */
ldr r0, =CLKDIVN
mov r1, #5
str r1, [r0]

/*
  *  Fin = 12.0000MHz
  *  #define S3C2440_MPLL_400MHZ ((0x5c<<12)|(0x01<<4)|(0x01))//FCLK=400MHz
  *  #define S3C2440_MPLL_405MHZ ((0x7f<<12)|(0x02<<4)|(0x01))//FCLK=405MHz
  */
#define   S3C2440_MPLL_400MHZ    ((0x5c<<12)|(0x01<<4)|(0x01))
ldr r0, =0x4c000004                
ldr r1, =S3C2440_MPLL_400MHZ      //set  S3C2440_MPLL_400MHZ
str r1, [r0]


3.4 memory control configuration not ok!

#define REFCNT 1113/* period=15.6us, HCLK=60Mhz, (2048+1-15.6*60) */

(in lowlevel_init.S)

pls change to:

//#define REFCNT 1113/* period=15.6us, HCLK=60Mhz, (2048+1-15.6*60) */
#define REFCNT 0x4f4


4. add "#define CONFIG_S3C2440"

4.1 

add "#define CONFIG_S3C2440"  

4.2

"#define CONFIG_S3C2410" needs to be commented out before the project will compile.

4.3

comment out " #define CONFIG_CMD_NAND"

4.4

comment out " #define CONFIG_YAFFS2"

4.5

make

...

make -C examples/api all
make[1]: Entering directory `/opt/bootloader/zangchao/u-boot-2013.04/u-boot/examples/api'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/opt/bootloader/zangchao/u-boot-2013.04/u-boot/examples/api'
light32@zangchao:/opt/bootloader/zangchao/u-boot-2013.04/u-boot$ ls
api    boards.cfg  COPYING  doc      examples  lib          Makefile  net     rules.mk         System.map  u-boot      u-boot.map
arch   common      CREDITS  drivers  fs        MAINTAINERS  mkconfig  post    snapshot.commit  test        u-boot.bin  u-boot.srec
board  config.mk   disk     dts      include   MAKEALL      nand_spl  README  spl              tools       u-boot.lds
light32@zangchao:/opt/bootloader/zangchao/u-boot-2013.04/u-boot$ 


4.6

program u-boot.bin  on Nor Flash with Jlink


4.7

turn on TQ2440, then u see:



5.









评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值