4. SD卡文件內(nèi)容二(BOOT.bin)
SDK會生成FSBL的elf文件,另外加上從XPS導(dǎo)出的System.bit,以及我們在第一篇文章中編譯生成的u-boot.elf,就可以生成用來實(shí)現(xiàn)SD卡啟動系統(tǒng)的完整Bootloader。
集齊u-boot.elf、system.bit和fsbl.elf就可以生成Image文件了,在SDK軟件中點(diǎn)擊Xilinx Tools→CreateBoot Image,然后選擇3個(gè)文件,點(diǎn)擊Create Image,生成文件,其中
u-boot.bin文件就是需要的u-boot image文件,將其重命名為BOOT.BIN后拷貝到SD卡中。
4.1. Elf文件(FSBL)
fsbl.elf文件需要在SDK軟件中生成,首先新建工程,選擇Xilinx C Project,然后選擇Zynq FSBL,編譯工程即可生成zynq_fsbl_0.elf文件。
4.2. System.bit文件
system.bit是PL部分的BIT文件,首先在ISE軟件中新建工程,加入zynq系統(tǒng),在EDK中配置ARM核及其外設(shè),返回ISE生成TOP HDL Source,點(diǎn)擊generate Programming File即可生
成Bit文件,然后點(diǎn)擊Export Hardware Design To SDK with Bitstream進(jìn)入下一步。
4.3. U-boot.elf文件(SSBL)
1. 首先Git下載Xilinx U-Boot代碼
git clone git://git.xilinx.com/u-boot-xlnx.git
2. 配置u-boot,在上一篇博客中介紹了交叉編譯環(huán)境的建立,此處可直接進(jìn)行配置
cd u-boot-xlnx
make zynq_zed_config
3. 編譯u-boot
Make
以上步驟完成之后會生成一個(gè)u-boot文件,將其另存為u-boot.elf文件,此文件在生成Bootimage文件時(shí)會使用到。
5. SD卡文件內(nèi)容三(Device Tree Blob)
5.1. Xilinx官網(wǎng)方法
This how-to describes the process of compiling a device tree blob.
Build Device Tree Blob is a part of the Xilinx design flow described in Getting Started.
Task Dependencies (Pre-requisites)
· Fetch Sources(Device Tree Generator sources and Linux sources)
· Hardware Project
Input Files Required
· Hardware Project directory
· Linux source directory
Output Files Produced
· *.dts, *.dtb
Task Description
Creating a Device Tree Source (.dts) file
1 Open the hardware project in XPS.
Export the hardware system to SDK:
XPS Menu: Project > Export Hardware Design to SDK... > Export & Launch SDK
2 The Device Tree Generator Git repository needs to be downloaded as specified on the Fetch Sources page. In order for SDK to be able to import the Device
Tree Generator correctly, the downloaded Git repository device-tree/ will need to be placed under /bsp/ (create this directory hierarchy, if needed). The file hierarchy needs to look like:
/bsp/device-tree/data/device-tree_v2_1_0.mld
/bsp/device-tree/data/device-tree_v2_1_0.tcl
Add the BSP repository in SDK:
SDK Menu: Xilinx Tools > Repositories > New... () > OK
Create a Device Tree Board Support Package (BSP):
SDK Menu: File > New > Board Support Package > Board Support Package OS: device-tree > Finish
3 A BSP settings window will appear. This window can also be accessed by opening the Device Tree BSP's system.mss file and clicking 'Modify this BSP's Settings'.
Fill in the values as appropriate:
o The 'bootargs' parameter specifies the arguments passed to the kernel at boot time (kernel command line). ***
o The 'console device' parameter specifies which serial output device will be used. Select a value from the drop-down.
The .dts file is now located in //
/libsrc/device-tree_v*/xilinx.dts.
評論