summaryrefslogtreecommitdiff
path: root/target/device/Atmel/atngw100-expanded/kernel-patches/linux-2.6.24.4-200-atngw100-video.patch
blob: b2ef6600a9b39d12c516897651b4889e96294f0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
diff -Nrup linux-2.6.24/arch/avr32/boards/atngw100/setup.c linux-2.6.24-patched/arch/avr32/boards/atngw100/setup.c
--- a/arch/avr32/boards/atngw100/setup.c	2008-01-31 10:47:55.000000000 -0500
+++ b/arch/avr32/boards/atngw100/setup.c	2008-01-31 10:28:00.000000000 -0500
@@ -16,6 +16,8 @@
 #include <linux/types.h>
 #include <linux/leds.h>
 #include <linux/spi/spi.h>
+#include <linux/fb.h>
+#include <video/atmel_lcdc.h>
 
 #include <asm/io.h>
 #include <asm/setup.h>
@@ -28,9 +30,63 @@
 /* Initialized by bootloader-specific startup code. */
 struct tag *bootloader_tags __initdata;
 
+static struct fb_videomode __initdata video_modes[] = {
+	{
+		.name		= "640x480@60",
+		.refresh	= 60,
+		.xres		= 640,		.yres		= 480,
+		.pixclock	= KHZ2PICOS(23856),
+
+		.left_margin	= 80,		.right_margin	= 16,
+		.upper_margin	= 13,		.lower_margin	= 1,
+		.hsync_len	= 64,		.vsync_len	= 3,
+
+		.sync		= 0,
+		.vmode		= FB_VMODE_NONINTERLACED,
+	},
+	{
+		.name		= "320x240@117",
+		.refresh	= 117,
+		.xres		= 320,		.yres		= 240,
+		.pixclock	= KHZ2PICOS(12074),
+
+		.left_margin	= 40,		.right_margin	= 8,
+		.upper_margin	= 14,		.lower_margin	= 1,
+		.hsync_len	= 32,		.vsync_len	= 3,
+
+		.sync		= 0,
+		.vmode		= FB_VMODE_NONINTERLACED,
+	},
+};
+
+static struct fb_monspecs __initdata atngw100_default_monspecs = {
+	.manufacturer		= "ATM",
+	.monitor		= "GENERIC",
+	.modedb			= video_modes,
+	.modedb_len		= ARRAY_SIZE(video_modes),
+	.hfmin			= 14820,
+	.hfmax			= 32000,
+	.vfmin			= 30,
+	.vfmax			= 200,
+	.dclkmax		= 30000000,
+};
+
+struct atmel_lcdfb_info __initdata atngw100_lcdc_data = {
+	.default_bpp		= 16,
+	.default_dmacon		= ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN,
+	.default_lcdcon2	= (ATMEL_LCDC_DISTYPE_TFT
+				   | ATMEL_LCDC_INVCLK 
+				   | ATMEL_LCDC_INVDVAL_NORMAL
+				   | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE
+				   | ATMEL_LCDC_MEMOR_BIG),
+	.default_monspecs	= &atngw100_default_monspecs,
+	.guard_time		= 2,
+};
+
 struct eth_addr {
 	u8 addr[6];
 };
+
 static struct eth_addr __initdata hw_addr[2];
 static struct eth_platform_data __initdata eth_data[2];
 
@@ -155,13 +211,14 @@ static int __init atngw100_init(void)
 	 * ATNGW100 uses 16-bit SDRAM interface, so we don't need to
 	 * reserve any pins for it.
 	 */
+	at32_add_device_lcdc(1, &atngw100_lcdc_data, fbmem_start, fbmem_size);
 
 	at32_add_system_devices();
 
 	at32_add_device_usart(0);
 
 	set_hw_addr(at32_add_device_eth(0, &eth_data[0]));
-	set_hw_addr(at32_add_device_eth(1, &eth_data[1]));
+	//set_hw_addr(at32_add_device_eth(1, &eth_data[1]));
 
 	at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info));
 	at32_add_device_mci(0, &mci0_data);
diff -Nrup linux-2.6.24/arch/avr32/mach-at32ap/at32ap700x.c linux-2.6.24-patched/arch/avr32/mach-at32ap/at32ap700x.c
--- a/arch/avr32/mach-at32ap/at32ap700x.c	2008-01-31 10:47:55.000000000 -0500
+++ b/arch/avr32/mach-at32ap/at32ap700x.c	2008-01-31 10:29:22.000000000 -0500
@@ -1133,7 +1142,7 @@ at32_add_device_lcdc(unsigned int id, st
 	monspecs->modedb = modedb;
 
 	switch (id) {
-	case 0:
+	case 0:		// STK1000 peripheral connections
 		pdev = &atmel_lcdfb0_device;
 		select_peripheral(PC(19), PERIPH_A, 0);	/* CC	  */
 		select_peripheral(PC(20), PERIPH_A, 0);	/* HSYNC  */
@@ -1170,6 +1179,43 @@ at32_add_device_lcdc(unsigned int id, st
 		clk_set_parent(&atmel_lcdfb0_pixclk, &pll0);
 		clk_set_rate(&atmel_lcdfb0_pixclk, clk_get_rate(&pll0));
 		break;
+	case 1:		// NGW100 peripheral connections
+		pdev = &atmel_lcdfb0_device;
+		//select_peripheral(PC(19), PERIPH_B, 0);	/* CC	  */
+		select_peripheral(PC(20), PERIPH_A, 0);	/* HSYNC  */
+		select_peripheral(PC(21), PERIPH_A, 0);	/* PCLK	  */
+		select_peripheral(PC(22), PERIPH_A, 0);	/* VSYNC  */
+		select_peripheral(PE(1), PERIPH_B, 0);	/* DVAL	  */
+		select_peripheral(PE(2), PERIPH_B, 0);	/* MODE	  */
+		//select_peripheral(PC(25), PERIPH_A, 0);	/* PWR	  */
+		select_peripheral(PE(3), PERIPH_B, 0);	/* DATA0  */
+		select_peripheral(PE(4), PERIPH_B, 0);	/* DATA1  */
+		select_peripheral(PE(5), PERIPH_B, 0);	/* DATA2  */
+		select_peripheral(PE(6), PERIPH_B, 0);	/* DATA3  */
+		select_peripheral(PE(7), PERIPH_B, 0);	/* DATA4  */
+		select_peripheral(PC(31), PERIPH_A, 0);	/* DATA5  */
+		select_peripheral(PD(0),  PERIPH_A, 0);	/* DATA6  */
+		select_peripheral(PD(1),  PERIPH_A, 0);	/* DATA7  */
+		select_peripheral(PE(8),  PERIPH_B, 0);	/* DATA8  */
+		select_peripheral(PE(9),  PERIPH_B, 0);	/* DATA9  */
+		select_peripheral(PE(10),  PERIPH_B, 0);	/* DATA10 */
+		select_peripheral(PE(11),  PERIPH_B, 0);	/* DATA11 */
+		select_peripheral(PE(12),  PERIPH_B, 0);	/* DATA12 */
+		select_peripheral(PD(7),  PERIPH_A, 0);	/* DATA13 */
+		select_peripheral(PD(8),  PERIPH_A, 0);	/* DATA14 */
+		select_peripheral(PD(9),  PERIPH_A, 0);	/* DATA15 */
+		select_peripheral(PE(13), PERIPH_B, 0);	/* DATA16 */
+		select_peripheral(PE(14), PERIPH_B, 0);	/* DATA17 */
+		select_peripheral(PE(15), PERIPH_B, 0);	/* DATA18 */
+		select_peripheral(PE(16), PERIPH_B, 0);	/* DATA19 */
+		select_peripheral(PE(17), PERIPH_B, 0);	/* DATA20 */
+		select_peripheral(PE(18), PERIPH_B, 0);	/* DATA21 */
+		select_peripheral(PD(16), PERIPH_A, 0);	/* DATA22 */
+		select_peripheral(PD(17), PERIPH_A, 0);	/* DATA23 */
+
+		clk_set_parent(&atmel_lcdfb0_pixclk, &pll0);
+		clk_set_rate(&atmel_lcdfb0_pixclk, clk_get_rate(&pll0));
+		break;
 
 	default:
 		goto err_invalid_id;