AnsweredAssumed Answered

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

Question asked by Patrick Brown on Dec 14, 2017
Latest reply on Jan 29, 2018 by Pavel Chubakov


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:// does not contain the source for the ls1012a-frdm RCW binary.



- 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




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_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