Date:2011-03-08 05:18:39 (9 years 2 months ago)
Author:Peter Zotov
Commit:8e02a117a91af13f0a7c4a9279f70a6f50fdd513
Message:Add LCD support to JZ4750.

Files: arch/mips/include/asm/mach-jz47xx/jz4750/gpio.h (1 diff)
arch/mips/include/asm/mach-jz47xx/jz4750/platform.h (1 diff)
arch/mips/jz47xx/jz4750/board-xz0032.c (2 diffs)
arch/mips/jz47xx/jz4750/platform.c (1 diff)
drivers/video/Kconfig (1 diff)

Change Details

arch/mips/include/asm/mach-jz47xx/jz4750/gpio.h
1818
1919#include <asm/mach-jz47xx/gpio.h>
2020
21/* Port C function pins */
22#define JZ_GPIO_LCD_DATA0 JZ_GPIO_PORTD(0)
23#define JZ_GPIO_LCD_DATA1 JZ_GPIO_PORTD(1)
24#define JZ_GPIO_LCD_DATA2 JZ_GPIO_PORTD(2)
25#define JZ_GPIO_LCD_DATA3 JZ_GPIO_PORTD(3)
26#define JZ_GPIO_LCD_DATA4 JZ_GPIO_PORTD(4)
27#define JZ_GPIO_LCD_DATA5 JZ_GPIO_PORTD(5)
28#define JZ_GPIO_LCD_DATA6 JZ_GPIO_PORTD(6)
29#define JZ_GPIO_LCD_DATA7 JZ_GPIO_PORTD(7)
30#define JZ_GPIO_LCD_DATA8 JZ_GPIO_PORTD(8)
31#define JZ_GPIO_LCD_DATA9 JZ_GPIO_PORTD(9)
32#define JZ_GPIO_LCD_DATA10 JZ_GPIO_PORTD(10)
33#define JZ_GPIO_LCD_DATA11 JZ_GPIO_PORTD(11)
34#define JZ_GPIO_LCD_DATA12 JZ_GPIO_PORTD(12)
35#define JZ_GPIO_LCD_DATA13 JZ_GPIO_PORTD(13)
36#define JZ_GPIO_LCD_DATA14 JZ_GPIO_PORTD(14)
37#define JZ_GPIO_LCD_DATA15 JZ_GPIO_PORTD(15)
38#define JZ_GPIO_LCD_DATA16 JZ_GPIO_PORTD(16)
39#define JZ_GPIO_LCD_DATA17 JZ_GPIO_PORTD(17)
40#define JZ_GPIO_LCD_PCLK JZ_GPIO_PORTD(18)
41#define JZ_GPIO_LCD_HSYNC JZ_GPIO_PORTD(19)
42#define JZ_GPIO_LCD_VSYNC JZ_GPIO_PORTD(20)
43#define JZ_GPIO_LCD_DE JZ_GPIO_PORTD(21)
44
45#define JZ_GPIO_LCD_CLS JZ_GPIO_PORTD(22)
46#define JZ_GPIO_LCD_SPL JZ_GPIO_PORTD(23)
47#define JZ_GPIO_LCD_PS JZ_GPIO_PORTD(24)
48#define JZ_GPIO_LCD_REV JZ_GPIO_PORTD(25)
49
50#define JZ_GPIO_FUNC_LCD_DATA0 JZ_GPIO_FUNC1
51#define JZ_GPIO_FUNC_LCD_DATA1 JZ_GPIO_FUNC1
52#define JZ_GPIO_FUNC_LCD_DATA2 JZ_GPIO_FUNC1
53#define JZ_GPIO_FUNC_LCD_DATA3 JZ_GPIO_FUNC1
54#define JZ_GPIO_FUNC_LCD_DATA4 JZ_GPIO_FUNC1
55#define JZ_GPIO_FUNC_LCD_DATA5 JZ_GPIO_FUNC1
56#define JZ_GPIO_FUNC_LCD_DATA6 JZ_GPIO_FUNC1
57#define JZ_GPIO_FUNC_LCD_DATA7 JZ_GPIO_FUNC1
58#define JZ_GPIO_FUNC_LCD_DATA8 JZ_GPIO_FUNC1
59#define JZ_GPIO_FUNC_LCD_DATA9 JZ_GPIO_FUNC1
60#define JZ_GPIO_FUNC_LCD_DATA10 JZ_GPIO_FUNC1
61#define JZ_GPIO_FUNC_LCD_DATA11 JZ_GPIO_FUNC1
62#define JZ_GPIO_FUNC_LCD_DATA12 JZ_GPIO_FUNC1
63#define JZ_GPIO_FUNC_LCD_DATA13 JZ_GPIO_FUNC1
64#define JZ_GPIO_FUNC_LCD_DATA14 JZ_GPIO_FUNC1
65#define JZ_GPIO_FUNC_LCD_DATA15 JZ_GPIO_FUNC1
66#define JZ_GPIO_FUNC_LCD_DATA16 JZ_GPIO_FUNC1
67#define JZ_GPIO_FUNC_LCD_DATA17 JZ_GPIO_FUNC1
68#define JZ_GPIO_FUNC_LCD_PCLK JZ_GPIO_FUNC1
69#define JZ_GPIO_FUNC_LCD_VSYNC JZ_GPIO_FUNC1
70#define JZ_GPIO_FUNC_LCD_HSYNC JZ_GPIO_FUNC1
71#define JZ_GPIO_FUNC_LCD_DE JZ_GPIO_FUNC1
72
73#define JZ_GPIO_FUNC_LCD_CLS JZ_GPIO_FUNC1
74#define JZ_GPIO_FUNC_LCD_SPL JZ_GPIO_FUNC1
75#define JZ_GPIO_FUNC_LCD_PS JZ_GPIO_FUNC1
76#define JZ_GPIO_FUNC_LCD_REV JZ_GPIO_FUNC1
77
2178#endif
arch/mips/include/asm/mach-jz47xx/jz4750/platform.h
2121extern struct platform_device jz4750_rtc_device;
2222extern struct platform_device jz4750_udc_device;
2323extern struct platform_device jz4750_nand_device;
24extern struct platform_device jz4750_framebuffer_device;
2425
2526void jz4750_serial_device_register(void);
2627
arch/mips/jz47xx/jz4750/board-xz0032.c
2222#include "../clock.h"
2323
2424#include <jz4750_nand.h>
25#include <jz4740_fb.h>
2526
2627/* NAND */
2728static struct nand_ecclayout xz0032_ecclayout = {
...... 
6768    .busy_gpio = 91,
6869};
6970
71/* LCD */
72
73static struct fb_videomode xz0032_video_modes[] = {
74    {
75        .name = "480x272",
76        .xres = 480,
77        .yres = 272,
78        .refresh = 60,
79        .left_margin = 2,
80        .right_margin = 2,
81        .upper_margin = 2,
82        .lower_margin = 2,
83        .hsync_len = 41,
84        .vsync_len = 10,
85        .sync = 0,
86        .vmode = FB_VMODE_NONINTERLACED,
87    },
88};
89
90static struct jz4740_fb_platform_data xz0032_fb_pdata = {
91    .width = 90,
92    .height = 52,
93    .num_modes = ARRAY_SIZE(xz0032_video_modes),
94    .modes = xz0032_video_modes,
95    .bpp = 16,
96    .lcd_type = JZ_LCD_TYPE_GENERIC_16_BIT,
97    .pixclk_falling_edge = 1,
98};
99
70100static struct platform_device *jz_platform_devices[] __initdata = {
71101    &jz4750_rtc_device,
72102    &jz4750_udc_device,
73103    &jz4750_nand_device,
104    &jz4750_framebuffer_device,
74105};
75106
76107static int __init xz0032_init_platform_devices(void)
77108{
78109    jz4750_nand_device.dev.platform_data = &xz0032_nand_pdata;
110    jz4750_framebuffer_device.dev.platform_data = &xz0032_fb_pdata;
79111
80112    jz4750_serial_device_register();
81113
arch/mips/jz47xx/jz4750/platform.c
8585    .resource = jz4750_nand_resources,
8686};
8787
88/* LCD controller */
89static struct resource jz4750_framebuffer_resources[] = {
90    {
91        .start = JZ47XX_LCD_BASE_ADDR,
92        .end = JZ47XX_LCD_BASE_ADDR + 0x1000 - 1,
93        .flags = IORESOURCE_MEM,
94    },
95};
96
97struct platform_device jz4750_framebuffer_device = {
98    .name = "jz4740-fb",
99    .id = -1,
100    .num_resources = ARRAY_SIZE(jz4750_framebuffer_resources),
101    .resource = jz4750_framebuffer_resources,
102    .dev = {
103        .dma_mask = &jz4750_framebuffer_device.dev.coherent_dma_mask,
104        .coherent_dma_mask = DMA_BIT_MASK(32),
105    },
106};
107
88108/* RTC controller */
89109static struct resource jz4750_rtc_resources[] = {
90110    {
drivers/video/Kconfig
22522252
22532253config FB_JZ4740
22542254    tristate "JZ4740 LCD framebuffer support"
2255    depends on FB && MACH_JZ4740
2255    depends on FB && (MACH_JZ4740 || MACH_JZ4750)
22562256    select FB_SYS_FILLRECT
22572257    select FB_SYS_COPYAREA
22582258    select FB_SYS_IMAGEBLIT

Archive Download the corresponding diff file



interactive