Project

General

Profile

MitySOM 5CSX SPI device not showing up in /dev

Added by Evgeny Galyaev over 2 years ago

Hello --and hoping that someone can please help me with the following.
I’m trying to get the SPI device to show up in /dev. I added spidev for SPI0 to my dtsi file like in the socfpga_mitysom5csx_leigh.dts file from https://support.criticallink.com/gitweb/?p=linux-socfpga.git;a=blob;f=arch/arm/boot/dts/socfpga_mitysom5csx_leigh.dts;h=867961f12818e92b1dd6872fb5b05f11bbc60dea;hb=73a206bd08cc06cacc51dc21aa0e1e9751a01959 and enabled SPI0 in the socfpga_cyclone5.dtsi file, I also added “CONFIG_SPI_SPIDEV=y” to the kernel and have the following settings for kernel configuration in the attached image. I’ve also tried adding the entire socfpga_mitysom5sx_leigh.dts file but nothing shows up in /dev. There are some other spidev directories that show up but nothing in /dev which makes me think that I may just be missing one thing in kernel or dts files.
Any ideas?
Thanks,
Evgeny.


Replies (4)

RE: MitySOM 5CSX SPI device not showing up in /dev - Added by Daniel Vincelette over 2 years ago

Hi Evgeny,

Which branch of the kernel are you using? Mainline linux removed the keyword spidev from the compatible list of the spidev driver around the 4.x branches. The socfpga_mitysom5csx_leigh.dts uses an earlier kernel.

If you're using the 4.9 kernel you'll be able to update the compatible flag to cl,spidev instead.

Dan

RE: MitySOM 5CSX SPI device not showing up in /dev - Added by Franz Sattler over 2 years ago

Hello Daniel,

I’m working with Evgeny on this and we’ve tried updating the compatible keyword to cl,spidev and we still don’t have SPI show up in /dev/, I have attached the updated dtsi file, also we are using kernel version 4.14.130. We are not very experienced with this, could you explain in more detail on what changes might be necessary, is there maybe a checklist of changes needed for the device tree files or kernel to have SPI? Maybe we just missed adding something. How would we make sure we have it working as well? We still have the same output from the SPI_search image attached before.

Thanks,

Franz

RE: MitySOM 5CSX SPI device not showing up in /dev - Added by Daniel Vincelette over 2 years ago

Hi Franz,

I would recommend switching to our socfpga-4.9.78-ltsi branch that can be downloaded from git repo: https://support.criticallink.com/gitweb/?p=linux-socfpga.git;a=summary, which our current stable branch. This has a few fixes for our SOM, specially needed to get USB to work. Our guide on building this branch can be found here: Building the Linux Kernel.

If you really require to use the 4.14.130 then changing the compatible keyword for your spidev to rohm,dh2228fv should work. In the kernel driver for spidev it has the following struct that has the list of compatible keyboards that can be used for device tree nodes:

static const struct of_device_id spidev_dt_ids[] = {
    { .compatible = "rohm,dh2228fv" },
    { .compatible = "lineartechnology,ltc2488" },
    { .compatible = "ge,achc" },
    { .compatible = "semtech,sx1301" },
    {},
};

Dan

RE: MitySOM 5CSX SPI device not showing up in /dev - Added by Franz Sattler over 2 years ago

Hello Daniel,

We tried changing the keyword to rohm,dh2228fv but it still does not show up in /dev/. Is there anything that might be missing from the kernel? We did add “CONFIG_SPI_SPIDEV=y” but is there more needed? You linked a spidev.c file, should that be added somewhere in the kernel or is it included with the 4.14.130 version? Any help is appreciated.

I will try to make the build with the socfpga-4.9.78-ltsi branch though ideally we want to make it work with 4.14.130.

Thanks,

Franz

    (1-4/4)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)