zynq zc706 Linux系统移植笔记

来源:互联网 发布:仿windows桌面 html5 编辑:程序博客网 时间:2024/06/05 19:31

1、uboot源码

       zynq u-boot github地址:https://github.com/xilinx

2、zynq下启动流程


3、uboot编译

    # make distclean 

    # make zynq_zc702_defconfig

   # make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

   # cp tools/mkimage  /bin   (后面制作uramdisk使用)

  将生成的uboot 重命名为 u-boot.elf 

4、测试uboot

    需要的文件是:

   u-boot.elf  fsbl.elf system.bit

    打开SDK,greate image    ,依次添加 fsbl.elf 、system.bit  u-boot.elf  

  (由于我用的flash为16M , Vivado生成的bit文件过大,最后没加载,uboot任然可以起来) 

  

5、内核配置编译

   从xilinx官网下载 linux内核

   #make distclean

   # make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

    也可以修改 Makefile ,初始化ARCH 和CROSS_COMPILE

  # make  LOADADDR=0x80000  uImage

  (此处 0x80000 为内核加载到内存的入口地址,该参数可通过查看

 uboot 源码   ./include/configs/zynq-common.h

 中 kernel_loadaddr  参数。)

   # cp  arch/arm/boot/dts/zynq_zc702.dtb 到windows 。 并命名为 devicetree.dtb

  # cp uImage 到  windows。

6、ramdisk 制作

  我使用的是别人制作好的,具体参看文章:

   http://blog.csdn.net/ljh618625/article/details/78563985

   我使用的是下载好的 ramdisk.gz ,在被人的基础上修改。

最终生成 uramdisk_image.gz  具体命名参看  ./include/configs/zynq-common.h 中具体脚本。

7、打包成 .bin 文件,并下载到Qspi flash

 按照以下顺序:

 fsbl.elf + uboot.elf + uImage + devicetree.dtb + uramdisk_image.gz 

后面三个文件的具体offset 必须和 kernel源码 和 uboot 中 ./include/configs/zynq-common.h 下 对于的zynq_zc702.dts 中的Qspi flash 分区匹配。

8、设置uboot启动参数

  在系统进入uboot 后: 

设置参数如下:

(1)、ramdisk 从内存中加载:

       setenv bootargs "initrd_start=0x4000000 initrd_end=0x4900000 root=/dev/ram0 rw init=/linuxrc ramdisk_size=0x900000 rootfstype=ext4"  具体参数含义参考下(3)

(2)、nfs 启动:

   setenv bootargs "noinitrd root=/dev/nfs nfsroot=192.168.1.103:/home/nfs_file ip=192.168.1.100"

 (3)、bootarg参考:

   设置uboot启动参数设置详细参见:http://blog.csdn.net/ljh618625/article/details/78563938 

  (4)、可能错误:

   如果bootarg 参数设置不对,可能会出现:

   VFS : cannot open root device "null" or unknow-block(0,0)

   Kernel panic - not syncing: VFS: Unable to mount rootfs on unknown-block 等错误。


   哈哈 , 系统应该可以起来了。

(移植注意点: IP核的DDR必须配置正确,配置完成后,可用SDK下的应用测试,加以测试)





    


  


  





 


原创粉丝点击