From: Stefan E. <se...@us...> - 2001-10-09 17:54:11
|
Update of /cvsroot/blob/blob/src/diag In directory usw-pr-cvs1:/tmp/cvs-serv14319 Modified Files: system3.c Log Message: - system 3 test and diagnosis functions Index: system3.c =================================================================== RCS file: /cvsroot/blob/blob/src/diag/system3.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- system3.c 2001/10/09 16:49:56 1.1 +++ system3.c 2001/10/09 17:54:08 1.2 @@ -0,0 +1,130 @@ +/********************************************************************** + * system3.c + * + * AUTOR: SELETZ + * + * Implements several POST routines for PT System 3 platform + * + * Copyright (C) 2001 Stefan Eletzhofer <ste...@ww...> + * + * 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 + */ + +#ident "$Id$" + +/********************************************************************** + * Includes + */ +#ifdef HAVE_CONFIG_H +# include <blob/config.h> +#endif + +#include <blob/types.h> +#include <blob/errno.h> +#include <blob/util.h> +#include <blob/command.h> +#include <blob/serial.h> +#include <blob/sa1100.h> +#include <blob/sa1111.h> + +#include <blob/lcd.h> + +/********************************************************************** + * defines + */ +#define MEM(adr) (*((u32*)adr)) +#define SET(reg,bit) ((reg) |= (1<<(bit))) +#define CLR(reg,bit) ((reg) &= ~(1<<(bit))) + +#define CPLD_BASE (0x10000000) +#define CPLD_ID (CPLD_BASE + 0x00) +#define CPLD_IRQ (CPLD_BASE + 0x24) +#define CPLD_0 (CPLD_BASE + 0x90) +#define CPLD_1 (CPLD_BASE + 0xA0) +#define CPLD_2 (CPLD_BASE + 0xB0) + +/********************************************************************** + * program globals + */ + +/********************************************************************** + * module globals + */ + +/********************************************************************** + * prototypes + */ + +/*********************************************************************/ +/*********************************************************************/ +/*********************************************************************/ + +#if defined(CONFIG_LCD_SUPPORT) +/********************************************************************** + * Overwrite LCD functions special for this platform + */ +int lcd_power_up( void ) +{ + SerialOutputString("_system3_" ); + SET( MEM( CPLD_0 ), 7 ); + PB_DDR = 0xFFFFFFFF; + SKPEN0 = 1; + SKPWM0 = 95; // und halbe Kraft + SKPEN1 = 1; + SKPWM1 = 240; // und auf null + return 0; +} + +int lcd_power_down( void ) +{ + SerialOutputString("_system3_" ); + CLR( MEM( CPLD_0 ), 7 ); + return 0; +} + +int lcd_backlight_on( void ) +{ + SerialOutputString("_system3_" ); + SET( MEM( CPLD_0 ), 2 ); + return 0; +} + +int lcd_backlight_off( void ) +{ + SerialOutputString("_system3_" ); + CLR( MEM( CPLD_0 ), 2 ); + return 0; +} + +int lcd_contrast( int value ) +{ + SerialOutputString("_system3_" ); + SKPWM0 = value; + return 0; +} + +int lcd_brightness( int value ) +{ + SerialOutputString("_system3_" ); + SKPWM1 = value; + return 0; +} + +#endif // defined(CONFIG_LCD_SUPPORT) + + +/********************************************************************** + * static functions + */ |