Hammer LCD 8bit Color STN

This is a "HowTo" for the Panasonic EDMGRB8KJF ([[media:edmgrb8jf.pdf|Datasheet]]) available from EarthLCD to be used with the Hammer development module from TinCanTools

NOTE: This screen is an 8-bit STN screen, however in order to use it on the S3C2410A Hammer 12-bit STN must be used. The last 4 bits are simply masked off. If you have intentions of using this screen for frameworks such as Qt4 or others please first verify that they have 12-bit color support.

Hardware
NOTE: VCON should be variable control to adjust contrast and the VDD should have separate power control, i.e. via a gpio NOTE: 3.3V from the Hammer dev kit is not enough power and a seperate regulator will be required to power the device. Please make sure you also tie together the ground pins from the external regulator and the dev board.

NOTE: This display also requires a backlight inverter (see datasheet for requirements)

Pictures
We have a login prompt! Picture of LCD Display running a mixer console Ncurses GUI

Linux Kernel 2.6.29.6 Build Notes
In order to get this screen to work framebuffer support has to be built into your kernel. cd hammer/source/linux-2.6.29.6 export ARCH=arm export CROSS_COMPILE=arm-linux-uclibc- make menuconfig

Device Drivers -> Graphics Support -> Support for frame buffer devices Inside this sub menu add: [*] Enable Video Mode Handling Helpers <*> S3C2410 LCD framebuffer support

Under Device Drivers -> Graphics Support -> Console display driver support ADD Framebuffer Console Support NOTE: It is also a good idea to go ahead and add the boot logo.

Adding LCD to Machine File
The next step is to add the display settings to your mach-tct_hammer.c file in ./arch/arm/s3c2410 If you have questions about this file please see the linux documentation ( I will try to make a patch for this at a later date)

Open up your mach-tct_hammer.c file as mentioned above and verify the following include headers exist #include  #include   #include   #include  If they do not exist please add them.

Next add this in the upper section of the file

/* LCD/VGA controller */ #ifdef CONFIG_FB_S3C2410 static struct s3c2410fb_display __initdata tct_hammer_lcd_info = { .width		= 640, .height		= 480, .type		= S3C2410_LCDCON1_STN8, .pixclock	= 120000, .xres		= 640, .yres		= 480, .bpp		= 12, .hsync_len	= 48, .left_margin  = 4 << (4 + 3), .right_margin = 8 << 3, .upper_margin	= 10, .lower_margin	= 10, .lcdcon5	= 2 }; /* LCD/VGA controller */ static struct s3c2410fb_mach_info __initdata tct_hammer_fb_info = { .displays = &tct_hammer_lcd_info, .num_displays = 1, .default_display = 0, .gpccon =	0xaaaaa9aa, .gpccon_mask =	0xffffffff, .gpcup =	0x0000ffff, .gpcup_mask =	0xffffffff, .gpdcon =	0x00000000, .gpdcon_mask =	0xffffffff, .gpdup =	0x00000000, .gpdup_mask =	0xffffffff, .lpcsel    = ((0xCE6) & ~7) | 1<<4, }; #endif

These definitions are what notify the s3c2410fb driver how to configure itself in order to talk to the LCD display properly. We still have to tell the kernel to initialize these as well as configure the GPIO pins to run as the VD pins.

In the *tct_hammer_devices[] definition add #ifdef CONFIG_FB_S3C2410 &s3c_device_lcd, #endif Finally in the tct_hammer_init function add the following lines to the top of the function: #ifdef CONFIG_FB_S3C2410 // disable LCD_DISPON. s3c2410_gpio_setpin(S3C2410_GPC4, 0); s3c2410_gpio_cfgpin(S3C2410_GPC4, S3C2410_GPIO_OUTPUT); // connect any frame buffer. s3c24xx_fb_set_platdata(&tct_hammer_fb_info); #endif

NOTE: TODO - Add information for modifying the s3c2410fb.c file as a setting needs changed to swap colors

Now build your kernel and install it on the device. The last thing you may have to do is configure your getty file in your rootfs to put a console on tty0 (this will include adding tty0 to your securetty list on some occasions)