I have an UDOO Quad Rev.D and I would like to activate the serial port SPI2 in the kernel so I can use them from the i.mx6. I chose SPI2 because it is available on the header. I am not sure what I need to add to the kernel files to get it working. I have managed to compile the kernel and get the UARTS working, but I am clueless with the SPI interfaces. Has anyone been able to get a serial port working for the i.mx6? I guess if all else fails, I could bit bang it. Would be nice to get it working without having to bit bang though. Is there a driver for the SPI interface that is needed? Any help would be appreciated. I did find this link on freescale, so I am going to see what I can accomplish while I wait... https://community.freescale.com/thread/302612 Thanks!
Hi there Whatdoudoo, for the moment regarding this matter the best documentation is indeed the Freescale website. I suggest to go for the solution you provided and try if it works. Cheers
Ok, I will try it this week sometime don't have time today. I already changed the pins in board-mx6qd_seco_UDOO.h. Would the only other file I need to change be the board-mx6_seco_UDOO.c? And I also assume I would use the spidev driver as they did on the freescale link? Thanks!
I have tried both ESCPI1 and ESCPI2 with no luck. I finally found a link that said you have to enable the User mode support in the spi device section of the menu config which I have also done. Device Drivers ---> [*] SPI support ---> <*> Freescale i.MX SPI controllers <*> User mode SPI device driver support The thing is, I think there is suppose to be an SPIDEV controller in this section to use the spidev drivers. All that is there is the Freescale i.mx SPI Controllers and I haven't found any info on them yet. Speaking of that, I may just be able to add the define for that, have not tried that yet. I also found this link in which there was a bug on the raspberrypi which looks like the same problem I am having, so maybe that bug in this kernel as well. https://github.com/raspberrypi/linux/issues/296 Anyway, I have not given up yet just hoping someone might be able to steer me further quicker. Here are my current files. I had no problem enabling all the uarts, but the SPI devices have been a real pain. Anyone see if I'm doing something wrong or something I'm not doing. If these files are right, the problem must be elsewhere. ########## board-mx6qd_seco_UDOO.h ############## //enabling SPI1, comment out GPIO and uncomment SCLK // MX6Q_PAD_DISP0_DAT20__GPIO_5_14, // pin 36 MX6Q_PAD_DISP0_DAT20__ECSPI1_SCLK, //enabling SPI1, comment out GPIO and uncomment MOSI // MX6Q_PAD_DISP0_DAT21__GPIO_5_15, // pin 37 MX6Q_PAD_DISP0_DAT21__ECSPI1_MOSI, //enabling SPI1, comment out GPIO and uncomment MISO //MX6Q_PAD_DISP0_DAT22__GPIO_5_16, // pin 45 MX6Q_PAD_DISP0_DAT22__ECSPI1_MISO, //enabling SPI1, comment out GPIO and uncomment SP1 SSO //MX6Q_PAD_DISP0_DAT23__GPIO_5_17, // pin 46 MX6Q_PAD_DISP0_DAT23__ECSPI1_SS0, ########## board-mx6_seco_UDOO.c ############## I added an SPI section. /*********************************************************************** * SPI * ***********************************************************************/ // chip select pin static int mx6q_UDOO_spi_SS0[] = { MX6Q_PAD_DISP0_DAT23__ECSPI1_SS0, }; // this struct is added in function mx6_seco_UDOO_board_init() static const struct spi_imx_master mx6q_UDOO_spi_data2 __initconst = { .chipselect = mx6q_UDOO_spi_SS0, .num_chipselect = ARRAY_SIZE(mx6q_UDOO_spi_SS0), }; // all spi devices initialization data goes in this array static struct spi_board_info imx6_UDOO_spi_any_device[] __initdata = { { .modalias = "spidev", .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .chip_select = 0, .mode = SPI_MODE_0, }, }; // this is called in function mx6_seco_UDOO_board_init() static void spi_device_init(void) { imx6q_add_ecspi(0, &mx6q_UDOO_spi_data2); spi_register_board_info(imx6_UDOO_spi_any_device, ARRAY_SIZE(imx6_UDOO_spi_any_device)); } In mx6_seco_UDOO_board_init(void) I added spi_device_init();
Looks like this person was having the same problem on kernel 3.0.35 as well, starting to think there is a bug in it... http://forum.solid-run.com/linux-on-cubox-i-and-hummingboard-f8/distribution-with-spidev--t1568.html Not sure how to move to a different kernel version, is there a newer version you guys have I can try?
Hi, I compiled the kernel 4.2 of patrykk from here : https://github.com/patrykk/linux-udoo It uses DTS file to manage the device tree but as you can see, there is nodes for I2C or UART but not for SPI : https://github.com/patrykk/linux-udoo/blob/4.2/arch/arm/boot/dts/imx6qdl-udoo.dtsi Anyone knows how to write a new node to enable SPIDEV?
Seems you would like to get final solution already? I'm trying to help you but ...... You just need to set correct pins (hint: check the schematic).
I've in mind this : Code: &ecspi2 { fsl,spi-num-chipselects = <2>; cs-gpios = <0>,<&gpio3 31 0>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ecspi2_1>; status = "okay"; spidev@0x00 { compatible = "spidev"; spi-max-frequency = <20000000>; reg = <0>; }; spidev@0x01 { compatible = "spidev"; spi-max-frequency = <20000000>; reg = <1>; }; }; &iomux { imx6q-udoo { pinctrl_ecspi2_1: ecspi2grp-1 { fsl,pins = < MX6SL_PAD_ECSPI2_MISO__ECSPI2_MISO 0x100b1 MX6SL_PAD_ECSPI2_MOSI__ECSPI2_MOSI 0x100b1 MX6SL_PAD_ECSPI2_SCLK__ECSPI2_SCLK 0x100b1 MX6SL_PAD_ECSPI2_SS0__ECSPI2_SS0 0x100b1 MX6SL_PAD_KEY_ROW3__GPIO3_IO31 0x100b1 >; }; }; }; Maybe I can guess the 2 GPIO for the chip select (cs-gpios) but I cannot figure out the rest.
Hi, Could you check https://github.com/patrykk/linux-udoo/issues/19. I added to last 4.2 kernel beta support for SPI. Please check it out. https://github.com/patrykk/linux-udoo/commit/aeb12cbbc875638074544121e6721e55049ba854 https://github.com/patrykk/linux-udoo/commit/5c2adc1834f4b3d4473da9a81457a65a284a2add
I pulled the last commits and compiled the kernel with the new DTS files. I do have the spidev1.0 and spidev1.1 devices in /dev now ! I'll try next week to start an SPI communication for test.
I'm trying to accomplish the exact same thing. Can you let me know the steps you took for success? Cheers!