(说明:顶行写的为需要修改的文件名 空一个TAB键写的内容中行前没有标记的为原样抄的内容,做定位用的,行前加‘-’号的为要修改的内容,行前加‘+’号的为修改后的内容。所以实际上是按照patch文件的书写方式来做的修改,便宜理解,也能够说的更清楚点,省的多花文字来描述,写代码还是挺直接的)
board/44b0/44b0/44b0.c boot_params = 0x0c000100 board/44b0/44b0/config.mk TEXT_BASE = 0x0c300000 board/44b0/44b0/Makefile OBJS := 44b0.o flash.o board/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 0x20 board/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=40Mhz include/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.c Makefile 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 44b0 lib_arm/board.c +#includestatic 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大概功能是齐全的,也算是成功移植吧 至于到底是不是,还要继续验证了。
另外,由于板子上网卡坏了,所以就没有去修改网卡相关的了。以后用到的话再说吧~~
上一篇:stc电子表c51程序V2.0
下一篇:uclinux编译
推荐阅读最新更新时间:2024-03-16 14:26