Page 1 of 1

Set specific pixelclk / pixelclock in kernel for TFT panel

Posted: Wed Mar 22, 2017 6:41 pm
by fl0wtec
Dear friendlyarm,

I´m trying to drive a TFT panel (1280x120px) via RGB interface of the NanoPi S2.

I`ve modified kernel source code and added the timings for the TFT panel in:

Code: Select all


and compiled the kernel (uImage).

However one critical parameter is missing in lcds.c:

The pixelclock. The TFT panel needs a specific pixel clock of 11 MHz.

This is not to be confused with the

Code: Select all

parameter in

Code: Select all


So when booting up the NanoPiS2, I see via serial console (UART interface) the following line:

Code: Select all

[    0.876000] Display.0 fps=161 (6 ms), wait= 4 jiffies, Pixelclk=200000000hz

This "Pixelclk" value is obviously wrong and cant be set in lcds.c

What I did so far:
1) Modify lcds.c
2) Compile kernel (uImage)
3) Copy uImage to boot partition and clone it as well to uImage.hdmi
4) Interrupt boot process via serial interface to set bootargs
5) set bootargs to include lcd=BTFT1280 (my config)
6) saveenv
7) boot

Where to set the correct pixelclock for the TFT panel?

Thanks for all your answers!

Re: Set specific pixelclk / pixelclock in kernel for TFT panel

Posted: Fri Mar 24, 2017 3:49 pm
by yonganch
Hi, try this please,
.width = 1280,
.height = 120,
.p_width = 280,
.p_height = 27,
.bpp = 24,
.freq = 60, // the refresh rate, not the pixel clock. the pixel clock will be calculated by driver.

If the lcd displays something but not correct, you need to modify .timing or .polarity.
Good luck.