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

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

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

488 Views
lixuhui112
Contributor I

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

Labels (2)
0 Kudos
1 Reply

313 Views
igorpadykov
NXP Employee
NXP Employee

Hi xuhui

I believe selection may be any: just assign

necessary values to bus, cs and change IMX_GPIO_NR(4, 9)

to suitable gpio number.

Suggest to post on uboot mail list for more details

U-Boot Info Page

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 Kudos