Spidev not functioning over ls1012a-frdm Arduino header (?)

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

Spidev not functioning over ls1012a-frdm Arduino header (?)

811 Views
patrickb-iss
Contributor I

Background:

I am trying to communicate over the SPI pins on the ls1012a Freedom board. I have added entries to the device tree and verified that they are being used. The spidev devices are listed under /dev on the ls1012a-frdm and the spidev kernel module is being loaded (as indicated by the /dev/spidev* entries). I'm using the Qoriq SDK v2.0 with the 1703 patch

At this point I suspect that there is an issue with the RCW and the ls1012a pins used for SPI communication to the Arduino headers are not configured correctly. It seems that SDHC2_BASE_DAT321 & SDHC2_BASE_BASE should be set to 11 for SPI but are not.

Additionally, it seems that rcw repo from git://git.freescale.com/ppc/sdk/rcw.git does not contain the source for the ls1012a-frdm RCW binary.

Questions:

- Is the current RCW as reported by u-boot correct?

- Is there any plan to make the ls1012a RCW source code available in the public repo?

- Is there a way to read out the RCW configuration on the chip after Linux has booted?

Thanks to anyone who can assist,

- Patrick

Details:

u-boot log with RCW:

U-Boot 2016.01LS1012A-SDK+g7944a94 (Aug 30 2016 - 13:13:19 +0800)

SoC: LS1012AE (0x87040010)
Clock Configuration:
 CPU0(A53):800 MHz 
 Bus: 250 MHz DDR: 1000 MT/s
Reset Configuration Word (RCW):
 00000000: 08000008 00000000 00000000 00000000
 00000010: 33050000 c000000c 40000000 00001800
 00000020: 00000000 00000000 00000000 000c4571
 00000030: 00000000 00c28120 00000096 00000000
I2C: ready
DRAM: 510 MiB
Using SERDES1 Protocol: 13061 (0x3305)
SF: Detected S25FS512S_256K with page size 512 Bytes, erase size 128 KiB, total 64 MiB
In: serial
Out: serial
Err: serial
Model: LS1012A FREEDOM Board
Board: LS1012AFRDM Net: cbus_baseaddr: 0000000004000000, ddr_baseaddr: 0000000083800000, ddr_phys_baseaddr: 03800000
class init complete
tmu init complete
bmu1 init: done
bmu2 init: done
GPI1 init complete
GPI2 init complete
HGPI init complete
hif_tx_desc_init: Tx desc_base: 0000000083e40400, base_pa: 03e40400, desc_count: 64
hif_rx_desc_init: Rx desc base: 0000000083e40000, base_pa: 03e40000, desc_count: 64
HIF tx desc: base_va: 0000000083e40400, base_pa: 03e40400
HIF init complete
bmu1 enabled
bmu2 enabled
pfe_hw_init: done
pfe_firmware_init
pfe_load_elf: no of sections: 13
pfe_firmware_init: class firmware loaded
pfe_load_elf: no of sections: 10
pfe_firmware_init: tmu firmware loaded
ls1012a_configure_serdes 0
ls1012a_configure_serdes 1
pfe_eth0, pfe_eth1
=> 

Here is the dts snippet inserted into fsl-ls1012a-frdm.dts:

&dspi {
   bus-num = <0>;
   status = "okay";

  spidev@0 { /* Should be the SPI->UART bridge on CS0 */
    #address-cells = <1>;
    #size-cells = <1>;
    compatible = "spidev";
    spi-max-frequency = <10000000>;
    reg = <0>;
  };

  spidev@1 { /* Should be the Arduino SPI pins on CS1 */
    #address-cells = <1>;
    #size-cells = <1>;
    compatible = "spidev";
    spi-max-frequency = <10000000>;
    reg = <1>;
  };
};


output of ls -l /dev/spidev*

crw------- 1 root root 153, 0 Jan 1 1970 /dev/spidev0.0
crw------- 1 root root 153, 1 Jan 1 1970 /dev/spidev0.1

Labels (1)
0 Kudos
1 Reply

574 Views
Pavel
NXP Employee
NXP Employee

- Is the current RCW as reported by u-boot correct?

The RCW[SDHC2_BASE_DAT321] / RCW[SDHC2_BASE_BASE] should be set to 0b11 for SPI using. See the Table 3-6 of the LS1012a Reference Manual.

 

- Is there a way to read out the RCW configuration on the chip after Linux has booted?

The RCWSRa registers contain the LS1012a RCW value. Use mmap possibility for read RCWSRa registers. U-boot reports RCW value using theses registers.


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos