* Patch by Pierre Aubert, 18 Mar 2004:
- Unify video mode handling for Chips & Technologies 69000 Video chip and Silicon Motion SMI 712/710/810 Video chip - Add selection of the video output (CRT or LCD) via 'videoout' environment variable for the Silicon Motion - README update * Patch by Pierre Aubert, 18 Mar 2004: include/common.h typo fix * Patches by Tolunay Orkun, 17 Mar 2004: - Add support for bd->bi_iic_fast[] initialization via environment variable "i2cfast" (CONFIG_I2CFAST) - Add "i2cfast" u-boot environment variable support for csb272
This commit is contained in:
parent
27aa818670
commit
eeb1b77b7d
15
CHANGELOG
15
CHANGELOG
@ -2,6 +2,21 @@
|
||||
Changes for U-Boot 1.0.2:
|
||||
======================================================================
|
||||
|
||||
* Patch by Pierre Aubert, 18 Mar 2004:
|
||||
- Unify video mode handling for Chips & Technologies 69000 Video
|
||||
chip and Silicon Motion SMI 712/710/810 Video chip
|
||||
- Add selection of the video output (CRT or LCD) via 'videoout'
|
||||
environment variable for the Silicon Motion
|
||||
- README update
|
||||
|
||||
* Patch by Pierre Aubert, 18 Mar 2004:
|
||||
include/common.h typo fix
|
||||
|
||||
* Patches by Tolunay Orkun, 17 Mar 2004:
|
||||
- Add support for bd->bi_iic_fast[] initialization via environment
|
||||
variable "i2cfast" (CONFIG_I2CFAST)
|
||||
- Add "i2cfast" u-boot environment variable support for csb272
|
||||
|
||||
* Patch by Carl Riechers, 17 Mar 2004:
|
||||
Ignore '\0' characters in console input for use with telnet and
|
||||
telco pads.
|
||||
|
29
README
29
README
@ -778,17 +778,30 @@ The following options need to be configured:
|
||||
Enable Chips & Technologies 69000 Video chip
|
||||
|
||||
CONFIG_VIDEO_SMI_LYNXEM
|
||||
Enable Silicon Motion SMI 712/710/810 Video chip
|
||||
Videomode are selected via environment 'videomode' with
|
||||
standard LiLo mode numbers.
|
||||
Following modes are supported (* is default):
|
||||
Enable Silicon Motion SMI 712/710/810 Video chip. The
|
||||
video output is selected via environment 'videoout'
|
||||
(1 = LCD and 2 = CRT). If videoout is undefined, CRT is
|
||||
assumed.
|
||||
|
||||
800x600 1024x768 1280x1024
|
||||
256 (8bit) 303* 305 307
|
||||
65536 (16bit) 314 317 31a
|
||||
16,7 Mill (24bit) 315 318 31b
|
||||
For the CT69000 and SMI_LYNXEM drivers, videomode is
|
||||
selected via environment 'videomode'. Two diferent ways
|
||||
are possible:
|
||||
- "videomode=num" 'num' is a standard LiLo mode numbers.
|
||||
Following standard modes are supported (* is default):
|
||||
|
||||
Colors 640x480 800x600 1024x768 1152x864 1280x1024
|
||||
-------------+---------------------------------------------
|
||||
8 bits | 0x301* 0x303 0x305 0x161 0x307
|
||||
15 bits | 0x310 0x313 0x316 0x162 0x319
|
||||
16 bits | 0x311 0x314 0x317 0x163 0x31A
|
||||
24 bits | 0x312 0x315 0x318 ? 0x31B
|
||||
-------------+---------------------------------------------
|
||||
(i.e. setenv videomode 317; saveenv; reset;)
|
||||
|
||||
- "videomode=bootargs" all the video parameters are parsed
|
||||
from the bootargs. (See drivers/videomodes.c)
|
||||
|
||||
|
||||
CONFIG_VIDEO_SED13806
|
||||
Enable Epson SED13806 driver. This driver supports 8bpp
|
||||
and 16bpp modes defined by CONFIG_VIDEO_SED13806_8BPP
|
||||
|
@ -42,7 +42,8 @@ OBJS = 3c589.o 5701rls.o ali512x.o \
|
||||
serial.o serial_max3100.o serial_pl011.o serial_pl010.o \
|
||||
smc91111.o smiLynxEM.o status_led.o sym53c8xx.o \
|
||||
ti_pci1410a.o tigon3.o w83c553f.o omap1510_i2c.o \
|
||||
usbdcore.o usbdcore_ep0.o usbdcore_omap1510.o usbtty.o
|
||||
usbdcore.o usbdcore_ep0.o usbdcore_omap1510.o usbtty.o \
|
||||
videomodes.o
|
||||
|
||||
all: $(LIB)
|
||||
|
||||
|
@ -26,52 +26,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/************************************************************************
|
||||
Get Parameters for the video mode:
|
||||
Parameters can be set via the variable "videomode" in the environment.
|
||||
2 diferent ways are possible:
|
||||
"videomode=301" - 301 is a hexadecimal number describing the VESA
|
||||
mode. Following modes are implemented:
|
||||
|
||||
Colors 640x480 800x600 1024x768 1152x864
|
||||
--------+-----------------------------------
|
||||
8 bits | 0x301 0x303 0x305 0x161
|
||||
15 bits | 0x310 0x313 0x316 0x162
|
||||
16 bits | 0x311 0x314 0x317 0x163
|
||||
24 bits | 0x312 0x315 0x318 ?
|
||||
--------+-----------------------------------
|
||||
"videomode=bootargs"
|
||||
- the parameters are parsed from the bootargs.
|
||||
The format is "NAME:VALUE,NAME:VALUE" etc.
|
||||
Ex.:
|
||||
"bootargs=video=ctfb:x:800,y:600,depth:16,pclk:25000"
|
||||
Parameters not included in the list will be taken from
|
||||
the default mode, which is one of the following:
|
||||
mode:0 640x480x24
|
||||
mode:1 800x600x16
|
||||
mode:2 1024x768x8
|
||||
mode:3 960x720x24
|
||||
mode:4 1152x864x16
|
||||
if "mode" is not provided within the parameter list,
|
||||
mode:0 is assumed.
|
||||
Following parameters are supported:
|
||||
x xres = visible resolution horizontal
|
||||
y yres = visible resolution vertical
|
||||
pclk pixelclocks in pico sec
|
||||
le left_marging time from sync to picture in pixelclocks
|
||||
ri right_marging time from picture to sync in pixelclocks
|
||||
up upper_margin time from sync to picture
|
||||
lo lower_margin
|
||||
hs hsync_len length of horizontal sync
|
||||
vs vsync_len length of vertical sync
|
||||
sync see FB_SYNC_*
|
||||
vmode see FB_VMODE_*
|
||||
depth Color depth in bits per pixel
|
||||
All other parameters in the variable bootargs are ignored.
|
||||
It is also possible to set the parameters direct in the
|
||||
variable "videomode", or in another variable i.e.
|
||||
"myvideo" and setting the variable "videomode=myvideo"..
|
||||
****************************************************************************/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
@ -79,6 +33,7 @@
|
||||
|
||||
#include <pci.h>
|
||||
#include <video_fb.h>
|
||||
#include "videomodes.h"
|
||||
|
||||
#ifdef CONFIG_VIDEO_CT69000
|
||||
|
||||
@ -304,32 +259,6 @@ static CT_CFG_TABLE xreg[] = {
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************
|
||||
* Resolution Struct
|
||||
******************************************************************/
|
||||
struct ctfb_res_modes {
|
||||
int xres; /* visible resolution */
|
||||
int yres;
|
||||
/* Timing: All values in pixclocks, except pixclock (of course) */
|
||||
int pixclock; /* pixel clock in ps (pico seconds) */
|
||||
int left_margin; /* time from sync to picture */
|
||||
int right_margin; /* time from picture to sync */
|
||||
int upper_margin; /* time from sync to picture */
|
||||
int lower_margin;
|
||||
int hsync_len; /* length of horizontal sync */
|
||||
int vsync_len; /* length of vertical sync */
|
||||
int sync; /* see FB_SYNC_* */
|
||||
int vmode; /* see FB_VMODE_* */
|
||||
};
|
||||
|
||||
/******************************************************************
|
||||
* Vesa Mode Struct
|
||||
******************************************************************/
|
||||
struct ctfb_vesa_modes {
|
||||
int vesanr; /* Vesa number as in LILO (VESA Nr + 0x200} */
|
||||
int resindex; /* index to resolution struct */
|
||||
int bits_per_pixel; /* bpp */
|
||||
};
|
||||
/*******************************************************************
|
||||
* Chips struct
|
||||
*******************************************************************/
|
||||
@ -351,58 +280,6 @@ static const struct ctfb_chips_properties chips[] = {
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0} /* Terminator */
|
||||
};
|
||||
|
||||
/*************************************************
|
||||
Video Modes:
|
||||
Colours 640x400 640x480 800x600 1024x768 1152x864 1280x1024 1600x1200
|
||||
--------+--------------------------------------------------------------
|
||||
4 bits | ? ? 0x302 ? ? ? ?
|
||||
8 bits | 0x300 0x301 0x303 0x305 0x161 0x307 0x31C
|
||||
15 bits | ? 0x310 0x313 0x316 0x162 0x319 0x31D
|
||||
16 bits | ? 0x311 0x314 0x317 0x163 0x31A 0x31E
|
||||
24 bits | ? 0x312 0x315 0x318 ? 0x31B 0x31F
|
||||
32 bits | ? ? ? ? 0x164 ?
|
||||
*/
|
||||
|
||||
#define RES_MODE_640x480 0
|
||||
#define RES_MODE_800x600 1
|
||||
#define RES_MODE_1024x768 2
|
||||
#define RES_MODE_960_720 3
|
||||
#define RES_MODE_1152x864 4
|
||||
#define RES_MODES_COUNT 5
|
||||
|
||||
#define VESA_MODES_COUNT 15
|
||||
|
||||
static const struct ctfb_vesa_modes vesa_modes[VESA_MODES_COUNT] = {
|
||||
{0x301, RES_MODE_640x480, 8},
|
||||
{0x310, RES_MODE_640x480, 15},
|
||||
{0x311, RES_MODE_640x480, 16},
|
||||
{0x312, RES_MODE_640x480, 24},
|
||||
{0x303, RES_MODE_800x600, 8},
|
||||
{0x313, RES_MODE_800x600, 15},
|
||||
{0x314, RES_MODE_800x600, 16},
|
||||
{0x315, RES_MODE_800x600, 24},
|
||||
{0x305, RES_MODE_1024x768, 8},
|
||||
{0x316, RES_MODE_1024x768, 15},
|
||||
{0x317, RES_MODE_1024x768, 16},
|
||||
{0x318, RES_MODE_1024x768, 24},
|
||||
{0x161, RES_MODE_1152x864, 8},
|
||||
{0x162, RES_MODE_1152x864, 15},
|
||||
{0x163, RES_MODE_1152x864, 16}
|
||||
};
|
||||
|
||||
static const struct ctfb_res_modes res_mode_init[RES_MODES_COUNT] = {
|
||||
/* x y pixclk le ri up lo hs vs s vmode */
|
||||
{640, 480, 39721, 40, 24, 32, 11, 96, 2, 0,
|
||||
FB_VMODE_NONINTERLACED},
|
||||
{800, 600, 27778, 64, 24, 22, 1, 72, 2, 0, FB_VMODE_NONINTERLACED},
|
||||
{1024, 768, 15384, 168, 8, 29, 3, 144, 4, 0,
|
||||
FB_VMODE_NONINTERLACED},
|
||||
{960, 720, 13100, 160, 40, 32, 8, 80, 4, 0,
|
||||
FB_VMODE_NONINTERLACED},
|
||||
{1152, 864, 12004, 200, 64, 32, 16, 80, 4, 0,
|
||||
FB_VMODE_NONINTERLACED}
|
||||
};
|
||||
|
||||
/*
|
||||
* The Graphic Device
|
||||
*/
|
||||
@ -1079,108 +956,6 @@ SetDrawingEngine (int bits_per_pixel)
|
||||
video_wait_bitblt (pGD->pciBase + BR04_o);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* Get Parameters for the video mode:
|
||||
*/
|
||||
/*********************************************************************
|
||||
* returns the length to the next seperator
|
||||
*/
|
||||
static int
|
||||
video_get_param_len (char *start, char sep)
|
||||
{
|
||||
int i = 0;
|
||||
while ((*start != 0) && (*start != sep)) {
|
||||
start++;
|
||||
i++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
static int
|
||||
video_search_param (char *start, char *param)
|
||||
{
|
||||
int len, totallen, i;
|
||||
char *p = start;
|
||||
len = strlen (param);
|
||||
totallen = len + strlen (start);
|
||||
for (i = 0; i < totallen; i++) {
|
||||
if (strncmp (p++, param, len) == 0)
|
||||
return (i);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/***************************************************************
|
||||
* Get parameter via the environment as it is done for the
|
||||
* linux kernel i.e:
|
||||
* video=ctfb:x:800,xv:1280,y:600,yv:1024,depth:16,mode:0,pclk:25000,
|
||||
* le:56,ri:48,up:26,lo:5,hs:152,vs:2,sync:0,vmode:0,accel:0
|
||||
*
|
||||
* penv is a pointer to the environment, containing the string, or the name of
|
||||
* another environment variable. It could even be the term "bootargs"
|
||||
*/
|
||||
|
||||
#define GET_OPTION(name,var) \
|
||||
if(strncmp(p,name,strlen(name))==0) { \
|
||||
val_s=p+strlen(name); \
|
||||
var=simple_strtoul(val_s, NULL, 10); \
|
||||
}
|
||||
|
||||
static int
|
||||
video_get_params (struct ctfb_res_modes *pPar, char *penv)
|
||||
{
|
||||
char *p, *s, *val_s;
|
||||
int i = 0, t;
|
||||
int bpp;
|
||||
int mode;
|
||||
/* first search for the environment containing the real param string */
|
||||
s = penv;
|
||||
if ((p = getenv (s)) != NULL) {
|
||||
s = p;
|
||||
}
|
||||
/* in case of the bootargs line, we have to start
|
||||
* after "video=ctfb:"
|
||||
*/
|
||||
i = video_search_param (s, "video=ctfb:");
|
||||
if (i >= 0) {
|
||||
s += i;
|
||||
s += strlen ("video=ctfb:");
|
||||
}
|
||||
/* search for mode as a default value */
|
||||
p = s;
|
||||
t = 0;
|
||||
mode = 0; /* default */
|
||||
while ((i = video_get_param_len (p, ',')) != 0) {
|
||||
GET_OPTION ("mode:", mode)
|
||||
p += i;
|
||||
if (*p != 0)
|
||||
p++; /* skip ',' */
|
||||
}
|
||||
if (mode >= RES_MODES_COUNT)
|
||||
mode = 0;
|
||||
*pPar = res_mode_init[mode]; /* copy default values */
|
||||
bpp = 24 - ((mode % 3) * 8);
|
||||
p = s; /* restart */
|
||||
while ((i = video_get_param_len (p, ',')) != 0) {
|
||||
GET_OPTION ("x:", pPar->xres)
|
||||
GET_OPTION ("y:", pPar->yres)
|
||||
GET_OPTION ("le:", pPar->left_margin)
|
||||
GET_OPTION ("ri:", pPar->right_margin)
|
||||
GET_OPTION ("up:", pPar->upper_margin)
|
||||
GET_OPTION ("lo:", pPar->lower_margin)
|
||||
GET_OPTION ("hs:", pPar->hsync_len)
|
||||
GET_OPTION ("vs:", pPar->vsync_len)
|
||||
GET_OPTION ("sync:", pPar->sync)
|
||||
GET_OPTION ("vmode:", pPar->vmode)
|
||||
GET_OPTION ("pclk:", pPar->pixclock)
|
||||
GET_OPTION ("depth:", bpp)
|
||||
p += i;
|
||||
if (*p != 0)
|
||||
p++; /* skip ',' */
|
||||
}
|
||||
return bpp;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* supported Video Chips
|
||||
*/
|
||||
|
1492
drivers/smiLynxEM.c
1492
drivers/smiLynxEM.c
File diff suppressed because it is too large
Load Diff
210
drivers/videomodes.c
Normal file
210
drivers/videomodes.c
Normal file
@ -0,0 +1,210 @@
|
||||
/*
|
||||
* (C) Copyright 2004
|
||||
* Pierre Aubert, Staubli Faverges , <p.aubert@staubli.com>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/************************************************************************
|
||||
Get Parameters for the video mode:
|
||||
The default video mode can be defined in CFG_DEFAULT_VIDEO_MODE.
|
||||
If undefined, default video mode is set to 0x301
|
||||
Parameters can be set via the variable "videomode" in the environment.
|
||||
2 diferent ways are possible:
|
||||
"videomode=301" - 301 is a hexadecimal number describing the VESA
|
||||
mode. Following modes are implemented:
|
||||
|
||||
Colors 640x480 800x600 1024x768 1152x864 1280x1024
|
||||
--------+---------------------------------------------
|
||||
8 bits | 0x301 0x303 0x305 0x161 0x307
|
||||
15 bits | 0x310 0x313 0x316 0x162 0x319
|
||||
16 bits | 0x311 0x314 0x317 0x163 0x31A
|
||||
24 bits | 0x312 0x315 0x318 ? 0x31B
|
||||
--------+---------------------------------------------
|
||||
"videomode=bootargs"
|
||||
- the parameters are parsed from the bootargs.
|
||||
The format is "NAME:VALUE,NAME:VALUE" etc.
|
||||
Ex.:
|
||||
"bootargs=video=ctfb:x:800,y:600,depth:16,pclk:25000"
|
||||
Parameters not included in the list will be taken from
|
||||
the default mode, which is one of the following:
|
||||
mode:0 640x480x24
|
||||
mode:1 800x600x16
|
||||
mode:2 1024x768x8
|
||||
mode:3 960x720x24
|
||||
mode:4 1152x864x16
|
||||
mode:5 1280x1024x8
|
||||
|
||||
if "mode" is not provided within the parameter list,
|
||||
mode:0 is assumed.
|
||||
Following parameters are supported:
|
||||
x xres = visible resolution horizontal
|
||||
y yres = visible resolution vertical
|
||||
pclk pixelclocks in pico sec
|
||||
le left_marging time from sync to picture in pixelclocks
|
||||
ri right_marging time from picture to sync in pixelclocks
|
||||
up upper_margin time from sync to picture
|
||||
lo lower_margin
|
||||
hs hsync_len length of horizontal sync
|
||||
vs vsync_len length of vertical sync
|
||||
sync see FB_SYNC_*
|
||||
vmode see FB_VMODE_*
|
||||
depth Color depth in bits per pixel
|
||||
All other parameters in the variable bootargs are ignored.
|
||||
It is also possible to set the parameters direct in the
|
||||
variable "videomode", or in another variable i.e.
|
||||
"myvideo" and setting the variable "videomode=myvideo"..
|
||||
****************************************************************************/
|
||||
|
||||
#include <common.h>
|
||||
#include "videomodes.h"
|
||||
|
||||
const struct ctfb_vesa_modes vesa_modes[VESA_MODES_COUNT] = {
|
||||
{0x301, RES_MODE_640x480, 8},
|
||||
{0x310, RES_MODE_640x480, 15},
|
||||
{0x311, RES_MODE_640x480, 16},
|
||||
{0x312, RES_MODE_640x480, 24},
|
||||
{0x303, RES_MODE_800x600, 8},
|
||||
{0x313, RES_MODE_800x600, 15},
|
||||
{0x314, RES_MODE_800x600, 16},
|
||||
{0x315, RES_MODE_800x600, 24},
|
||||
{0x305, RES_MODE_1024x768, 8},
|
||||
{0x316, RES_MODE_1024x768, 15},
|
||||
{0x317, RES_MODE_1024x768, 16},
|
||||
{0x318, RES_MODE_1024x768, 24},
|
||||
{0x161, RES_MODE_1152x864, 8},
|
||||
{0x162, RES_MODE_1152x864, 15},
|
||||
{0x163, RES_MODE_1152x864, 16},
|
||||
{0x307, RES_MODE_1280x1024, 8},
|
||||
{0x319, RES_MODE_1280x1024, 15},
|
||||
{0x31A, RES_MODE_1280x1024, 16},
|
||||
{0x31B, RES_MODE_1280x1024, 24},
|
||||
};
|
||||
const struct ctfb_res_modes res_mode_init[RES_MODES_COUNT] = {
|
||||
/* x y pixclk le ri up lo hs vs s vmode */
|
||||
{640, 480, 39721, 40, 24, 32, 11, 96, 2, 0, FB_VMODE_NONINTERLACED},
|
||||
{800, 600, 27778, 64, 24, 22, 1, 72, 2, 0, FB_VMODE_NONINTERLACED},
|
||||
{1024, 768, 15384, 168, 8, 29, 3, 144, 4, 0, FB_VMODE_NONINTERLACED},
|
||||
{960, 720, 13100, 160, 40, 32, 8, 80, 4, 0, FB_VMODE_NONINTERLACED},
|
||||
{1152, 864, 12004, 200, 64, 32, 16, 80, 4, 0, FB_VMODE_NONINTERLACED},
|
||||
{1280, 1024, 9090, 200, 48, 26, 1, 184, 3, 0, FB_VMODE_NONINTERLACED},
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
* Get Parameters for the video mode:
|
||||
*/
|
||||
/*********************************************************************
|
||||
* returns the length to the next seperator
|
||||
*/
|
||||
static int
|
||||
video_get_param_len (char *start, char sep)
|
||||
{
|
||||
int i = 0;
|
||||
while ((*start != 0) && (*start != sep)) {
|
||||
start++;
|
||||
i++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
static int
|
||||
video_search_param (char *start, char *param)
|
||||
{
|
||||
int len, totallen, i;
|
||||
char *p = start;
|
||||
len = strlen (param);
|
||||
totallen = len + strlen (start);
|
||||
for (i = 0; i < totallen; i++) {
|
||||
if (strncmp (p++, param, len) == 0)
|
||||
return (i);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/***************************************************************
|
||||
* Get parameter via the environment as it is done for the
|
||||
* linux kernel i.e:
|
||||
* video=ctfb:x:800,xv:1280,y:600,yv:1024,depth:16,mode:0,pclk:25000,
|
||||
* le:56,ri:48,up:26,lo:5,hs:152,vs:2,sync:0,vmode:0,accel:0
|
||||
*
|
||||
* penv is a pointer to the environment, containing the string, or the name of
|
||||
* another environment variable. It could even be the term "bootargs"
|
||||
*/
|
||||
|
||||
#define GET_OPTION(name,var) \
|
||||
if(strncmp(p,name,strlen(name))==0) { \
|
||||
val_s=p+strlen(name); \
|
||||
var=simple_strtoul(val_s, NULL, 10); \
|
||||
}
|
||||
|
||||
int video_get_params (struct ctfb_res_modes *pPar, char *penv)
|
||||
{
|
||||
char *p, *s, *val_s;
|
||||
int i = 0, t;
|
||||
int bpp;
|
||||
int mode;
|
||||
/* first search for the environment containing the real param string */
|
||||
s = penv;
|
||||
if ((p = getenv (s)) != NULL) {
|
||||
s = p;
|
||||
}
|
||||
/* in case of the bootargs line, we have to start
|
||||
* after "video=ctfb:"
|
||||
*/
|
||||
i = video_search_param (s, "video=ctfb:");
|
||||
if (i >= 0) {
|
||||
s += i;
|
||||
s += strlen ("video=ctfb:");
|
||||
}
|
||||
/* search for mode as a default value */
|
||||
p = s;
|
||||
t = 0;
|
||||
mode = 0; /* default */
|
||||
while ((i = video_get_param_len (p, ',')) != 0) {
|
||||
GET_OPTION ("mode:", mode)
|
||||
p += i;
|
||||
if (*p != 0)
|
||||
p++; /* skip ',' */
|
||||
}
|
||||
if (mode >= RES_MODES_COUNT)
|
||||
mode = 0;
|
||||
*pPar = res_mode_init[mode]; /* copy default values */
|
||||
bpp = 24 - ((mode % 3) * 8);
|
||||
p = s; /* restart */
|
||||
while ((i = video_get_param_len (p, ',')) != 0) {
|
||||
GET_OPTION ("x:", pPar->xres)
|
||||
GET_OPTION ("y:", pPar->yres)
|
||||
GET_OPTION ("le:", pPar->left_margin)
|
||||
GET_OPTION ("ri:", pPar->right_margin)
|
||||
GET_OPTION ("up:", pPar->upper_margin)
|
||||
GET_OPTION ("lo:", pPar->lower_margin)
|
||||
GET_OPTION ("hs:", pPar->hsync_len)
|
||||
GET_OPTION ("vs:", pPar->vsync_len)
|
||||
GET_OPTION ("sync:", pPar->sync)
|
||||
GET_OPTION ("vmode:", pPar->vmode)
|
||||
GET_OPTION ("pclk:", pPar->pixclock)
|
||||
GET_OPTION ("depth:", bpp)
|
||||
p += i;
|
||||
if (*p != 0)
|
||||
p++; /* skip ',' */
|
||||
}
|
||||
return bpp;
|
||||
}
|
||||
|
||||
|
89
drivers/videomodes.h
Normal file
89
drivers/videomodes.h
Normal file
@ -0,0 +1,89 @@
|
||||
/*
|
||||
* (C) Copyright 2004
|
||||
* Pierre Aubert, Staubli Faverges , <p.aubert@staubli.com>
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CFG_DEFAULT_VIDEO_MODE
|
||||
#define CFG_DEFAULT_VIDEO_MODE 0x301
|
||||
#endif
|
||||
|
||||
/* Some mode definitions */
|
||||
#define FB_SYNC_HOR_HIGH_ACT 1 /* horizontal sync high active */
|
||||
#define FB_SYNC_VERT_HIGH_ACT 2 /* vertical sync high active */
|
||||
#define FB_SYNC_EXT 4 /* external sync */
|
||||
#define FB_SYNC_COMP_HIGH_ACT 8 /* composite sync high active */
|
||||
#define FB_SYNC_BROADCAST 16 /* broadcast video timings */
|
||||
/* vtotal = 144d/288n/576i => PAL */
|
||||
/* vtotal = 121d/242n/484i => NTSC */
|
||||
#define FB_SYNC_ON_GREEN 32 /* sync on green */
|
||||
#define FB_VMODE_NONINTERLACED 0 /* non interlaced */
|
||||
#define FB_VMODE_INTERLACED 1 /* interlaced */
|
||||
#define FB_VMODE_DOUBLE 2 /* double scan */
|
||||
#define FB_VMODE_MASK 255
|
||||
|
||||
#define FB_VMODE_YWRAP 256 /* ywrap instead of panning */
|
||||
#define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */
|
||||
#define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* Resolution Struct
|
||||
******************************************************************/
|
||||
struct ctfb_res_modes {
|
||||
int xres; /* visible resolution */
|
||||
int yres;
|
||||
/* Timing: All values in pixclocks, except pixclock (of course) */
|
||||
int pixclock; /* pixel clock in ps (pico seconds) */
|
||||
int left_margin; /* time from sync to picture */
|
||||
int right_margin; /* time from picture to sync */
|
||||
int upper_margin; /* time from sync to picture */
|
||||
int lower_margin;
|
||||
int hsync_len; /* length of horizontal sync */
|
||||
int vsync_len; /* length of vertical sync */
|
||||
int sync; /* see FB_SYNC_* */
|
||||
int vmode; /* see FB_VMODE_* */
|
||||
};
|
||||
|
||||
/******************************************************************
|
||||
* Vesa Mode Struct
|
||||
******************************************************************/
|
||||
struct ctfb_vesa_modes {
|
||||
int vesanr; /* Vesa number as in LILO (VESA Nr + 0x200} */
|
||||
int resindex; /* index to resolution struct */
|
||||
int bits_per_pixel; /* bpp */
|
||||
};
|
||||
|
||||
#define RES_MODE_640x480 0
|
||||
#define RES_MODE_800x600 1
|
||||
#define RES_MODE_1024x768 2
|
||||
#define RES_MODE_960_720 3
|
||||
#define RES_MODE_1152x864 4
|
||||
#define RES_MODE_1280x1024 5
|
||||
#define RES_MODES_COUNT 6
|
||||
|
||||
#define VESA_MODES_COUNT 19
|
||||
|
||||
extern const struct ctfb_vesa_modes vesa_modes[];
|
||||
extern const struct ctfb_res_modes res_mode_init[];
|
||||
|
||||
int video_get_params (struct ctfb_res_modes *pPar, char *penv);
|
||||
|
@ -319,7 +319,7 @@ void relocate_code (ulong, gd_t *, ulong);
|
||||
ulong get_endaddr (void);
|
||||
void trap_init (ulong);
|
||||
#if defined (CONFIG_4xx) || \
|
||||
defined (CONFIG_5xxx) || \
|
||||
defined (CONFIG_MPC5xxx) || \
|
||||
defined (CONFIG_74xx_7xx) || \
|
||||
defined (CONFIG_74x) || \
|
||||
defined (CONFIG_75x) || \
|
||||
|
@ -300,6 +300,7 @@
|
||||
*
|
||||
*/
|
||||
#define CFG_I2C_PLL_ADDR 0x58 /* I2C address of AMIS FS6377-01 PLL */
|
||||
#define CONFIG_I2CFAST 1 /* enable "i2cfast" env. setting */
|
||||
|
||||
/*
|
||||
* Internal Definitions
|
||||
|
@ -509,8 +509,26 @@ void board_init_f (ulong bootflag)
|
||||
bd->bi_pci_busfreq = get_PCI_freq ();
|
||||
bd->bi_opbfreq = get_OPB_freq ();
|
||||
|
||||
#if defined(CONFIG_I2CFAST)
|
||||
/*
|
||||
* set bi_iic_fast for linux taking environment variable
|
||||
* "i2cfast" into account
|
||||
*/
|
||||
{
|
||||
char *s = getenv ("i2cfast");
|
||||
if (s && ((*s == 'y') || (*s == 'Y'))) {
|
||||
bd->bi_iic_fast[0] = 1;
|
||||
bd->bi_iic_fast[1] = 1;
|
||||
} else {
|
||||
bd->bi_iic_fast[0] = 0;
|
||||
bd->bi_iic_fast[1] = 0;
|
||||
}
|
||||
}
|
||||
#else
|
||||
bd->bi_iic_fast[0] = 0;
|
||||
bd->bi_iic_fast[1] = 0;
|
||||
#endif
|
||||
|
||||
#elif defined(CONFIG_XILINX_ML300)
|
||||
bd->bi_pci_busfreq = get_PCI_freq ();
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user