ラベル EBAZ4205 の投稿を表示しています。 すべての投稿を表示
ラベル EBAZ4205 の投稿を表示しています。 すべての投稿を表示
2021/04/27

How to dump device tree from NAND flash to get dts (Zynq-7000)

In this article, I will dump the original device tree of the Zynq EBAZ4205 Board.

Since the Zynq EBAZ4205 Board is not a development board, the design information is not provided by the manufacturer. You need to get the necessary information yourself.

From the device tree source text (dts) file converted from the dumped device tree blob (dtb) file, you can get reference information when developing a custom Linux image using Vivado and PetaLinux.

Prepare

Insert the microSD card into the Zynq EBAZ4205 Board. This microSD card is used to transfer the dumped dtb file to the PC.

If you can use Ethernet, you can transfer the file by other methods.

Dump

Boot original Linux from the NAND flash on the Zynq EBAZ4205 Board.

Make sure the microSD card is mounted.

Execute the following command to dump the device tree from the NAND flash and save it as dtb file on the microSD card.

Convert

Copy the dtb file from the microSD card to your PC.

Convert dtb file to dts file. Use the device tree compiler (dtc) command for this conversion.

For Ubuntu, you can install it with the following command.

Execute the dtc command.

Now you have a dts file.

Tips

One of the information that can be obtained from the dts file is the NAND flash timing parameters and existing partition information.

For example, in the dts file, it was described as follows.

For the timing parameters nand-cycle-t0 to nand-cycle-t6, refer to the Xilinx Wiki.

If you are developing a custom Linux image using Vivado and PetaLinux, set these parameters in Vivado. At this time, you should also check the NAND flash data sheet.

Note: The parameters in the screenshot are examples and have not been tested.

Partition information can be set in PetaLinux.

This information is reflected in the device tree automatically generated by PetaLinux. The device tree is generated in the following directory when you run the petalinux-build command.

  • /components/plnx_workspace/device-tree/device-tree

My Vivado design and PetaLinux project are available on GitHub.

If there are any mistakes in the description, please let me know.

2021/04/23

Solves the warning when loading the U-Boot environment (Zynq-7000, PetaLinux 2020.2)

I have built a boot image for the Zynq EBAZ4205 Board with Xilinx PetaLinux 2020.2. Linux was able to boot normally, but the following warning was displayed when U-Boot was booted.

The Zynq EBAZ4205 Board does not have SPI Flash. In order to solve this warning, it was necessary to change the U-Boot configurations.

Open the U-Boot configuration with the following command.

Enable "Environment is not stored".

Environment-> Environment is not stored

Disable "Environment is in SPI flash".

Environment-> Environment is in SPI flash

Exit from the U-Boot configuration and rebuild the U-Boot.

The following 2 lines are added to the U-Boot settings.

An example of the PetaLinux project can be found below.