This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Using McSPI2 on AM/DM 3730 Mistral EVM

Other Parts Discussed in Thread: ADS7846

Hi all,

I have a problem while configuring SPI2. Firstly i know that, HS USB uses SPI2, so I need to close USB, According to this i configured GPMC_NBE1 pin mux as a GPIO in evm.h file. (_U-BootSource_/board/ti/evm/evm.h)

    MUX_VAL(CP(GPMC_NBE1),        (IDIS | PTU | EN  | M4)) /*GPIO_61*/\

Then i added MUX_VAL for SPI2,

    MUX_VAL(CP(MCSPI2_CLK),        (IEN  | PTD | DIS | M0)) /*McSPI2_CLK*/\
    MUX_VAL(CP(MCSPI2_SIMO),    (IEN  | PTD | DIS | M0)) /*McSPI2_SIMO*/\
    MUX_VAL(CP(MCSPI2_SOMI),    (IEN  | PTD | DIS | M0)) /*McSPI2_SOMI*/\
    MUX_VAL(CP(MCSPI2_CS0),        (IEN  | PTD | EN  | M0)) /*McSPI2_CS0*/\
    MUX_VAL(CP(MCSPI2_CS1),        (IEN  | PTD | EN  | M0)) /*McSPI2_CS1*/\

After saved evm.h, i compiled Uboot like this,

$ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm distclean

$ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm omap3_evm_config

$ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm

After these steps, configured kernel to, i removed all USB configs from omap3_evm_defconfig and configured SPI configs like this,

CONFIG_SPI=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_OMAP24XX=y
CONFIG_SPI_SPIDEV=y

After these added below lines to board-omap3evm.c file (arch/arm/mach-omap2/board-omap3evm.c),

struct spi_board_info omap3evm_spi_board_info[] = {
    [0] = {
        .modalias        = "ads7846",
        .bus_num        = 1,
        .chip_select        = 0,
        .max_speed_hz        = 1500000,
        .controller_data    = &ads7846_mcspi_config,
        .irq            = OMAP_GPIO_IRQ(OMAP3_EVM_TS_GPIO),
        .platform_data        = &ads7846_config,
    },
        /*A.Caliskan*/
    [1] = {
        .modalias        = "spidev",
        .bus_num        = 2,
        .chip_select        = 0,
        .max_speed_hz        = 1000000,
        .mode            = SPI_MODE_0,
    },

    [2] = {
        .modalias        = "spidev",
        .bus_num        = 2,
        .chip_select        = 1,
        .max_speed_hz        = 24000000,
        .mode            = SPI_MODE_0,
    },
    /*A.Caliskan*/
};

 

After these steps i compiled kernel as below,

$ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm distclean

$ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm omap3_evm_defconfig

$ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm uImage modules

and boot the board with new Uboot and Kernel. After run a SPI test program did not see something on SCK MISO MOSI CS0 pins,  Then check the GPMC_NBE1 pin from board with the Voltmeter i see it HIGH. Then configured omap3_evm_init function which in board-omap3evm.c file like these,

        /* Select EHCI port on main board */
        // omap_mux_init_gpio(61, OMAP_PIN_INPUT_PULLUP);
        // gpio_request(OMAP3_EVM_EHCI_SELECT, "select EHCI port");
        // gpio_direction_output(OMAP3_EVM_EHCI_SELECT, 0);
        // gpio_set_value(OMAP3_EVM_EHCI_SELECT, 0);

        /* setup SPI2 config */
        omap_mux_init_gpio(61, OMAP_PIN_INPUT_PULLUP);
        gpio_request(OMAP3_EVM_SPI2_SELECT, "select SPI2 port");
        gpio_direction_output(OMAP3_EVM_SPI2_SELECT, 0);
        gpio_set_value(OMAP3_EVM_SPI2_SELECT, 1);

Closed EHCI port and configured GPIO_61 (GPMC_NBE1) pin to LOW, After these changes i compiled the kernel again, and boot, but nothing change...

Where is the problem?

 

Best regards,

Ahmet