u-boot下自動(dòng)升級(jí)功能設(shè)計(jì)說(shuō)明_第1頁(yè)
u-boot下自動(dòng)升級(jí)功能設(shè)計(jì)說(shuō)明_第2頁(yè)
u-boot下自動(dòng)升級(jí)功能設(shè)計(jì)說(shuō)明_第3頁(yè)
u-boot下自動(dòng)升級(jí)功能設(shè)計(jì)說(shuō)明_第4頁(yè)
u-boot下自動(dòng)升級(jí)功能設(shè)計(jì)說(shuō)明_第5頁(yè)
已閱讀5頁(yè),還剩14頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

設(shè)計(jì)分 實(shí)現(xiàn)過(guò) FAT文件系統(tǒng)支 MMC驅(qū)動(dòng)移 使能USB 詳細(xì)設(shè) AutoUpdate詳細(xì)設(shè) 插圖圖1-1U-boot下SD卡/U盤(pán)升級(jí)簡(jiǎn)要流程 圖3-1函數(shù)運(yùn)行過(guò)程

1設(shè)計(jì)分析2.SDU3.4.----結(jié)束當(dāng)同時(shí)SD卡和U盤(pán)時(shí),若SD卡中沒(méi)有有效升級(jí)包,則系統(tǒng)自動(dòng)轉(zhuǎn)入U(xiǎn)盤(pán)升級(jí),若SD卡中含有有效升級(jí)包直接使用SD卡中的升級(jí)包升級(jí)系統(tǒng),不再掃描U盤(pán)中的內(nèi)容。具體實(shí)現(xiàn)見(jiàn)3.1.2.2“函數(shù)實(shí)現(xiàn)”實(shí)現(xiàn)過(guò)程以下的實(shí)現(xiàn)均以Hi3536為例進(jìn)行說(shuō)明,其中SD卡升級(jí)以Hi3516A為例進(jìn)行說(shuō)明,具體的代碼路徑需要根據(jù)實(shí)際使用修改。Hi3520D/Hi3515A/Hi3535/Hi3536/Hi3521A/Hi3520DV300平臺(tái)僅支持U? ? ? ?include/configs/hi3518ev200.h【hi3518ev200?include/configs/hi3518ev201.h【hi3518ev201?include/configs/hi3516cv200.h【hi3516cv200?include/configs/ ?include/configs/ ?include/configs/ ?include/configs ?include/configs/ ?include/configs/hi3516a.h和 ?include/configs/hi3536.h和 ?include/configs/ 【hi3521A*sdcard/usbstoragesystem*#define#ifdef1#define1#define1 #define1#define1**#ifdefCONFIG_AUTO_SD_UPDATE //SD卡驅(qū)動(dòng)編譯開(kāi)關(guān),受總開(kāi)關(guān)#define#defineREG_BASE_MCI #defineCONFIG_HIMCI_V100#define#define #define**的11112SD支持SD卡升級(jí)或者U盤(pán)升級(jí)#define #define Hi3536代碼為例,SDHi3516A代碼為例,說(shuō)明升級(jí)模塊中各個(gè)子模 【程序 FAT在配置文件中增加FAT相關(guān)的編譯開(kāi)關(guān)即可,紅色部分為相關(guān)修*sdcard/usbstoragesystem*#define #ifdef#define #define #define #define MMC編譯開(kāi)* #ifdef#define#defineREG_BASE_MCI #defineCONFIG_HIMCI_V100#define#define #define代碼移

Hi3520D、Hi3515A、Hi3535、Hi3536不支持SD卡,故不支持從SD編譯開(kāi) :**#define #define #define #defineCONFIG_USB_XHCI1#define2代碼移

完成“2.2.1FAT文件系統(tǒng)支持”和“2.2.2MMCU-boot支mmcinfommcSD卡的相關(guān)命令。同理完成“2.2.1FAT文件系統(tǒng)支持”和“2.2.3USBOHCIUUSBOHCI驅(qū)動(dòng)是從SD卡中手動(dòng)升級(jí)系統(tǒng)的升級(jí)包到內(nèi)存,燒寫(xiě)到Flash上的相應(yīng)的位置即可。SD卡自動(dòng)升級(jí)使用手冊(cè)和移植說(shuō)明.docsfprobe0;sferase100000400000;sfwrite0x82000000100000400000;將內(nèi)核燒寫(xiě)到SPI【燒寫(xiě)位置可以自行決定】或者直接bootm0x82000000啟動(dòng)新內(nèi)核詳細(xì)操hisilicon#mmcinfoDevice:HIMCI_V100ManufacturerID:3OEM:5344Name:SD01GTranSpeed:25000000RdBlockLen:512SDversion2.0HighCapacity:NoCapacity:1015808000BusWidth:4-bithisilicon#fatlsmmchisilicon#fatloadmmc00x82000000readingkernel2902412bytesreadhisilicon#bootm##BootingkernelfromLegacyImageat82000000ImageName:Linux-ImageType:ARMLinuxKernelImage( DataSize: 2902348Bytes=2.8MiBLoadAddress:EntryPoint:80008000LoadingKernelImage...OKStartingkernel從U盤(pán)中手動(dòng)升級(jí)系統(tǒng)鍵入usbstart命令,初始化USB設(shè)fatlsusb0U鍵入fatloadmmc00x42000000kernel,將kernel鏡像到內(nèi)sfprobe0;sferase100000600000;sfwrite0x42000000100000600000;將內(nèi)核燒寫(xiě)到SPI(燒寫(xiě)位置可以自行決定)或者直接bootm0x42000000啟動(dòng)新內(nèi)核詳細(xì)操hisilicon#usbstart(Re)startUSB... scanningbusfordevices...2USBDevice(s)scanningbusforstoragedevices...usb_stor_get_info-1StorageDevice(s)hisilicon#fatlsusb02902412kernel220236u-39495683file(s),0hisilicon#fatloadusb00x42000000kernelreadingkernel2902412byteshisilicon#bootm##BootingkernelfromLegacyImageat42000000ImageName:Linux-ImageType:ARMLinuxKernelImage( DataSize: 3941184Bytes=3.8MiBLoadAddress:EntryPoint:40008000LoadingKernelImage...OKStartingkernel計(jì)見(jiàn)3詳細(xì)設(shè)計(jì)。int{#ifdef#ifdefexternintdo_auto_update(void);#ifdefCFG_MMU_HANDLEOK #endif/*CONFIG_AUTO_UPDATE*/return0;}詳細(xì)設(shè)計(jì)AutoUpdate簡(jiǎn)單數(shù)據(jù)Image*"StandalonePrograms"aredirectlyrunnableintheprovidedbyU-Boot;itisexpectedthat(iftheywell)youcancontinuetoworkinU-BootafterreturntheStandalone"OSKernelImages"areusuallyimagesofsomeEmbeddedOSwilltakeovercontrol y.Usuallythesewillinstalltheirownsetofexceptionhandlers,drivers,setuptheMMU,etc.-thismeans,thatyouexpecttore-enterU-Bootexceptbyresettingthe"RAMDiskImages"aremoreorlessjustdatablocks,andparameters(address,size)arepassedtoanOSkernelthatbeing"Multi-FileImages"containseveralimages,typicallyan(Linux)kernelimageandoneormoredataimagesRAMDisks.ThisconstructisusefulforinstancewhenyoutobootoverthenetworkusingBOOTPetc.,wheretheserverprovidesjustasingleimagefile,butyouwanttoforinstanceanOSkernelandaRAMDisk"Multi-FileImages"startwithalistofimagesizes,imagesize(inbytes)specifiedbyan"uint32_t"inbyteorder.ThislististerminatedbyanImmediayaftertheterminating0followtheimages,oneone,allalignedon"uint32_t"boundaries(sizeroundedupamultipleof4bytes-exceptforthelast"FirmwareImages"arebinaryimagescontainingfirmwareU-BootorFPGAimages)whichusuallywillbeprogrammedflash"Scriptfiles"arecommandsequencesthatwillbeexecutedU-Boot'scommandinterpreter;thisfeatureisusefulwhenyouconfigureU-Boottousearealsascommandinterpreter(=>S#define /*Invalid #defineIH_TYPE_STANDALONE1 /*StandaloneProgram #defineIH_TYPE_KERNEL2 /*OSKernelImage #defineIH_TYPE_RAMDISK3 /*RAMDiskImage #defineIH_TYPE_MULTI4 /*Multi-FileImage*/#defineIH_TYPE_FIRMWARE /*FirmwareImage*/#defineIH_TYPE_SCRIPT6 /*Scriptfile*/#defineIH_TYPE_FILESYSTEM7 /*FilesystemImage(anytype)*/#defineIH_TYPE_FLATDT8 /*BinaryFlatDeviceTreeBlob*/u-–/*indexofeachfileinthefollowingarrays*/#defineIDX_FIRMWARE0#defineIDX_KERNEL#defineIDX_ROOTFS/*max.numberoffileswhichcouldinterestus*/#defineAU_MAXFILES3#defineAU_FIRMWARE"u-boot"#defineAU_KERNEL #define /*pointerstofilenames*/char*aufile[AU_MAXFILES]={AU_FIRMWARE,autoupdatestruct{longend;/*layoutoftheFLASH.ST=startaddress,ND=endaddress.*/#defineAU_FL_FIRMWARE_ST0x0#defineAU_FL_FIRMWARE_ND0x7FFFF#defineAU_FL_KERNEL_ST0x100000#defineAU_FL_KERNEL_ND0x5FFFFF#defineAU_FL_ROOTFS_ST0x600000#defineAU_FL_ROOTFS_ND0xbFFFFF/*sizesofflashareasforeachfile*/longausize[AU_MAXFILES]={(AU_FL_FIRMWARE_ND+1)-AU_FL_FIRMWARE_ST,(AU_FL_KERNEL_ND+1)-AU_FL_KERNEL_ST,(AU_FL_ROOTFS_ND+1)-/*arrayofflashareasstartandendaddresses*/structflash_layoutaufl_layout[AU_MAXFILES]={{ {AU_FL_KERNEL_ST,AU_FL_KERNEL_ND,{AU_FL_ROOTFS_ST,AU_FL_ROOTFS_ND,/*wheretoloadfilesintomemory#defineLOAD_ADDR((unsignedchar/*theappisthelargestimage#defineMAX_LOADSZUflash上的步驟:1.SD卡/Uload到內(nèi)存上。步驟2.從內(nèi)存寫(xiě)到SPIflash上。----結(jié)束校驗(yàn)信每個(gè)升級(jí)所用的鏡像的開(kāi)頭幾個(gè)字節(jié),都必須包含如下信息:(包括魔術(shù)字、crc校#defineIH_MAGIC 0x27051956/*ImageMagicNumber*/#defineIH_NMLEN 32/*ImageNameLength*/typedefstructimage_header{ ih_magic;/*ImageHeaderMagicNumber /*ImageHeaderCRCChecksum /*ImageCreationTimestamp*/ /*ImageDataSize /*DataLoadAddress /*E

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論