针对-s5pv210,但对其他平台也使用
lcd显示logo失败,若显示成功默认的logo是一只企鹅,但是串口打印“Start display and show logo”,但是LCD屏没有显示
[ 0.833071] s3cfb s3cfb: [fb2] dma: 0x465ab000, cpu: 0xe1000000, size: 0x005dc000 [ 0.845112] FIMD src sclk = 166750000 [ 0.965701] s3cfb s3cfb: registered successfully [ 0.965744] Start display and show logo
原因:LCD驱动有问题。
第一步:在arch/arm/mach-s5pv210/mach-smdkc110.c当中,约712行,将之前的LCD初始化删掉,并修改如下:
#ifdef CONFIG_FB_S3C_LTE480WV static struct s3cfb_lcd wvga_s70 = { .width = 800, .height = 480, .p_width = 154, .p_height = 96, .bpp = 32, .freq = 65, .timing = { .h_fp = 80, .h_bp = 36, .h_sw = 10, .v_fp = 22, .v_fpe = 1, .v_bp = 15, .v_bpe = 1, .v_sw = 8, }, .polarity = { .rise_vclk = 0, .inv_hsync = 1, .inv_vsync = 1, .inv_vden = 0, }, }; static void lcd_cfg_gpio(struct platform_device *pdev) { int i; for (i = 0; i < 8; i++) { s3c_gpio_cfgpin(S5PV210_GPF0(i), S3C_GPIO_SFN(2)); s3c_gpio_setpull(S5PV210_GPF0(i), S3C_GPIO_PULL_NONE); } for (i = 0; i < 8; i++) { s3c_gpio_cfgpin(S5PV210_GPF1(i), S3C_GPIO_SFN(2)); s3c_gpio_setpull(S5PV210_GPF1(i), S3C_GPIO_PULL_NONE); } for (i = 0; i < 8; i++) { s3c_gpio_cfgpin(S5PV210_GPF2(i), S3C_GPIO_SFN(2)); s3c_gpio_setpull(S5PV210_GPF2(i), S3C_GPIO_PULL_NONE); } for (i = 0; i < 4; i++) { s3c_gpio_cfgpin(S5PV210_GPF3(i), S3C_GPIO_SFN(2)); s3c_gpio_setpull(S5PV210_GPF3(i), S3C_GPIO_PULL_NONE); } /* mDNIe SEL: why we shall write 0x2 ? */ writel(0x2, S5P_MDNIE_SEL); /* drive strength to max */ writel(0xaaaaaaaa, S5PV210_GPF0_BASE + 0xc); writel(0xaaaaaaaa, S5PV210_GPF1_BASE + 0xc); writel(0xaaaaaaaa, S5PV210_GPF2_BASE + 0xc); writel(0x000000aa, S5PV210_GPF3_BASE + 0xc); } #define S5PV210_GPD_0_0_TOUT_0 (0x2) #define S5PV210_GPD_0_1_TOUT_1 (0x2 << 4) #define S5PV210_GPD_0_2_TOUT_2 (0x2 << 8) #define S5PV210_GPD_0_3_TOUT_3 (0x2 << 12) static int lcd_backlight_on(struct platform_device *pdev) { int err; err = gpio_request(S5PV210_GPD0(3), "GPD0"); if (err) { printk(KERN_ERR "failed to request GPD0 for " "lcd backlight control\n"); return err; } gpio_direction_output(S5PV210_GPD0(3), 1); s3c_gpio_cfgpin(S5PV210_GPD0(3), S5PV210_GPD_0_3_TOUT_3); gpio_free(S5PV210_GPD0(3)); return 0; } static int lcd_backlight_off(struct platform_device *pdev, int onoff) { int err; err = gpio_request(S5PV210_GPD0(3), "GPD0"); if (err) { printk(KERN_ERR "failed to request GPD0 for " "lcd backlight control\n"); return err; } gpio_direction_output(S5PV210_GPD0(3), 0); gpio_free(S5PV210_GPD0(3)); return 0; } static int lcd_reset_lcd(struct platform_device *pdev) { int err; err = gpio_request(S5PV210_GPH0(6), "GPH0"); if (err) { printk(KERN_ERR "failed to request GPH0 for " "lcd reset control\n"); return err; } gpio_direction_output(S5PV210_GPH0(6), 1); mdelay(100); gpio_set_value(S5PV210_GPH0(6), 0); mdelay(10); gpio_set_value(S5PV210_GPH0(6), 1); mdelay(10); gpio_free(S5PV210_GPH0(6)); return 0; } static struct s3c_platform_fb lte480wv_fb_data __initdata = { .hw_ver = 0x62, .nr_wins = 5, .default_win = CONFIG_FB_S3C_DEFAULT_WINDOW, .swap = FB_SWAP_WORD | FB_SWAP_HWORD, .lcd = &wvga_s70, .cfg_gpio = lcd_cfg_gpio, .backlight_on = lcd_backlight_on, .backlight_onoff = lcd_backlight_off, .reset_lcd = lcd_reset_lcd, }; #endif
第二步:使用make menuconfig,去配置当前显示的windows,请配置为windows0
Device Drivers -->Graphics support --> Support for frame buffer devices --> (2) Default Window (0-4)
修改为
Device Drivers -->Graphics support --> Support for frame buffer devices --> (0) Default Window (0-4)
时间: 2024-10-21 19:40:56