spidev not visible in /dev after required changes in dtsi and menuconfig

cancel
Showing results for 
Search instead for 
Did you mean: 

spidev not visible in /dev after required changes in dtsi and menuconfig

Jump to solution
655 Views
kunalkulshresth
Contributor III

Dear All,

In order to enable user level accessible spidev I did the following things on my iMX6DL platform:

In imx6dl.dtsi for ecspi1 node added support for spidev:

ecspi1: ecspi@02008000 {

                                        #address-cells = <1>;

                                        #size-cells = <0>;

                                        compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";

                                        reg = <0x02008000 0x4000>;

                                        interrupts = <0 31 IRQ_TYPE_LEVEL_HIGH>;

                                        clocks = <&clks IMX6QDL_CLK_ECSPI1>,

                                                 <&clks IMX6QDL_CLK_ECSPI1>;

                                        clock-names = "ipg", "per";

                                        status = "disabled";

spidev1@0x00 {

                                          compatible = "spidev";

                                          spi-max-frequency = <200000>;

                                          reg = <0>;
};

};

Another thing I did is to enable the user mode device driver support in menuconfig, so I can see CONFIG_SPI_SPIDEV=y in .config.

After these changes when board boots, I can see the SPIdev coming in /sys/bus/spi/devices/spi0.0

root@imx6dlsabreauto:~# find / -name *spi*
/opt/ltp/testcases/bin/cpu_hotplug/tools/do_spin_loop
/opt/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock
/opt/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock
/opt/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init
/opt/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy
/opt/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_trylock
/etc/at-spi2
/etc/ssl/certs/spi-cacert-2008.pem
/etc/xdg/autostart/at-spi-dbus-bus.desktop
/usr/include/qt5/QtPlatformSupport/5.3.2/QtPlatformSupport/private/atspiadaptor_p.h
/usr/include/qt5/QtWidgets/qspinbox.h
/usr/include/qt5/QtWidgets/5.3.2/QtWidgets/private/qabstractspinbox_p.h
/usr/include/qt5/QtWidgets/qabstractspinbox.h
/usr/include/qt5/QtCore/5.3.2/QtCore/private/qwindowspipereader_p.h
/usr/include/qt5/QtCore/5.3.2/QtCore/private/qwindowspipewriter_p.h
/usr/include/bits/initspin.h
/usr/include/linux/spi
/usr/include/linux/spi/spidev.h
/usr/include/gtk-2.0/gtk/gtkspinbutton.h
/usr/include/gtk-2.0/gtk/gtkspinner.h
/usr/include/gtk-2.0/gtk/gtkcellrendererspin.h
/usr/include/gtk-2.0/gtk/gtkcellrendererspinner.h
/usr/share/cinematicexperience-1.0/content/images/spinner.png
/usr/share/locale/en_GB/LC_MESSAGES/at-spi2-core.mo
/usr/share/qt5nmapcarousedemo-1.0/content/images/spinner.png
/usr/share/dbus-1/services/org.a11y.atspi.Registry.service
/usr/share/terminfo/s/spinwriter
/usr/share/ca-certificates/spi-inc.org
/usr/share/ca-certificates/spi-inc.org/spi-cacert-2008.crt
/usr/share/qt5/examples/widgets/widgets/icons/iconsizespinbox.h
/usr/share/qt5/examples/widgets/widgets/icons/iconsizespinbox.cpp
/usr/share/qt5/examples/widgets/widgets/stylesheet/images/spindown_hover.png
/usr/share/qt5/examples/widgets/widgets/stylesheet/images/spindown_pressed.png
/usr/share/qt5/examples/widgets/widgets/stylesheet/images/spinup_hover.png
/usr/share/qt5/examples/widgets/widgets/stylesheet/images/spindown.png
/usr/share/qt5/examples/widgets/widgets/stylesheet/images/spinup_pressed.png
/usr/share/qt5/examples/widgets/widgets/stylesheet/images/spinup_off.png
/usr/share/qt5/examples/widgets/widgets/stylesheet/images/spindown_off.png
/usr/share/qt5/examples/widgets/widgets/stylesheet/images/spinup.png
/usr/share/qt5/examples/widgets/widgets/spinboxes
/usr/share/qt5/examples/widgets/widgets/spinboxes/spinboxes.pro
/usr/share/qt5/examples/widgets/widgets/spinboxes/spinboxes
/usr/share/qt5/examples/widgets/itemviews/spinboxdelegate
/usr/share/qt5/examples/widgets/itemviews/spinboxdelegate/spinboxdelegate
/usr/share/qt5/examples/widgets/itemviews/spinboxdelegate/spinboxdelegate.pro
/usr/lib/at-spi2-core
/usr/lib/at-spi2-core/at-spi2-registryd
/usr/lib/at-spi2-core/at-spi-bus-launcher
/usr/lib/libatspi.so.0
/usr/lib/qt5/qml/QtQuick/Controls/Styles/Base/images/spinner_large.png
/usr/lib/qt5/qml/QtQuick/Controls/Styles/Base/images/spinner_medium.png
/usr/lib/qt5/qml/QtQuick/Controls/Styles/Base/images/spinner_small.png
/usr/lib/libatspi.so.0.0.1
/sys/bus/spi
/sys/bus/spi/devices/spi0.0
/sys/bus/spi/drivers/m25p80/spi0.0
/sys/bus/spi/drivers/spidev
/sys/bus/platform/devices/2008000.ecspi
/sys/bus/platform/drivers/spi_imx
/sys/bus/platform/drivers/spi_imx/2008000.ecspi
/sys/bus/platform/drivers/fsl-quadspi
/sys/devices/soc0/soc.0/2000000.aips-bus/2000000.spba-bus/2008000.ecspi
/sys/devices/soc0/soc.0/2000000.aips-bus/2000000.spba-bus/2008000.ecspi/spi_master
/sys/devices/soc0/soc.0/2000000.aips-bus/2000000.spba-bus/2008000.ecspi/spi_master/spi0
/sys/devices/soc0/soc.0/2000000.aips-bus/2000000.spba-bus/2008000.ecspi/spi_master/spi0/spi0.0
/sys/class/spi_master
/sys/class/spi_master/spi0
/sys/class/spidev
/sys/kernel/debug/clk/osc/pll3_bypass_src/pll3/pll3_bypass/pll3_usb_otg/pll3_60m/ecspi_root
/sys/kernel/debug/clk/osc/pll3_bypass_src/pll3/pll3_bypass/pll3_usb_otg/pll3_60m/ecspi_root/ecspi1
/sys/kernel/debug/clk/osc/pll3_bypass_src/pll3/pll3_bypass/pll3_usb_otg/pll3_60m/ecspi_root/ecspi2
/sys/kernel/debug/clk/osc/pll3_bypass_src/pll3/pll3_bypass/pll3_usb_otg/pll3_60m/ecspi_root/ecspi3
/sys/kernel/debug/clk/osc/pll3_bypass_src/pll3/pll3_bypass/pll3_usb_otg/pll3_60m/ecspi_root/ecspi4
/sys/module/spidev
/proc/irq/63/2008000.ecspi
/unit_tests/mxc_spi_test1.out
/run/media/mmcblk2p1/imx6dl-sabreauto-ecspi.dtb
/lib/udev/keymaps/acer-aspire_8930
/lib/udev/keymaps/acer-aspire_5920g
/lib/udev/keymaps/acer-aspire_6920
/lib/udev/keymaps/acer-aspire_5720
root@imx6dlsabreauto:~#

Still I cannot see spi0.0 in /dev.

Please suggest what could be the issue here. What I understood was required, I have done the changes to enable the spidev, but it is not working.

Thanks and regards,

Kunal

Tags (3)
0 Kudos
1 Solution
134 Views
kunalkulshresth
Contributor III

I changed the status of ecspi1 to "okay" and this works:)

View solution in original post

0 Kudos
2 Replies
134 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Kunal

please check that M25P32 spi-nor (it also uses spi) was commented as in example
https://community.freescale.com/message/309184#309184

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
135 Views
kunalkulshresth
Contributor III

I changed the status of ecspi1 to "okay" and this works:)

View solution in original post

0 Kudos