嵌入式BootLoader移植实验三_第1页
嵌入式BootLoader移植实验三_第2页
嵌入式BootLoader移植实验三_第3页
嵌入式BootLoader移植实验三_第4页
嵌入式BootLoader移植实验三_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

合肥学院嵌入式系统设计实验报告(2013-2014第二学期)专业:实验项目:实验三BootLoader移植实验实验时间:2014年5月7实验成员:指导老师:干开峰电子信息与电气工程系

2014年4月制一、实验目的1、熟悉Bootloader工作原理。2、了解U-Boot的代码结构。3、掌握U-Boot移植过程。二、实验内容本实验熟悉Bootloader工作原理,了解U-Boot源码结构,基于S3C2440处理器,完成U-Boot移植,并在目标开发板上测试通过。三、移植环境u-boot版本:u-boot-2011-03Linux平台:Fedora14交叉编译工具:arm-linux-gcc-4.3.3arm开发板:micro2440CPU:S3C2440SDRAM:64M1NorFlash:2MNandFlash:256M网卡:DM9000EP四、实验过程1、建立Micro2440配置(1)按下图所示命令解压u-boot-2011.03-micro2440.tar压缩包root用ubuntu:~#mkdir/home/ubootmot用ubuntu:~#cd/home/ubootroot^ubuntu:/home/uboot#tarjxvfu-boot-2011.03-micro2440.tar(2)输入命令:geditboards.cfg打开boards.cfg文件。root@ubuntucd/home/uboot/u-boot-2011.S3rootfaubuntu:/home/iiboot/u-boot-2011.03#geditboards.cfg在boards.cfg中添加一行:micro2440armarm920t-Samsungs3c24x0语句。_boards.cfgX#micro2440armarm920t-Samsungs3c24xS#Listofboards|(3)创建板级支持文件输入命令:cp-rboard/samsung/smdk2410board/samsung/micro2440cdboard/samsung/micro2440/mvsmdk2410.cmicro2440.cgeditMakefile□ot(jduDuntu:/noine/uDoot/ii-Doot-2tiii.tu/Doara/samsung/micro244a#caDoara/samsumicro244S/ash:cd:board/samsung/micro2440/:Nosuchfileordirectoryoot母ubuntu:/home/uboot/u-boot-2911.03/board/samsung/micro244S#geditMakefile将COBJS:=smdk2410.oflash.o改为COBJS:=micro2440.oflash.oCOBJS:=micro244B.oflash.onandread.oSOBJS:=lowlevelinit.oI-输入命令:cd../../..cpinclude/configs/smdk2410.hinclude/configs/micro2440.hgeditinclude/configs/micro2440.hroot@ubuntu:/honie/uboot/u-boot-2011.03/board/samsung/micro2440#cd../■■/--root@ubuntu:/home/uboot/u-boot-2011.B3#cpinclude/configs/smdk2410.hinclude/configs/micro244S.hroot@ubuntu:/home/uboot/u-boot-2011.03#geditinclude/configs/miicro2440.h修改内容一:#defineCONFIG_SYS_PROMPT"[Micro2440]#"/*MonitorCommandPrompt*/修改内容二:#defineCONFIG_SYS_SDRAM_BASEPHYS_SDRAM_1#defineCONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_SDRAM_BASE+0x1000-GENERATED_GBL_DATA_SIZE)If^defineCONFIGSYSSDRAHBASEP'HYS_SDRAM_1^defineCONFIG[SYS[lNIT_§P_ADDR(CONFIGSYSSDRAMBASE+SxlQSSGENERATEDGBLDATASIZE}*micro2440.hX#defineCONFIGKGDBSERINDEX1/♦whichserialporttouse♦/#endif/*♦Miscellaneousconfigurableoptions*/#defineCONFIG_SYSSDRAMBASEPHYSSDRAM1#defineCONFIG^SYS^INITSPADDR(CONFIGSYSSDRAMBASE+6x1000GENERATEDGBLDATASIZE)#defineC0NFIG]sys]L0NGHelp一一/*undeftosavememory♦/#defineCONFIG]SYS]PROMPTM[^1icro2440]#"/♦MonitorCommandPrompt♦/#defineCONFIG]SYS]CBSIZE256/♦ConsoleI/OBufferSize♦/#defineCONFIG]SYS[PBSIZE(CONFIGSYSCBSIZE+sizeof(CONFIGSYSPROMPT)+16)/*PrintBufferSize*/#defineCONFIGSYSMAXARGS16/♦maxnumberofcommandargs♦/#defineCONFIG]SYS[BARGSIZECONFIGSYSCBSIZE/♦BootArgumentBufferSize*/#defineCONFIGSYSMEMTESTSTART0x30000600/♦memtestworkson♦/#defineCONFIG]SYS[MEMTEST[END0X33FO0O00/*63MBinDRAM♦/#defineCONFIGSYSLOADADDR0x33000000/♦defaultloadaddress♦/测试编译环境输入命令:makemicro2440_config出现:Configuringformicro2440board...输入命令:makeGeneratinginclude/autoconf.mkGeneratinginclude/autoconf.mk.deparm-linux-objcopy-Osrecu-bootu-boot.srecarm-linux-objcopy--gap-fill=0xff-Obinaryu-bootu-boot.bin

.3/armv4t-Igcc-Mapu-boot.map-ou-bootarm-linux-objcopy-0srecu-bootu-boot.srecarm-linux-objcopy--gap-fill=0xff-0binaryu-bootu-boot.binrootfaubuntui/home/uboot/u-boot-2011.03#|、在RAM中运行(1)在根目录下进入include/configs文件夹输入命令:geditmicro2440.h,打开micro2440.h文件。「oot@ubuntu:~#cd/home/uboot/u-boot-2011.03/include/configsroot(aubuntu:/home/uboot/u-boot-2011.03/include/configs#geditmicro2440.h(2)在micro2440.h中删除:#defineCONFIG_S3C24101/*specificallyaSAMSUNGS3C2410SoC*/#defineCONFIG_SMDK24101/*onaSAMSUNGSMDK2410Board*/添加:#defineCONFIG_S3C24401/*specificallyaSAMSUNGS3C2440SoC*/#defineCONFIG_MICRO2440#defineCONFIG_SKIP_LOWLEVEL_INIT#ifndef_CONIFIG_H#define二CONFIG]H#defineCOMFIGS3C24401/*specificallyaSAMSUNGS3C2446SoC*/#defineC0NIFIg2mICR0244S^defineCOMFIG^SKIPLOWLEVELIHIT]/*在根目录下进入arch/arm/cpu/arm920t文件夹输入命令:geditstart.Sroot^ubuntu:/home/uboot/u-boot-2011.03#cdarchroot@ubuntu:/home/uboot/u-boot-2011.03/arch#cdarm/cpu/arm920troot@ubuntu:/home/uboot/u-boot-2011.03/arch/arm/cpu/arm920t#geditstartsroot@ubuntu:/home/uboot/u-boot-2011.03/arch/arm/cpu/ann920t#geditstart.S按下图所示进行修改部分内容:###deTine###deTineLOCKTIMEdefineMPLLCONdefineUPLLCON0X4C0000000X4C0000040X4C000008defineCLKDIVVAL5defineMMDIV-0x7fdefineM>DIV2defineM^SDIV1defineU^MDIV0x38defineu]PDIV2defineU^SDIV2tdrrl,=0x7fffIdrr0r=INTSUBMSKstrrlf[rQ]Idrr0,=LOCKTIMEEeOAULTIME^iMLTIME♦/tdrrl,=0x0fff0fffstrrlp[r0]start.SX/»XTal=12.0MHzMPLL=405MHz*//*XTal=12.0MHzUPLL=48MHz*/在根目录board/samsung/micro2440下中输入geditmicro2440.c命令ntroot@ubuntu:/home/uboot/u-boot-2011.03/board/samsung/micro2440#geditmlcro244€.ntcpci.oanvers/pcmcia/Liopcmcia.□anvers/power/Liopower.oanversdrivers/serial/libserial.odrivers/spi/libspi.odrivers/twserial/libtws.odrivers/usb/eth/libusb_eth.adrivers/usb/gadget/libusbgadget.odrivers/usb/host/libusbhost.odrivers/usb/musb/libusbmusb.□drivers/usb/phy/libusbphy.□drivers/video/libvideo.□drivers/watchdog/libwatchdog.ofs/cramfs/libcramfs.ofs/ext2/libext2fs.ofs/fat/libfat.ofs/fdos/libfdos.ofs/jffs2/libjffs2.ofs/reiserfs/libreiserfs.ofs/ubifs/libubifs.ofs/yaffs2/libyaffs2.olib/libfdt/libfdt.olib/libgeneric.□lib/lzma/liblzma.olib/lzo/liblzo.□net/libnet.opost/libpost.oboard/samsung/nicro2440/1ibmicra244e.o--end-group/home/uboot/u-boot-2011.B3/arch/arm/lib/eabi_compat.o-L/usr/local/ar[n/4.3.3/bin/../^ib/gcc/anr-none-linux-gnueabi/4.3.3/armv+t-Igcc-Mapu-boot.map-ou-bootam-linux-objcopy-0srecu-bootu-boot.srecam-linux-objcopy--gap-fill=Sxff-0binaryu-bootu-boot.binmot足ubuntu:/home/uboot/u-boot-2011.03#|测试在根目录下输入命令:make编译完成后将u-boot.bin下载到SDRAM的0x33f80000地址处,u-boot已经能在RAM中运行。Downloadedfileat0x30000000,size=124385bytes+Boot2011.CJ3(May13201^一20:57:25}DRAM:EMiBaail:512KiBNANE:NAND_ECC_NCNEselectedbyJo□己rddriver.Thisisnotreconmeaded!!256MiB-***Warning-badCRCfusingdefaultenvironnientIn:aerialOut:serialErr:serialNet:dm9000Hitaoykeytostopautoboot:0dm9000i/o:0z20000300rid:0x90000a^6HM9000:runaingin16bitmodeMAC:08:00:3e:2€:Oa.:5boperatingatuaknown:0modeUaingdm9000deviceTFTPfromaerver192..1.210;ourIPaddreaaia30Filename'uimage-nf3.img'.Loadaddress:0X31000000Loading:TT|3、支持DM900在根目录下打开include/configs文件夹,执行geditmicro2440.h命令root@ubuntu:/home/uboot/u-boot-2811.83/include/configsgeditmicm?446.h删除:#defineCONFIG_CS8900/*wehaveaCS8900on-board*/#defineCONFIG_NETMASK#defineCONFIG_IPADDR10

#defineCONFIG_SERVERIP添加:#defineCONFIG_CMD_NET#defineCONFIG_DRIVER_DM90001#defineCONFIG_DM9000_NO_SROM1#defineCONFIG_DM9000_BASE0x20000300#defineDM9000_IOCONFIG_DM9000_BASE#defineDM9000_DATA(CONFIG_DM9000_BASE+4)#defineCONFIG_CMD_PING#defineCONFIG_ETHADDR08:00:3e:26:0a:5b#defineCONFIG_NETMASK#defineCONFIG_IPADDR26//开发板MAC地址//开发板IP地址//主机IP地址#ifndef_CONFIG_H#define二//开发板MAC地址//开发板IP地址//主机IP地址#ifndef_CONFIG_H#define二CONFIG[h#defineCONFIG_S3C24401#defineC0NFIGJIICR0244Q#defineCONFIG^SKIPLOWLEVELINIT#defineCONFljG^MDNzT/*specificallyaSAMSUNGS3C2440SoC#define#define#define#define#define#define#define#define#define#defineCONFIGCONFIGCONFIGDM900QDM900SCONFIGCONFIGCONFIGCONFIGCONFIG110X20000300DRIVERDM9000DM9Q00"NOSROH□M9000-BASE10CONFIG_DM9000BASEDATA(CONFIGDM900QBASE+4)CMDPINGETHADDRNETflASKIPADDRSERVERIP08:00:3e:26:0a:5b192.1&8.1S.12&24开发椒IIAC地HI〃开发板IP地HI〃正机IPWil在根目录下进入board/samsung/micro2440文件夹执行geditmicro2440.c命令intboard_eth_init(bdt^bis)(intrc-0;#ifdefCONFIG_CS890arc=€s8900_initia!ize(OrCONFIG_CS8900_BASE);#endif#ifdefCONFIG_DRIVER_DM9000rc=dm9000_initialize(bis);#endif|returnrc;}#endif在根目录下进入arch/arm/lib文件夹执行gediteabi_compat.c命令^ootfaubuntu:/home/uboot/u-boot-2811.03/arch/arm/lib#gedi:eabicompat.c

#ifndefCONFIG__HICRO2440lotraise(intsignum)printft11raise:Signal#cdught\n"rsignum);#endifreturn9;#ifndefCONFIG__HICRO2440在根目录下进入drivers/net文件夹执行geditdm9000x.c命令root(aubuntu:/home/uboot/u-boot-2011.03/drivers/net#geditdmgsOQx.c在修改staticintdm9000_init(structeth_device*dev,bd_t*bd)函数中内容,如下图所示:Istaticvoiddm9^QGhalt(structeth_device*netdev)□M900e_DBGf"%.s\nn,_func_);#ifndefCONFIG-MICRO2440/*RESETdevie*/phy_writet0,0x8000);/*PHYRESET*/DM9000_iow(DFI9000_GPRr0x01);尸Power-DownPHY*/DM90003iow(DM90002lMRr0x80);尸Disableallin坨门DMgeOQ^iowtDMgOSO^CR,0x00);/*DisableRX*/#endif|测试在根目录下输入命令:make编译完成后将u-boot.bin下载到SDRAM的0x33f80000地址处,u-boot已经能在RAM中运行。测试结果如下图所示:Downloadedfileat0x30000000,size=127340bytesBoot2011.03(May13201^-21:53:1^)DRAM:64MiB己mh:512K1BNAND:NANE_ECC_N0NE:selectedbyboazddriver.Tillsisnotreconuuended!!256M1B""***LfaTDing-badCRCfusingdefaultenvironmentIn:aerialCut:aerialErr:aerialNet:dia900OHitanykeytostopautoboot:0dm9000!/□:05:20000300,id:0x900Gaa4€DM9000:runningin16bitmodeMAC:08:00:3e:26:Qfl:5boperatingatunkriowTi:0modeUsingdm9OO0deviceTFTPfromserver10;ourIPaddressia30Filename1uiniage-nf3.img*.Loadaddress:0x31000000Loading:TT

4、支持内核启动(1)在根目录下进入include/configs文件夹执行geditmicro2440.h命令「Ettgubuntu:,ho"e/ub8t/u-b8t-2Gll.臼gedit用ic「口244添加:#defineCONFIG_SETUP_MEMORY_TAGS1//如果没有定义这个参数,则uboot参数必须加入men=内存大小11〃设置11〃设置bootargs出入内械必须

nnoinitrdroot=/dev/mtdblock3init=/l#defineCONFIG^CHDLINETAG^defineCONFIG^BOOTARGS(2)在根目录下进入arch/arm/lib文件夹执行geditbootm.c命令root(aubuntu:/home/uboot/u-boot-2Sll.S3/arch/arm/lib#geditbootm.c在staticvoidannounce_and_cleanup(void)函数中添加:#ifndefCONFIG_MICRO2440cleanup_before_linux();#endifstaticvoidannou-Ke_and_cleanup(void){""printf("\nStartingkernel...\n\n"l;#ifdefCONFIGUSBDEVICE{''externvoidudcdisconnect(void]:tidedisconnect(J;}"#endif#ifndefCONFIG_MICRO2440cleanupbefore_linux();#endif}自动启动内核如果要自动启动内核,需要include/conskfigs/micro2440.h定义CONFIG_BOOTCOMMAND,类似如下内容:#defineCONFIG_BOOTCOMMAND"nandread0x300080000x600000x300000;bootm0x30008000"#defineCONFIGBOOTCOMMANDunandread0x30008330OxGflflflO0x300000;boot#ifdefined(CONFIG_CMD_KGDB)(4)测试在根目录下输入命令:make编译完成后将u-boot.bin下载到SDRAM的0x33f80000地址处,u-boot已经能在RAM中运行。测试结果如下图所示:EownloadedfileatOx30000OOOrsize=127800bytesSoot2011.03(May13201^一22:10:19)DRAM:石司MiBash:512KiBNANE:NANE_ECC_N0NEselectedbyboarddriver.Thisisnotreconmieiided!!256MiB一一***Kaming一badCRCfusingdefaulteavizonraent二n:serialCat:serialErr:serialNet:dni9000Hitanykeytoatopautoboot:05、支持NandFlash添加s3c2440_nand.c文件在根目录下输入touchdrivers/mtd/nand/s3c2440_nand.c指令进行文件的创建,在根目录下输入geditdrivers/mtd/nand/s3c2440_nand.c命令打开文件。但ubuntu:/home/uboot/u-boot-2011.03/drivers/mtd/nand#gedits3c2440_nand.在DEBUGN(〃board_nand_init()/n〃);下面修改如图所示的三句内容:DEBUGN("board_nand_initn\n11);//twrphO=1;//twrphl=1;//taels=0;taels-1;twrphQ=2;twrphl=1;在根目录下进入drivers/mtd/nand文件夹中执行geditMakefile命令ubuntu:/home/uboot/u-boot-2eil.03/drivers/mtd/nand#geditMakefile添加:#COBJS-$(CONFIG_NAND_S3C2440)+=s3c2440_nand.o如下图所示:C0BJS-$(C0NFIG2mAND2S3C244B)+=S3c2446_nand.0在根目录下进入include/conskfigs文件夹打开micro2440.h文件添加:#defineCONFIG_MTD_DEVICE#defineCONFIG_NAND_S3C2440#defineCONFIG_CMD_NAND#ifdefined(CONFIG_CMD_NAND)#defineCONFIG_SYS_NAND_BASE0x4E000000//Nand配置寄存器基地址#defineCONFIG_SYS_MAX_NAND_DEVICE1

#defineCONFIG_MTD_NAND_VERIFY_WRITE1#endif#defineCONFIG_ENV_IS_IN_NAND1#defineCONFIG_ENV_OFFSET0x40000//将环境变量保存到nand中的0x40000位置#defineCONFIG_ENV_SIZE0x10000/*TotalSizeofEnvironmentSector*/#defineCONFIGMTDDEVICE^defineCONFIGjNAND53C2440#defineCDNFTGCMDNAND#ifdefined(CDNFIG^CHDNAND)0X4E0000Q0//Nand配置寄存器底地址11#defineCONFIGSYSNANDBASE#defineCONFIG'^YS^MAXNAND_DEVICE#defineCQNFIG-MTDNANDVERIFYWRITE#endif#defineCONFIGENV_I5INNAND1#defineCONFIG'EMV~0FF5ET0x40000〃将环境斐.将保事利nand中的0X4000G#defineCONFIGENV~SIZEOxlOSOO/*Total0X4E0000Q0//Nand配置寄存器底地址11测试在根目录下输入命令:make编译完成后将u-boot.bin下载到SDRAM的0x33f80000地址处,u-boot已经能在RAM中运行。测试结果如下图所示:6、支持yaffs下载在根目录下进入include/conskfigs文件夹执行geditmicro2440.h命令root@ubuntu:/home/uboot/u-boot-2011.03/include/confiqs#qeditmicro2440.h添加:#defineCONFIG_CMD_NAND_YAFFSI#deflneCONFIG_CMDNAND_YAFFS在根目录下进入drivers/mtd/nand文件夹打开nand_util.c文件修改部分内容:if(!need_skip&&!withoob){}ops.mode=MTD_OOB_RAWrval=nand->write_oob(nand,offset,&ops);if(rval)break;ops.Ten=pagesize;□ps.ooblen=nand->oobsize;ops.mode=hfTDOOBRAW;ops.ooboffs=0;pages=write_size/pagesizeoob;for(0;page<pages;page++){

ops.datbuf=pbuffer;ops.oobbuf=ops.datbuf+pagesize;rval=nand->write_oob(nand,offsetr&ops);if(rval)break;下载yaffs镜像下载yaffs镜像的时候要注意分区的第一块不能写,比如友善之臂的默认分区如下:Numberofpartitions:4nameoffsetsizeflagvivi0x000000000x000400000param0x000400000x000200000kernel0x000600000x005000000root0x005600000x3fa800000也就是说yaffs镜像所在分区的起始地址在0x560000,因此使用nandwrite.yaffs命令下载yaffs时要写的地址为0x560000+0x20000(NandFlash每块的大小)=0x580000,即下载命令类似如下:tftp0x30008000uImagenandwrite.yaffs0x300080000x5800000x3000007、支持NandFlash启动创建nand_read.c在根目录下执行touchboard/samsung/micro2440/nand_read.c命令,在根目录下执行geditboard/samsung/micro2440/nand_read.c命令,将下列内容复制到nand_read.c文件中#definerNFCONF(^(volatileunsigned*)0x4E000000)#definerNFCONT(^(volatileunsigned*)0x4E000004)#definerNFCMD(^(volatileunsigned*)0x4E000008)#definerNFADDR(^(volatileunsigned*)0x4E00000C)#definerNFDATA8(^(volatileunsignedchar*)0x4E000010)#definerNFSTAT(*(volatileunsigned*)0x4E000020)#defineCMD_READ10x00/*页读命令周期1*/#defineCMD_READ20x30/*页读命令周期2*/#defineCMD_RESET0xFF/*复位*/#defineNF_CMD(cmd){rNFCMD=(cmd);}/*写命令*/#defineNF_ADDR(addr){rNFADDR=(addr);}/*写地址*/#defineNF_RDDATA8()(rNFDATA8)/*读8位数据*/#defineNF_nFCE_L(){rNFCONT&=~(1<<1);}/*片选使能*/#define#define#define#define#define#define#defineNF_nFCE_H()NF_WAITRB()NF_CLEAR_RB()NF_DETECT_RB()TACLSTWRPH0TWRPH1121i){rNFCONT|=(1<<1);}/*片选禁用*/{while(!(rNFSTAT&(1<<1)));}/*等待就绪*/{rNFSTAT|=(1<<2);}/*清除就绪/忙位*/{while(!(rNFSTAT&(1<<2)));}/*等待就绪*/voiddelay(int{while(i—>0);}voidNand_Init(void){rNFCONF=(TACLS<<12)|(TWRPH0<<8)|(TWRPH1<<4)|(0<<0);rNFCONT=(1<<4)|(1<<1)|(1<<0);}staticvoidNand_Reset(void){NF_nFCE_L();NF_CLEAR_RB();NF_CMD(CMD_RESET);NF_DETECT_RB();NF_nFCE_H();}unsignedcharNand_ReadPage(constint{/*片选使能*//*清除就绪/忙位/*写复位命令/*等待就绪*//*片选禁用*/*/*/page,unsignedchar*constbuffer)inti;Nand_Reset();NF_nFCE_L();NF_CLEAR_RB();NF_CMD(CMD_READ1);NF_ADDR(0x0);NF_ADDR(0x0);NF_ADDR(page&0xff);NF_ADDR((page>>8)&0xff);NF_ADDR((page>>16)&0xff);NF_CMD(CMD_READ2);NF_DETECT_RB();for(i=0;i<2048;i++){buffer[i]=NF_RDDATA8();}NF_nFCE_H();}intnand_read(intstart_page,intread_pages,unsignedchar*buffer){inti;Nand_Init();for(i=0;i<read_pages;i++){Nand_ReadPage(start_page,buffer+2048*i);start_page++;}return0;}*nand_read.cXNF_DETECT_RB();for(i=O;i<2048;i++){buffer[i]=NFRDDATA8();}NFnFCEH();}intnandread(intstartpage,intreadpages,unsignedchar*buffer){inti;NandInit();for(i=0;i<read_pages;i++){NandReadPage(startpage,buffer+2948*1);start_page++;}|return0;在根目录下进入board/samsung/micro2440文件夹执行geditMakefile命令root@ubuntu:/home/uboot/u-boot-2011.e3/board/samsung/micro2440#geditMakefile修改COBJS:=micro2440.oflash.onand_read.oCOBJS:=micro2440.oflash.onand_read.o在根目录下执行geditarch/arm/cpu/arm920t/u-boot.lds命令修改:.text:{arch/arm/cpu/arm920t/start.o(.text)board/samsung/micro2440/libmicro2440.o(.text)*(.text)}.text:{arch/arm/cpu/arm920t/start.a(.text)board/samsung/micro2440/'Libmicro2449.0(.text)气.text)}在根目录下执行geditarch/arm/cpu/arm920t/start.S命令添加下面蓝色字体的内容,黑色字体用于定位#ifndefCONFIG_SKIP_LOWLEVEL_INITblcpu_init_crit#endif#ifdefCONFIG_S3C2440_NAND_BOOTldrsp,=0x30008000ldrr0,=0x0;ldrr1,_end_ofsmovr1,r1,LSR#11addr1,r1,#1ldrr2,=(CONFIG_SYS_TEXT_BASE)blnand_readldrpc,=relocations#endifcopy_loop:ldmiar0!,{r9-r10}/*copyfromsourceaddress[r0]*/stmiar1!,{r9-r10}/*copytotargetaddress[r1]*/cmpr0,r2/*untilsourceendaddress[r2]*/blocopy_loop#ifdefCONFIG_S3C2440_NAND_BOOTrelocations:ldrr6,=CONFIG_SYS_TEXT_BASE#endif#ifndefCONFIG_PRELOADER/**fix.rel.dynrelocations*/clbss_l:strr2,[r0]/*clearloop...*/addr0,r0,#4cmpr0,r1bneclbss_lblcoloured_LED_initblred_LED_on#endif#ifdefCONFIG_S3C2440_NAND_BOOTldrsp,=(CONFIG_SYS_INIT_SP_ADDR)bicsp,sp,#7/*8-bytealignmentforABIcompliance*/ldrr0,=0x00000000ldrpc,=board_init_f#endif/*Wearedone.Donotreturn,insteadbranchtosecondpartofboardinitialization,nowrunningfromRAM.*/#ifdefCONFIG_NAND_SPL(5)在根目录下进入include/configs文件夹执行geditmicro2440.h命令root@ubuntu:/home/uboot/u-boot-2011.03/include/configs#geditmicro2440.h#defineCONFIG_S3C2440_NAND_BOOT/*#defineCONFIG_SKIP_LOWLEVEL_INIT*/#defineCDNFlO3C2440-NAND_B00T//#defineCONFIGSKIPLOWLEVELINIT(6)在根目录下进入arch/arm/lib文件夹执行geditboard.c命令roojjaubuntu:/hame/uboot/u-boot-2011.B3/arch/arm/lib#aedit.board.c修改一下内容:voidboard_init_f(ulongbootflag){gd->mon_len=_bss_end_ofs+0x100000;/*why*//*relocate_code(addr_sp,id,addr);*/#ifdefCONFIG_S3C2440_NAND_BOOT/*addbywzc*/__asmvolatile__("movsp,%0〃::〃r〃(addr_sp):〃sp〃);/*addbywzc*/board_init_r(id,addr);#elserelocate_code(addr_sp,id,addr);/*NOTREACHED-relocate_code()doesnotreturn*/#endif}+board.cXdebugfrelocatiDfitfTtsetis:gd->reloc_ott);memcpy(idr(void*)gdrsizeof(gdt));/*relocatecode(addrsp,id,addr);*/#lfdefCONFIG_S3C2440NAND_B00T/*addbyw

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论