cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dima2882
Explorer
Explorer
4,398 Views
Registered: ‎03-26-2010

SPIDEV errors in Petalinux 2017.1

Jump to solution

Hi all,

 

With Vivado/Petalinux 2017.1 I get spidev errors that are different from the others I've seen on the forum. When kernel boots up, I see this:

cdns-spi e0006000.spi: chipselect 0 already in use
spi_master spi0: spi_device register error /amba/spi@e0006000/spidev@0
spi_master spi0: Failed to create SPI device for /amba/spi@e0006000/spidev@0

 

I have CONFIG_SPI_SPIDEV=y set in the kernel. Additionally, my system-user.dtsi has the same stuff everyone else uses:

&spi0 {
    status = "okay";
    is-decoded-cs = <0>;
    num-cs = <1>;
	device@0 {
		compatible = "spidev";
		reg = <0>; //chipselect 0
		spi-max-frequency = <50000000>;
	};
};

I have edited the device-tree-generation_%.bbappend file in ...project-spec/meta-user/recipes-bsp/device-tree to include the system-user.dtsi. The hardware/software used has worked for Vivado/Petalinux 2016.2 in the past.

 

Anyone know what's going on?

0 Kudos
Reply
1 Solution

Accepted Solutions
dima2882
Explorer
Explorer
6,474 Views
Registered: ‎03-26-2010

I was able to solve my issues...

 

Thing to remember with Petalinux 2017.1 is that for whatever reason everything gets renamed - spidev numbers changed, uio numbers changed, no idea why. If the SW driver source is updated to reflect this then everything works again as it did under earlier releases.

View solution in original post

0 Kudos
Reply
6 Replies
dima2882
Explorer
Explorer
4,383 Views
Registered: ‎03-26-2010

Made some progress - found that the kernel had a problem with the fact that I had

reg = <0>;

set for two different devices within spi0. This has not been a problem in Petalinux 2016.2 before. Now here's what I get in dmesg | grep spi:

spidev spi0.0: buggy DT: spidev listed directly in DT

 

My spi0 devices are ad9361-phy@0 for the AD9361 and the spidev device. There's only one chip select. What should both of these be set to? And why am I getting spi0.0 instead of spidev32766.1 the way I used to in 2016.2?

0 Kudos
Reply
dima2882
Explorer
Explorer
6,475 Views
Registered: ‎03-26-2010

I was able to solve my issues...

 

Thing to remember with Petalinux 2017.1 is that for whatever reason everything gets renamed - spidev numbers changed, uio numbers changed, no idea why. If the SW driver source is updated to reflect this then everything works again as it did under earlier releases.

View solution in original post

0 Kudos
Reply
aynilian
Explorer
Explorer
2,681 Views
Registered: ‎07-05-2017

Hi dima2882

 

How did you set this "CONFIG_SPI_SPIDEV=y"?

0 Kudos
Reply
aynilian
Explorer
Explorer
2,680 Views
Registered: ‎07-05-2017

writing this in system-user.dtsi gives errors.

 

I could not use the reference &spi0. Was there more you had in the system-user.dtsi?

 

&spi0 {
    status = "okay";
    is-decoded-cs = <0>;
    num-cs = <1>;
	device@0 {
		compatible = "spidev";
		reg = <0>; //chipselect 0
		spi-max-frequency = <50000000>;
	};
};

 

0 Kudos
Reply
dima2882
Explorer
Explorer
2,653 Views
Registered: ‎03-26-2010

This is what I had:

 

&spi0 {

    status = "okay";
    num-cs = <1>;
    device@0 {
        spi-cpha;
        compatible = "spidev";
        reg = <0>; //chipselect 0
        spi-max-frequency = <10000000>;
    };
};
aynilian
Explorer
Explorer
2,635 Views
Registered: ‎07-05-2017

Hi dima2882,

 

modified the system-user.dtsi which looks close to your device-tree modification.

 

Here is the solved post: 

 

https://forums.xilinx.com/t5/Embedded-Linux/can-t-acces-the-PS-SPI-with-Petalinux-2017-3/m-p/857061#M26134

 

Cheers!

0 Kudos
Reply