cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
amurices
Visitor
Visitor
3,382 Views
Registered: ‎02-21-2018

Don't understand how AXI Quad SPI works with (Peta)Linux

Jump to solution

Hi all, noob here (started messing with hardware about 5 days ago). I'm trying to run a PetaLinux distribution on my MicroZed 7010 by programming the FPGA with just a simple SPI IP. Done this in Vivado, letting it do most of the work, and came up with a design that can successfully generate a bitstream and program the FPGA.

final block design.png

So now, as I understand, I need to export the hardware design to PetaLinux. I used the following three commands, as instructed in the PetaLinux reference guide:

 

petalinux-config -c kernel
petalinux-build
petalinux-package --boot --format BIN --fsbl ./components/plnx_workspace/fsbl/fsbl/Release/fsbl.elf 
--fpga images/linux/main_block_design_0_wrapper.bit // the .bit file is what was produced by Vivado

The drivers I activate are these:

menuconfig.png

All good so far, right? But then, after I copy the files produced by PetaLinux in <project_dir>/images/linux/ to the Boot partition of my SD card, one of two things happen (and I have the jumpers on the right position: JP1-2-3, JP2-2-3, JP3-1-2):

1. It doesn't boot.

2. It boots, but the drivers are nowhere to be found.

 

So what I realized is that the .dtb generated by PetaLinux is incorrect. It contains no reference to axi_quad_spi as it should, and neither does the boot log (I know this from dtc'ing the .dtb back to .dts). So what I do then is use the SDK to generate a .dts, and that one was correct (to the best of my knowledge). However, now, when I try to boot with the new .dtb, it gets stuck. According to this post, it has to do with the SPI references in the .dts. It shouldn't have anything to do with the SPI ports being MIO'd though, because as I understand it, that should only apply to the PS SPI.

 

Am I missing something? I'm trying to follow the normal PetaLinux design flow from the wiki, but I can't see what I'm doing wrong.

0 Kudos
1 Solution

Accepted Solutions
amurices
Visitor
Visitor
3,800 Views
Registered: ‎02-21-2018

Thanks for the reply, but it turns out the issue was with the IP I was using. Turns out the AXI Quad SPI is, by default, enabling its STARTUP primitive. I'm not exactly sure what this primitive does, but since it makes it so the core has no clock output, I assume it has something to do with using the SPI interface as a way to interact with Flash memory, like the PS's Quad SPI interface.

 

By disabling that primitive and going through the whole process again (and manually editing the Device Tree as suggested), I was able to make progress and ran into another error (which was solved in this post). But it's now working. Correct devices now show up in both /sys/ and /dev, and I've even measured the signal output of a simple program with an oscilloscope. Really happy with the Xilinx suite. Thanks!

View solution in original post

4 Replies
smarell
Community Manager
Community Manager
3,349 Views
Registered: ‎07-23-2012
Did you try adding the definitions of AXI QSPI controller and the flash in dts as mentioned in http://www.wiki.xilinx.com/Linux%20SPI%20Driver?
-----------------------------------------------------------------------------------------------
Please mark the post as "Accept as solution" if the information provided answers your query/resolves your issue.

Give Kudos to a post which you think is helpful.
0 Kudos
amurices
Visitor
Visitor
3,337 Views
Registered: ‎02-21-2018

That's the thing; the .dts should be automatically generated by PetaLinux, no? If not, the one generated by the SDK contains a block similar to the one in the wiki, but the drivers still don't show up when it boots.

0 Kudos
smarell
Community Manager
Community Manager
3,301 Views
Registered: ‎07-23-2012
You should add the entry sometimes in dts. I'm not an expert in this domain but I have seen cases where we should add the dts entry manually.

Did you add the definition for the flash memory too in dts?
-----------------------------------------------------------------------------------------------
Please mark the post as "Accept as solution" if the information provided answers your query/resolves your issue.

Give Kudos to a post which you think is helpful.
0 Kudos
amurices
Visitor
Visitor
3,801 Views
Registered: ‎02-21-2018

Thanks for the reply, but it turns out the issue was with the IP I was using. Turns out the AXI Quad SPI is, by default, enabling its STARTUP primitive. I'm not exactly sure what this primitive does, but since it makes it so the core has no clock output, I assume it has something to do with using the SPI interface as a way to interact with Flash memory, like the PS's Quad SPI interface.

 

By disabling that primitive and going through the whole process again (and manually editing the Device Tree as suggested), I was able to make progress and ran into another error (which was solved in this post). But it's now working. Correct devices now show up in both /sys/ and /dev, and I've even measured the signal output of a simple program with an oscilloscope. Really happy with the Xilinx suite. Thanks!

View solution in original post