Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Versal™Boot and Configuration Tutorials

See Vivado™ Development Environment on amd.com

VCK190 eMMC Bring Up

Version: Vivado 2022.1
No updates to this tutorial planned

Table of Contents

  1. Introduction

  2. Before You Begin

  3. Building Hardware Design

  4. Building Software Design

  5. Running the Design

  6. Debugging the Design

Introduction

AMD Versal™ Adaptive SoC combines adaptable processing and acceleration engines with programmable logic and configurable connectivity to enable custom, heterogeneous hardware solutions for a wide variety of applications in Data Center, automotive, 5G wireless, wired network, and defense. Versal Adaptive SoC supports several primary boot modes for application flexibility.

Objectives

To use the eMMC Boot Module on the VCK190, the flash needs to be formatted and partitioned properly. This page guides you through the first time usage of the eMMC flash in two cases:

  • without an AMD Vivado™ HW Manager
  • with Vivado HW Manager

This page can also be followed to recover a corrupted eMMC flash that does not boot up to Linux.

Design Block Diagram

The eMMC boot module is put on the QSPI boot module connector.

Block_Diagram

Directory Structure

Tutorial Directory Details
vck190_boot_emmc
|___Design.................Contains all the generated hardware and software design for this example
  |___Hardware.................Contains Vivado design 
  |___Software................Contains TCL scripts to generate reference design and PDI, and to read JTAG registers
    |___emmc........Directory that XSA for eMMC project will be written to
    |___sd1................Directory that XSA for SD card project will be written to
    |___user_dtsi...............Contains "system-user.dtsi" for petalinux projects
      |___system-user.dtsi.........................."system-user.dtsi" for petalinux projects
|___Scripts.................Contains TCL scripts to generate reference design, PDI/XSA, and text file with the commands to reconfigure eMMC
  |___cmd_to_reconfigure_emmc....................Contains the text file with the commands to reconfigure eMMC
    |___cmd_to_reconfigure_emmc.txt....................text file with the commands to reconfigure eMMC
  |___project_top_emmc.tcl....................Create vivado project for eMMC
  |___project_top_sd1.tcl.....................Create vivado project for SD card
  |___vck190_emmc_bd.tcl......................Create block design for eMMC
  |___vck190_sd1_bd.tcl..................Create block design for SD card
  |___xsa_generation_for_projects_emmc_and_sd1.tcl..............Top level scripts for eMMC and SD card vivado project, and it also run implement and write XSA for the projects
|___Figures.................Contains images to format eMMC in linux and hardware manager
  |___vck190_image.png...........................Image of vck190 board
  |___fdisk_commands.PNG...........................Image to format eMMC partitions in linux
  |___boot_modes_switch.PNG........................Image to select the boot modes switch
  |___add_config.PNG...............................Image to add configuration memory device
  |___config_mem.PNG...............................Image to add configuration memory device
  |___config_mem_ok.PNG............................Image to program memory device
  |___prog_mem.PNG.................................Image to program memory device
|___README.md...............Includes tutorial overview, steps to create reference design, and instructions to run the design

Before You Begin

Recommended general knowledge of:

  • VCK190 evaluation board
  • Versal primary boot mode
  • Versal PMC/PS peripherals
  • AMD Vivado™ Design Suite
Key Versal Reference Documents
  • VCK190 Evaluation Board User Guide (UG1366)
  • Versal Technical Reference Manual (AM011)
  • Versal System Software Developers User Guide (UG1304)
  • PetaLinux Tools Reference Guide (UG1144)
  • Versal Control Interfaces and Processing System (CIPS) (PG352)
Versal Terms
Term Description
Platform management controller (PMC) Manages Versal Adaptive SoC boot and the life cycle management of the device. The PMC ROM Code Unit (RCU) and platform processing unit (PPU) are responsible for booting the device.
ROM code unit (RCU) Includes an AMD Microblaze™ processor that executes the BootROM to initiate the boot phase2: boot setup.
Platform processing unit (PPU) Includes a Microblaze processor that executes the platform loader and manager (PLM) to initiate the boot phase3: load platform.
Scalar engines Includes the processing system (PS) Dual-Core ARM Cortex R5F and A72.
Adaptable engines Includes Versal adaptable hardware also referred to in this tutorial as programmable logic (PL).
Control Interfaces and Processing System (CIPS) CIPS LogiCORE IP sets the configuration of PMC/PS peripherals, clocks, and MIO.
BootROM Responsible for initial security and boot mode interface checks. Reads and processes the PDI boot header. Releases the PMC PPU to complete the boot phases. See the Versal Technical Reference Manual (AM011) for more detail on BootROM.
Platform loader and manager (PLM) Responsible for the final boot phases to load the PDI. Executes supported platform management libraries and application user code. See the Versal System Software Developers User Guide (UG1304) for more detail on the PLM.
Programmable device image (PDI) Boot image for programming and configuring the Versal Adaptive SoC device. See the BootGen UG1283 for details on the format. See system software developers user guide for details on how PLM manages the images and partitions.
MIO Multiplexed IO pins that can be configured for different peripherals and functions.
DIO Dedicated IO pins dedicated for specific functions, such as JTAG (TCK, TMS, TDI, TDO) or power-on reset (POR_B).

Tutorial Requirements

This tutorial is demonstrated on the VCK190 production evaluation board. To run this tutorial, download the necessary files from the lounge and ensure you have the correct licenses installed. If you do not have a board and Vivado license, contact your AMD sales representative. See https://www.xilinx.com/products/boards-and-kits/vck190.html for more information.

Note: This tutorial targets the VCK190 evaluation board, but the methodology flow also applies to the VMK180 evaluation board.

Hardware Requirements
  • Host machine with an operating system supported by Vivado Design Suite and Vitis 2022.1
  • VCK190 production evaluation board, which includes:
    • Versal Adaptive SoC XCVC1902-2VSVA2197
    • AC power adapter (100-240VAC input, 12VDC 15.0A output).
    • System controller microSD card in socket (J302).
    • USB Type-C cable (for JTAG and UART communications).
    • eMMC boot module daughter card
Board Setup and Considerations

eMMC boot module is attached to vck190 board with FMC slot(J212), and the eMMC device connects with PMC MIO 0~11 through this FMC slot. That means QSPI should be disabled and only the SD1 controller can be used in the Vivado project either for SD or eMMC (but not at the same time). You need boot from an SD card and reinitialize SD1 controller and PMC MIO to eMMC configuration.

On the approach using Vivado Hardware Manager, only a specific design for eMMC is needed.

Without using Vivado HW Manager, create two Vivado projects for SD boot and eMMC boot.

Note: The eMMC Boot Module is currently not available for customers but the steps highlighted in this example can be easily adopted for a custom board with eMMC connected to Versal. For more information about the Boot Modules, contact your AMD representative or file a Service Request.

Software Requirements:

To build and run the tutorial reference design, the following must be available or installed:

  • Vivado Design Suite and Vitis 2022.1:
  • Scripts to generate the reference design are provided in this example.
  • UART serial terminal recommended:
    • Vitis serial Terminal or a terminal emulator program for UART (that is, Putty or Tera Term) can be used to display valuable PLM log boot status.
    • When UART is not available, Vivado Design Suite and Vitis xsct/xsdb command line tools can be used to read the plm log after a boot attempt.
Known issues and Limitations:

Building Hardware Design

Vivado

Be sure to source settings.sh for Vivado.

Change current directory to Script, and run the following from the command line, it creates sd1 project and emmc project and export xsa to Design/Software/sd1 and Design/Software/emmc:

vivado -source xsa_generation_for_projects_emmc_and_sd1.tcl

Building Software Design

Petalinux

Enter the Design/Software/sd1 directory. Here are the PetaLinux steps to create the SW components (BOOT.BIN, boot.scr, and image.ub) for SD1:

petalinux-create -t project --template versal --name plnx_vck190_sd1

cd plnx_vck190_sd1/

petalinux-config --get-hw-description=/<directory-to-sd-boot-xsa>

To enable ethernet, add phy node in the device tree by replacing the system-user.dtsi in the PetaLinux project.

cp ../../../user_dtsi/system-user.dtsi ./project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi

petalinux-build

petalinux-package --boot --uboot

Enter the Design/Software/emmc directory, and the SW components (BOOT.BIN, boot.scr, and image.ub) for eMMC:

petalinux-create -t project --template versal --name plnx_vck190_emmc

cd plnx_vck190_emmc/

petalinux-config --get-hw-description=/<directory-to-emmc-boot-xsa>

To enable ethernet, add phy node in the device tree by replacing the system-user.dtsi in the PetaLinux project.

cp ../../../user_dtsi/system-user.dtsi ./project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi

petalinux-build

petalinux-package --boot --uboot

Running the Design

Running the Design without using Vivado Hardware Manager

Here is a brief list of the steps to initialize eMMC after booting from an SD card.

Boot u-boot from SD card:

Step 1. Open the UART Console for the Versal device.

Step 2. Copy the BOOT.BIN for SD boot to SD card, Copy the "image.ub" for emmc boot to the SD card. Boot in an SD mode (SW1[1:4]=1110, which sets pins MODE[0:3]=1110).

Load "image.ub" for eMMC boot to ddr memory from the u-boot console:

Step 3. Run the following command in u-boot console.

fatload mmc ${devnum}:${distro_bootpart} 0x10000000 image.ub

Re-initialize SD1 controller and PMC MIO 0~11 for eMMC using the commands in emmc_pmc_reconfig.txt from the u-boot console:

Step 4. Copy the commands in Scripts/cmd_to_reconfigure_emmc/emmc_pmc_reconfig.txt to u-boot console, and run them all.

Note: The commands in "emmc_pmc_reconfig.txt" are generated by comparing the register differece between "pmc_data.cdo" files for sd boot and emmc boot.

Boot the "image.ub" specific for eMMC boot:

Step 5. Run the below command in u-boot console, and it boots Linux.

bootm 0x10000000

Format the eMMC device with partition, from the Linux console:

Step 6. In Linux console, re-format and re-partition the eMMC to its max capacity.

Be sure to unmount the eMMC before using fdisk.

fdisk_commands

copy eMMC boot images from host with tftp to eMMC partition:

Step 7. Setup tftpd server in host, and configure IP with ifconfig in Linux on the board.

     - setup IP address for GEM0, `ifconfig eth0 192.168.1.10`
     
     - connect ethernet cable between RJ45 slot J307(upper) and host, setup IP address '192.168.1.100' in host, test ping
     
     - setup tftp server in host, and set tftp server folder to directory of eMMC boot images

Step 8. Copy the boot images for emmc boot from tftpd server to eMMC partition.

     - `plnxvck190emmc:/mnt$ sudo mount /dev/mmcblk0p1 /mnt`
	 
	 - `plnxvck190emmc:/mnt$ tftp -g 192.168.1.100 -r BOOT.BIN`
     
     - `plnxvck190emmc:/mnt$ tftp -g 192.168.1.100 -r boot.scr`
     
     - `plnxvck190emmc:/mnt$ tftp -g 192.168.1.100 -r image.ub`

Step 9. Umount the eMMC partition, and power off the board.

Power again to boot from eMMC:

Step 10. After changing the boot mode pins to eMMC (SW1[1:4]=0110, which sets pins MODE[0:3]=0110), power on the board.

     - After linux boot, you can see below linux prompt which indicates this is eMMC image.
       
       plnxvck190emmc:/mnt$

Running the Design using Vivado Hardware Manager

Here is a brief list of the steps to initialize eMMC using Vivado HW Manager. For additional details, refer to Programming Configuration Memory Devices in Programming and Debugging UG908.

Step 1. Before you begin, ensure that the SW13 power switch is off.

Step 2. Connect the power cable to the VCK190 J16.

Step 3. Connect the USB-C cable used for JTAG/UART from your host system (where Vivado is installed) to VCK190 J207.

Step 4. Set the Versal Adaptive SoC to JTAG Boot Mode SW1[1:4]=0000 (which sets pins MODE[0:3]=0000) (All Up).

boot_modes_switch

Step 5. Set SW13 to the ON position.

Step 6. Check that the power good (PG) LEDs are all on, except the VCC_RAM PG LED is off and reserved LEDs (reserved LEDs can be on or off).

Step 7. Open the 2022.1 Vivado Hardware Manager.

Step 8. Select Open New Target and connect the VCK190.

Step 9. Right-click Versal device xcvc1902_1 and select Add Configuration Memory Device.

add_config

Step 10. Configuration memory part and click OK. The configuration memory device is now added to the hardware target device.

config_mem

Step 11. After creating the configuration memory device, Vivado device programmer prompts, Do you want to program the configuration memory device now? as shown below.

config_mem_ok

Step 12. Click OK to open the Program Configuration Memory Device dialog box. Populate the "Files to load" with the SW components (BOOT.BIN, boot.scr and image.ub) for eMMC. Use the same BOOT.bin for eMMC as Initialization PDI as shown in the following figure.

prog_mem

Step 13. Click Apply and then OK.

Step 14. Wait for the programming to finish.

Step 15. After changing the boot mode pins to eMMC (SW1[1:4]=0110, which sets pins MODE[0:3]=0110), power on the board.


Copyright © 2020–2024 Advanced Micro Devices, Inc.

Terms and Conditions