也不知道U-BOOT移植究竟是不是成功了,或许说是彻底成功了。移植后的U-BOOT其他的一些功用,比方printenv,loadb,bdi,fli等指令和显现的信息都是正确的 也能加载uclinux,但便是加载不成功有些uclinux内核能加载进去,但是不能解压;有些根本就没有显现,连内核头的一些信息都没显现,像是死机了,哎,也不知道是哪的原因,还要渐渐搞~~~前次也写过一篇差不多的文章:http://www.51hei.com/mcu/1135.html,本文仅仅做为那个的弥补吧~~~现在就整体的记载一下U-BOOT移植过程中自己做的作业吧。仍是用代码的方法进行描绘吧,即简略,又讲的清楚:
(阐明:顶行写的为需求修正的文件名 空一个TAB键写的内容中行前没有符号的为原样抄的内容,做定位用的,行前加‘-’号的为要修正的内容,行前加‘+’号的为修正后的内容。所以实际上是依照patch文件的书写方法来做的修正,廉价了解,也可以说的更清楚点,省的多花文字来描绘,写代码仍是挺直接的)
board/44b0/44b0/44b0.c boot_params = 0x0c000100board/44b0/44b0/config.mk TEXT_BASE = 0x0c300000board/44b0/44b0/Makefile OBJS := 44b0.o flash.oboard/44b0/44b0/lowlevel_init.S Tcos = 11 = 0x3 (4clk) Tacc = 001 = 0x1 (2clk) Toch = 0 (0clk) Tcah = 0 (0clk) Trcd = 01 (2clk) Trp = 00 (2clk) Trc = 11 (7clk) MCLK = 40MHz refresh_count = 1424 BWSCON_val = 0x11110090 最终三个 .word 0x16 .word 0x20 .word 0x20board/44b0/common/flash.c 把一切的#ifdef CONFIG_B2改成#ifdef CONFIG_44b0(板子称号)cpu/s3c44b0/config.mk (gcc版别过低,编译时报错时:) -PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) +PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,$(call cc-option,-mabi=pacs-gnu))cpu/s3c44b0/serial.c void serial_setbrg(void) { switch(gd->baudrate) case 115200: divisor = 21 ;Mclk = 40Mhz }cpu/s3c44b0/start.S(vectors_base = 0x0c0000008) ldr r1,=LOCKTIME ldr r0,=2000 str r0,[r1] ldr r1,=PLLCON ldr r0,=0x48032 ;Mclk=40Mhzinclude/configs/44b0.h (cp B2.h) -#define CONFIG_B2 +#define CONFIG_44b0 -#define CONFIG_S3C44B0_CLOCK_SPEED 75 +#define CONFIG_S3C44B0_CLOCK_SPEED 40 -#define CONFIG_DRIVER_LAN91C96 -#define CONFIG_LAN91C96_BASE 0x04000300 +#define CONFIG_DRIVER_RTL8019 +#define RTL8019_BASE 0x06000300 -#define CONFIG_COMMANDS (CONFIG_CMD_DFL | CFG_CMD_DATE | CFG_CMD_ELF | CFG_CMD_EEPROM | CFG_CMD_I2C) +define CONFIG_COMMANDS ( CONFIG_CMD_DFL|CONFIG_CMD_DATE|CONFIG_CMD_NET|CONFIG_CMD_ENV|CONFIG_CMD_FLASH) 注:如选用上述的|换行,或许有的编译的时分会报错,我的就会,所以选用单行书写 -#define CONFIG_BOOTFILE "~~~`" +#define CONFIG_BOOTFILE "uclinux.bin" -#define CONFIG_BOOTCOMMAND "bootm 20000 f0000" +#define CONFIG_BOOTCOMMAND "bootm 50000" -#define CFG_MEMTEST_START 0x0c400000 //还不理解这个界说是什么意思 -#define CFG_MEMTEST_END 0x0c800000 //假如删去的话,编译的时分会报错 +#define CFG_MEMTEST_START 0x0c000000及//所以仍是藏着吧,恰当的界说一下 +#define CFG_MEMTEST_END 0x0c100000 //也不知道会有什么影响 -#define CFG_LOAD_ADDR 0x0c700000 +#define CFG_LOAD_ADDR 0x0c008000 -#define PHYS_SDRAM_1 0xc0000000 -#define PHYS_SDRAM_1_SIZE 0x01000000 -#define PHYS_FLASH_1 0x00000000 -#define PHYS_FLASH_SIZE 0x00400000 +#define PHYS_SDRAM_1 0x0c000000 +#define PHYS_SDRAM_1_SIZE 0x00800000 +#define PHYS_FLASH_1 0x00000000 +#define PHYS_FLASH_SIZE 0x00200000 -#define CFG_MAX_FLASH_SECT 256 +#define CFG_MAX_FLASH_SECT 32 -#define CFG_ENV_IS_IN_EEPROM 1 -#define CFG_ENV_OFFSET 0x0 +#define CFG_ENV_IS_IN_FLASH +#undef CFG_ENV_IS_NOWHERE +#define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x20000) +#define CFG_ENV_SECT_SIZE 0x10000 +#define CFG_MONITOR_BASE PHYS_SDRAM_1 ;ENV IS NOT IN EEPROM /tools/envcrc.cMakefile ifeq($(ARCH),arm) -CROSS_COMPILE = arm-linux- +CROSS_COMPILE = arm-elf- B2_config : unconfig @./mkconfig $(@:_config=) arm s3c44b0 B2 dave +44b0_config : unconfig #./mkconfig $(@:_config=) arm s3c44b0 44b0 44b0lib_arm/board.c +#include static int display_banner(void) { #endif 后加上一段代码:LED指示灯亮,蜂鸣器关 PCONE |= (1<<10); pe5=pcon(10:11) PCONE &= ~(1<<11); PDATE &= ~(1<<5); ;beep=gpe5 //led0=pc1 led1=pc2 led2=pc3 PCONC |= ((1<<2)|(1<<4)|(1<<6)); //pconc[1:2:3]=PCONC[765432]output=01 PCONC &= ~((1<<3)|(1<<5)|(1<<7)); PDATC |= (1<<1); pdatc1=PDATC[1]=1 led0=light }
依照这个修正后的U-BOOT大约功用是完全的,也算是成功移植吧 至于究竟是不是,还要持续验证了。
别的,因为板子上网卡坏了,所以就没有去修正网卡相关的了。今后用到的话再说吧~~