IMX6UL: SPI failures are seen with Zeus migration

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

IMX6UL: SPI failures are seen with Zeus migration

948 Views
sikumar3
Contributor III

We are migrating from Jethro to Zeus version.

One of our SPI device is failing to come up with the Zeus kernel. 

The failure happens during FW download the SPI device.

SPI probe log shows only "2008000.spi" in zeus where as it shows "2008000.ecspi" for jethro.

Can someone help me to resolve this issue?

Zeus dmesg log:

Linux version 5.4.3-2.0.0+gfd263a3edd95 (oe-user@oe-host) (gcc version 9.2.0 (GCC))

at25 spi0.0: 64 KByte at25 eeprom, pagesize 128
spi_imx 2008000.spi: probed
random: fast init done
spi_imx 2010000.spi: probed

Jethro dmesg log:

Linux version 4.1.15-1.2.0

at25 spi0.0: 64 KByte at25 eeprom, pagesize 128
spi_imx 2008000.ecspi: probed
spi_imx 2010000.ecspi: probed

Device tree:

#include "imx6ul.dtsi"

&ecspi1 {
fsl,spi-num-chipselects = <3>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_spi1>;
// cs-gpios = <&gpio4 26 0>, <&gpio5 3 0>, <&gpio5 2 0>;
cs-gpios = <&gpio4 26 0>, <&gpio1 24 0>, <&gpio1 18 0>;
status = "okay";
num-cs = <3>;

// eeprom (chip select is gpio4.26, EEPROM_SPI1_CS)
eeprom_cust: at25@0 {
compatible = "atmel,at25";
address-width = <16>;
spi-max-frequency = <10000000>;
reg = <0>;
size = <0x10000>;
pagesize = <128>;
};
};

&ecspi3 {
fsl,spi-num-chipselects = <6>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_spi3>;
// cs-gpios = <&pca9535u20 6 0>, <&pca9535u79 4 0>, <&pca9535u20 14 0>, <&pca9535u20 13 0>, <&pca9535u19 1 0>, <&pca9535u79 3 0>;
cs-gpios = <&pca9535u20 3 0>, <&pca9535u20 8 0>, <&pca9535u20 9 0>, <&pca9535u19 2 0>, <&pca9535u19 3 0>, <&pca9535u19 11 0>;
status = "okay";
num-cs = <6>;


// mxl277 (U53)
mxl277: mxl@5 {
compatible = "rohm,dh2228fv";
reg = <0x5>;
spi-cpha;
spi-max-frequency = <10000000>;
};
};

 

 

0 Kudos
4 Replies

940 Views
igorpadykov
NXP Employee
NXP Employee

HI sikumar3

 

one can try to tweak drive strength ecspi signals in dts : "&iomuxc { pinctrl_ecspi** " :

https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm/boot/dts/imx6ul-14x14-evk-ecspi.d...

DSE field (drive strength) is described in IOMUX Chapter of

i.MX 6UltraLite Applications Processor Reference Manual

Also if this one spi device it may be hardware issue, bad contact or cable.

 

Best regards
igor

0 Kudos

931 Views
sikumar3
Contributor III

Hi Igor,

Thanks for the pointers!

Below are my IOMUX settings for eCSPI1 and eCSPI3. The device which is connected to eCSPI1 works fine in Zeus.

pinctrl_spi1: spi1grp {
fsl,pins = <
MX6UL_PAD_CSI_DATA07__ECSPI1_MISO 0x70a1
MX6UL_PAD_CSI_DATA06__ECSPI1_MOSI 0x70a1
// MX6UL_PAD_CSI_DATA05__ECSPI1_SS0 0x70a1
MX6UL_PAD_CSI_DATA04__ECSPI1_SCLK 0x80000000
>;
};

pinctrl_spi3: spi3grp {
fsl,pins = <
MX6UL_PAD_NAND_CLE__ECSPI3_MISO 0x70a1
MX6UL_PAD_NAND_CE1_B__ECSPI3_MOSI 0x70a1
MX6UL_PAD_NAND_CE0_B__ECSPI3_SCLK 0x80000000
>;
};

The spi device connected to eCSPI3 works fine with the same IOMUX settings in Jethro (4.14 kernel). So, we can rule out any HW issue here.

Also, I noticed that I am able to read version number from the device. But, only firmware download is failing.

Do I need to look at from DMA perspective?

Could you also help me to understand why spi-imx.c probe function is printing only spi (2010000.spi) instead ecspi (2010000.ecspi)?

0 Kudos

926 Views
igorpadykov
NXP Employee
NXP Employee

HI sikumar3

 

>The spi device connected to eCSPI3 works fine with the same IOMUX settings
>in Jethro (4.14 kernel). So, we can rule out any HW issue here.

 

still it may be hardware issue, is if signal quality is marginal, small power consumption/noise

difference may cause issue. Suggest to check signals with oscilloscope.

 

>Could you also help me to understand why spi-imx.c probe function is

>printing only spi (2010000.spi) instead ecspi (2010000.ecspi)?

 

it is just naming. In general you can debug it in driver sources:

https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/spi/spi-imx.c?h=imx_5.4.3_2.0.0

 

Best regards
igor

0 Kudos

920 Views
sikumar3
Contributor III

Hi Igor,

 

Thanks for helping out!

 

SPI chip select signal was not applied properly from NXP driver (spi-imx.c) to the Max Linear chip. This change was present in Jethro through a kernel patch.

 

@@ -329,6 +329,12 @@ static int __maybe_unused mx51_ecspi_config(struct spi_imx_data *spi_imx,
u32 ctrl = MX51_ECSPI_CTRL_ENABLE, cfg = 0, dma = 0;
u32 clk = config->speed_hz, delay;

+// printk ("[[%d %d>>", config->mode, config->cs);
+
+ if (config->cs > 3) {
+ config->cs = 3;
+ }

 

Since, mx51_ecspi_config() function got removed in the latest spi-imx.c file, the patch was not applied properly.

 

My SPI device started working (firmware download in particular) after adding the above changes in mx51_ecspi_prepare_message().

--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -511,6 +511,10 @@ static int mx51_ecspi_prepare_message(struct spi_imx_data *spi_imx,
u32 testreg;
u32 cfg = readl(spi_imx->base + MX51_ECSPI_CONFIG);

+ if (spi->chip_select > 3) {
+ spi->chip_select = 3;
+ }
+

 

Regards,
Siva

0 Kudos