Building a kernel 3.12-rc2 for the imx23-olinuxino

Started by Fadil Berisha, September 26, 2013, 07:38:43 am

Previous topic - Next topic

Christian Jann

October 04, 2013, 11:54:18 am #15 Last Edit: October 06, 2013, 07:06:29 pm by Christian Jann

OK, now I've found the time to try these i2c patches:

- [PATCH 1/3 V2] i2c: mxs: distinguish i.MX23 and i.MX28 based I2C controller http://www.spinics.net/lists/linux-i2c/msg13406.html, http://marc.info/?l=linux-i2c&m=138049705921935&q=raw
- [PATCH 2/3 V4] i2c: mxs: Rework the PIO mode operation http://www.spinics.net/lists/linux-i2c/msg13481.html, http://marc.info/?l=linux-arm-kernel&m=138106100311582&w=2

The kernel (sd_mmc_bootstream.raw etc.) and all patches are avaible here: http://sourceforge.net/projects/janncc/files/olinuxino/kernel/3.12-rc3/


curl -L http://sourceforge.net/projects/janncc/files/olinuxino/kernel/3.12-rc3/0001-ARM-imx23-olinuxino-Add-i2c-support.patch/download -o 0001-ARM-imx23-olinuxino-Add-i2c-support.patch
curl -L http://sourceforge.net/projects/janncc/files/olinuxino/kernel/3.12-rc3/0002-i2c-mxs-distinguish-i.MX23-and-i.MX28-based-I2C-controller.patch/download -o 0002-i2c-mxs-distinguish-i.MX23-and-i.MX28-based-I2C-controller.patch
curl -L http://sourceforge.net/projects/janncc/files/olinuxino/kernel/3.12-rc3/0003-i2c-mxs-Rework-the-PIO-mode-operation.patch/download -o 0003-i2c-mxs-Rework-the-PIO-mode-operation.patch
curl -L http://sourceforge.net/projects/janncc/files/olinuxino/kernel/3.12-rc3/0004-ARM-imx23-olinuxino-Set-compatibily-for-i2c0-to-imx2.patch/download -o 0004-ARM-imx23-olinuxino-Set-compatibily-for-i2c0-to-imx2.patch
patch -p1 < 0001-ARM-imx23-olinuxino-Add-i2c-support.patch
patch -p1 < 0002-i2c-mxs-distinguish-i.MX23-and-i.MX28-based-I2C-controller.patch
patch -p1 < 0003-i2c-mxs-Rework-the-PIO-mode-operation.patch
patch -p1 < 0004-ARM-imx23-olinuxino-Set-compatibily-for-i2c0-to-imx2.patch
curl -L http://sourceforge.net/projects/janncc/files/olinuxino/kernel/3.12-rc3/dotconfig/download -o .config


Now I get the following errors:


[root@olinuxino ~]# i2cdetect 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- [  154.710000] mxs-i2c 80058000.i2c: Failed to get PIO reg. write descriptor.
-- -- [  155.710000] mxs-i2c 80058000.i2c: Failed to get PIO reg. write descriptor.
-- -- [  156.710000] mxs-i2c 80058000.i2c: Failed to get PIO reg. write descriptor.
-- -- [  157.710000] mxs-i2c 80058000.i2c: Failed to get PIO reg. write descriptor.
-- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- [  158.760000] mxs-i2c 80058000.i2c: Failed to get PIO reg. write descriptor.
-- -- [  159.760000] mxs-i2c 80058000.i2c: Failed to get PIO reg. write descriptor.
-- -- [  160.760000] mxs-i2c 80058000.i2c: Failed to get PIO reg. write descriptor.
-- -- [  161.760000] mxs-i2c 80058000.i2c: Failed to get PIO reg. write descriptor.
-- -- [  162.760000] mxs-i2c 80058000.i2c: Failed to get PIO reg. write descriptor.
-- -- [  163.760000] mxs-i2c 80058000.i2c: Failed to get PIO reg. write descriptor.
-- -- [  164.760000] mxs-i2c 80058000.i2c: Failed to get PIO reg. write descriptor.
-- -- [  165.760000] mxs-i2c 80058000.i2c: Failed to get PIO reg. write descriptor.
--
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                         
[root@olinuxino ~]#


The error messages are coming from the new code. But I can switch off and on the relays on the MOD-IO2:


[root@olinuxino ~]# ./i2c-tool -w 0 0x48 4 0x02 0xA0 0x40 0x03 #REL 1&2 on
SLAVE ADDRESS: 0x48
NUMBER OF BYTES TO WRITE: 4
MEMORY ALLOCATED AT ADDRESS: 0x8DC008
/dev/i2c-0 OPENDED!
WRITE:SUCCESS
[root@olinuxino ~]# ./i2c-tool -w 0 0x48 4 0x02 0xA0 0x40 0x00 #REL 1&2 off
SLAVE ADDRESS: 0x48
NUMBER OF BYTES TO WRITE: 4
MEMORY ALLOCATED AT ADDRESS: 0x18AF008
/dev/i2c-0 OPENDED!
WRITE:SUCCESS
[root@olinuxino ~]# ./i2c-tool -w 0 0x48 4 0x02 0xA0 0x40 0x01 #REL 1 on
SLAVE ADDRESS: 0x48
NUMBER OF BYTES TO WRITE: 4
MEMORY ALLOCATED AT ADDRESS: 0x1D09008
/dev/i2c-0 OPENDED!
WRITE:SUCCESS
[root@olinuxino ~]# ./i2c-tool -w 0 0x48 4 0x02 0xA0 0x40 0x02 #REL 2 on
SLAVE ADDRESS: 0x48
NUMBER OF BYTES TO WRITE: 4
MEMORY ALLOCATED AT ADDRESS: 0x46F008
/dev/i2c-0 OPENDED!
WRITE:SUCCESS
[root@olinuxino ~]#


Pictures of the wiring are available here: http://www.jann.cc/2013/05/04/imx233_olinuxino_current_state.html#i2c


atlaware

Quote from: TrevorPage on September 29, 2013, 10:42:53 pm
I'm extremely grateful once again, because I now seem to have an audio driver that behaves far better than in the kernel I tried that's discussed here: https://www.olimex.com/forum/index.php?topic=704.0.


Hi! Can I ask you to upload the raw kernel 3.x with audio driver? to somehow (wetransfer o gdrive).
Good to compile, but also good to dd a raw file :)

Thank you!

Grawp

Please note that https://github.com/koliqi/imx23-olinuxino contains an old audio driver containing rather serious DMA interrupts bug.
There is a newer driver at https://github.com/ITserve/imx23-audio. Btw. there are certainly still some bugs (e.g. it may not work properly when not compiled as module).

Fadil Berisha

Hi Grawp,

Quote from: Grawp on November 08, 2013, 02:30:34 pm
Please note that https://github.com/koliqi/imx23-olinuxino contains an old audio driver containing rather serious DMA interrupts bug.
There is a newer driver at https://github.com/ITserve/imx23-audio. Btw. there are certainly still some bugs (e.g. it may not work properly when not compiled as module).


Thank you for pointing out problem with audio driver. I will fix that in https://github.com/koliqi/imx23-olinuxino.

If you are author of driver, would be nice if you find time to submit patches to mainline kernel. There is much wider audience and more people will help to fix problems on audio driver. Anyway, I will write this suggestion also to author on his email address supplied on patch.

Thanks again,

Fadil Berisha

Mr.D

And what about SPI is it working "out of box" with 3.12 ,or also need a Patch ?

Best Regards

Fadil Berisha

Hi Mr.D,

Quote from: Mr.D on November 16, 2013, 10:32:01 am
And what about SPI is it working "out of box" with 3.12 ,or also need a Patch ?


SPI is working out of box. My patch for SPI is incorporated on mainline and you need only to add node for your device.
How to add node? Please check samples at my web page http://g-lab.ca/spi-serial-periferial-interface/ and http://g-lab.ca/spi-gpio-expander-with-mcp23s08/

Fadil Berisha

Mr.D

Hallo Fadil ,
Thanks for help!
Best Regards


Quote from: Fadil Berisha on November 16, 2013, 05:19:17 pm
Hi Mr.D,

Quote from: Mr.D on November 16, 2013, 10:32:01 am
And what about SPI is it working "out of box" with 3.12 ,or also need a Patch ?


SPI is working out of box. My patch for SPI is incorporated on mainline and you need only to add node for your device.
How to add node? Please check samples at my web page http://g-lab.ca/spi-serial-periferial-interface/ and http://g-lab.ca/spi-gpio-expander-with-mcp23s08/

Fadil Berisha

igg

Quote from: Fadil Berisha on September 28, 2013, 06:38:40 pm
About rtl8188cu. My feeling is build in driver is source of problem. Because of that suggested to Olimex to "check any "nonworking" board with kernel 3.7.1 and compare result with 3.11.x / 3.12.x."
If that work on 3.7.1, I am willing to bring again driver from RTL's website  on new build 3.12-rc2

Fadil Berisha


I tried that already, and couldn't make it work.  The rtlwifi is considerably restructured in 3.10 onwards, and I'm no kernel hacker.  The furthest I got was a bunch of unresolved wireless_send_event symbols during linking, despite the fact that this function was being called from other modules apparently without issues.  The patched module I was using is based on Realtec's v4.0.2_9000, and advertised to work with 3.10 onwards, but not in my hands - at least not as a non-DKMS build.  It worked great in 3.7 once debugging and power-saving were turned off.  Without turning that off, the log was being spammed > 20 lines/second causing the whole system to be in a constant wait state, and the console unusable.

There is an open kernel bug for the rtl8192cu driver, and more recently, a patch against 3.11, which works with 3.10.  My WiFi is an EdiMax EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS].

I'm targeting 3.10 because its supposed to have long-term support, and this is what archlinux is currently using (though not on their official olinuxino image).

To try to make life easier for people, I rolled Christian's and your I2C/SPI patches (for 3.12rc3) together with the rtl8192cu patch from the kernel wireless team, and applied them all to 3.10.19.  The patches took only some minor fiddling, so they are largely what was provided by others.

I put everything up on my under-utilized GoogleDrive, including a bootstream image, full mmc rootfs image (updated to 2013-11-16), and various kernel building inputs and products.

I've subscribed to the kernel bug, and will try to keep these updated with latest developments.  Also the I2C/SPI patches.

Thanks for all of your and Christian's excellent work, BTW.

N.B.:  I don't actually have any I2C or SPI hardware to test.  It would be nice if someone tried it out and reported back.

-igg