Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => iMX233 => Topic started by: tmcdos on July 04, 2015, 09:42:06 PM

Title: Working frame buffer for kernel 4.1
Post by: tmcdos on July 04, 2015, 09:42:06 PM
I needed a minimal kernel for my LED-strips project (inspired by Jeroen Domburg (http://spritesmods.com/?art=imx233-ws2811))
Kernel has almost all peripherals working - excluding WiFi, NetFilter, IPsec, power management,fancy filesystems and other non-relevant stuff.
Frame-buffer is working (it took me whole day to make it work due to some missing information in DTS) and there is also Timer 1 as 30MHz clock source for userspace. Hardware I2C is disabled, because it overlaps with LCD pins, but software bit-banging can be used.

The contributions here are:
1) added 16-bit LCD interface in device tree according to Jeroen Domburg`s patch on his web page (link is above)
2) included important parameters as per Documentation/devicetree/bindings/fb/mxsfb.txt in the stock kernel 4.1
3) copied parameter clocks from imx23.dtsi into imx23-olinuxino.dts - otherwise there is no /dev/fb0
4) patched /drivers/clocksource/mxs_timer.c as per aero-linux patch (https://github.com/balrog-kun/aerolinux-patchset/blob/master/0002-mx23-High-res-clocksource-using-16-bit-Timer-1.patch)

Get the files from Mirror Creator (http://uploadmirrors.com/download/1EOJEWXP/imx233_0.zip)
Title: Re: Working frame buffer for kernel 4.1
Post by: Fabio Estevam on July 04, 2015, 09:46:55 PM
Any plans to sending the patches upstream?

Regards,

Fabio Estevam
Title: Re: Working frame buffer for kernel 4.1
Post by: swahren on July 05, 2015, 06:30:44 PM
Providing a Windows Executable is pretty unusual for Linux sources. Looks suspicious to me.
Title: Re: Working frame buffer for kernel 4.1
Post by: tmcdos on July 05, 2015, 07:42:23 PM
Quote from: swahren on July 05, 2015, 06:30:44 PM
Providing a Windows Executable is pretty unusual for Linux sources. Looks suspicious to me.

I am not sure what do you mean. There is no executable file in the archive - only textual information (besides the DTB, but you can always compile it from the DTS).
If you are talking about choosing ZIP instead of GZ or XZ or even TAR - I can not see a strong enough reason why to prefer one over another, they are all equally suitable for the purpose.

Regarding sending the patches upstream - I am still quite new to this forum and to the hardware platform itself, and do not know what is the procedure. I do not need a credit, just wanted to share a working solution for a specific problem.
Title: Re: Working frame buffer for kernel 4.1
Post by: swahren on July 06, 2015, 01:12:42 AM
Quote from: tmcdos on July 05, 2015, 07:42:23 PM
I am not sure what do you mean. There is no executable file in the archive - only textual information (besides the DTB, but you can always compile it from the DTS).
If you are talking about choosing ZIP instead of GZ or XZ or even TAR - I can not see a strong enough reason why to prefer one over another, they are all equally suitable for the purpose.

If i click on your link above then i'll get an imx233_0.zip.exe
Title: Re: Working frame buffer for kernel 4.1
Post by: tmcdos on July 06, 2015, 09:37:04 PM
Quote from: swahren on July 06, 2015, 01:12:42 AM
If i click on your link above then i'll get an imx233_0.zip.exe

If I click, then I see a list of download locations (like UptoBox, HugeFiles, AFile, TusFiles, FileRIO ....)
Then if I click one of these download links - I get a ZIP file, not EXE.
I would be more than happy to attach the files here in the forum - but unfortunately attachments are disabled by forum administrator :(
Title: Re: Working frame buffer for kernel 4.1
Post by: swahren on July 07, 2015, 03:50:49 AM
Another option would be to clone an existing Linux repository at a Git provider and apply your patches.

Edit: Okay, it was my fault to click on the obvious link. Thanks for providing.
Title: Re: Working frame buffer for kernel 4.1
Post by: JohnS on July 07, 2015, 09:30:59 AM
It's generous to provide the file(s), and I expect will help people, but an EXE is about the worst option, sadly.  Is there no other host where a ZIP (or bz2 or whatever) can be put?

John
Title: Re: Working frame buffer for kernel 4.1
Post by: tmcdos on July 09, 2015, 09:05:54 PM
http://dox.bg/files/dw?a=7dc66a68e9

I really do not want to be rude, but I do wonder how do you people are "fighting" with a complex beast like Linux and with hardware devices, but could not see so obvious hyperlinks for downloading ....

If there is a moderator - it seems that the option for attaching small (e.g. up to 10 MB) files would be extremely handy.
Title: Re: Working frame buffer for kernel 4.1
Post by: lambda on July 10, 2015, 11:12:35 AM
Quote from: tmcdos on July 05, 2015, 07:42:23 PM
Regarding sending the patches upstream - I am still quite new to this forum and to the hardware platform itself, and do not know what is the procedure.

At least three people (including me) answering in this thread could help you getting started.
However I don't have any LCD hardware for testing your work, so I'd hope one of the other
two jumps in if possible.

Quote
I do not need a credit, just wanted to share a working solution for a specific problem.

IMO sending patches upstream isn't for credit, but to have it work out of the box should you ever
need to upgrade to a newer kernel. Also of course you learn a lot during the review process.

HTH,
Harald
Title: Re: Working frame buffer for kernel 4.1
Post by: Chris on August 13, 2015, 12:18:35 PM
I tried to compile a fresh kernel (4.1.4) with your patches and .config, but it won't boot at all. Compilation completed without errors (however, modules are disabled??), but when booting it only says:
bus = 0xb83d34c8

and then locks up.
Any idea?

Thanks,
Chris
Title: Re: Working frame buffer for kernel 4.1
Post by: Chris on August 13, 2015, 12:56:45 PM
PS: I added some options in the menuconfig (like essential boot options!) and now it will come up, but fails with a kernel panic:
Kernel panic - not syncing: Requested init /usr/lib/systemd/systemd failed (error -2).
CPU: 0 PID: 1 Comm: swapper Not tainted 4.1.4-ARCH #9
Hardware name: Freescale MXS (Device Tree)
[<c000ef4c>] (unwind_backtrace) from [<c000cf0c>] (show_stack+0x10/0x14)
[<c000cf0c>] (show_stack) from [<c03fdb20>] (panic+0x98/0x200)
[<c03fdb20>] (panic) from [<c03fca7c>] (kernel_init+0x80/0xec)
[<c03fca7c>] (kernel_init) from [<c000a3b0>] (ret_from_fork+0x14/0x24)
---[ end Kernel panic - not syncing: Requested init /usr/lib/systemd/systemd failed (error -2).


Ideas??
What filesystem (distro) are you using?

Thanks,
Chris
Title: Re: Working frame buffer for kernel 4.1
Post by: swahren on August 13, 2015, 07:42:00 PM
Hello Chris,

without your actual Kernel config and used bootloader it would be hard to find the problem.

Maybe you missed the systemd requirements (http://cgit.freedesktop.org/systemd/systemd/tree/README)?
Title: Re: Working frame buffer for kernel 4.1
Post by: Chris on August 14, 2015, 09:03:12 AM
without your actual Kernel config and used bootloader it would be hard to find the problem.


I used the kernel config provided here in the first post from tmcdos.

Bootloader (Bootlets) taken from https://github.com/koliqi/imx23-olinuxino 
(It's not a bootloader problem - even running the kernel under Qemu will bring the Kernel panic above.)

RootFS taken from
https://www.olimex.com/wiki/images/4/49/Imx233_kernel_2.6_ARCH_FS_WIFI_release_4.torrent
Title: Re: Working frame buffer for kernel 4.1
Post by: swahren on August 14, 2015, 06:18:27 PM
Did you try it without tmcdos patches?

Did you try to the fix systemd requirements?

Title: Re: Working frame buffer for kernel 4.1
Post by: Chris on August 25, 2015, 03:59:07 PM
Thanks to https://www.olimex.com/forum/index.php?topic=4687.0 (https://www.olimex.com/forum/index.php?topic=4687.0) it's working now, including tmcdos changes.
Title: Re: Working frame buffer for kernel 4.1
Post by: timesee on October 10, 2015, 11:03:06 AM

I am seeking a linux kernel source with TV out capability and tried to get tmcdos's patch mentioned above but failed to download it. I think tmcdos's patch probably make it possible to TV out which I actually need. so would someone send me it or get me the patch or any guide or hint on how to access linux kernel source will be appreciate.

Title: Re: Working frame buffer for kernel 4.1
Post by: JohnS on October 11, 2015, 05:02:07 PM
Best bet is probably to grab kernel sources and build what you want.

John
Title: Re: Working frame buffer for kernel 4.1
Post by: swahren on October 11, 2015, 05:42:38 PM
Quote from: timesee on October 10, 2015, 11:03:06 AM

I am seeking a linux kernel source with TV out capability and tried to get tmcdos's patch mentioned above but failed to download it. I think tmcdos's patch probably make it possible to TV out which I actually need. so would someone send me it or get me the patch or any guide or hint on how to access linux kernel source will be appreciate.

Hi, tmcdoc's patch has nothing to do with TV output. AFAIK the TV out support never hit mainline. So you will need to get the downstream kernel 2.6.35 from Freescale:

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/?h=imx_2.6.35_maintain
Title: Re: Working frame buffer for kernel 4.1
Post by: Chris on October 19, 2015, 09:40:39 PM
Quote from: timesee on October 10, 2015, 11:03:06 AMI am seeking a linux kernel source with TV out capability and tried to get tmcdos's patch mentioned above but failed to download it. I think tmcdos's patch probably make it possible to TV out which I actually need. so would someone send me it or get me the patch or any guide or hint on how to access linux kernel source will be appreciate.
I think you don't need a special kernel build just to enable TV output. Have a look into Freescale's "i.MX23 Applications Processor Reference Manual", chapter 19 "TV-Out NTSC/PAL Encoder": There is exactly explained which values you have to set into the registers to configure TV output - even a programming example (chapter 19.3), that should work also from user space (IMHO).

However, if you're searching for tmcdos's mod, you can download it also here:
https://drive.google.com/file/d/0B5RB6TqFSILBeHYxNjRtaVk3OUk/view?usp=sharing (https://drive.google.com/file/d/0B5RB6TqFSILBeHYxNjRtaVk3OUk/view?usp=sharing)