Missing peripherals (i2c, spi, ...) in /dev/ on i.MX28

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Missing peripherals (i2c, spi, ...) in /dev/ on i.MX28

4,785 Views
mmaaxx
Contributor III

Hello,

I'm developing a software on i.MX28 evk board, and ran into the problem with missing devices in /dev/. I don't have i2c, spi, adc, hsadc devices. I enabled drivers for these devices, when build kernel. But they don't exists.

I checked /etc/udev/rules.d/* scripts and there are no script that enumerates peripheral drivers, as block devices. This is true for both Linux build from source and Linux image that freescale provides. I tried: L2.6.31_10.08.01_SDK_images_MX28.tar.gz and L2.6.35_10.12.01_SDK_source_bundle.tar.gz.

 

Because of this problem pretty much all of the unit-tests that freescale provides fail:

autorun.sh: completed test suiteTest cases run: 15  Pass: 3  Fail: 12

 

Also I cannot access imx28 peripherals from linux application. 

 

Can anybody please help to make peripherals appear under /dev/ ?

 

Thanks!

Tags (1)
11 Replies

1,952 Views
mmaaxx
Contributor III

Here is what I've got, I'm going to try it now:

 

Here is a link to the build that I was using to toggle the I2C.  You can find i2ctools in /usr/sbin.

The kernel image in .sb format is located in /boot/

http://dl.dropbox.com/u/13992412/rootfs.tar.gz

 

You should see i2c-0 in your /dev folder.  There are no SPI devices present on the board, no spi device is loaded.

I was using i2cdetect –l  and i2cdump 0 0x<i2c addr>  to toggle the lines.

0 Kudos

1,952 Views
MassimoBonazzi
NXP Employee
NXP Employee

Configure your kernel like this: (2.6.35)

--- SPI support                                                  │ │ 

  │ │          *** SPI Master Controller Drivers ***                      │ │ 

  │ │    < >   Utilities for Bitbanging SPI masters                       │ │ 

  │ │    < >   GPIO-based bitbanging SPI Master                           │ │ 

  │ │    < >   Xilinx SPI controller common module                        │ │ 

  │ │    <*>   Freescale MXS SPI/SSP controller                           │ │ 

  │ │    < >   DesignWare SPI controller core support                     │ │ 

  │ │          *** SPI Protocol Masters ***                               │ │ 

  │ │    <*>   User mode SPI device driver support                        │ │ 

  │ │    < >   Infineon TLE62X0 (for power switching)

Even doing so you will get that no device is showing up in /dev

This is because originally the modalias is equal to m25p80 since it is intended to be used with a serial eeprom in the original design, changing to spidev is NOT automatic:

Code changes in red.

in /arch/arm/mach-mx28/mx28evk.c

static struct spi_board_info spi_board_info[] __initdata = {

#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)

                {

                                /* the modalias must be the same as spi device driver name */

                                .modalias = "spidev", /* Name of spi_driver for this device */

                                .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */

                                .bus_num = 1, /* Framework bus number */

                                .chip_select = 0, /* Framework chip select. */

                                .platform_data = &mx28_spi_flash_data,

                },

#endif

};

Also remember that spidev comes with a sample application in Documentation/spi/spidev_test.c

If you bult it it won't work either, the issue is that our MX28 has only one DMA channel attached and it can read or write only on the spi not do both at the same time, this means that in the sample application the RX or the TX arrays addresses needs to be 0 otherwise the driver will state it cannot work in bidirectional mode and abort the transfer.

This with our 2.6.35_11_09 bsp, spidev enabled in the kernel config and the modalias to spidev and not to the eeprom.

And the test application modified like this:

struct spi_ioc_transfer tr = {

  .tx_buf = (unsigned long)tx,

  //.rx_buf = (unsigned long)rx,

  .rx_buf = (unsigned long)0,

  .len = ARRAY_SIZE(tx),

  .delay_usecs = delay,

  .speed_hz = speed,

  .bits_per_word = bits,

};

Remember also to change the default spi device like this:

static const char *device = "/dev/spidev1.0";

Otrhewise you will need to use -D option.

Massimo

1,952 Views
Joe2
Contributor II

Great, thanks Max.  It's a big problem ATM.

0 Kudos

1,952 Views
mmaaxx
Contributor III
We did conf.call today, and I should get a solution today. I'll post it here.
0 Kudos

1,952 Views
Joe2
Contributor II

Hi Max

 

Did you and your FAE resolve this?  If so, could you post the solution? 

 

I'm also working on an i.MX28 EVK.  A number of devices appear to be missing from /dev.

 

Thanks in advance

Joe

0 Kudos

1,952 Views
mmaaxx
Contributor III

No, I'm using 700mb image from freescale which boots into gnome gui. Also, I'm getting same results, when using custom built image with custom built kernel (I made sure that all the drivers that I need are selected).

Anyways, thank you for looking into this. I'm working with Freescale FAE to resolve this. I'll post a solution, if we'll resolve the problem.

0 Kudos

1,952 Views
VladanJovanovic
NXP Employee
NXP Employee
Not sure why you get these kind of result. Only things that come to my mind are either that something went wrong with flashing the images or you've flashed wrong image (updater image maybe, which has quite limited functionality as such)?
0 Kudos

1,952 Views
mmaaxx
Contributor III

Boot log and dmesg are attached. 

Vladan, thanks for looking into this!

0 Kudos

1,952 Views
VladanJovanovic
NXP Employee
NXP Employee
Could you attach serial log so we can see messages printed during boot time?
0 Kudos

1,952 Views
mmaaxx
Contributor III

Sure:

I'm using standard imx28evk from Freescale + standard 4"3 Seiko display.

I downloaded latest Linux Images from Freescale: L2.6.31_10.08.01_SDK_images_MX28.tar.gz. Installed them using CFImager. Plugged SDCard into the board, and pressed power. This is it. 

 

Attached are ls of /dev/ and /etc/udev/rules.d/.

0 Kudos

1,952 Views
VladanJovanovic
NXP Employee
NXP Employee
Hm, this is quite unusual... Can you describe in more detail your setup and how you programmed the images?
0 Kudos