Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => iMX233 => Topic started by: ghrvy on January 31, 2016, 07:42:43 PM

Title: Working tv encoder out (PAL or NTSC) for kernel 4.4
Post by: ghrvy on January 31, 2016, 07:42:43 PM
I'm going to be along shortly with questions, so I though I'd start with an offering.

I've prepared a TGZ file here:
https://drive.google.com/file/d/0B_f6WM6ITL6uNjZ3WEZOZ1ZZTDA/view?usp=sharing (https://drive.google.com/file/d/0B_f6WM6ITL6uNjZ3WEZOZ1ZZTDA/view?usp=sharing)

It contains:
(a) a kernel patch (source and device tree) to set up the frame buffer driver in the correct mode to drive the TV encoder in PAL mode.
(b) a second patch to apply after the first if you prefer NTSC.
(c) a utility to run (as root) to turn on the TV output (for either mode).

It is possible to call the utility automatically on boot (see https://bbs.archlinux.org/viewtopic.php?id=147790 (https://bbs.archlinux.org/viewtopic.php?id=147790)).

I've installed the resulting kernel and device tree into an ARCH disk image, an I get a login prompt on the TV out, and it is possible to start X.
Title: Re: Working tv encoder out (PAL or NTSC) for kernel 4.4
Post by: lambda on January 31, 2016, 09:52:11 PM
Sounds great! Any plans to get this upstream into the mainline kernel?
Title: Re: Working tv encoder out (PAL or NTSC) for kernel 4.4
Post by: swahren on January 31, 2016, 11:46:35 PM
@ghrvy

So the utility manipulate the mx23 registers, too?
Title: Re: Working tv encoder out (PAL or NTSC) for kernel 4.4
Post by: ghrvy on February 02, 2016, 11:44:06 PM
Quote from: lambda on January 31, 2016, 09:52:11 PM
Sounds great! Any plans to get this upstream into the mainline kernel?

As it stands - probably not. For a start there are clock lookups by name, which can't be "right".

Quote from: swahren on January 31, 2016, 11:46:35 PM
@ghrvy

So the utility manipulate the mx23 registers, too?

Yes. To enable the clock to tvenc and to set up tvenc itself.
Title: Re: Working tv encoder out (PAL or NTSC) for kernel 4.4
Post by: lambda on February 03, 2016, 05:41:10 PM
Quote from: ghrvy on February 02, 2016, 11:44:06 PM
Quote from: lambda on January 31, 2016, 09:52:11 PM
Sounds great! Any plans to get this upstream into the mainline kernel?
As it stands - probably not. For a start there are clock lookups by name, which can't be "right".

I wasn't suggesting that you submit the patches as is ... ;)

Just asking (hoping) if this is a long term goal.
Title: Re: Working tv encoder out (PAL or NTSC) for kernel 4.4
Post by: swahren on February 04, 2016, 11:30:13 PM
Quote from: ghrvy on February 02, 2016, 11:44:06 PM
Quote from: lambda on January 31, 2016, 09:52:11 PM
Sounds great! Any plans to get this upstream into the mainline kernel?

As it stands - probably not. For a start there are clock lookups by name, which can't be "right".

I don't think lookup by name is a big problem. I recommend to implement the clock handling in clk-imx23 first.
Title: Re: Working tv encoder out (PAL or NTSC) for kernel 4.4
Post by: swahren on April 16, 2016, 03:47:04 PM
As a small step for mainline support i added the necessary clock into the i.MX23 clock tree in my private repo:

https://github.com/lategoodbye/linux-mxs-power/commit/d87966f03e7714cca982bc10933ce9d828c48b25

Maybe this finally works ...