友善开发板移植uboot-2010.03
来源:互联网 发布:公安民警网络答题 编辑:程序博客网 时间:2024/05/16 09:21
一、硬件资源
CPU:S3C6410 ARM1176 run at 533Mhz,up to 677Mhz
FLASH:K9F2G08U 256M*8bit
DDR/SDRAM:K4X2G323PD-8GD8 256M(64M*32)
二、移植第一步
1、下载:u-boot-2010.03.tar.bz2
http://ftp.denx.de/pub/u-boot/
解压:
#tar jxvf u-boot-2010.03.tar.bz2#cd u-boot-2010.03/board/samsung
2、建立tiny6410文件夹
mkdir tiny6410
3、6410和6400资源差不多,所以以6400代码作为模版
#cp -rf smdk6400/* tiny6410 //将6400下所有的代码复制到tiny6400目录下#cd tiny6410#mv smdk6400.c tiny6410.c //将smdk6400.c改名为tiny6410.c
4、修改tiny6410文件夹Makefile的第31行为
31 COBJS-y := tiny6410.o
5、建立tiny6410头文件
#cd ../../../include/configs#cp -rf smdk6400.h tiny6410.h
6、修改U-boot根目录下Makefile文件
指定交叉环境(163行):CROSS_COMPILE ?=arm-linux-
找到smdk6400配置项(3316行),复制一段修改为tiny6410配置项,将smdk6400全改为tiny6410,如下:
注意:空格位应为一个tab键,否则会出错。
tiny6410_noUSB_config \tiny6410_config : unconfig @mkdir -p $(obj)include $(obj)board/samsung/tiny6410 @mkdir -p $(obj)nand_spl/board/samsung/tiny6410 @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h @if [ -z "$(findstring tiny6410_noUSB_config,$@)" ]; then \ echo "RAM_TEXT = 0x57e00000" >> $(obj)board/samsung/tiny6410/config.tmp;\ $(MKCONFIG) $(@:_config=) arm arm1176 tiny6410 samsung s3c64xx; \ else \ echo "RAM_TEXT = 0xc7e00000" >> $(obj)board/samsung/tiny6410/config.tmp;\ $(MKCONFIG) $(@:_noUSB_config=) arm arm1176 tiny6410 samsung s3c64xx; \ fi @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
其中:
arm: CPU的架构
arm1176:CPU的类型
tiny6410:对应在board目录下建立新的开发板项目目录
samsung:新开发板项目的上级目录,如直接在board下建立新的开发板项目,此处应为NULL
s3c64xx:CPU的型号
7、测试编译新建的tiny6410开发板项目
#make tiny6410_config (出现:Configuring for tiny6410 board...表正确,否则重新配置。#make编译后没有错误,且根目录生成u-boot.bin文件,表示u-boot移植第一步成功
参考:http://blog.sina.com.cn/s/blog_79abea8a01012ruj.html
二、移植第二步
1、修改u-boot第一个要运行的程序位于:cpu/arm1176/start.S
在dsable MMU中(大约166行):
添加一行:mcr p15, 0, r0, c1, c0, 0
/* * disable MMU stuff and caches */ mrc p15, 0, r0, c1, c0, 0 bic r0, r0, #0x00002300 @ clear bits 13, 9:8 (--V- --RS) bic r0, r0, #0x00000087 @ clear bits 7, 2:0 (B--- -CAM) orr r0, r0, #0x00000002 @ set bit 2 (A) Align orr r0, r0, #0x00001000 @ set bit 12 (I) I-Cache mcr p15, 0, r0, c1, c0, 0
在bl lowlevel_init之后添加如下代码,主要用于判断是从nandflash启动还是ram中启动:
/* when we already run in ram, we don't need to relocate U-Boot. * and actually, memory controller must be configured before U-Boot * is running in ram. */ ldr r0, =0xff000fff bic r1, pc, r0 /* r0 <- current base addr of code */ ldr r2, _TEXT_BASE /* r1 <- original base addr in ram */ bic r2, r2, r0 /* r0 <- current base addr of code */ cmp r1, r2 /* compare r0, r1 */ beq after_copy /* r0 == r1 then skip flash copy */
如果没有完成copy,则接下来应该copy_from_nand,那么在beq after_copy后面添加:
#ifdef CONFIG_BOOT_NAND mov r0, #0x1000 bl copy_from_nand#endif
如果完成则会跳过这段代码,直接进入after_copy。
2、那么在u-boot-2010.03\cpu\arm1176下建立一个nand_cp.c,为了方便,我们可以直接从u-boot-1.1.6\cpu\s3c64xx下拷贝过来使用。
修改该目录下的Makefile,添加如下:
COBJS = cpu.o nand_cp.o
3、回到Start.S,在
- #ifdef CONFIG_ENABLE_MMU
- .globl theLastJump
之前添加如下代码:
/* * copy U-Boot to SDRAM and jump to ram (from NAND or OneNAND) * r0: size to be compared * Load 1'st 2blocks to RAM because U-boot's size is larger than 1block(128k) size */ .globl copy_from_nandcopy_from_nand: mov r10, lr /* save return address */ mov r9, r0 /* get ready to call C functions */ ldr sp, _TEXT_PHY_BASE /* setup temp stack pointer */ sub sp, sp, #12 mov fp, #0 /* no previous frame, so fp=0 */ mov r9, #0x1000 bl copy_uboot_to_ram3: tst r0, #0x0 bne copy_failed ldr r0, =0x0c000000 ldr r1, _TEXT_PHY_BASE1: ldr r3, [r0], #4 ldr r4, [r1], #4 teq r3, r4 bne compare_failed /* not matched */ subs r9, r9, #4 bne 1b4: mov lr, r10 /* all is OK */ mov pc, lrcopy_failed: nop /* copy from nand failed */ b copy_failedcompare_failed: nop /* compare failed */ b compare_failed
4、接着修改6410的头文件,进入include\configs,打开tiny6410.h
在
#if !defined(CONFIG_NAND_SPL) && (TEXT_BASE >= 0xc0000000)#define CONFIG_ENABLE_MMU#endif
下方添加:
#ifdef CONFIG_ENABLE_MMU#define virt_to_phys(x) virt_to_phy_smdk6410(x)#else#define virt_to_phys(x) (x)#endif
接着修改:
#define CONFIG_SYS_PROMPT "SMDK6400 #
表示命令行的名称,我这里改为tiny6410#
然后确定板载SDRAM的大小,我们这里使用的是256M的SDRAM所以修改如下:
#define PHYS_SDRAM_1_SIZE 0x10000000#define CFG_MEMTEST_END MEMORY_BASE_ADDRESS + 0xfe00000
当为128M的SDRAM时,应修改为:
#define PHYS_SDRAM_1_SIZE 0x08000000 #define CFG_MEMTEST_END MEMORY_BASE_ADDRESS + 0x7e00000
另一方面机器号的确定,6410我们修改如下:
#define MACH_TYPE 1626
时间修改:
//#define CONFIG_SYS_HZ 1000 // at PCLK 50MHz#define CONFIG_SYS_HZ 1562500
- 友善开发板移植uboot-2010.03
- 友善mini2440:uboot和内核的移植
- uboot移植(S3Cmini2440开发板)
- UBOOT移植OK210开发板
- boa在友善6410开发板上的移植
- 友善之臂smart210 uboot移植过程中的体会
- arm-6410友善之臂 uboot linux内核.文件系统移植
- 最新的我的友善之臂s3c2410开发板的uboot及内核制作过程
- Uboot的启动流程--以友善之臂tiny4412开发板为例
- 友善之臂tiny4412使用SD卡烧录uboot,并使开发板从SD卡启动进入uboot过程记录。
- 天嵌TQ2440 ARM开发板Uboot移植
- 飞凌OK210开发板UBOOT移植步骤
- 飞凌OK210开发板UBoot移植步骤
- 移植uboot到FL2440开发板
- TX2440开发板Uboot移植教程
- 移植官方uboot到GEC210开发板
- 手把手移植tiny4412开发板uboot
- QT Embedded 4.5.0 移植到友善之臂mini2440开发板
- SVN使用小结
- 过滤器及异步线程使用试验
- Android 获取设备和系统信息
- JavaSE003_String类总结之内存分析
- FFMPEG研究: FFmpeg的Android平台移植编译
- 友善开发板移植uboot-2010.03
- ant安装配置使用介绍及eclipse中使用
- windows 64 intel 安装Numpy 报错Microsoft Visual C++ 9.0 is required Unable to find
- MySQL字符串函数substring:字符串截取
- opencv从入门到精通(3)——基本数据类型
- POJ 2391 Ombrophobic Bovines (网络流)
- 虚函数继承的默认缺省参数
- Maven项目下update maven后Eclipse报错:java.lang.ClassNotFoundException: ContextLoaderListener
- poj 1195 Mobile phones