initial commit with v2.6.9
[linux-2.6.9-moxart.git] / include / asm-arm / arch-sa1100 / omnimeter.h
blob6c7a7b23750673641dda532fd0ffeaf6c2375bd1
1 /* -*- Mode: c++ -*-
3 * Copyright 2000 Massachusetts Institute of Technology
5 * Permission to use, copy, modify, distribute, and sell this software and its
6 * documentation for any purpose is hereby granted without fee, provided that
7 * the above copyright notice appear in all copies and that both that
8 * copyright notice and this permission notice appear in supporting
9 * documentation, and that the name of M.I.T. not be used in advertising or
10 * publicity pertaining to distribution of the software without specific,
11 * written prior permission. M.I.T. makes no representations about the
12 * suitability of this software for any purpose. It is provided "as is"
13 * without express or implied warranty.
17 #ifndef OMNIMETER_H
18 #define OMNIMETER_H
19 // use the address of the second socket for both sockets
20 // (divide address space in half and use offsets to wrap second card accesses back to start of address space)
21 // Following values for programming Cirrus Logic chip
22 #define Socket1Base 0x40
24 #define SocketMemoryWindowLen (0x00400000)
25 #define Socket0MemoryWindowStart (0x00800000)
26 #define Socket1MemoryWindowStart (Socket0MemoryWindowStart + SocketMemoryWindowLen)
28 #define SocketIOWindowLen (0x00008000)
29 #define Socket1IOWindowStart (SocketIOWindowLen)
30 #define Socket1IOWindowOffset (0x00010000 - Socket1IOWindowStart)
32 // Following values for run-time access
34 //#define PCCardBase (0xe4000000) //jca (0x30000000)
35 //#define PCCardBase (0x30000000)
36 #define PCCardBase (0xe0000000) //jag
38 #define PCCard0IOBase (PCCardBase)
39 //#define PCCard0AttrBase (0xec000000) //jca (PCCardBase + 0x08000000)
40 #define PCCard0AttrBase (0xe8000000)
41 //#define PCCard0AttrBase (PCCardBase + 0x08000000)
42 //#define PCCard0MemBase (0xf4000000) //jca (PCCardBase + 0x0C000000)
43 //#define PCCard0MemBase (PCCardBase + 0x0C000000)
44 #define PCCard0MemBase (0xf0000000)
46 //#define PCCard1IOBase (PCCardBase + SocketIOWindowLen) //jag
47 #define PCCard1IOBase (0xe4000000)
48 //#define PCCard1AttrBase (0xec000000 + SocketMemoryWindowLen) //jag
49 #define PCCard1AttrBase (0xec000000)
50 //#define PCCard1MemBase (0xf4000000 + SocketMemoryWindowLen) //jag
51 #define PCCard1MemBase (0xf4000000)
53 #define PCCardIndexRegister (PCCard0IOBase + 0x000003E0) //altered
54 #define PCCardDataRegister (PCCardIndexRegister + 1)
56 /* interrupts */
57 #define PIN_cardInt2 13
58 #define PIN_cardInt1 5
60 void SMBOn(unsigned char SMBaddress);
61 void SetSMB(unsigned char SMBaddress, unsigned int dacValue);
63 #define GPIO_key6 0x00040000
64 #define GPIO_scl 0x01000000 // output, SMB clock
65 #define GPIO_sda 0x02000000 // bidirect, SMB data
66 #define SMB_LCDVEE 0x2C
67 #define DefaultLCDContrast 16
69 #define LEDBacklightOn() ClearGPIOpin(GPIO_key6)
70 #define LEDBacklightOff() SetGPIOpin(GPIO_key6)
71 #define LCDPowerOn() SMBOn(SMB_LCDVEE)
72 #define LCDPowerOff() SMBOff(SMB_LCDVEE)
73 #define SetLCDContrast(d) SetSMB(SMB_LCDVEE, d)
74 #define WritePort32(port,value) (port = (value))
75 #define ReadPort32(port) (port)
76 #define SetGPIOpin(pin) WritePort32(GPSR,pin)
77 #define ClearGPIOpin(pin) WritePort32(GPCR,pin)
79 void jcaoutb(long p, unsigned char data);
80 unsigned char jcainb(long p);
81 void jcaoutw(long p, unsigned short data);
82 unsigned short jcainw_p(long p);
84 #endif