Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create folder /lib/firmware if it does not exist using following command in Linux.

    Code Block
    themeMidnight
    mkdir -p /lib/firmware


  2. Copy bitstream file (in .bin format) to be loaded to PL into folder /lib/firmware/.
  3. Select the type of bitstream to be loaded to PL using below command in Linux.

    Code Block
    themeMidnight
    echo <bitstream_type> > /sys/class/fpga_manager/fpga0/flags

    where bitstream type can be selected from below table. 

    bitstream_type

    Usage

    0x01

    Partial bitstream

    0x020x40

    Authentication with image in DDR. Once bitstream is authenticated, it is either copied to PL or sent to AES crypto engine based on the bitstream image type.

    0x040x80

    Authentication with image in OCM. During authentication of the bitstream block, the system stores the hash of the bitstream block chunk during authentication. Once authentication is passed, during the transfer of the bitstream block to PL or to AES engine, system revalidates hashes of chunk chunks to make sure the image is not modified after authentication.

    0x080x20

    Decryption using user key (user key in KUP register)

    0x100x4

    Decryption using device key

    Note that above values can be ORed based on type of bitstream to be loaded. For example, if bitstream image is to be authenticated in OCM and decrypted using device key, the flag should be written with value 0x14 (0x04 OR 0x10)
    0x60Authentication(DDR memory) + Decryption using user key. Once bitstream is authenticated, it is sent to the AES crypto engine based on the bitstream image type.
    0xA0Authentication(OCM memory) + Decryption using user key. Once bitstream is authenticated, it is sent to the AES crypto engine based on the bitstream image type.
    0x44Authentication(DDR memory) + Decryption using Device key. Once bitstream is authenticated, it is sent to the AES crypto engine based on the bitstream image type.
    0x84Authentication(OCM memory) + Decryption using Device key. Once bitstream is authenticated, it is sent to the AES crypto engine based on the bitstream image type.


  4. If user key to be used for bitstream decryption, the key should be stored in file and pushed using following command in Linux.

    Code Block
    themeMidnight
    cat <user_defined_key_file> > /sys/class/fpga_manager/fpga0/key

    For example,  

    User key 2584B3F7844A0A0AECD36F0E511DA724E38492277D71192462AFC6975936EED0 is stored in usr_key.txt file and this file is pushed to system using following command.

    echo usr_key.txt > /sys/class/fpga_manager/fpga0/key
  5. Now download the bitstream using following command in Linux.

    Code Block
    themeMidnight
    echo <bitstream_file_name> > /sys/class/fpga_manager/fpga0/firmware

    where bitstream_file_name is the name of file copied into folder /lib/firmware in step 2.

...