UPGRADE YOUR BROWSER

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!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
1,133 Views
Registered: ‎07-10-2015

axi quad spi in standard mode got an error

Jump to solution

my block design as figure 0

 

 

petalinux auto-generated pl_dtsi  as figure 1

 

the linux spi device node as figure 2

 

but after I run the linux app similar to spidev , I got an error as figure 2.

 

I assume my device-tree is wrong or using the spidev framework is wrong. when I use spidev framework and PS spi controller, everything is good.

 

Any help is appreciated.

And is there any linux driver or app about axi quad spi core? in standard mode.

blkdesign5.png
device-tree.png
linux-error.png
device-tree.png
linux-error.png
0 Kudos
1 Solution

Accepted Solutions
Adventurer
Adventurer
1,667 Views
Registered: ‎07-10-2015

Re: axi quad spi in standard mode got an error

Jump to solution

3Q,I found my problem and after adding below lines to system-top.dts  there was good news.

 

&axi_quad_spi_0 {
is-decoded-cs = <0>;
num-cs = <1>;
status = "okay";
spidev@0x00 {
compatible = "spidev";
spi-max-frequency = <25000000>;
reg = <0>;
};
};

View solution in original post

0 Kudos
2 Replies
Moderator
Moderator
1,103 Views
Registered: ‎12-04-2016

Re: axi quad spi in standard mode got an error

Jump to solution

Hi 

 

See if this below SPI driver change works:-

 

--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -921,7 +921,7 @@ static int spi_transfer_one_message(struct spi_master *master,
struct spi_transfer *xfer;
bool keep_cs = false;
int ret = 0;
- unsigned long ms = 1;
+ unsigned long long ms = 1;
struct spi_statistics *statm = &master->statistics;
struct spi_statistics *stats = &msg->spi->statistics;

@@ -952,8 +952,12 @@ static int spi_transfer_one_message(struct spi_master *master,

if (ret > 0) {
ret = 0;
- ms = xfer->len * 8 * 1000 / xfer->speed_hz;
- ms += ms + 100; /* some tolerance */
+ ms = 8LL * 1000LL * xfer->len;
+ do_div(ms, xfer->speed_hz);
+ ms += ms + 200; /* some tolerance */
+
+ if (ms > UINT_MAX)
+ ms = UINT_MAX;

 

 

Best Regards

Shabbir

0 Kudos
Adventurer
Adventurer
1,668 Views
Registered: ‎07-10-2015

Re: axi quad spi in standard mode got an error

Jump to solution

3Q,I found my problem and after adding below lines to system-top.dts  there was good news.

 

&axi_quad_spi_0 {
is-decoded-cs = <0>;
num-cs = <1>;
status = "okay";
spidev@0x00 {
compatible = "spidev";
spi-max-frequency = <25000000>;
reg = <0>;
};
};

View solution in original post

0 Kudos