Commit 845c4140 authored by Ralf Bächle's avatar Ralf Bächle Committed by Linus Torvalds

[PATCH] Cobalt LCD Driver update

Mostly reformatting to get the sometimes random formatting style of the LCD
driver to something Linux compliant.  Use module_init/exit for module
initialization and cleanup.
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5d119c3c
...@@ -932,11 +932,6 @@ config AU1000_USB_DEVICE ...@@ -932,11 +932,6 @@ config AU1000_USB_DEVICE
depends on MIPS_PB1500 || MIPS_PB1100 || MIPS_PB1000 depends on MIPS_PB1500 || MIPS_PB1100 || MIPS_PB1000
default n default n
config COBALT_LCD
bool
depends on MIPS_COBALT
default y
config MIPS_GT96100 config MIPS_GT96100
bool bool
depends on MIPS_EV96100 depends on MIPS_EV96100
......
...@@ -80,7 +80,6 @@ CONFIG_I8259=y ...@@ -80,7 +80,6 @@ CONFIG_I8259=y
CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_CPU_LITTLE_ENDIAN=y
CONFIG_IRQ_CPU=y CONFIG_IRQ_CPU=y
CONFIG_MIPS_GT64111=y CONFIG_MIPS_GT64111=y
CONFIG_COBALT_LCD=y
CONFIG_MIPS_L1_CACHE_SHIFT=5 CONFIG_MIPS_L1_CACHE_SHIFT=5
# CONFIG_FB is not set # CONFIG_FB is not set
...@@ -432,6 +431,7 @@ CONFIG_LEGACY_PTY_COUNT=256 ...@@ -432,6 +431,7 @@ CONFIG_LEGACY_PTY_COUNT=256
# #
# CONFIG_WATCHDOG is not set # CONFIG_WATCHDOG is not set
CONFIG_RTC=y CONFIG_RTC=y
CONFIG_COBALT_LCD=y
# CONFIG_DTLK is not set # CONFIG_DTLK is not set
# CONFIG_R3964 is not set # CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set # CONFIG_APPLICOM is not set
......
...@@ -793,6 +793,13 @@ config EFI_RTC ...@@ -793,6 +793,13 @@ config EFI_RTC
bool "EFI Real Time Clock Services" bool "EFI Real Time Clock Services"
depends on IA64 depends on IA64
config COBALT_LCD
bool "Support for Cobalt LCD"
depends on MIPS_COBALT
help
This option enables support for the LCD display and buttons found
on Cobalt systems through a misc device.
config H8 config H8
bool "Tadpole ANA H8 Support (OBSOLETE)" bool "Tadpole ANA H8 Support (OBSOLETE)"
depends on OBSOLETE && ALPHA_BOOK1 depends on OBSOLETE && ALPHA_BOOK1
......
...@@ -68,6 +68,7 @@ obj-$(CONFIG_DS1620) += ds1620.o ...@@ -68,6 +68,7 @@ obj-$(CONFIG_DS1620) += ds1620.o
obj-$(CONFIG_HW_RANDOM) += hw_random.o obj-$(CONFIG_HW_RANDOM) += hw_random.o
obj-$(CONFIG_QIC02_TAPE) += tpqic02.o obj-$(CONFIG_QIC02_TAPE) += tpqic02.o
obj-$(CONFIG_FTAPE) += ftape/ obj-$(CONFIG_FTAPE) += ftape/
obj-$(CONFIG_COBALT_LCD) += lcd.o
obj-$(CONFIG_H8) += h8.o obj-$(CONFIG_H8) += h8.o
obj-$(CONFIG_PPDEV) += ppdev.o obj-$(CONFIG_PPDEV) += ppdev.o
obj-$(CONFIG_NWBUTTON) += nwbutton.o obj-$(CONFIG_NWBUTTON) += nwbutton.o
......
This diff is collapsed.
/*
* LED, LCD and Button panel driver for Cobalt
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1996, 1997 by Andrew Bose
*
* Linux kernel version history:
* March 2001: Ported from 2.0.34 by Liam Davies
*
*/
// function headers
static int dqpoll(volatile unsigned long, volatile unsigned char );
static int timeout(volatile unsigned long);
#define LCD_CHARS_PER_LINE 40
#define FLASH_SIZE 524288
#define MAX_IDLE_TIME 120
struct lcd_display {
unsigned long buttons;
int size1;
int size2;
unsigned char line1[LCD_CHARS_PER_LINE];
unsigned char line2[LCD_CHARS_PER_LINE];
unsigned char cursor_address;
unsigned char character;
unsigned char leds;
unsigned char *RomImage;
};
#define LCD_DRIVER "Cobalt LCD Driver v2.10"
#define kLCD_IR 0x0F000000
#define kLCD_DR 0x0F000010
#define kGPI 0x0D000000
#define kLED 0x0C000000
#define kDD_R00 0x00
#define kDD_R01 0x27
#define kDD_R10 0x40
#define kDD_R11 0x67
#define kLCD_Addr 0x00000080
#define LCDTimeoutValue 0xfff
// Flash definitions AMD 29F040
#define kFlashBase 0x0FC00000
#define kFlash_Addr1 0x5555
#define kFlash_Addr2 0x2AAA
#define kFlash_Data1 0xAA
#define kFlash_Data2 0x55
#define kFlash_Prog 0xA0
#define kFlash_Erase3 0x80
#define kFlash_Erase6 0x10
#define kFlash_Read 0xF0
#define kFlash_ID 0x90
#define kFlash_VenAddr 0x00
#define kFlash_DevAddr 0x01
#define kFlash_VenID 0x01
#define kFlash_DevID 0xA4 // 29F040
//#define kFlash_DevID 0xAD // 29F016
// Macros
#define LCDWriteData(x) outl((x << 24), kLCD_DR)
#define LCDWriteInst(x) outl((x << 24), kLCD_IR)
#define LCDReadData (inl(kLCD_DR) >> 24)
#define LCDReadInst (inl(kLCD_IR) >> 24)
#define GPIRead (inl(kGPI) >> 24)
#define LEDSet(x) outb((char)x, kLED)
#define WRITE_GAL(x,y) outl(y, 0x04000000 | (x))
#define BusyCheck() while ((LCDReadInst & 0x80) == 0x80)
#define WRITE_FLASH(x,y) outb((char)y, kFlashBase | (x))
#define READ_FLASH(x) (inb(kFlashBase | (x)))
/*
* Function command codes for io_ctl.
*/
#define LCD_On 1
#define LCD_Off 2
#define LCD_Clear 3
#define LCD_Reset 4
#define LCD_Cursor_Left 5
#define LCD_Cursor_Right 6
#define LCD_Disp_Left 7
#define LCD_Disp_Right 8
#define LCD_Get_Cursor 9
#define LCD_Set_Cursor 10
#define LCD_Home 11
#define LCD_Read 12
#define LCD_Write 13
#define LCD_Cursor_Off 14
#define LCD_Cursor_On 15
#define LCD_Get_Cursor_Pos 16
#define LCD_Set_Cursor_Pos 17
#define LCD_Blink_Off 18
#define LED_Set 40
#define LED_Bit_Set 41
#define LED_Bit_Clear 42
// Button defs
#define BUTTON_Read 50
// Flash command codes
#define FLASH_Erase 60
#define FLASH_Burn 61
#define FLASH_Read 62
// Ethernet LINK check hackaroo
#define LINK_Check 90
#define LINK_Check_2 91
// Button patterns _B - single layer lcd boards
#define BUTTON_NONE 0x3F
#define BUTTON_NONE_B 0xFE
#define BUTTON_Left 0x3B
#define BUTTON_Left_B 0xFA
#define BUTTON_Right 0x37
#define BUTTON_Right_B 0xDE
#define BUTTON_Up 0x2F
#define BUTTON_Up_B 0xF6
#define BUTTON_Down 0x1F
#define BUTTON_Down_B 0xEE
#define BUTTON_Next 0x3D
#define BUTTON_Next_B 0x7E
#define BUTTON_Enter 0x3E
#define BUTTON_Enter_B 0xBE
#define BUTTON_Reset_B 0xFC
// debounce constants
#define BUTTON_SENSE 160000
#define BUTTON_DEBOUNCE 5000
// Galileo register stuff
#define kGal_DevBank2Cfg 0x1466DB33
#define kGal_DevBank2PReg 0x464
#define kGal_DevBank3Cfg 0x146FDFFB
#define kGal_DevBank3PReg 0x468
// Network
#define kIPADDR 1
#define kNETMASK 2
#define kGATEWAY 3
#define kDNS 4
#define kClassA 5
#define kClassB 6
#define kClassC 7
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment