How to enable EIM CS1 in u-boot of i.mx6?

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

How to enable EIM CS1 in u-boot of i.mx6?

624 Views
nanjh98
Contributor I

hello everyone

My system is

bootloader: u-boot200908

kernel : L3.0.35 LTIB

I want use EIM CS1 (8bit mode) in u-boot level...

What I applied:  

/u-boot/board/freescale/mx6q_sabresd/mx6q_sabresd.c

iomux_v3_cfg_t   weim_pads[] = {

  MX6DL_PAD_EIM_OE__WEIM_WEIM_OE,

  MX6DL_PAD_EIM_RW__WEIM_WEIM_RW,

  MX6DL_PAD_EIM_CS0__WEIM_WEIM_CS_0,

  MX6DL_PAD_EIM_CS1__WEIM_WEIM_CS_1,

  MX6DL_PAD_DISP0_DAT8__GPIO_4_29,

  MX6DL_PAD_EIM_LBA__WEIM_WEIM_LBA,

  MX6DL_PAD_EIM_BCLK__WEIM_WEIM_BCLK,

 MX6DL_PAD_CSI0_DAT12__WEIM_WEIM_D_8,

MX6DL_PAD_CSI0_DAT13__WEIM_WEIM_D_9,

MX6DL_PAD_CSI0_DAT14__WEIM_WEIM_D_10,

MX6DL_PAD_CSI0_DAT15__WEIM_WEIM_D_11,

MX6DL_PAD_CSI0_DAT16__WEIM_WEIM_D_12,

MX6DL_PAD_CSI0_DAT17__WEIM_WEIM_D_13,

MX6DL_PAD_CSI0_DAT18__WEIM_WEIM_D_14,

MX6DL_PAD_CSI0_DAT19__WEIM_WEIM_D_15,

...

};

void setup_eim(void)

{

     u32 reg = 0;

    mxc_iomux_v3_setup_multiple_pads(weim_pads,ARRAY_SIZE(weim_pads));

    reg = readl(IOMUXC_BASE_ADDR + 0x4);   // GPR1 register  CS0/CS1 enable

    reg &= ~0x07ffffff;

    reg |= 0x1b;

    writel(reg, IOMUXC_BASE_ADDR + 0x4);

writel(0x00851081,(WEIM_BASE_ADDR + 0x18));    //CS1GCR1

writel(0x00000001,(WEIM_BASE_ADDR + 0x18 + 0x4));    //CS1GCR2

writel(0x1C022000,(WEIM_BASE_ADDR + 0x18 + 0x8));    //CS1RCR1

writel(0x0000C000,(WEIM_BASE_ADDR + 0x18 + 0xC));    //CS1RCR2

writel(0x1404A38E,(WEIM_BASE_ADDR + 0x18 + 0x10));    //CS1WCR

}

/u-boot/board/freescale/mx6q_sabresd/lowlevel_init.S

ldr r0, CCM_BASE_ADDR_W

....

ldr r1, =0xFFC

str r1, [r0, #CLKCTL_CCGR6]

...

/u-boot/board/freescale/mx6q_sabresd/flash_header.S

none .

EIM CS1 does not work after applying the above. 

HOW do i get EIM CS1 to work????

Pleas help me....

0 Kudos
Reply
1 Reply

404 Views
igorpadykov
NXP Employee
NXP Employee

Hi jun

please also check enabled memory range in
IOMUXC_GPR1 settings ADDRSx, ACT_CSx i.MX6SDL Reference Manual
http://cache.freescale.com/files/32bit/doc/ref_manual/IMX6SDLRM.pdf
Pay attention to max. clock and used eim pins in sect.4.9.3 External Interface Module (EIM)
i.MX6SDL Datasheet
http://www.nxp.com/docs/en/data-sheet/IMX6SDLCEC.pdf
may be useful to look at eim settings using baremetal eim examples in SDK
Github SDK
https://github.com/backenklee/swp-report/tree/master/iMX6_Platform_SDK

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply