Problem in configuring ECSPI-2 on i.MX6SL in Linux

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

Problem in configuring ECSPI-2 on i.MX6SL in Linux

Jump to solution
1,749 Views
koperapune
Contributor II

We are designing a system using "i.MX6SL". The design is based on EVK-board. We need to enable ECSPI-2 to communicate with NAND-Flash. on uBoot, I can communicate with the device over ECSPI-2. By looking at the code, I though that I need to modify only two files "board-mx6sl_common.h" and "board-mx6sl_evk.c" to enable ECSPI-2.

1) Hence, I have configured "iomux" by adding following lines in

        MX6SL_PAD_ECSPI2_MISO__ECSPI2_MISO,

        MX6SL_PAD_ECSPI2_MOSI__ECSPI2_MOSI,

        MX6SL_PAD_ECSPI2_SCLK__ECSPI2_SCLK,

        MX6SL_PAD_ECSPI2_SS0__ECSPI2_SS0,

        MX6SL_PAD_ECSPI2_SS0__GPIO_4_15,       

in "mx6sl_brd_pads[ ]" from "board-mx6sl_common.h"

2) "imx6q_add_ecspi(0, &mx6_evk_spi_data);" is used to add support for ECSPI-1 in file "board-mx6sl_evk.c". Therefore I have added "imx6q_add_ecspi(1, &mx6_spi_data_for_nand);" for ECSPI-2

However, I haven't seen any activity on ECSPI-2. ECSPI-1 is working fine in linux. How to check whether ECSPI-2 is configured properly or not?

Could you please provide me some pointer to debug the problem?

I am using LTIB: "L3.0.35_12.10.02_GA_source.tar.gz" and Kernel version is "3.0.35"


Labels (2)
Tags (3)
0 Kudos
1 Solution
771 Views
koperapune
Contributor II

I have commented the pin configuration for charger. Problem was in the pin-configuration. We have found the solution of the problem.

in file "linux/arch/arm/plat-mxc/include/mach/iomux-mx6sl.h"  while configuring ECSPI2 pins replace NO_PAD_CTRL with (PAD_CTL_SRE_FAST | PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm   | PAD_CTL_HYS)

e.g.

#define MX6SL_PAD_ECSPI2_MISO__ECSPI2_MISO  IOMUX_PAD(0x0368, 0x0078, 0, 0x06A0, 0, NO_PAD_CTRL)

to

#define MX6SL_PAD_ECSPI2_MISO__ECSPI2_MISO  IOMUX_PAD(0x0368, 0x0078, 0, 0x06A0, 0, (PAD_CTL_SRE_FAST | PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm   | PAD_CTL_HYS))

View solution in original post

0 Kudos
4 Replies
771 Views
varsmolta
Contributor V
0 Kudos
771 Views
koperapune
Contributor II

I have already added the changes suggested in the thread. However, SPI-NAND is not getting probed. Probing works well in UBoot. I have checked ECSPI control and config registers in UBoot and Linux. Both are having same value.

0 Kudos
771 Views
robby
NXP Employee
NXP Employee

Did you put the iomux setting at the end of the mx6sl_brd_pads[] array? If not, they will be overridden because there

are some setting:

    MX6SL_PAD_ECSPI2_SCLK__USB_USBOTG2_OC,                             
    /* Charge */                                                       
    MX6SL_PAD_ECSPI2_MISO__GPIO_4_14,  /* CHG_FLT */                   
    MX6SL_PAD_ECSPI2_SS0__GPIO_4_15, /* CHG_STATUS */                  
    MX6SL_PAD_ECSPI2_MOSI__GPIO_4_13, /* CHG_UOK ,CHG_DOK*/  


Besides, did you already adjust the bus_num and chip_select according to your board design?

0 Kudos
772 Views
koperapune
Contributor II

I have commented the pin configuration for charger. Problem was in the pin-configuration. We have found the solution of the problem.

in file "linux/arch/arm/plat-mxc/include/mach/iomux-mx6sl.h"  while configuring ECSPI2 pins replace NO_PAD_CTRL with (PAD_CTL_SRE_FAST | PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm   | PAD_CTL_HYS)

e.g.

#define MX6SL_PAD_ECSPI2_MISO__ECSPI2_MISO  IOMUX_PAD(0x0368, 0x0078, 0, 0x06A0, 0, NO_PAD_CTRL)

to

#define MX6SL_PAD_ECSPI2_MISO__ECSPI2_MISO  IOMUX_PAD(0x0368, 0x0078, 0, 0x06A0, 0, (PAD_CTL_SRE_FAST | PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm   | PAD_CTL_HYS))

0 Kudos