We are using imx6q based customize board for our product , we use
uboot-imx/freescale/board/myboard.c
iomux_v3_cfg_t const ecspi2_pads[] = {
MX6_PAD_CSI0_DAT8__ECSPI2_SCLK | MUX_PAD_CTRL(SPI_PAD_CTRL),
MX6_PAD_CSI0_DAT9__ECSPI2_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL),
MX6_PAD_CSI0_DAT10__ECSPI2_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL),
MX6_PAD_CSI0_DAT11__GPIO5_IO29 | MUX_PAD_CTRL(NO_PAD_CTRL),
};
void setup_spinor(void)
{
imx_iomux_v3_setup_multiple_pads(ecspi2_pads,
ARRAY_SIZE(ecspi2_pads));
gpio_direction_output(IMX_GPIO_NR(5, 29), 0);
}
int board_spi_cs_gpio(unsigned bus, unsigned cs)
{
return (bus == 0 && cs == 0) ? (IMX_GPIO_NR(5, 29)) : -1;
}
in uboot-imx/include/configs/myboard.h
#ifdef CONFIG_SYS_USE_SPINOR
#define CONFIG_CMD_SF
#define CONFIG_SPI_FLASH
#define CONFIG_SPI_FLASH_STMICRO
#define CONFIG_MXC_SPI
#define CONFIG_SF_DEFAULT_BUS 0
#define CONFIG_SF_DEFAULT_CS 0
#define CONFIG_SF_DEFAULT_SPEED 20000000
#define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0)
#endif
we also change the bus and cs ,such as bus =1 cs =0, bus=2 cs =0 and so on ,but in my uboot it can not detected the spinor,
SF: Unsupported flash IDs: manuf 00, jedec 0000, ext_jedec 0000
*** Warning - spi_flash_probe() failed, using default environment
so I don not know which bus and cs can be use for ecspi2
Hi xuhui
one can check if this flash model has entry in uboot/drivers/mtd/spi/sf_params.c
uboot-imx.git - Freescale i.MX u-boot Tree
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
we use the flash is m25p32({"M25P32", 0x202016, 0x0, 64 * 1024, 64, RD_NORM, 0},
)
you can debug it with jtag in uboot/drivers/spi/fsl_espi.c