一:建立工程文件 1.修改/board/dave/B2为/board/dave/ULong44b0 2.修改/board/dave/ULong44b0/B2.c为ULong44b0.c 3.修改/board/dave/ULong44b0/Makefile中B2.o为ULong44b0.o 4.修改/include/configs/B2.h为ULong44b0.h 5.修改/Makefile B2_config : unconfig @./mkconfig $(@:_config=) arm s3c44b0 B2 dave 为 ULong44b0_config : unconfig @./mkconfig $(@:_config=) arm s3c44b0 ULong44b0 dave 二:详细修改 1. /include/configs/ULong44b0.h #define CONFIG_B2 1 /* on an B2 Board */ 修改为 #define CONFIG_ULong44b0 1 /* on an tti44b Board */ #define CONFIG_S3C44B0_CLOCK_SPEED 75 /* we have a 75Mhz S3C44B0*/ 修改为 #define CONFIG_S3C44B0_CLOCK_SPEED 60 /* we have a 60 Mhz S3C44B0*/ #define CONFIG_DRIVER_ LAN91C96 #define CONFIG_LAN91C96_BASE 0x04000300 /* base address */ 修改为 #define CONFIG_DRIVER_RTL8019 //we have a RTL8019AS chip #define RTL8019_BASE 0x6000000 //修改 原值为0c700000 //#define CFG_LOAD_ADDR 0x0c800000 /* default load address */ //这是uclinux加载的地址,将uclinux内核下载到sdram后运行的地址 修改 //sdram和Nor flash的参数地址和大小,修改为自己开发办上相应的值。 /* Physical Memory Map*/ #define CONFIG_NR_DRAM_BANKS 1 /* we have 1 banks of DRAM */ #define PHYS_SDRAM_1 0x0c000000 /* SDRAM Bank #1 */ #define PHYS_SDRAM_1_SIZE 0x00800000 /* 8 MB */
#define PHYS_FLASH_1 0x00000000 /* Flash Bank #1 */ #define PHYS_FLASH_SIZE 0x00200000 /* 2MB */ #define CFG_FLASH_BASE PHYS_FLASH_1 2. /cpu/s3c44b0/serial.c
#if CONFIG_S3C44B0_CLOCK_SPEED==60 divisor = 32; 3. cpu/s3c44b0/start.S: ldr r1, =PLLCON #if CONFIG_S3C44B0_CLOCK_SPEED==60 ldr r0, = 0x88042 #elif CONFIG_S3C44B0_CLOCK_SPEED==75 ldr r0, =0x610c1 /*B2: Xtal=20mhz Fclk=75MHz */ #elif CONFIG_S3C44B0_CLOCK_SPEED==64 ldr r0, =((M_DIV<<12)+(P_DIV<<4)+S_DIV) //Fin=8MHz,Fout=64MHz #else #error CONFIG_S3C44B0_CLOCK_SPEED undefined #endif 中断向量表部分: add pc, pc, #0x0c000000 add pc, pc, #0x0c000000 add pc, pc, #0x0c000000 add pc, pc, #0x0c000000 add pc, pc, #0x0c000000 add pc, pc, #0x0c000000 add pc, pc, #0x0c000000 修改为: LDR PC, Undefined_Addr LDR PC, SWI_Addr LDR PC, Prefetch_Addr LDR PC, Abort_Addr LDR PC,RESERVE_Addr LDR PC, IRQ_Addr /* subs pc,lr,#4*/ LDR PC, IRQ_Addr /* subs pc,lr,#4*/ Undefined_Addr: .word 0x0c000004 SWI_Addr: .word 0x0c000008 Prefetch_Addr: .word 0x0c00000C Abort_Addr: .word 0x0c000010 RESERVE_Addr: .word 0x0c000014 IRQ_Addr: .word 0x0c000018 FIQ_Addr: .word 0x0c00001C 4. /board/dave/common/flash.c
flash_get_offsets函数中的flash芯片块的大小如下 /* set up sector start address table */ if (((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_SST) || ((info->flash_id & FLASH_TYPEMASK) == FLASH_AM640U)) { for (i = 0; i < info->sector_count; i++) info->start[i] = base + (i * 0x00008000);//39VF1601 每块大小为32K flash_get_size函数中增加flash芯片信息 case (CFG_FLASH_WORD_SIZE)SST_ID_xF1601://增加VF1601的判断语句 info->flash_id += FLASH_SST160A; info->sector_count = 64;//总共2M,每块32k,共64 info->size = 0x00200000; break; /* => 2 MB */ 文件中B2全修改为ULong44b0 5. /drivers/rtl8019.h 36 #define ETH_ADDR_SFT (8) 37 #define EI_SHIFT(x) ((x)<<ETH_ADDR_SFT) 38 39 #define RTL8019_REG_00 (RTL8019_BASE + EI_SHIFT(0x00)) 40 #define RTL8019_REG_01 (RTL8019_BASE + EI_SHIFT(0x01)) #define RTL8019_REG_02 ... ... 6. /board/dave/ULong44b0/lowlevel_init.S
MEMORY_CONFIG: .long 0x11010102 .long 0x600 .long 0x7ffc .long 0x7ffc .long 0x7ffc .long 0x7ffc .long 0x2610 .long 0x18000 .long 0x18000 .long 0x960459 .long 0x10 .long 0x20 .long 0x20 7. /include/configs/ULong44b0.h 79 #define CONFIG_COMMANDS ( CONFIG_CMD_DFL | \ 80 CFG_CMD_DATE | \ 81 CFG_CMD_ELF | \ 82 CFG_CMD_NET | \ CFG_CMD_PING | \ 83 CFG_CMD_ENV|CFG_CMD_FLASH ) 173 #define CFG_ENV_IS_IN_FLASH 174 #undef CFG_ENV_IS_NOWHERE 175 176 #define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x20000) /* environment start address */ 177 #define CFG_ENV_SECT_SIZE 0x10000 /* Total Size of Environment Sector */ 增加宏 #define CFG_MONITOR_BASE PHYS_SDRAM_1 三:编译出错后的修改 /cpu/s3c44b0/下的config.mk: PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) 改成: PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,$(call cc-option,-mabi=apcs-gnu),)
|