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.

spi



HI all

I am new to the AM335x SK board. Can anyone help me the below queries..

1..How to enable SPI0 module using IO mux for AM335x SK board..

2.. How can i get the SPI0 clk  in master mode..

Regards

Bala

  • Hi Bala,

    The SPI0 interface on the StarterKit can be pinmuxed out of the J11 Zigbee header. Add this line (in bold) to the evm_sk_dev_cfg[] structure array inside <linux_folder>/arch/arm/mach-omap2/board-am335xevm.c:

    /* EVM - Starter Kit */
    static struct evm_dev_cfg evm_sk_dev_cfg[] = {
        {am335x_rtc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
        {mmc1_wl12xx_init,    DEV_ON_BASEBOARD, PROFILE_ALL},
        {mmc0_init,    DEV_ON_BASEBOARD, PROFILE_ALL},
        {rgmii1_init,    DEV_ON_BASEBOARD, PROFILE_ALL},
        {rgmii2_init,    DEV_ON_BASEBOARD, PROFILE_ALL},
        {lcdc_init,     DEV_ON_BASEBOARD, PROFILE_ALL},
        {enable_ecap2,     DEV_ON_BASEBOARD, PROFILE_ALL},
        {mfd_tscadc_init,    DEV_ON_BASEBOARD, PROFILE_ALL},
        {gpio_keys_init,  DEV_ON_BASEBOARD, PROFILE_ALL},
        {gpio_led_init,  DEV_ON_BASEBOARD, PROFILE_ALL},
        {lis331dlh_init, DEV_ON_BASEBOARD, PROFILE_ALL},
        {mcasp1_init,   DEV_ON_BASEBOARD, PROFILE_ALL},
        {uart1_wl12xx_init, DEV_ON_BASEBOARD, PROFILE_ALL},
        {wl12xx_init,       DEV_ON_BASEBOARD, PROFILE_ALL},
        {gpio_ddr_vtt_enb_init,    DEV_ON_BASEBOARD, PROFILE_ALL},
        {sgx_init,       DEV_ON_BASEBOARD, PROFILE_ALL},
        {spi0_init,       DEV_ON_BASEBOARD, PROFILE_ALL},
        {NULL, 0, 0},
    };

    As for your second question, the Linux driver only supports master mode as stated here: http://processors.wiki.ti.com/index.php/AM335x_McSPI_Driver%27s_Guide

    Best regards,
    Miroslav

  • Hi Miroslav


    I did the same, and got the new kernal image.but,

    I am unable to see the SPI CLK signal in the Oscilloscope..(Pins i have connected to CRO is J11 Connector 4th and 5th pins)..My SPI Board slave information give like below..

    static struct spi_board_info am335x_spi0_slave_info[] = {
    {
    .modalias = "spike",
    .max_speed_hz = 24000000,
    .bus_num = 1,
    .chip_select = 0,
    .mode = SPI_MODE_0,
    },

    Please suggest me..

    Regards 

    Bala



  • Hi Miroslav,

    can you help me in the same issue.

    regards,

    Muthe.

  • Hi,

    Can you both try the following to see if your pinmux configurations are correct:

    On your target system:

    mount -t debugfs none /sys/kernel/debug/
    cd /sys/kernel/debug/omap_mux/
    cat spi0_sclk
    cat spi0_d0

    The output from the "cat" commands should show in which mode are these pins pinmuxed.

    Best regards,
    Miroslav

  • Here is the output

    cat spi0_sclk
    name: spi0_sclk.spi0_sclk (0x44e10950/0x950 = 0x0020), b NA, t NA
    mode: OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN
    signals: spi0_sclk | uart2_rxd | i2c2_sda | NA | NA | NA | NA | gpio0_2

    cat spi0_d0

    name: spi0_d0.spi0_d0 (0x44e10954/0x954 = 0x0030), b NA, t NA
    mode: OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP
    signals: spi0_d0 | uart2_txd | i2c2_scl | NA | NA | NA | NA | gpio0_

  • Hi muthe..

    I have also got the same output.

    cat spi0_sclk 
    name: spi0_sclk.spi0_sclk (0x44e10950/0x950 = 0x0020), b NA, t NA
    mode: OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN
    signals: spi0_sclk | uart2_rxd | i2c2_sda | NA | NA | NA | NA | gpio0_2

    cat spi0_d0

    name: spi0_d0.spi0_d0 (0x44e10954/0x954 = 0x0030), b NA, t NA
    mode: OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP
    signals: spi0_d0 | uart2_txd | i2c2_scl | NA | NA | NA | NA | gpio0_3

    Regards

    bala

  • hi ,

    may be we are facing the same issue.  :)

    regards,

    Muthe