[SOLVED] SPI module missing in kernel 4.4.2-1

This forum is for supported devices using an ARMv7 Texas Instruments (TI) SoC.

[SOLVED] SPI module missing in kernel 4.4.2-1

Postby IlikePepsi » Fri Feb 26, 2016 9:30 am

Hi there,

recently I created a kernel module using the SPI0 interface on the Beaglebone Black. In the device tree that SPI device is tagged with compatible = <"ti,omap2-mcspi">;. So when booting the BBB the corresponding kernel module was loaded (spi-omap2-mcspi.ko.gz). That was with kernel version 4.3.3-1-ARCH.

Then I made a system upgrade with pacman -Syu and afterwards my module wouldn't send any data. Now under kernel 4.4.2-1 that specific kernel module is no longer available under /usr/lib/modules/4.4.2-1-ARCH/kernel/drivers/spi. Instead there is a different module spi-ti-qspi.ko.gz but that doesn't match the hardware on the BBB.

Does anybody know why the available module was changed and how reverse that? Right now I'm trying to compile that module from source.. wish me luck. Bye.
Last edited by IlikePepsi on Fri Feb 26, 2016 2:02 pm, edited 1 time in total.
IlikePepsi
 
Posts: 8
Joined: Mon Jul 27, 2015 9:26 am

Re: SPI module missing in kernel 4.4.2-1

Postby IlikePepsi » Fri Feb 26, 2016 11:54 am

After some research I found out that spi-omap2-mcspi is not longer compiled as a kernel module. Instead it is built into the kernel.

In /usr/lib/modules/(uname -r)/build/.config i found the difference:

Kernel 4.3.3-1 (line 2621 ff.):
...
CONFIG_SPI_OMAP24XX=m
# CONFIG_SPI_TI_QSPI is not set
...

Kernel 4.2.2-1 (line 2648 ff.):
...
CONFIG_SPI_OMAP24XX=y
CONFIG_SPI_TI_QSPI=m
...

So now the question is how can I make sure that built in code is used?
IlikePepsi
 
Posts: 8
Joined: Mon Jul 27, 2015 9:26 am

Re: SPI module missing in kernel 4.4.2-1

Postby IlikePepsi » Fri Feb 26, 2016 2:01 pm

Ok, I solved it.

On boot I use a device tree overlay to configure my pins. That is done by adding bone_capemgr.enable_partno=<overlay> to the optargs parameter in /boot/uEnv.txt. Here is a code fragment from my overlay.

$this->bbcode_second_pass_code('', '
fragment@0 {
target = <&am33xx_pinmux>;

__overlay__ {
spi0_pins: pinmux_spi0_pins {
pinctrl-single,pins = <
0x154 0x30 /* P9_21 uart2_txd SPI0_D0 INPUT_PULLUP | MODE0 */
0x150 0x30 /* P9_22 uart2_rxd SPI0_SCLK INPUT_PULLUP | MODE0 */
0x044 0x37 /* P9_23 gpio1_17 nADC_DRDY INPUT_PULLUP | MODE7 */
>;
};
};
};
')

But the configuration fails and the SPI pins are still configured as GPIO pins (0x37) . So as a fix I do the pinmux configuration in my kernel module and everything works.
IlikePepsi
 
Posts: 8
Joined: Mon Jul 27, 2015 9:26 am

Re: [SOLVED] SPI module missing in kernel 4.4.2-1

Postby WarheadsSE » Fri Feb 26, 2016 3:29 pm

Does it succeed in loading the overlay, but by the time the module is loaded it is not correct?
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: [SOLVED] SPI module missing in kernel 4.4.2-1

Postby IlikePepsi » Sat Feb 27, 2016 8:53 pm

$this->bbcode_second_pass_quote('', 'D')oes it succeed in loading the overlay, but by the time the module is loaded it is not correct?


Yes that is exactly the behavior regarding the pinmux settings. In my overlay I also set the states for some OCP devices like I2C1 or UART1 and that works perfectly and it is a lucky coincidence that no change of the pinmux settings is needed to use these devices.

That's why it took me a while to figure out what was going on.

Kind regards.
IlikePepsi
 
Posts: 8
Joined: Mon Jul 27, 2015 9:26 am


Return to Texas Instruments (TI)

Who is online

Users browsing this forum: No registered users and 1 guest