diff options
Diffstat (limited to 'meta/packages/uboot/u-boot-mkimage-openmoko-native/uboot-s3c2410_fb.patch')
-rw-r--r-- | meta/packages/uboot/u-boot-mkimage-openmoko-native/uboot-s3c2410_fb.patch | 215 |
1 files changed, 0 insertions, 215 deletions
diff --git a/meta/packages/uboot/u-boot-mkimage-openmoko-native/uboot-s3c2410_fb.patch b/meta/packages/uboot/u-boot-mkimage-openmoko-native/uboot-s3c2410_fb.patch deleted file mode 100644 index b50853554b..0000000000 --- a/meta/packages/uboot/u-boot-mkimage-openmoko-native/uboot-s3c2410_fb.patch +++ /dev/null | |||
@@ -1,215 +0,0 @@ | |||
1 | Index: u-boot/drivers/Makefile | ||
2 | =================================================================== | ||
3 | --- u-boot.orig/drivers/Makefile | ||
4 | +++ u-boot/drivers/Makefile | ||
5 | @@ -52,7 +52,7 @@ | ||
6 | ks8695eth.o \ | ||
7 | pxa_pcmcia.o mpc8xx_pcmcia.o tqm8xx_pcmcia.o \ | ||
8 | rpx_pcmcia.o \ | ||
9 | - fsl_i2c.o | ||
10 | + fsl_i2c.o s3c2410_fb.o | ||
11 | |||
12 | SRCS := $(COBJS:.o=.c) | ||
13 | OBJS := $(addprefix $(obj),$(COBJS)) | ||
14 | Index: u-boot/drivers/s3c2410_fb.c | ||
15 | =================================================================== | ||
16 | --- /dev/null | ||
17 | +++ u-boot/drivers/s3c2410_fb.c | ||
18 | @@ -0,0 +1,166 @@ | ||
19 | +/* | ||
20 | + * (C) Copyright 2006 by OpenMoko, Inc. | ||
21 | + * Author: Harald Welte <laforge@openmoko.org> | ||
22 | + * | ||
23 | + * This program is free software; you can redistribute it and/or | ||
24 | + * modify it under the terms of the GNU General Public License as | ||
25 | + * published by the Free Software Foundation; either version 2 of | ||
26 | + * the License, or (at your option) any later version. | ||
27 | + * | ||
28 | + * This program is distributed in the hope that it will be useful, | ||
29 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
30 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
31 | + * GNU General Public License for more details. | ||
32 | + * | ||
33 | + * You should have received a copy of the GNU General Public License | ||
34 | + * along with this program; if not, write to the Free Software | ||
35 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
36 | + * MA 02111-1307 USA | ||
37 | + */ | ||
38 | + | ||
39 | +#include <common.h> | ||
40 | + | ||
41 | +#if defined(CONFIG_VIDEO_S3C2410) | ||
42 | + | ||
43 | +#include <video_fb.h> | ||
44 | +#include "videomodes.h" | ||
45 | +#include <s3c2410.h> | ||
46 | +/* | ||
47 | + * Export Graphic Device | ||
48 | + */ | ||
49 | +GraphicDevice smi; | ||
50 | + | ||
51 | +#define VIDEO_MEM_SIZE 0x200000 /* 480x640x16bit = 614400 bytes */ | ||
52 | + | ||
53 | +extern void board_video_init(GraphicDevice *pGD); | ||
54 | + | ||
55 | +/******************************************************************************* | ||
56 | + * | ||
57 | + * Init video chip with common Linux graphic modes (lilo) | ||
58 | + */ | ||
59 | +void *video_hw_init (void) | ||
60 | +{ | ||
61 | + S3C24X0_LCD * const lcd = S3C24X0_GetBase_LCD(); | ||
62 | + GraphicDevice *pGD = (GraphicDevice *)&smi; | ||
63 | + int videomode; | ||
64 | + unsigned long t1, hsynch, vsynch; | ||
65 | + char *penv; | ||
66 | + int tmp, i, bits_per_pixel; | ||
67 | + struct ctfb_res_modes *res_mode; | ||
68 | + struct ctfb_res_modes var_mode; | ||
69 | + unsigned char videoout; | ||
70 | + | ||
71 | + /* Search for video chip */ | ||
72 | + printf("Video: "); | ||
73 | + | ||
74 | + tmp = 0; | ||
75 | + | ||
76 | + videomode = CFG_DEFAULT_VIDEO_MODE; | ||
77 | + /* get video mode via environment */ | ||
78 | + if ((penv = getenv ("videomode")) != NULL) { | ||
79 | + /* deceide if it is a string */ | ||
80 | + if (penv[0] <= '9') { | ||
81 | + videomode = (int) simple_strtoul (penv, NULL, 16); | ||
82 | + tmp = 1; | ||
83 | + } | ||
84 | + } else { | ||
85 | + tmp = 1; | ||
86 | + } | ||
87 | + if (tmp) { | ||
88 | + /* parameter are vesa modes */ | ||
89 | + /* search params */ | ||
90 | + for (i = 0; i < VESA_MODES_COUNT; i++) { | ||
91 | + if (vesa_modes[i].vesanr == videomode) | ||
92 | + break; | ||
93 | + } | ||
94 | + if (i == VESA_MODES_COUNT) { | ||
95 | + printf ("no VESA Mode found, switching to mode 0x%x ", CFG_DEFAULT_VIDEO_MODE); | ||
96 | + i = 0; | ||
97 | + } | ||
98 | + res_mode = | ||
99 | + (struct ctfb_res_modes *) &res_mode_init[vesa_modes[i]. | ||
100 | + resindex]; | ||
101 | + bits_per_pixel = vesa_modes[i].bits_per_pixel; | ||
102 | + } else { | ||
103 | + | ||
104 | + res_mode = (struct ctfb_res_modes *) &var_mode; | ||
105 | + bits_per_pixel = video_get_params (res_mode, penv); | ||
106 | + } | ||
107 | + | ||
108 | + /* calculate hsynch and vsynch freq (info only) */ | ||
109 | + t1 = (res_mode->left_margin + res_mode->xres + | ||
110 | + res_mode->right_margin + res_mode->hsync_len) / 8; | ||
111 | + t1 *= 8; | ||
112 | + t1 *= res_mode->pixclock; | ||
113 | + t1 /= 1000; | ||
114 | + hsynch = 1000000000L / t1; | ||
115 | + t1 *= | ||
116 | + (res_mode->upper_margin + res_mode->yres + | ||
117 | + res_mode->lower_margin + res_mode->vsync_len); | ||
118 | + t1 /= 1000; | ||
119 | + vsynch = 1000000000L / t1; | ||
120 | + | ||
121 | + /* fill in Graphic device struct */ | ||
122 | + sprintf (pGD->modeIdent, "%dx%dx%d %ldkHz %ldHz", res_mode->xres, | ||
123 | + res_mode->yres, bits_per_pixel, (hsynch / 1000), | ||
124 | + (vsynch / 1000)); | ||
125 | + printf ("%s\n", pGD->modeIdent); | ||
126 | + pGD->winSizeX = res_mode->xres; | ||
127 | + pGD->winSizeY = res_mode->yres; | ||
128 | + pGD->plnSizeX = res_mode->xres; | ||
129 | + pGD->plnSizeY = res_mode->yres; | ||
130 | + switch (bits_per_pixel) { | ||
131 | + case 8: | ||
132 | + pGD->gdfBytesPP = 1; | ||
133 | + pGD->gdfIndex = GDF__8BIT_INDEX; | ||
134 | + break; | ||
135 | + case 15: | ||
136 | + pGD->gdfBytesPP = 2; | ||
137 | + pGD->gdfIndex = GDF_15BIT_555RGB; | ||
138 | + break; | ||
139 | + case 16: | ||
140 | + pGD->gdfBytesPP = 2; | ||
141 | + pGD->gdfIndex = GDF_16BIT_565RGB; | ||
142 | + break; | ||
143 | + case 24: | ||
144 | + pGD->gdfBytesPP = 3; | ||
145 | + pGD->gdfIndex = GDF_24BIT_888RGB; | ||
146 | + break; | ||
147 | + } | ||
148 | + | ||
149 | + /* statically configure settings */ | ||
150 | + pGD->winSizeX = pGD->plnSizeX = 480; | ||
151 | + pGD->winSizeY = pGD->plnSizeY = 640; | ||
152 | + pGD->gdfBytesPP = 2; | ||
153 | + pGD->gdfIndex = GDF_16BIT_565RGB; | ||
154 | + | ||
155 | + pGD->frameAdrs = LCD_VIDEO_ADDR; | ||
156 | + pGD->memSize = VIDEO_MEM_SIZE; | ||
157 | + | ||
158 | + board_video_init(pGD); | ||
159 | + | ||
160 | + lcd->LCDSADDR1 = pGD->frameAdrs >> 1; | ||
161 | + | ||
162 | + /* This marks the end of the frame buffer. */ | ||
163 | + lcd->LCDSADDR2 = (lcd->LCDSADDR1&0x1fffff) + (pGD->winSizeX+0) * pGD->winSizeY; | ||
164 | + lcd->LCDSADDR3 = pGD->winSizeX; | ||
165 | + | ||
166 | + /* Clear video memory */ | ||
167 | + memset(pGD->frameAdrs, 0, pGD->memSize); | ||
168 | + | ||
169 | + /* Enable Display */ | ||
170 | + lcd->LCDCON1 |= 0x01; /* ENVID = 1 */ | ||
171 | + | ||
172 | + return ((void*)&smi); | ||
173 | +} | ||
174 | + | ||
175 | +void | ||
176 | +video_set_lut (unsigned int index, /* color number */ | ||
177 | + unsigned char r, /* red */ | ||
178 | + unsigned char g, /* green */ | ||
179 | + unsigned char b /* blue */ | ||
180 | + ) | ||
181 | +{ | ||
182 | +} | ||
183 | + | ||
184 | +#endif /* CONFIG_VIDEO_S3C2410 */ | ||
185 | Index: u-boot/drivers/cfb_console.c | ||
186 | =================================================================== | ||
187 | --- u-boot.orig/drivers/cfb_console.c | ||
188 | +++ u-boot/drivers/cfb_console.c | ||
189 | @@ -141,6 +141,14 @@ | ||
190 | #endif | ||
191 | |||
192 | /*****************************************************************************/ | ||
193 | +/* Defines for the S3C2410 driver */ | ||
194 | +/*****************************************************************************/ | ||
195 | +#ifdef CONFIG_VIDEO_S3C2410 | ||
196 | +/* it actually is little-endian, but the host CPU, too ! */ | ||
197 | +//#define VIDEO_FB_LITTLE_ENDIAN | ||
198 | +#endif | ||
199 | + | ||
200 | +/*****************************************************************************/ | ||
201 | /* Include video_fb.h after definitions of VIDEO_HW_RECTFILL etc */ | ||
202 | /*****************************************************************************/ | ||
203 | #include <video_fb.h> | ||
204 | @@ -307,6 +315,11 @@ | ||
205 | #define SHORTSWAP32(x) (x) | ||
206 | #endif | ||
207 | |||
208 | +#ifdef CONFIG_VIDEO_S3C2410 | ||
209 | +#undef SHORTSWAP32 | ||
210 | +#define SHORTSWAP32(x) ((((x) & 0xffff) << 16) | (((x) >> 16) & 0xffff)) | ||
211 | +#endif | ||
212 | + | ||
213 | #if defined(DEBUG) || defined(DEBUG_CFB_CONSOLE) | ||
214 | #define PRINTD(x) printf(x) | ||
215 | #else | ||