生活随笔
收集整理的這篇文章主要介紹了
zynq-7000移植linux操作系统
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
目錄
- 1.u-boot
- 2.linux內(nèi)核
- 3.devicetree.dtb
- 4.BOOT.bin
- 5.根文件系統(tǒng)
- 6.修改bootargs與bootcmd
- 7.相關(guān)網(wǎng)站
開(kāi)發(fā)環(huán)境
: vivado
2017.4, ubuntu
16.04
開(kāi)發(fā)板
: ax7010
編譯器
: gcc
-linaro
-4.9.4-2017.01-x86_64_arm
-linux
-gnueabihf
u
-boot
: u
-boot
-xlnx
-v2017
.4
linux內(nèi)核
: linux
-xlnx
-xilinx
-v2017
.4
rootfs
: debian文件系統(tǒng)
1.u-boot
make ARCH=arm zynq_zc702_defconfig
make ARCH=arm menuconfig
- BOOT media->support QSPI/SPI flash
- 編譯
make ARCH=arm
CROSS_COMPILE=arm-linux-gnueabihf-
- 編譯成功后生產(chǎn)的是 u-boot,重命名為 u-boot.elf,用于生成 BOOT.bin文件
2.linux內(nèi)核
make ARCH=arm xilinx_zynq_defconfig
make ARCH=arm menuconfig
- Device Drivers->Memory Technology Device(MTD) surport->Self-contained MTD device drivers->support most SPI Flash
- Device Drivers->Common Clock Framework->Digilent axi_dynclk Driver
- Device Drivers->Graphics support-> Digilent VGA/HDMI DRM Encoder Driver
- 編譯
make ARCH=arm
CROSS_COMPILE=arm-linux-gnueabihf-
- 編譯成功后生成的 ./arch/arm/boot/zImage 即為內(nèi)核文件
3.devicetree.dtb
- 生成設(shè)備樹(shù)可參考利用Xilinx SDK生成設(shè)備樹(shù)
- 修改pcw.dtsi中的qpsi節(jié)點(diǎn)
&qspi {is
-dual = <0
>;num
-cs = <1
>;spi
-rx
-bus
-width = <4
>;spi
-tx
-bus
-width = <4
>;status = "okay";
flash0: flash@0
{compatible = "n25q512a"
,"micron
,m25p80";reg = <0x0
>;spi
-max
-frequency = <50000000
>;partition@0x00000000
{label = "boot";reg = <0x00000000 0x00500000
>;
};partition@0x00500000
{label = "bootenv";reg = <0x00500000 0x00020000
>;
};partition@0x00520000
{label = "kernel"; reg = <0x00520000 0x00a80000
>;
};partition@0x00fa0000
{label = "devicetree";reg = <0x00fa0000 0x00020000
>;
};partition@0x00fc0000
{label = "bitstream";reg = <0x00fc0000 0x00500000
>;
};
};
};
- 修改設(shè)備樹(shù)system-top.dts文件
/dts
-v1/;
/include/ "zynq
-7000.dtsi"
/include/ "pl.dtsi"
/include/ "pcw.dtsi"/
{chosen
{bootargs = "console=ttyPS0
,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait earlycon";stdout
-path = "serial0
:115200n8";
};aliases
{ethernet0 =
&gem0;serial0 =
&uart1;spi0 =
&qspi;};memory
{device_type = "memory";reg = <0x0 0x20000000
>;
};
usb_phy0: usb_phy@0
{compatible = "ulpi
-phy";reg = <0xe0002000 0x1000
>;view
-port = <0x0170
>;drv
-vbus;
};
};
&i2c0 {clock
-frequency = <100000
>;
};
&usb0 {dr_mode = "host";usb
-phy = <
&usb_phy0>;
};
&sdhci0 {u
-boot
,dm
-pre
-reloc;
};
&uart1 {u
-boot
,dm
-pre
-reloc;
};
&flash0 {compatible = "micron
,m25p80"
, "w25q256", "spi
-flash";
};
&gem0 {phy
-handle = <
ðernet_phy>;ethernet_phy: ethernet
-phy@1
{reg = <1
>;device_type = "ethernet
-phy";
};
};
&amba_pl {hdmi_encoder_0
:hdmi_encoder
{compatible = "digilent
,drm
-encoder";digilent
,edid
-i2c = <
&i2c0>;};xilinx_drm
{compatible = "xlnx
,drm";xlnx
,vtc = <
&v_tc_0>;xlnx
,connector
-type = "HDMIA";xlnx
,encoder
-slave = <
&hdmi_encoder_0>;clocks = <
&axi_dynclk_0>;dglnt
,edid
-i2c = <
&i2c0>;planes
{xlnx
,pixel
-format = "rgb888";plane0
{dmas = <
&axi_vdma_0 0
>;dma
-names = "dma";
};
};
};
};
&axi_dynclk_0 {compatible = "digilent
,axi
-dynclk";clocks = <
&clkc 15
>;
};
&v_tc_0 {compatible = "xlnx
,v
-tc
-5.01.a";
};
dtc -I dts -O dtb -o devicetree.dtb system-top.dts
4.BOOT.bin
- BOOT.bin由FSBL.elf,FPGA.bit,u-boot.elf打包生成
- FSBL.elf - FPGA.bit - u-boot.elf
- Xilinx SDK->Xilinx->Create Boot Image->依次添加FSBL.elf,FPGA.bit,u-boot.elf->Create Image
- BOOT.bin即在上圖Output path路徑下
5.根文件系統(tǒng)
- 將SD卡分為兩個(gè)區(qū)
- Part1 fat32 用于存儲(chǔ)BOOT.bin zImage devicetree.dtb
- Part2 ext4 用于存儲(chǔ)根文件系統(tǒng)
- 此處使用的是黑金提供的debian系統(tǒng),寫(xiě)入SD卡ext4fs分區(qū)即可。假定掛載路徑為/media/dingz/rootfs:
tar -zxvfp debian_rootfs.tar.gz -C /media/dingz/rootfs
6.修改bootargs與bootcmd
- 開(kāi)發(fā)板啟動(dòng)方式設(shè)為SD卡啟動(dòng),連接串口,打開(kāi)超級(jí)終端,autoboot前按下任意鍵,進(jìn)入u-boot命令行
setenv bootargs
'console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait earlycon'
setenv bootcmd
'fatload mmc 0:1 0x2080000 zImage;fatload mmc 0:1 0x2000000 devicetree.dtb;bootz 0x2080000 - 0x2000000'
saveenv
print
boot
7.相關(guān)網(wǎng)站
- ARM交叉編譯器:linaro arm交叉編譯器
- u-boot-xlnx-v2017.4.tar.gz:xilinx u-boot
- linux-xlnx-xilinx-v2017.4.tar.gz:xilinx linux
總結(jié)
以上是生活随笔為你收集整理的zynq-7000移植linux操作系统的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。