#include #include #include #include #include #include #include #include struct spi_pinmux { unsigned char func; unsigned char bias; unsigned char drive; char *name; }; /* Please change your pinmux setting according your board */ static struct spi_pinmux spi_pinmux_config[] = { /* qspi1 */ { 3, PIN_PULL_UP, 3, "PD.4" }, // CS, default set to high { 3, PIN_PULL_UP, 3, "PD.5" }, { 3, PIN_PULL_UP, 3, "PD.6" }, // SI { 3, PIN_PULL_UP, 7, "PD.7" }, // CLK { 3, PIN_PULL_UP, 3, "PD.8" }, { 3, PIN_PULL_UP, 3, "PD.9" }, /* qspi2 */ { 3, PIN_PULL_UP, 3, "PB.6" }, { 3, PIN_PULL_UP, 3, "PB.7" }, { 3, PIN_PULL_UP, 3, "PB.8" }, { 3, PIN_PULL_UP, 3, "PB.9" }, { 3, PIN_PULL_UP, 3, "PB.10" }, { 3, PIN_PULL_UP, 3, "PB.11" }, /* qspi3 */ { 3, PIN_PULL_UP, 3, "PD.0" }, { 3, PIN_PULL_UP, 3, "PD.1" }, //CS, default set to high { 3, PIN_PULL_UP, 3, "PD.2" }, { 3, PIN_PULL_UP, 3, "PD.3" }, }; static u32 qspi_clk_ids[4] = {CLK_QSPI0, CLK_QSPI1, CLK_QSPI2, CLK_QSPI3}; static u32 qspi_irq_num[] = {QSPI0_IRQn, QSPI1_IRQn, QSPI2_IRQn, QSPI3_IRQn}; static u32 qspi_input_clk[4] = { #ifdef AIC_USING_QSPI0 [0] = AIC_DEV_QSPI0_MAX_SRC_FREQ_HZ, #endif #ifdef AIC_USING_QSPI1 [1] = AIC_DEV_QSPI1_MAX_SRC_FREQ_HZ, #endif #ifdef AIC_USING_QSPI2 [2] = AIC_DEV_QSPI2_MAX_SRC_FREQ_HZ, #endif #ifdef AIC_USING_QSPI3 [3] = AIC_DEV_QSPI3_MAX_SRC_FREQ_HZ, #endif }; void test_qspi_slave_set_pinmux(void) { uint32_t i = 0; long pin = 0; unsigned int g; unsigned int p; for (i=0; i