AnsweredAssumed Answered

SPI support for i.MX25 with kernel 3.2.60

Question asked by Fernando Martinez on Aug 8, 2014
Latest reply on Aug 12, 2014 by Fernando Martinez

Hi,

 

I'm developing a custom board based on i.MX25 PDK with kernel 3.2.60 and I'm having problems to compile when I add SPI support. This is what I have added to mach-mx25_3ds.c file (based on eukrea_mbimxsd25-baseboard.c):

 

#include <linux/spi/spi.h>

----------------------------------------------------------------------------------------------------

In mx25pdk_pads:

 

/* CSPI1 */

MX25_PAD_CSPI1_MOSI__CSPI1_MOSI,

MX25_PAD_CSPI1_MISO__CSPI1_MISO,

MX25_PAD_CSPI1_SS0__GPIO_1_16,

MX25_PAD_CSPI1_SCLK__CSPI1_SCLK,

----------------------------------------------------------------------------------------------------

 

#defineGPIO_SPI1_SS0IMX_GPIO_NR(1, 16)

static struct spi_board_info mx25_spi_board_info[] __initdata = {

{
.modalias = "spidev",
.max_speed_hz = 20000000,
.bus_num = 0,
.chip_select = 0,
.mode = SPI_MODE_3,
},

};

 

static int mx25_spi_cs[] = {GPIO_SPI1_SS0};

 

static const struct spi_imx_master mx25_spi0_data __initconst = {

  .chipselect     = mx25_spi_cs,

  .num_chipselect = ARRAY_SIZE(mx25_spi_cs),

};

----------------------------------------------------------------------------------------------------

In mx25pdk_init:

 

imx25_add_spi_imx0(&mx25_spi0_data);

spi_register_board_info(mx25_spi_board_info,

       ARRAY_SIZE(mx25_spi_board_info));

----------------------------------------------------------------------------------------------------

 

In menuconfig, I have the following configuration:

 

Device Drivers  --->

     [*] SPI support  --->

          <*>   Freescale i.MX SPI controllers

          <*>   User mode SPI device driver support

 

But when I try to build uImage, I get the following error message:

 

     arch/arm/mach-imx/built-in.o: In function `mx25pdk_init':

     mach-mx25_3ds.c:(.init.text+0x27c): undefined reference to `imx_add_spi_imx'

     mach-mx25_3ds.c:(.init.text+0x74c): undefined reference to `imx25_cspi_data'

     make: *** [.tmp_vmlinux1] Error 1

 

I don´t understand why I'm getting this error. Both imx_add_spi_imx and imx25_cspi_data are defined in \arch\arm\plat-mxc\devices\platform-spi_imx.c

 

Can anyone please help?

 

Thanks,

Fernando.

Outcomes