AnsweredAssumed Answered

How to Set the chipselect of on board flash, change  bus and cs

Question asked by xuhui li on May 20, 2016
Latest reply on May 20, 2016 by igorpadykov

hello all :

my board base in mx6qsabresd ,change spi flash  ,but I don't know how to change

static void setup_spi(void) and int board_spi_cs_gpio(unsigned bus, unsigned cs)

 

Anyone know it ,Please help me

Thank you!

 

 

#ifdef CONFIG_MXC_SPI

static iomux_v3_cfg_t const ecspi1_pads[] = {

    MX6_PAD_CSI0_DAT4__ESPI1_SCLK |    MUX_PAD_CTRL(SPI_PAD_CTRL),

    MX6_PAD_CSI0_DAT5__ESPI1_MOSI |    MUX_PAD_CTRL(SPI_PAD_CTRL),

    MX6_PAD_CSI0_DAT6__ESPI1_MISO |    MUX_PAD_CTRL(SPI_PAD_CTRL),

    MX6_PAD_CSI0_DAT7__GPIO5_IO25 |    MUX_PAD_CTRL((NO_PAD_CTRL),// 

 

/*

        MX6_PAD_KEY_COL0__ECSPI1_SCLK | MUX_PAD_CTRL(SPI_PAD_CTRL),

    MX6_PAD_KEY_COL1__ECSPI1_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL),

    MX6_PAD_KEY_ROW0__ECSPI1_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL),

    MX6_PAD_KEY_ROW1__GPIO4_IO09 | MUX_PAD_CTRL(NO_PAD_CTRL),

*/

};

 

static void setup_spi(void)

{

    imx_iomux_v3_setup_multiple_pads(ecspi1_pads, ARRAY_SIZE(ecspi1_pads));

}

 

int board_spi_cs_gpio(unsigned bus, unsigned cs)

{

    return (bus == 0 && cs == 0) ? (IMX_GPIO_NR(4, 9)) : -1;  //??????

}

#endif

Outcomes