AnsweredAssumed Answered

ecspi2 on the i.MX8 not functioning?

Question asked by GregT on Dec 20, 2018
Latest reply on Dec 28, 2018 by GregT

I am trying to use the spi-imx.c driver but it doesn't seem like the registers are responding.  Is there an enable or voltage regulator required to use the ecspi?  For example I try to write to the ecspi control register and it does not stick in the register.  I used devmem2 that comes with the yocto build for the Compulabs cl-som-imx8.  The driver doesn't seem to be able to write to this register either.  See below.  It tries to write 0xf091f5 but it stays at 0xF091F1.  FYI, I am not using dma.

 

root@cl-som-imx8:~# devmem2 0x30830008 w 0x0000010000F091F5
/dev/mem opened.
Memory mapped at address 0xffff84016000.
Read at address 0x30830008 (0xffff84016008): 0x0000010000F091F1
Write at address 0x30830008 (0xffff84016008): 0x0000010000F091F5, readback 0x0000010000F091F5
root@cl-som-imx8:~# devmem2 0x30830008 w
/dev/mem opened.
Memory mapped at address 0xffff91e4e000.
Read at address 0x30830008 (0xffff91e4e008): 0x0000010000F091F1

 

Below is some debug output from the spi-imx.c driver also tries to write a value to this register.  But it does not stick.

Dec 20 20:11:32 cl-som-imx8 user.debug kernel: [ 575.886816] spidev spi32766.0: spi_imx_setup: mode 0, 16 bpw, 10000000 hz
Dec 20 20:11:32 cl-som-imx8 user.debug kernel: [ 575.886830] spidev spi32766.0: 16 bits per word
Dec 20 20:11:32 cl-som-imx8 user.debug kernel: [ 575.887069] spidev spi32766.0: xfer len 4 tx 16bits 0 usec 10000000Hz
Dec 20 20:11:32 cl-som-imx8 user.debug kernel: [ 575.887076] spidev spi32766.0: xfer len 4 rx 16bits 0 usec 10000000Hz
Dec 20 20:11:32 cl-som-imx8 user.debug kernel: [ 575.887103] spidev spi32766.0: spi_imx_setupxfer: NEW mode 0, 16 bpw, 10000000 hz, conf
ig.bpw 16, config.speed_hz 10000000, spi_imx->usedma 0
Dec 20 20:11:32 cl-som-imx8 user.debug kernel: [ 575.887111] spi_imx 30830000.ecspi: mx51_ecspi_clkdiv: fin: 200000000, fspi: 10000000,
post: 1, pre: 9
Dec 20 20:11:32 cl-som-imx8 user.debug kernel: [ 575.887119] spi_imx 30830000.ecspi: spi_imx_push: count 4, txfifo 0, txfifosize 64
Dec 20 20:11:32 cl-som-imx8 user.debug kernel: [ 575.887125] spi_imx 30830000.ecspi: mx51_ecspi_trigger: trigger value 0xf091f5
Dec 20 20:11:32 cl-som-imx8 user.debug kernel: [ 575.887132] spi_imx 30830000.ecspi: mx51_ecspi_intctrl: enable 0x1, val 0x1
Dec 20 20:11:32 cl-som-imx8 user.debug kernel: [ 575.887139] spidev spi32766.0: spi_imx_pio_transfer: count 0, timeout 500

Outcomes