2 * LED, LCD and Button panel driver for Cobalt
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
8 * Copyright (C) 1996, 1997 by Andrew Bose
10 * Linux kernel version history:
11 * March 2001: Ported from 2.0.34 by Liam Davies
17 #define LCD_CHARS_PER_LINE 40
18 #define MAX_IDLE_TIME 120
24 unsigned char line1[LCD_CHARS_PER_LINE];
25 unsigned char line2[LCD_CHARS_PER_LINE];
26 unsigned char cursor_address;
27 unsigned char character;
29 unsigned char *RomImage;
34 #define LCD_DRIVER "Cobalt LCD Driver v2.10"
38 #define kLCD_IR 0x0F000000
39 #define kLCD_DR 0x0F000010
40 #define kGPI 0x0D000000
41 #define kLED 0x0C000000
48 #define kLCD_Addr 0x00000080
50 #define LCDTimeoutValue 0xfff
55 #define LCDWriteData(x) outl((x << 24), kLCD_DR)
56 #define LCDWriteInst(x) outl((x << 24), kLCD_IR)
58 #define LCDReadData (inl(kLCD_DR) >> 24)
59 #define LCDReadInst (inl(kLCD_IR) >> 24)
61 #define GPIRead (inl(kGPI) >> 24)
63 #define LEDSet(x) outb((char)x, kLED)
65 #define WRITE_GAL(x,y) outl(y, 0x04000000 | (x))
66 #define BusyCheck() while ((LCDReadInst & 0x80) == 0x80)
71 * Function command codes for io_ctl.
77 #define LCD_Cursor_Left 5
78 #define LCD_Cursor_Right 6
79 #define LCD_Disp_Left 7
80 #define LCD_Disp_Right 8
81 #define LCD_Get_Cursor 9
82 #define LCD_Set_Cursor 10
86 #define LCD_Cursor_Off 14
87 #define LCD_Cursor_On 15
88 #define LCD_Get_Cursor_Pos 16
89 #define LCD_Set_Cursor_Pos 17
90 #define LCD_Blink_Off 18
93 #define LED_Bit_Set 41
94 #define LED_Bit_Clear 42
98 #define BUTTON_Read 50
101 // Ethernet LINK check hackaroo
102 #define LINK_Check 90
103 #define LINK_Check_2 91
105 // Button patterns _B - single layer lcd boards
107 #define BUTTON_NONE 0x3F
108 #define BUTTON_NONE_B 0xFE
110 #define BUTTON_Left 0x3B
111 #define BUTTON_Left_B 0xFA
113 #define BUTTON_Right 0x37
114 #define BUTTON_Right_B 0xDE
116 #define BUTTON_Up 0x2F
117 #define BUTTON_Up_B 0xF6
119 #define BUTTON_Down 0x1F
120 #define BUTTON_Down_B 0xEE
122 #define BUTTON_Next 0x3D
123 #define BUTTON_Next_B 0x7E
125 #define BUTTON_Enter 0x3E
126 #define BUTTON_Enter_B 0xBE
128 #define BUTTON_Reset_B 0xFC
131 // debounce constants
133 #define BUTTON_SENSE 160000
134 #define BUTTON_DEBOUNCE 5000
137 // Galileo register stuff
139 #define kGal_DevBank2Cfg 0x1466DB33
140 #define kGal_DevBank2PReg 0x464
141 #define kGal_DevBank3Cfg 0x146FDFFB
142 #define kGal_DevBank3PReg 0x468