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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
1,911 次查看
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"


标签 (2)
标记 (3)
0 项奖励
回复
1 解答
933 次查看
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 项奖励
回复
4 回复数
933 次查看
varsmolta
Contributor V
0 项奖励
回复
933 次查看
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 项奖励
回复
933 次查看
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 项奖励
回复
934 次查看
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 项奖励
回复