10 Replies Latest reply on Aug 29, 2015 10:01 AM by xbolshe

    missing spidev devices

    dfwJones

      I'm trying to figure out why all the spidev devices aren't showing up in /dev.

      root@clanton:~# ls /dev/s*

      /dev/spidev1.0  /dev/stderr     /dev/stdin      /dev/stdout

       

      Shouldn't there be spidev0.0, spidev0.1 and spidev1.1?

       

      I have tested the following images on a Galileo Gen 2 board and they all have virtually identical results.

      SDCard.1.0.4.tar.bz2

      galileo_iot_1.1.0_dirty_custom_build_xbolshe.zip

      iot-devkit-1.5-i586-galileo.bz2

      iot-devkit-latest-mmcblkp0.direct.bz2

       

      I have also taken the source from:

      meta-clanton_v1.1.0-dirty.tar.gz

      and tested the default build as well as turning on everything I can think of via menuconfig and rebuilding.

       

      What we are trying to do is to talk to a wide variety of interchangeable SPI devices that will connect to the Quark SPI0 bus. The intention is to have some simple C code to talk to each device. It is planned to only be using one device at a time on the bus. We will connect the devices to SPI0_MOSI, SPI0_MISO, SPI0_SS_B and SPI0_SCK.

       

      Attached below are the results from the SDCard.1.0.4 image showing every test I have been able to find in every other post online with similar problems.

       

      uname -a

      Linux clanton 3.8.7-yocto-standard #1 Thu Oct 16 16:06:45 PDT 2014 i586 GNU/Linux

       

      root@clanton:~# ls /dev/s*

      /dev/spidev1.0  /dev/stderr     /dev/stdin      /dev/stdout

       

      root@clanton:~# opkg install kernel-module-spidev

      Package kernel-module-spidev (3.8-r0) installed in root is up to date.

       

      root@clanton:~# ls /sys/bus/spi/devices

      spi0.0  spi1.0

       

      root@clanton:~# opkg install http://iotdk.intel.com/repos/1.1/iotdk/quark/kernel-module-spidev_3.8-r0_quark.ipk

      Downloading http://iotdk.intel.com/repos/1.1/iotdk/quark/kernel-module-spidev_3.8-r0_quark.ipk.

      Package kernel-module-spidev (3.8-r0) installed in root is up to date.

       

      root@clanton:~# opkg install http://iotdk.intel.com/repos/1.1/iotdk/quark/kernel-module-spidev_3.8-r0_quark.ipk

      Downloading http://iotdk.intel.com/repos/1.1/iotdk/quark/kernel-module-spidev_3.8-r0_quark.ipk.

      Package kernel-module-spidev (3.8-r0) installed in root is up to date.

       

      root@clanton:~# opkg install http://iotdk.intel.com/repos/1.1/iotdk/quark/kernel-module-spi-pxa2xx_3.8-r0_quark.ipk

      Downloading http://iotdk.intel.com/repos/1.1/iotdk/quark/kernel-module-spi-pxa2xx_3.8-r0_quark.ipk.

      Package kernel-module-spi-pxa2xx (3.8-r0) installed in root is up to date.

       

      root@clanton:~# opkg install http://iotdk.intel.com/repos/1.1/iotdk/quark/kernel-module-spi-pxa2xx-pci_3.8-r0_quark.ipk

      Downloading http://iotdk.intel.com/repos/1.1/iotdk/quark/kernel-module-spi-pxa2xx-pci_3.8-r0_quark.ipk.

      Package kernel-module-spi-pxa2xx-pci (3.8-r0) installed in root is up to date.

       

      root@clanton:~# opkg install http://iotdk.intel.com/repos/1.1/iotdk/quark/kernel-module-st-sensors-spi_3.8-r0_quark.ipk

      Downloading http://iotdk.intel.com/repos/1.1/iotdk/quark/kernel-module-st-sensors-spi_3.8-r0_quark.ipk.

      Package kernel-module-st-sensors-spi (3.8-r0) installed in root is up to date.

       

      root@clanton:~# lspci

      00:00.0 Class 0600: 8086:0958

      00:14.0 Class 0805: 8086:08a7

      00:14.1 Class 0700: 8086:0936

      00:14.2 Class 0c03: 8086:0939

      00:14.3 Class 0c03: 8086:0939

      00:14.4 Class 0c03: 8086:093a

      00:14.5 Class 0700: 8086:0936

      00:14.6 Class 0200: 8086:0937

      00:14.7 Class 0200: 8086:0937

      00:15.0 Class 0c80: 8086:0935

      00:15.1 Class 0c80: 8086:0935

      00:15.2 Class 0c80: 8086:0934

      00:17.0 Class 0604: 8086:11c3

      00:17.1 Class 0604: 8086:11c4

      00:1f.0 Class 0601: 8086:095e

       

      root@clanton:~# dmesg | grep spi

      [   55.170362] ce4100_spi 0000:00:15.0: enabling device (0000 -> 0002)

      [   55.176815] ce4100_spi 0000:00:15.0: enabling bus mastering

      [   55.176870] ce4100_spi 0000:00:15.0: setting latency timer to 64

      [   55.177021] ce4100_spi 0000:00:15.0: irq 43 for MSI/MSI-X

      [   55.193353] ce4100_spi 0000:00:15.1: enabling device (0000 -> 0002)

      [   55.199810] ce4100_spi 0000:00:15.1: enabling bus mastering

      [   55.199864] ce4100_spi 0000:00:15.1: setting latency timer to 64

      [   55.200129] ce4100_spi 0000:00:15.1: irq 44 for MSI/MSI-X

      [   55.240830] pxa2xx-spi pxa2xx-spi.0: registered master spi0

      [   55.247692] spi_master spi0: will run message pump with realtime priority

      [   55.255687] spi spi0.0: 1666666 Hz actual, PIO

      [   55.255749] spi spi0.0: setup mode 3, 8 bits/w, 16667000 Hz max --> 0

      [   55.256968] pxa2xx-spi pxa2xx-spi.0: registered child spi0.0

      [   55.262014] pxa2xx-spi pxa2xx-spi.1: registered master spi1

      [   55.270712] spi_master spi1: will run message pump with realtime priority

      [   55.281802] spi spi1.0: 5000000 Hz actual, PIO

      [   55.281855] spi spi1.0: setup mode 0, 8 bits/w, 50000000 Hz max --> 0

      [   55.291786] pxa2xx-spi pxa2xx-spi.1: registered child spi1.0

        • 1. Re: missing spidev devices
          PabloM_Intel

          Hi dfwJones,

           

          Could you please tell us which image are you using right now? Have you tried entering the modprobe commands?

           

          modprobe spi-pxa2xx.ko 
          modprobe spi-pxa2xx-pci
          modprobe spidev.ko
          

           

          You can check this out in the following guide Intel® Quark™ SoC X1000: Software Developer's Manual for Linux*, under section 4.7.


          Regards,

          PabloM_Intel

          • 2. Re: missing spidev devices
            dfwJones

            I'm using the image from:

            SDCard.1.0.4.tar.bz2

             

            It displays this after booting

            Poky 9.0.2 (Yocto Project 1.4 Reference Distro) 1.4.2 clanton /dev/ttyS1

             

            root@clanton:~# uname -a

            Linux clanton 3.8.7-yocto-standard #1 Thu Oct 16 16:06:45 PDT 2014 i586 GNU/Linux

             

            When I run modprobe, there aren't any messages displayed:

            root@clanton:~# modprobe spi-pxa2xx.ko

            root@clanton:~# modprobe spi-pxa2xx-pci

            root@clanton:~# modprobe spidev.ko

             

            There are no new messages in /var/log/messages about SPI.

             

            Section 4.7 in the developers manual says:

            "Once loaded, the master SPI driver populates entries in /dev as follows:

            /dev/spidev0.0

            /dev/spidev0.1

            /dev/spidev1.0

            /dev/spidev1.1"

             

            I'm still only seeing /dev/spidev1.0

            • 3. Re: missing spidev devices
              dfwJones

              Some more information, but we still can't get the /dev/spidev* devices to appear.

               

              Following the instructions in:

              Quark_SW_RelNotes_330232_003revisedfinal.pdf section 2.34.

               

              I tried killing the two processes described in the pdf, but no new devices appeared.

              root@clanton:~# ps|grep clloader

              1294 root       836 S    /opt/cln/galileo/clloader --escape --binary --zmodem

              1309 root      1276 S    grep clloader

              root@clanton:~# ps | grep launcher.sh

              1289 root      1848 S    {launcher.sh} /bin/sh /opt/cln/galileo/launcher.sh

              1311 root      1276 S    grep launcher.sh

              root@clanton:~# kill -9 1294

              root@clanton:~# kill -9 1289

              root@clanton:~# ls /dev/sp*

              /dev/spidev1.0

               

              I then ran lsmod on the Galileo board:

              root@clanton:~# lsmod

                  Tainted: G

              evdev 17378 0 - Live 0xd2797000

              usbhid 23097 0 - Live 0xd27a7000

              btusb 17950 0 - Live 0xd279d000

              bluetooth 188151 1 btusb, Live 0xd2830000

              iwlwifi 73340 0 - Live 0xd27b1000

              cfg80211 171950 1 iwlwifi, Live 0xd27ce000

              rfkill 20724 2 bluetooth,cfg80211, Live 0xd2790000

              adc1x8s102 12766 0 - Live 0xd2731000 (C)

              industrialio_triggered_buffer 12686 1 adc1x8s102, Live 0xd271f000

              kfifo_buf 13032 1 industrialio_triggered_buffer, Live 0xd272c000

              industrialio 43160 3 adc1x8s102,industrialio_triggered_buffer,kfifo_buf, Live 0xd2784000

              spi_pxa2xx 21688 0 - Live 0xd2725000

              spi_pxa2xx_pci 13049 1 spi_pxa2xx, Live 0xd271a000

              spidev 13053 0 - Live 0xd2712000

              i2c_dev 13053 0 - Live 0xd270d000

              at24 12949 0 - Live 0xd2708000

              pca9685 13582 0 - Live 0xd2700000

              regmap_i2c 12714 1 pca9685, Live 0xd26a6000

              gpio_pca953x 17384 3 - Live 0xd26e2000

              intel_qrk_gip 20101 3 - Live 0xd26f6000

              gpio_sch 17990 0 - Live 0xd267b000

              uio 14412 2 intel_qrk_gip,gpio_sch, Live 0xd26dd000

              usb_storage 46592 0 - Live 0xd26ab000

              g_serial 20109 5 - Live 0xd2694000

              libcomposite 24059 1 g_serial, Live 0xd268d000

              pch_udc 31862 0 - Live 0xd2684000

              udc_core 14227 2 libcomposite,pch_udc, Live 0xd262b000

              ipv6 230713 14 -Live 0xd274a000

              efivars 22960 0 - Live 0xd2674000

              mmc_block 26513 2 - Live 0xd266c000

              ehci_pci 12656 0 - Live 0xd264b000

              ohci_hcd 26434 0 - Live 0xd2664000

              ehci_hcd 40376 1 ehci_pci, Live 0xd269b000

              sdhci_pci 18191 0 - Live 0xd2621000

              sdhci 27440 1 sdhci_pci, Live 0xd2742000

              led_class 13282 1 sdhci, Live 0xd265a000

              stmmac 48422 0 - Live 0xd26e9000

              usbcore 140133 6 usbhid,btusb,usb_storage,ehci_pci,ohci_hcd,ehci_hcd, Live 0xd26b9000

              usb_common 12481 3 libcomposite,udc_core,usbcore, Live 0xd2655000

              mmc_core 92969 3 mmc_block,sdhci_pci,sdhci, Live 0xd2633000

              • 4. Re: missing spidev devices
                PabloM_Intel

                Hi dfwJones,

                 

                I’ll keep searching more about this and as soon as I have some more information I’ll let you know.

                Is there any specific reason as to why you want the rest spidevs to appear?

                 

                Regards,

                PabloM_Intel

                • 5. Re: missing spidev devices
                  dfwJones

                  Thanks for continuing to search for an answer.

                   

                  We have a number of SPI devices and have some of them on each bus. That way we want to have the spidevs that apply to the other bus accessible.

                  • 6. Re: missing spidev devices
                    PabloM_Intel

                    Hi dfwJones,

                     

                    I apologize for the late reply. The reason why you’re not seeing the other SPI interfaces, even after using the modprobe command, is because they are being used to communicate with other devices. For example, one of them is used to access the ADC and another one is used for the firmware rom. So, as of now, you have one SPI interface available (spidev1.0).

                     

                    Regards,

                    PabloM_Intel

                    • 7. Re: missing spidev devices
                      dfwJones

                      Thanks for the update.

                       

                      Since we don't need the ADC, how do I disable it so I can get access to the SPI interface?

                       

                      Also on our board we don't have the ADC on the that SPI interface. We only have an EEPROM which doesn't get picked up by the kernel.

                      • 8. Re: missing spidev devices
                        xbolshe

                        Hi,

                         

                        to disable ADC need to rewrite a lot of code for spidev.

                        For example, here:

                         

                        spi_mod.jpg

                         

                        BR,

                        xbolshe

                        • 9. Re: missing spidev devices
                          dfwJones

                          Would it be possible for you to be a bit more specific about what code needs to change or be rewritten?

                           

                          Would it be easier if we just changed our devices to use I2C versions instead of SPI?

                          • 10. Re: missing spidev devices
                            xbolshe

                            Hi,

                             

                            need to change drivers code (that originally was depeloped for Galileo board) for your project.

                            In my understanding I2C will be easy, as well as using available spidev1.0 with dedicated Chip Select (CS aka SPI1_SS_B) pins for your chips.

                             

                            BR,

                            xbolshe