We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Showing results for 
Search instead for 
Did you mean: 
Observer magonmonkey
Registered: ‎09-20-2018

Connect SPI module to XC7Z035 custom board with device tree

Hi, I'm currently working on a custom board with xc7z035 on it. The module I want to connect is an ethernet controller with SPI interface on it.

After finished configuration in Vivado, I've moved .hdf and .bit to Ubuntu and create PetaLinux project using petalinux-config --get-hw-description -p <proj_path>

I then enabled the module in the kernel configuration

petalinux-config -c kernel

After connecting the module to my custom board, building Linux image and booting it. From the booting message, I can't see any message about the module's driver. I surveyed the forum and suspect the problem is in the device tree. Therefore, I tried to add the module into device-tree manually. I learned that the only file we can adjust is system-user.dtsi. According to this file, I adjust the system-user.dtsi as shown below. I expected GPIO_31(which is also MIO31) to be the interrupt pin.

(BTW, I set alias "spi0=&spi1;" because we only have access to spi1 according to the schematic. Registration of spi slave seems only work on spi0. So I have to use this alias to work around)


In the document, they did mention that I should set pinctrl-0. But according to another post, which I can't find it currently, I can trust in the pinctrl-names=" default" attribute and let petalinux configured it. Therefore, I skip this part.

The problem here is that Linux can recognize the module correctly and I can see driver loaded in dmesg. However,  I can't transfer data when I connected my computer to the module using an ethernet cable. The indication light on the ethernet port will lit when I ping from my PC to custom board. The light won't lit in the opposite direction. Therefore, I believe the problem might occur on SPI, especially the interruption pin setting.

So, here's my questions.

  1. Is configuring device tree the correct path to enable the module on my custom board? Or is there a better solution?
  2. Is my configuration on device tree correct?
  3. Maybe the interrupt is configured incorrectly, how should I fix it?

The attached files are the result of dmesg, /proc/interrupts and device-tree files.

I'm new to petalinux and might make very basic mistakes. I appreciate any comments.

0 Kudos