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.

OMAPL138 SPI1 CS pinmux in kernel

Other Parts Discussed in Thread: OMAPL138, DA8XX

Hi 

     I'm working on OMAPl138 LCDK kit. I need to enable SPI1 master to connect my SPI device with J16 header.

J16 have  SPI1_SOMI,  SPI1_SIMO,  SPI1_CLK, SPI1_SCSn_3,  SPI1_SCSn_7,  SPI1_SCSn_6 

I have initiated the SPI1 by the function call 

      da8xx_register_spi(1, da830evm_spi_info, ARRAY_SIZE(da830evm_spi_info));

But there is no pinmux initialize part in board file.

How to configure SPI1 with any one of above mentioned chip select pins and how to configure pinmux function, is there any sample function for SPI pin muxing ?

  • Hi Kumar,

    Can you please tell me which board file are you using ?

    As per my understanding, If you are using  "board-da850-sdi.c" then not required, by default it got enabled,

    If you used any other board file which is not enabled SPI1 by default, then you need to enable SPI1 as you said above.

    For pinmuxing:

    arch/arm/mach-davinci//include/mach/mux.h

    ---> use SPI1 definitions from mux.h (if not then declare it)

    static const short da8xx_evm_spi_pins[] __initdata = {
        DA830_SPI1_SOMI_0, DA830_SPI1_SIMO_0, DA830_SPI1_CLK, DA830_NSPI1_ENA,
        DA830_NSPI1_SCS_0,
        -1
    };

            ret = davinci_cfg_reg_list(da8xx_evm_spi_pins);   --> Enable pin muxing
            if (ret)
                pr_warning("da8xx_evm_init: spi mux setup failed: "
                        "%d\n", ret);

          da8xx_register_spi(1, da830evm_spi_info, ARRAY_SIZE(da830evm_spi_info));

    Please take above code as  a example, change it as per your requirement,

  • Hi Mr.Titus Rathinaraj Stalin

             Thanks for the response. I'm using OMAPl138 LCDK kit and using

    /arch/arm/mach-davinci/board-omapl138-hawk.c file as board file. I hope that i'm using correct board file.

    I'm not using SPI_ENABLE pin because its optional as per datasheet i'm just using 4 wire.

    I'll try and update you the status.

    Thanks 

    Kumar

  • Hi Kumar,

    Got fixed?

    Please update the status.

  • Hi Mr.Titus

             Sorry unfortunately SPI is conflict with Ethernet we need to desolder the resister from Ethernet PHY and solder the SPI DNI resister but we need Ethernet lot of works in application is based on ethernet. 

             I'll try soon and update you.. 

            Thanks for the attention.

  • Hi Mr. stalin

               My board file is board-omapl138-hawk.c 

              As per your reply i cant get reference code for DA850_SPI pin muxing. 

    My spi pins at expansion header is SPI1_CLK, SPI1_SIMO, SPI1_SOMI and SPI1_SCSn_0. 

    Kindly let me know the pinmux details and procedure for enable SPI.