LCD type auto detection

brox
I'd like to auto detect LCD rather than hardcode its type (which is lame).
Any ideas how to do it?

davef
Have a look at how it is done in the:

http://www.ptxdist.org/oselas/bsp/pengutronix/mini2440_bsp_en.html

brox
Thanks davef!

davef
When you install the BSP for Nov you find find a directory with all the
patches for the kernel in it.

brox
I think there is some misunderstanding...
OSELAS.BSP-Pengutronix-Mini2440-Quickstart.pdf says:
"The BSP comes with a pre-configuration for the portrait N35 240 x 320
display. [...] To forward this additional information to Qt, the file
configs/platform-friendlyarm-mini2440/projectroot/etc/profile.environment
exists in the BSP. We can edit it prior the build and change the size
settings according to our own display if it differs from the default one."

So as I understood, no auto detection is done, and LCD type appears
hardcoded.

davef
"The touchscreen is enabled by the mini2440= kernel parameter".  So, you
have to change it in /env/config.  What confused me is the LCD type is
REPORTED during kernel boot, not determined during boot-up.  You can stop
the boot process and change touchscreen type, save it and re-boot.

Top of page 27 mini2440:/ edit /env/config


Sorry about the misleading information.


What you are referring to above are the values that are past to QT
applications.

Dave

Juergen Beisert
The list and numbers of supported displays are part of the quickstart
manual.
And yes. The BSP (at least the Qt demo application) is prepared for the 240
x 320 LCD. But not the kernel. Refer page 20 for the supported LCDs

• 0: N35: 3.5” TFT + touchscreen (NEC
NL2432HC22-23B/LCDN3502-23B)                              • 1: A70:
7” TFT + touchscreen (Innolux AT070TN83)
• 2: VGA shield
• 3: t35: 3.5” TFT + touchscreen (TD035STED4)
• 4: 5.6” TFT + touchscreen (Innolux AT056TN52)
• 5: x35: 3.5” TFT + touchscreen (Sony ACX502BMU-7)
• 6: w35i: 3.5” TFT + touchscreen (Sharp LQ035Q1DG06)
• 7: N43: 4.3” TFT + touchscreen (NEC NL4827HC19-01B / Sharp
LQ043T3DX02)

brox
But this require user interaction anyway? What I'm looking for, is some OEM
string stored in LCD, or maybe some hack that can distinguish one hardware
from another...

Juergen Beisert
You can't auto detect the attached display type.

Anatole
You can retrieve LCD parameters from SoC hardware registers:

// getting the Screen buffer parameters
  LCD_buffer  = (unsigned short *)((*( unsigned *)0x4d000014) << 1);
  LCD_X    = (*( unsigned *)0x4d00001c);
Knowing LCD_X you can determine LCD_Y and so on...
You can get LCD buffer address and use it as you wish.
                                              (Hello3 sketch)