]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - board/mpl/pip405/pip405.h
Patch by Denis Peter, 19 Mai 2003:
[karo-tx-uboot.git] / board / mpl / pip405 / pip405.h
1 /*
2  * (C) Copyright 2001
3  * Denis Peter, MPL AG Switzerland, d.peter@mpl.ch
4  *
5  * See file CREDITS for list of people who contributed to this
6  * project.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of
11  * the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21  * MA 02111-1307 USA
22  *
23  */
24  /****************************************************************************
25  * Global routines used for PIP405
26  *****************************************************************************/
27
28
29 extern int  mem_test(unsigned long start, unsigned long ramsize,int mode);
30
31 void print_pip405_info(void);
32
33 void user_led0(unsigned char on);
34 void user_led1(unsigned char on);
35
36
37 #define PLD_BASE_ADDRESS                CFG_ISA_IO_BASE_ADDRESS + 0x800
38 #define PLD_PART_REG                            PLD_BASE_ADDRESS + 0
39 #define PLD_VERS_REG                            PLD_BASE_ADDRESS + 1
40 #define PLD_BOARD_CFG_REG               PLD_BASE_ADDRESS + 2
41 #define PLD_LED_USER_REG                PLD_BASE_ADDRESS + 3
42 #define PLD_SYS_MAN_REG                 PLD_BASE_ADDRESS + 4
43 #define PLD_FLASH_COM_REG               PLD_BASE_ADDRESS + 5
44 #define PLD_CAN_REG                                     PLD_BASE_ADDRESS + 6
45 #define PLD_SER_PWR_REG                 PLD_BASE_ADDRESS + 7
46 #define PLD_COM_PWR_REG                 PLD_BASE_ADDRESS + 8
47 #define PLD_NIC_VGA_REG                 PLD_BASE_ADDRESS + 9
48 #define PLD_SCSI_RST_REG                PLD_BASE_ADDRESS + 0xA
49
50 #define PIIX4_VENDOR_ID                 0x8086
51 #define PIIX4_IDE_DEV_ID                0x7111
52
53
54 /* timings */
55 /* PLD (CS7) */
56 #define PLD_BME 0       /* Burst disable */
57 #define PLD_TWE 5       /* 5 * 30ns 120ns Waitstates (access=TWT+1+TH) */
58 #define PLD_CSN 1       /* Chipselect is driven inactive for 1 Cycle BTW transfers */
59 #define PLD_OEN 1       /* Cycles from CS low to OE low   */
60 #define PLD_WBN 1       /* Cycles from CS low to WE low   */
61 #define PLD_WBF 1       /* Cycles from WE high to CS high */
62 #define PLD_TH  2       /* Number of hold cycles after transfer */
63 #define PLD_RE  0       /* Ready disabled */
64 #define PLD_SOR 1       /* Sample on Ready disabled */
65 #define PLD_BEM 0       /* Byte Write only active on Write cycles */
66 #define PLD_PEN 0       /* Parity disable */
67 #define PLD_AP  ((PLD_BME << 31) + (PLD_TWE << 23) + (PLD_CSN << 18) + (PLD_OEN << 16) + (PLD_WBN << 14) + \
68                                         (PLD_WBF << 12) + (PLD_TH << 9) + (PLD_RE << 8) + (PLD_SOR << 7) + (PLD_BEM << 6) + (PLD_PEN << 5))
69
70 /* Size: 0=1MB, 1=2MB, 2=4MB, 3=8MB, 4=16MB, 5=32MB, 6=64MB, 7=128MB */
71 #define PLD_BS  0       /* 1 MByte */
72 /* Usage: 0=disabled, 1=Read only, 2=Write Only, 3=R/W */
73 #define PLD_BU  3       /* R/W */
74 /* Bus width: 0=8Bit, 1=16Bit, 2=32Bit, 3=Reserved */
75 #define PLD_BW  0       /* 16Bit */
76 #define PLD_CR  ((PER_PLD_ADDR & 0xfff00000) + (PLD_BS << 17) + (PLD_BU << 15) + (PLD_BW << 13))
77
78
79 /* timings */
80
81 #define PER_BOARD_ADDR (PER_UART1_ADDR+(1024*1024))
82 /* Dummy CS to get the board revision */
83 #define BOARD_BME       0       /* Burst disable */
84 #define BOARD_TWE       255     /* 255 * 30ns 120ns Waitstates (access=TWT+1+TH) */
85 #define BOARD_CSN       1       /* Chipselect is driven inactive for 1 Cycle BTW transfers */
86 #define BOARD_OEN       1       /* Cycles from CS low to OE low   */
87 #define BOARD_WBN       1       /* Cycles from CS low to WE low   */
88 #define BOARD_WBF       1       /* Cycles from WE high to CS high */
89 #define BOARD_TH        2       /* Number of hold cycles after transfer */
90 #define BOARD_RE        0       /* Ready disabled */
91 #define BOARD_SOR       1       /* Sample on Ready disabled */
92 #define BOARD_BEM       0       /* Byte Write only active on Write cycles */
93 #define BOARD_PEN       0       /* Parity disable */
94 #define BOARD_AP        ((BOARD_BME << 31) + (BOARD_TWE << 23) + (BOARD_CSN << 18) + (BOARD_OEN << 16) + (BOARD_WBN << 14) + \
95                                         (BOARD_WBF << 12) + (BOARD_TH << 9) + (BOARD_RE << 8) + (BOARD_SOR << 7) + (BOARD_BEM << 6) + (BOARD_PEN << 5))
96
97 /* Size: 0=1MB, 1=2MB, 2=4MB, 3=8MB, 4=16MB, 5=32MB, 6=64MB, 7=128MB */
98 #define BOARD_BS        0       /* 1 MByte */
99 /* Usage: 0=disabled, 1=Read only, 2=Write Only, 3=R/W */
100 #define BOARD_BU        3       /* R/W */
101 /* Bus width: 0=8Bit, 1=16Bit, 2=32Bit, 3=Reserved */
102 #define BOARD_BW        0       /* 16Bit */
103 #define BOARD_CR        ((PER_BOARD_ADDR & 0xfff00000) + (BOARD_BS << 17) + (BOARD_BU << 15) + (BOARD_BW << 13))
104
105
106 /* UART0 CS2 */
107 #define UART0_BME       0       /* Burst disable */
108 #define UART0_TWE       7       /* 7 * 30ns 210ns Waitstates (access=TWT+1+TH) */
109 #define UART0_CSN       1       /* Chipselect is driven inactive for 1 Cycle BTW transfers */
110 #define UART0_OEN       1       /* Cycles from CS low to OE low   */
111 #define UART0_WBN       1       /* Cycles from CS low to WE low   */
112 #define UART0_WBF       1       /* Cycles from WE high to CS high */
113 #define UART0_TH        2       /* Number of hold cycles after transfer */
114 #define UART0_RE        0       /* Ready disabled */
115 #define UART0_SOR       1       /* Sample on Ready disabled */
116 #define UART0_BEM       0       /* Byte Write only active on Write cycles */
117 #define UART0_PEN       0       /* Parity disable */
118 #define UART0_AP        ((UART0_BME << 31) + (UART0_TWE << 23) + (UART0_CSN << 18) + (UART0_OEN << 16) + (UART0_WBN << 14) + \
119                                         (UART0_WBF << 12) + (UART0_TH << 9) + (UART0_RE << 8) + (UART0_SOR << 7) + (UART0_BEM << 6) + (UART0_PEN << 5))
120
121 /* Size: 0=1MB, 1=2MB, 2=4MB, 3=8MB, 4=16MB, 5=32MB, 6=64MB, 7=128MB */
122 #define UART0_BS        0       /* 1 MByte */
123 /* Usage: 0=disabled, 1=Read only, 2=Write Only, 3=R/W */
124 #define UART0_BU        3       /* R/W */
125 /* Bus width: 0=8Bit, 1=16Bit, 2=32Bit, 3=Reserved */
126 #define UART0_BW        0       /* 8Bit */
127 #define UART0_CR        ((PER_UART0_ADDR & 0xfff00000) + (UART0_BS << 17) + (UART0_BU << 15) + (UART0_BW << 13))
128
129 /* UART1 CS3 */
130 #define UART1_AP UART0_AP /* same timing as UART0 */
131 #define UART1_CR        ((PER_UART1_ADDR & 0xfff00000) + (UART0_BS << 17) + (UART0_BU << 15) + (UART0_BW << 13))
132
133
134
135 /* Flash CS0 or CS 1 */
136 /* 0x7F8FFE80 slowest timing at all... */
137 #define FLASH_BME_B     1       /* Burst enable */
138 #define FLASH_FWT_B     0x6     /* 6 * 30ns 210ns First Wait Access */
139 #define FLASH_BWT_B     0x6     /* 6 * 30ns 210ns Burst Wait Access */
140 #define FLASH_BME       0       /* Burst disable */
141 #define FLASH_TWE       0xb/* 11 * 30ns 330ns Waitstates (access=TWT+1+TH) */
142 #define FLASH_CSN       0       /* Chipselect is driven inactive for 1 Cycle BTW transfers */
143 #define FLASH_OEN       1       /* Cycles from CS low to OE low   */
144 #define FLASH_WBN       1       /* Cycles from CS low to WE low   */
145 #define FLASH_WBF       1       /* Cycles from WE high to CS high */
146 #define FLASH_TH        2       /* Number of hold cycles after transfer */
147 #define FLASH_RE        0       /* Ready disabled */
148 #define FLASH_SOR       1       /* Sample on Ready disabled */
149 #define FLASH_BEM       0       /* Byte Write only active on Write cycles */
150 #define FLASH_PEN       0       /* Parity disable */
151 /* Access Parameter Register for non Boot */
152 #define FLASH_AP        ((FLASH_BME << 31) + (FLASH_TWE << 23) + (FLASH_CSN << 18) + (FLASH_OEN << 16) + (FLASH_WBN << 14) + \
153                                         (FLASH_WBF << 12) + (FLASH_TH << 9) + (FLASH_RE << 8) + (FLASH_SOR << 7) + (FLASH_BEM << 6) + (FLASH_PEN << 5))
154 /* Access Parameter Register for Boot */
155 #define FLASH_AP_B      ((FLASH_BME_B << 31) + (FLASH_FWT_B << 26) + (FLASH_BWT_B << 23) + (FLASH_CSN << 18) + (FLASH_OEN << 16) + (FLASH_WBN << 14) + \
156                                         (FLASH_WBF << 12) + (FLASH_TH << 9) + (FLASH_RE << 8) + (FLASH_SOR << 7) + (FLASH_BEM << 6) + (FLASH_PEN << 5))
157
158 /* Size: 0=1MB, 1=2MB, 2=4MB, 3=8MB, 4=16MB, 5=32MB, 6=64MB, 7=128MB */
159 #define FLASH_BS        2       /* 4 MByte */
160 /* Usage: 0=disabled, 1=Read only, 2=Write Only, 3=R/W */
161 #define FLASH_BU        3       /* R/W */
162 /* Bus width: 0=8Bit, 1=16Bit, 2=32Bit, 3=Reserved */
163 #define FLASH_BW        1       /* 16Bit */
164 /* CR register for Boot */
165 #define FLASH_CR_B      ((FLASH_BASE0_PRELIM & 0xfff00000) + (FLASH_BS << 17) + (FLASH_BU << 15) + (FLASH_BW << 13))
166 /* CR register for non Boot */
167 #define FLASH_CR        ((MULTI_PURPOSE_SOCKET_ADDR & 0xfff00000) + (FLASH_BS << 17) + (FLASH_BU << 15) + (FLASH_BW << 13))
168
169 /* MPS CS1 or CS0 */
170 /* Boot CS: */
171 #define MPS_BME_B       1       /* Burst enable */
172 #define MPS_FWT_B       0x6/* 6 * 30ns 210ns First Wait Access */
173 #define MPS_BWT_B       0x6     /* 6 * 30ns 210ns Burst Wait Access */
174 #define MPS_BME         0       /* Burst disable */
175 #define MPS_TWE         0xb/* 11 * 30ns 330ns Waitstates (access=TWT+1+TH) */
176 #define MPS_CSN         0       /* Chipselect is driven inactive for 1 Cycle BTW transfers */
177 #define MPS_OEN         1       /* Cycles from CS low to OE low   */
178 #define MPS_WBN         1       /* Cycles from CS low to WE low   */
179 #define MPS_WBF         1       /* Cycles from WE high to CS high */
180 #define MPS_TH          2       /* Number of hold cycles after transfer */
181 #define MPS_RE          0       /* Ready disabled */
182 #define MPS_SOR         1       /* Sample on Ready disabled */
183 #define MPS_BEM         0       /* Byte Write only active on Write cycles */
184 #define MPS_PEN         0       /* Parity disable */
185 /* Access Parameter Register for non Boot */
186 #define MPS_AP          ((MPS_BME << 31) + (MPS_TWE << 23) + (MPS_CSN << 18) + (MPS_OEN << 16) + (MPS_WBN << 14) + \
187                                         (MPS_WBF << 12) + (MPS_TH << 9) + (MPS_RE << 8) + (MPS_SOR << 7) + (MPS_BEM << 6) + (MPS_PEN << 5))
188 /* Access Parameter Register for Boot */
189 #define MPS_AP_B                ((MPS_BME_B << 31) + (MPS_FWT_B << 26) + (MPS_BWT_B << 23) + (MPS_CSN << 18) + (MPS_OEN << 16) + (MPS_WBN << 14) + \
190                                         (MPS_WBF << 12) + (MPS_TH << 9) + (MPS_RE << 8) + (MPS_SOR << 7) + (MPS_BEM << 6) + (MPS_PEN << 5))
191
192 /* Size: 0=1MB, 1=2MB, 2=4MB, 3=8MB, 4=16MB, 5=32MB, 6=64MB, 7=128MB */
193 #define MPS_BS          2       /* 4 MByte */
194 /* Usage: 0=disabled, 1=Read only, 2=Write Only, 3=R/W */
195 #define MPS_BU          3       /* R/W */
196 /* Bus width: 0=8Bit, 1=16Bit, 2=32Bit, 3=Reserved */
197 #define MPS_BW          0       /* 8Bit */
198 /* CR register for Boot */
199 #define MPS_CR_B        ((FLASH_BASE0_PRELIM & 0xfff00000) + (MPS_BS << 17) + (MPS_BU << 15) + (MPS_BW << 13))
200 /* CR register for non Boot */
201 #define MPS_CR          ((MULTI_PURPOSE_SOCKET_ADDR & 0xfff00000) + (MPS_BS << 17) + (MPS_BU << 15) + (MPS_BW << 13))
202
203
204
205
206
207
208
209
210
211
212