1、模仿友堅恆天的6410 Android2.3的內核2.6.36來移植!
2、對比mach-smdk6410.c
static void smdk6410_lcd_power_set(struct plat_lcd_data *pd,
unsigned int power)
{
if (power) {
gpio_direction_output(S3C64XX_GPF(13), 1);
//add by hcm
gpio_direction_output(S3C64XX_GPF(15), 1); //pwm isn`t gpf14?
/* fire nRESET on power up */
gpio_direction_output(S3C64XX_GPN(5), 0);
msleep(10);
gpio_direction_output(S3C64XX_GPN(5), 1);
msleep(1);
} else {
gpio_direction_output(S3C64XX_GPF(13), 0);
//add by hcm
gpio_direction_output(S3C64XX_GPF(15), 0);
}
}
static struct map_desc smdk6410_iodesc[] =
{
{
/* LCD support */
.virtual = (unsigned long)S3C_VA_LCD,
.pfn = __phys_to_pfn(S3C_PA_FB),
.length = SZ_16K,
.type = MT_DEVICE,
},
};
在map-base.h中添加
#define S3C_VA_UART S3C_ADDR(0x01000000)/* UART */
//add by hcm
#define S3C_VA_LCD S3C_ADDR(0x01100000)
從友堅2.6.36中將drivers/video/samsung整個文件夾拷貝過來
vi drivers/video/Kconfig
第2068行增加
source "drivers/video/samsung/Kconfig"
vi drivers/video/Makefile
120行增加
obj-$(CONFIG_FB_S3C_EXT) += samsung/
將Y:\ut6410_kernel_2.6.36\arch\arm\mach-s3c64xx\include\mach下的regs-lcd.h和regs-fb.h拷貝到Y:\linux-3.6.6\arch\arm\mach-s3c64xx\include\mach
Device Drivers --->
Graphics support --->
<*> Support for frame buffer devices ---> (裡面的都空選)一定的將< > Samsung S3C framebuffer support空選(如果你默認的話後,後面添加的lcd驅動將無效)
<*> Support for frame buffer devices --->
[ ] Backlight & LCD device support --->
<*> S3C Framebuffer Support (eXtended)(修改Kconfig之後才有這個選)
Select LCD Type (4.3 inch 480x272 TFT LCD) --->
(X) 4.3 inch 480x272 TFT LCD
<*> Advanced options for S3C Framebuffer
Select BPP(Bits Per Pixel) (16 BPP) --->
(4) Number of Framebuffers
[ ] Enable Virtual Screen
[*] Enable Double Buffering
Console display driver support --->
<*> Framebuffer Console support
[*] Bootup logo --->(顯示小企鵝)
[*] Standard 224-color Linux logo
最後燒寫顯示:
S3C_LCD clock got enabled :: 133.000 Mhz
LCD TYPE :: UT_LCD7inch will be initialized
Window[0] - FB1: map_video_memory: clear c885a000:00177000
Window[0] - FB2: map_video_memory: clear c8915800:000bb800
Console: switching to colour frame buffer device 100x30
fb0: s3cfb frame buffer device
Window[1] - FB1: map_video_memory: clear c89d2000:00177000
Window[1] - FB2: map_video_memory: clear c8a8d800:000bb800
fb1: s3cfb frame buffer device
Window[2] - FB1: map_video_memory: clear c8b4a000:000bb800
fb2: s3cfb frame buffer device
Window[3] - FB1: map_video_memory: clear c8c07000:000bb800
fb3: s3cfb frame buffer device
這就說明你的lcd成功了!
觸摸屏調試