How to assign SPI_PCS3 as a chip selection line for dspi interface on LS1088ardb_pb platform

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to assign SPI_PCS3 as a chip selection line for dspi interface on LS1088ardb_pb platform

4,081 Views
gsuresh_12
Contributor II

I am working on LS1088ardb_pb platform

I am trying to use SPI_PCS3 (pin V1 - gpiochip3 offset 20) as a chip selection line for dspi, and here is my device tree node assigned

&dspi {

        status = "okay";

        bus-num = <0>;

        spidev@0 {

                compatible = "linux,spidev";

                spi-max-frequency = <12000000>;

                reg = <x>;  //For chip selection pin SPI_PCS3 

        };

};

In reg = <x>;  what would be the number for "x" for corresponding pin SPI_PCS3 to choose a spi chip select?

in rcw_1600_qspi.rcw file I have added below mentioned code

SPI_EXT=0

SPI_BASE_BASE=0

SPI_PCS_BASE=0 

I am booting from qspi flash (not SD Card boot) and SPI_PCS3 pin is multiplexed with other  functionality, do I need to set any switch configuration?

switch setup as mentioned below:

SW1[1:8]

SW2[1:8]

SW3[1:8]

SW4[1:8]

SW5[1:8]

0011 0001

0100 0000

1110 0010

1001 0011

0111 0000

 

Regards

Suresh

 

0 Kudos
12 Replies

3,703 Views
nikunjtapodhan1979
Contributor I

Hi, adding to the thread, we face similar issue, even when we are booting through SD Card, we do not see CS (SPI_PCS3 chosen) signal coming out correct on oscilloscopes or logic analyzer captures. We tried to make changes in application using the parameter cs_change in spi transfer structure:

https://docs.huihoo.com/doxygen/linux/kernel/3.7/structspi__transfer.html

But with this also the CS does not come aligned with clock and other SPI signals. Application code has already been shared to you by my colleague. We use SPIDev method of user space application to test our SPI driver. 

Please suggest us the solution, as this driver is becoming a bottleneck for our project. 

0 Kudos

3,659 Views
gsuresh_12
Contributor II

When we boot from SD Card SPI_PCS_BASE=3 then only SD Card booting will work properly and SPI_PCS[0:3] lines cannot be used for SPI Chip Selection lines. If we want to use SPI_PCS[0:3] lines for SPI Chip Selection lines then SPI_PCS_BASE=0 but SD Card booting won't happen.

Can you please suggest is there any method SPI_PCS[1:3] can be used for SPI Chip selection lines when we boot from SD Card?

 

gsuresh_12_0-1647258686217.png

 

Regards

Suresh

Tags (1)
0 Kudos

4,082 Views
ufedor
NXP Employee
NXP Employee

> In reg = <x>; what would be the number for "x" for corresponding

> pin SPI_PCS3 to choose a spi chip select?

3

In case of further questions please provide textual U-Boot log.

0 Kudos

4,068 Views
gsuresh_12
Contributor II

Hi ufedor,

Please find the uboot log text file as an attachment.

My spi data transfer happening when I transfer the data, I tested through external loop back like MOSI connected to MISO and I could see the loop back data. But chip selection line is not toggling.

Regards

Suresh 

0 Kudos

4,069 Views
ufedor
NXP Employee
NXP Employee

> But chip selection line is not toggling.

Which SPI CS is toggling? - Can you probe CS0, CS1 and CS2?

Tags (1)
0 Kudos

4,036 Views
gsuresh_12
Contributor II

I have probed all four lines of SPI_PCS0, SPI_PCS1, SPI_PCS2 and SPI_PCS3, but I did not see any line toggling while transmitting the data.

0 Kudos

4,040 Views
ufedor
NXP Employee
NXP Employee

For a test purpose please modify DTS for PCS0 (reg = <0>;)

Can you see PCS0 during SPI access?

0 Kudos

3,975 Views
gsuresh_12
Contributor II

Hi ufedor,

I have tried out all the combinations of SPI_PCS0,1,2,3 and I probed the CS line for toggling, but I could not able to see any toggling on CS line.

Can you please suggest, after booting up, do I need to change any BRDCFG bits to bring out SPI_PCS lines from MUX which was controlled by CFG_MUX_SPI line which was connected to CPLD?

I am booting from QSPI 1 and my boot partition and rootfs in emmc.

attached is my source code file.

Regards

Suresh  

0 Kudos

3,973 Views
ufedor
NXP Employee
NXP Employee

> I have probed all four lines of SPI_PCS0, SPI_PCS1, SPI_PCS2 and SPI_PCS3

Please mark in the schematics points where the signals were probed.

0 Kudos

3,940 Views
gsuresh_12
Contributor II

Please find the attached file for where we are probing for SPI_PCS0, SPI_PCS1, SPI_PCS2 and SPI_PCS3.

TP191

TP239

TP240

Regards

Suresh

0 Kudos

3,936 Views
ufedor
NXP Employee
NXP Employee

You have to probe the signals at the processor's pins.

0 Kudos

3,898 Views
gsuresh_12
Contributor II

Basically these pins are not able to access for probing, because both ICs are BGA ICs. Only access those test points.

I did some experiment looks like SPI is working but problem is CS is not coming out due to multiplexing these lines with eMMC lines.

I need to test SPI in different manner. I need to configure eMMC for 4 bit bus width mode and by using Qixis command I need to switch SPI_PCS lines to out to test points.

Can you please help me where I need to change in the code to make eMMC bus width for 4 bit at boot mode and linux mode.

I am using flexbuilder_2108 software package.  

0 Kudos