zynq-mpsoc系列之用petalinux生成BOOT.bin文件

zynq-mpsoc系列之用petalinux生成zcu102的BOOT.bin文件

                              作者:卢浩  

                                     时间:2017.2.28

                                    转载请注明出处


首先我们来了解一下petalinux-package的用法
Usage:
  petalinux-package --boot [options]


Options for boot image package:
  -h|--help                   Display help messages
  --force                     Force overwrite the boot binary image
  --format           Avaiable formats:
                               For Zynq:
                                * BIN (default): generate BIN file to be put to
                                  Flash or SD for Zynq to boot from it.
                               For MicroBlaze:
                                * MCS: generate MCS file
  --fsbl           Path to FSBL ELF image location.
                               For Zynq:
                                Default is images/linux/zynq_fsbl.elf
                               For ZynqMP:
                                Default is images/linux/zynqmp_fsbl.elf
                               For MicroBlaze:
                                Default is images/linux/fs-boot.elf
                               Please use "--fsbl none" for no fsbl if required.
  --fpga          Path to FPGA bitstream image location
                                Default is: images/linux/*.bit (The one copied from the HDF)
  --atf []           ZynqMP only. Path to ATF
  --pmufw []       Path to the PMUFW ELF location
                              Optional and applicable only for ZynqMP.
                                * path to the PMUFW ELF image
                                  default: /prebuilt/linux/images/pmufw.elf
                                       * By default, pre-built pmufw is packed without specifying this option.
             To skip packing pmufw use --pmufw no


  --u-boot []     Path to the u-boot image location.
                              Not valid for DOWNLOAD.BIT
                               For Zynq:
                                * path to the u-boot ELF image
                                  default: /images/linux/u-boot.elf
                               For MicroBlaze:
                                * path to the u-boot-s.bin image
                                  default: /images/linux/u-boot-s.bin
  --kernel []     Path to the kernel image location
                              Not valid for DOWNLOAD.BIT
                              Default: /images/linux/image.ub
  --add           Path to the data to add
  --offset           offset of previously specified data file, u-boot
                              , or kernel image.
  --bmm            Bitstream BMM file. Valid for MicroBlaze only.
                              It will be used to generate the download.bit with
                              bootloader in the bram. Default will be the BMM
                              file in the same directory as the FPGA bitstream.
                              This is deprecated and an MMI file should be used instead.
  --mmi            Bitstream MMI file. Valid for MicroBlaze only.
                              It will be used to generate the download.bit with
                              bootloader in the bram. Default will be the MMI
                              file in the same directory as the FPGA bitstream.
  --flash-size   Flash size in MBytes of the PROM device is targeted.
                              It must be power of 2.
                              Only valid for MicroBlaze MCS format.
                              If this value is not specified. It will auto detect
                              the system flash configured from system config.
                              If it is parallel flash, it will auto detect flash
                              size.
                              If it is SPI flash, the default is 16 Mbytes.
  --flash-intf    Flash interface. Available options:
                              Only valid for MicroBlaze MCS
                               * SERIALx1
                               * SPIx1
                               * SPIx2
                               * SPIx4
                               * BPIx8
                               * BPIx16
                               * SMAPx8
                               * SMAPx16
                               * SMAPx32
                              If not specified, it will auto detect the system
                              flash configured from system config.
                              If it is parallel flash, it will auto detect flash
                              width. If it is SPI flash, the default will be SPIx1.
  -o, --output      Generated boot image name
  -p, --project     PetaLinux SDK project location.
                              Default is the working project.
  --cpu              ZynqMP only. destination CPU of the data file
  --file-attribute  Zynq/ZynqMP only. data file file-attribute
  --bif-attribute        Zynq/ZynqMP only. name of BIF attribute
  --bif-attribute-value      Zynq/ZynqMP only. value of the attribute specified by
                                     --attribute argument
  --fsblconfig     Zynq/ZynqMP only. BIF fsbl config value
  --bif                        Zynq/ZynqMP only. BIF file. It overrides all
                                     other settings:
                                     --fsbl, --fpga, --u-boot, --add, --fsblconfig,
                                     --file-attribute, --bif-attribute and
                                     --bif-attribute-value.
  --boot-device           valid for BIN for Zynq and ZynqMP only.
                                     sd | flash
                                     default will be the one selected from system select menu
                                     of boot image settings


EXAMPLES:


Package BOOT.BIN for ZynqMP:
$ petalinux-package --boot --fsbl --fpga --u-boot --pmufw
  It will generate a BOOT.BIN in your working directory with:
    * specified
    * specified
    * specified < PMUFW_ELF > *
    * newly built u-boot image which is /images/linux/u-boot.elf

首先我来介绍生成一个简单的BOOT.bin文件,包含fsbl,u-boot.elf,bl31.elf;
输入如下命令:

$ petalinux-package --boot --fsbl images/linux/zynqmp_fsbl.elf --u-boot=images/linux/u-boot.elf --pmufw no --atf --force 
下面是输入命令之后的打印信息:
INFO: File in BOOT BIN: "/home/luhao/xilinx/peta_project/xilinx-zcu102-2016.4/images/linux/zynqmp_fsbl.elf"
INFO: File in BOOT BIN: "/home/luhao/xilinx/peta_project/xilinx-zcu102-2016.4/images/linux/bl31.elf"
INFO: File in BOOT BIN: "/home/luhao/xilinx/peta_project/xilinx-zcu102-2016.4/images/linux/u-boot.elf"
INFO: Generating zynq binary package BOOT.BIN...
INFO: Binary is ready.
petalinux-package --boot 用来生成一个BOOT.bin目标文件;
--fsbl images/linux/zynqmp_fsbl.elf 代表着fsbl的路径;
--u-boot=images/linux/u-boot.elf 代表着u-boot.elf的路径;
--pmufw no 表示禁用pmufw,如果不加no,默认路径就是image/linux/pmufw.elf;
--force是覆盖之前生成的BOOT.bin文件;
bl31.elf是atf文件,arm加密固件;

如果需要加入bit文件,请加入如下选项
--fpga images/linux/design_1_wrapper.bit 

你可能感兴趣的:(zynq-mpsoc系列之用petalinux生成BOOT.bin文件)