AnsweredAssumed Answered

Enable and access AUART on iMX28

Question asked by Damien Gotfroi on Mar 25, 2014
Latest reply on Apr 30, 2014 by Damien Gotfroi

Hello all.

I designed my own PCB with a iMX28.

I based my design on the mx28evk board and I use Yocto + Linux kernel 3.12 + the devicetree for iMX28EVK.

 

 

Because my design is not the same than the mx28evk, I modified the pin muxing in ~/fsl-community-bsp/build/tmp/work/imx28evk-poky-linux-gnueabi/u-boot-fslc/v2013.10-r0/git/board/freescale/mx28evk/mx28evk.c

 

 

I have a iMX283 and I need to use all AUART and SPI + some GPIOs, so, in mx28evk.c I wrote :

 

 

        int board_early_init_f(void)

    {

    /* IO0 clock at 480MHz */

    mxs_set_ioclk(MXC_IOCLK0, 480000);

    /* IO1 clock at 480MHz */

    mxs_set_ioclk(MXC_IOCLK1, 480000);

   

    /* SSP0 clock at 96MHz */

    mxs_set_sspclk(MXC_SSPCLK0, 96000, 0);

    /* SSP2 clock at 160MHz */

    mxs_set_sspclk(MXC_SSPCLK2, 160000, 0);

   

    // GPIOs

    mxs_iomux_setup_pad(MX28_PAD_LCD_D16__GPIO_1_16 | MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D17__GPIO_1_17 | MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D18__GPIO_1_18 | MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D19__GPIO_1_19 | MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D20__GPIO_1_20 | MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D21__GPIO_1_21 | MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D22__GPIO_1_22 | MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D23__GPIO_1_23 | MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL);

   

    mxs_iomux_setup_pad(MX28_PAD_SSP2_SS1__GPIO_2_20 | MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL);

    mxs_iomux_setup_pad(MX28_PAD_SSP2_SS2__GPIO_2_21 | MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL);

   

    mxs_iomux_setup_pad(MX28_PAD_SAIF0_MCLK__GPIO_3_20 | MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL);

    mxs_iomux_setup_pad(MX28_PAD_SAIF0_LRCLK__GPIO_3_21 | MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL);

    mxs_iomux_setup_pad(MX28_PAD_SAIF1_SDATA0__GPIO_3_26 | MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL);

    mxs_iomux_setup_pad(MX28_PAD_PWM4__GPIO_3_29 | MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL);

   

    // AUART

    mxs_iomux_setup_pad(MX28_PAD_AUART0_RX__AUART0_RX);

    mxs_iomux_setup_pad(MX28_PAD_AUART0_TX__AUART0_TX);

    mxs_iomux_setup_pad(MX28_PAD_AUART0_CTS__AUART0_CTS);

    mxs_iomux_setup_pad(MX28_PAD_AUART0_RTS__AUART0_RTS);

   

    mxs_iomux_setup_pad(MX28_PAD_AUART1_RX__AUART1_RX);

    mxs_iomux_setup_pad(MX28_PAD_AUART1_TX__AUART1_TX);

   

    mxs_iomux_setup_pad(MX28_PAD_SSP2_SCK__AUART2_RX);

    mxs_iomux_setup_pad(MX28_PAD_SSP2_MOSI__AUART2_TX);

   

    mxs_iomux_setup_pad(MX28_PAD_SSP2_MISO__AUART3_RX);

    mxs_iomux_setup_pad(MX28_PAD_SSP2_SS0__AUART3_TX);

   

    mxs_iomux_setup_pad(MX28_PAD_SAIF0_BITCLK__AUART4_RX);

    mxs_iomux_setup_pad(MX28_PAD_SAIF0_SDATA0__AUART4_TX);

   

    mxs_iomux_setup_pad(MX28_PAD_PWM0__DUART_RX);

    mxs_iomux_setup_pad(MX28_PAD_PWM1__DUART_TX);

   

    // LCD

    mxs_iomux_setup_pad(MX28_PAD_LCD_D00__LCD_D0);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D01__LCD_D1);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D02__LCD_D2);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D03__LCD_D3);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D04__LCD_D4);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D05__LCD_D5);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D06__LCD_D6);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D07__LCD_D7);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D08__LCD_D8);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D09__LCD_D9);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D10__LCD_D10);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D11__LCD_D11);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D12__LCD_D12);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D13__LCD_D13);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D14__LCD_D14);

    mxs_iomux_setup_pad(MX28_PAD_LCD_D15__LCD_D15);

    mxs_iomux_setup_pad(MX28_PAD_LCD_RS__LCD_RS);

    mxs_iomux_setup_pad(MX28_PAD_LCD_RD_E__LCD_VSYNC);

    mxs_iomux_setup_pad(MX28_PAD_LCD_WR_RWN__LCD_HSYNC);

    mxs_iomux_setup_pad(MX28_PAD_LCD_CS__LCD_ENABLE);

   

    // SSP0

    mxs_iomux_setup_pad(MX28_PAD_SSP0_DATA0__SSP0_D0);

    mxs_iomux_setup_pad(MX28_PAD_SSP0_DATA1__SSP0_D1);

    mxs_iomux_setup_pad(MX28_PAD_SSP0_DATA2__SSP0_D2);

    mxs_iomux_setup_pad(MX28_PAD_SSP0_DATA3__SSP0_D3);

    mxs_iomux_setup_pad(MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT);

    mxs_iomux_setup_pad(MX28_PAD_SSP0_SCK__SSP0_SCK);

    mxs_iomux_setup_pad(MX28_PAD_SSP0_CMD__SSP0_CMD);

   

    // SSP2

    mxs_iomux_setup_pad(MX28_PAD_SSP0_DATA4__SSP2_D0);

    mxs_iomux_setup_pad(MX28_PAD_SSP0_DATA5__SSP2_D3);

    mxs_iomux_setup_pad(MX28_PAD_SSP0_DATA6__SSP2_CMD);

    mxs_iomux_setup_pad(MX28_PAD_SSP0_DATA7__SSP2_SCK);

   

    // USB ID

    mxs_iomux_setup_pad(MX28_PAD_PWM2__USB0_ID);

   

    return 0;

    }

 

 

I recompiled U-boot and uploaded it on my board.

 

 

So now, I can use all my GPIOs without any problems. But in /dev/ I only have ttyAPP0 and ttyAPP3. I can't access the others AUART. Also, I have nothing to access SPI.

 

 

So what can I do to resolve that ? What did I miss ?

 

 

Many thanks in advance.

Outcomes