wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2002 |
| 3 | * Rich Ireland, Enterasys Networks, rireland@enterasys.com. |
| 4 | * Keith Outwater, keith_outwater@mvis.com. |
| 5 | * |
| 6 | * See file CREDITS for list of people who contributed to this |
| 7 | * project. |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU General Public License as |
| 11 | * published by the Free Software Foundation; either version 2 of |
| 12 | * the License, or (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 22 | * MA 02111-1307 USA |
| 23 | * |
| 24 | */ |
| 25 | |
| 26 | /* |
| 27 | * Virtex2 FPGA configuration support for the GEN860T computer |
| 28 | */ |
| 29 | |
| 30 | #include <common.h> |
| 31 | #include <virtex2.h> |
| 32 | #include <command.h> |
| 33 | #include "fpga.h" |
| 34 | |
| 35 | #if (CONFIG_FPGA) |
| 36 | |
| 37 | #if 0 |
| 38 | #define GEN860T_FPGA_DEBUG |
| 39 | #endif |
| 40 | |
| 41 | #ifdef GEN860T_FPGA_DEBUG |
| 42 | #define PRINTF(fmt,args...) printf (fmt ,##args) |
| 43 | #else |
| 44 | #define PRINTF(fmt,args...) |
| 45 | #endif |
| 46 | |
| 47 | /* |
| 48 | * Port bit numbers for the Selectmap controls |
| 49 | */ |
| 50 | #define FPGA_INIT_BIT_NUM 22 /* PB22 */ |
| 51 | #define FPGA_RESET_BIT_NUM 11 /* PC11 */ |
| 52 | #define FPGA_DONE_BIT_NUM 16 /* PB16 */ |
| 53 | #define FPGA_PROGRAM_BIT_NUM 7 /* PA7 */ |
| 54 | |
| 55 | /* Note that these are pointers to code that is in Flash. They will be |
| 56 | * relocated at runtime. |
| 57 | */ |
| 58 | Xilinx_Virtex2_Slave_SelectMap_fns fpga_fns = { |
| 59 | fpga_pre_config_fn, |
| 60 | fpga_pgm_fn, |
| 61 | fpga_init_fn, |
| 62 | fpga_err_fn, |
| 63 | fpga_done_fn, |
| 64 | fpga_clk_fn, |
| 65 | fpga_cs_fn, |
| 66 | fpga_wr_fn, |
| 67 | fpga_read_data_fn, |
| 68 | fpga_write_data_fn, |
| 69 | fpga_busy_fn, |
| 70 | fpga_abort_fn, |
| 71 | fpga_post_config_fn |
| 72 | }; |
| 73 | |
| 74 | Xilinx_desc fpga[CONFIG_FPGA_COUNT] = { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 75 | {Xilinx_Virtex2, |
| 76 | slave_selectmap, |
| 77 | XILINX_XC2V3000_SIZE, |
| 78 | (void *) &fpga_fns, |
| 79 | 0} |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 80 | }; |
| 81 | |
| 82 | /* |
| 83 | * Display FPGA revision information |
| 84 | */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 85 | void print_fpga_revision (void) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 86 | { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 87 | vu_long *rev_p = (vu_long *) 0x60000008; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 88 | |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 89 | printf ("FPGA Revision 0x%.8lx" |
| 90 | " (Date %.2lx/%.2lx/%.2lx, Status \"%.1lx\", Version %.3lu)\n", |
| 91 | *rev_p, |
| 92 | ((*rev_p >> 28) & 0xf), |
| 93 | ((*rev_p >> 20) & 0xff), |
| 94 | ((*rev_p >> 12) & 0xff), |
| 95 | ((*rev_p >> 8) & 0xf), (*rev_p & 0xff)); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | |
| 99 | /* |
| 100 | * Perform a simple test of the FPGA to processor interface using the FPGA's |
| 101 | * inverting bus test register. The great thing about doing a read/write |
| 102 | * test on a register that inverts it's contents is that you avoid any |
| 103 | * problems with bus charging. |
| 104 | * Return 0 on failure, 1 on success. |
| 105 | */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 106 | int test_fpga_ibtr (void) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 107 | { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 108 | vu_long *ibtr_p = (vu_long *) 0x60000010; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 109 | vu_long readback; |
| 110 | vu_long compare; |
| 111 | int i; |
| 112 | int j; |
| 113 | int k; |
| 114 | int pass = 1; |
| 115 | |
| 116 | static const ulong bitpattern[] = { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 117 | 0xdeadbeef, /* magic ID pattern for debug */ |
| 118 | 0x00000001, /* single bit */ |
| 119 | 0x00000003, /* two adjacent bits */ |
| 120 | 0x00000007, /* three adjacent bits */ |
| 121 | 0x0000000F, /* four adjacent bits */ |
| 122 | 0x00000005, /* two non-adjacent bits */ |
| 123 | 0x00000015, /* three non-adjacent bits */ |
| 124 | 0x00000055, /* four non-adjacent bits */ |
| 125 | 0xaaaaaaaa, /* alternating 1/0 */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 126 | }; |
| 127 | |
| 128 | for (i = 0; i < 1024; i++) { |
| 129 | for (j = 0; j < 31; j++) { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 130 | for (k = 0; |
| 131 | k < sizeof (bitpattern) / sizeof (bitpattern[0]); |
| 132 | k++) { |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 133 | *ibtr_p = compare = (bitpattern[k] << j); |
| 134 | readback = *ibtr_p; |
| 135 | if (readback != ~compare) { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 136 | printf ("%s:%d: FPGA test fail: expected 0x%.8lx" " actual 0x%.8lx\n", __FUNCTION__, __LINE__, ~compare, readback); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 137 | pass = 0; |
| 138 | break; |
| 139 | } |
| 140 | } |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 141 | if (!pass) |
| 142 | break; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 143 | } |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 144 | if (!pass) |
| 145 | break; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 146 | } |
| 147 | if (pass) { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 148 | printf ("FPGA inverting bus test passed\n"); |
| 149 | print_fpga_revision (); |
| 150 | } else { |
| 151 | printf ("** FPGA inverting bus test failed\n"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 152 | } |
| 153 | return pass; |
| 154 | } |
| 155 | |
| 156 | |
| 157 | /* |
| 158 | * Set the active-low FPGA reset signal. |
| 159 | */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 160 | void fpga_reset (int assert) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 161 | { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 162 | volatile immap_t *immap = (immap_t *) CFG_IMMR; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 163 | |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 164 | PRINTF ("%s:%d: RESET ", __FUNCTION__, __LINE__); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 165 | if (assert) { |
| 166 | immap->im_ioport.iop_pcdat &= ~(0x8000 >> FPGA_RESET_BIT_NUM); |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 167 | PRINTF ("asserted\n"); |
| 168 | } else { |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 169 | immap->im_ioport.iop_pcdat |= (0x8000 >> FPGA_RESET_BIT_NUM); |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 170 | PRINTF ("deasserted\n"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 171 | } |
| 172 | } |
| 173 | |
| 174 | |
| 175 | /* |
| 176 | * Initialize the SelectMap interface. We assume that the mode and the |
| 177 | * initial state of all of the port pins have already been set! |
| 178 | */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 179 | void fpga_selectmap_init (void) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 180 | { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 181 | PRINTF ("%s:%d: Initialize SelectMap interface\n", __FUNCTION__, |
| 182 | __LINE__); |
| 183 | fpga_pgm_fn (FALSE, FALSE, 0); /* make sure program pin is inactive */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 184 | } |
| 185 | |
| 186 | |
| 187 | /* |
| 188 | * Initialize the fpga. Return 1 on success, 0 on failure. |
| 189 | */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 190 | int gen860t_init_fpga (void) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 191 | { |
| 192 | DECLARE_GLOBAL_DATA_PTR; |
| 193 | |
| 194 | int i; |
| 195 | |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 196 | PRINTF ("%s:%d: Initialize FPGA interface (relocation offset = 0x%.8lx)\n", __FUNCTION__, __LINE__, gd->reloc_off); |
| 197 | fpga_init (gd->reloc_off); |
| 198 | fpga_selectmap_init (); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 199 | |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 200 | for (i = 0; i < CONFIG_FPGA_COUNT; i++) { |
| 201 | PRINTF ("%s:%d: Adding fpga %d\n", __FUNCTION__, __LINE__, i); |
| 202 | fpga_add (fpga_xilinx, &fpga[i]); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 203 | } |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 204 | return 1; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 205 | } |
| 206 | |
| 207 | |
| 208 | /* |
| 209 | * Set the FPGA's active-low SelectMap program line to the specified level |
| 210 | */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 211 | int fpga_pgm_fn (int assert, int flush, int cookie) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 212 | { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 213 | volatile immap_t *immap = (immap_t *) CFG_IMMR; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 214 | |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 215 | PRINTF ("%s:%d: FPGA PROGRAM ", __FUNCTION__, __LINE__); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 216 | |
| 217 | if (assert) { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 218 | immap->im_ioport.iop_padat &= |
| 219 | ~(0x8000 >> FPGA_PROGRAM_BIT_NUM); |
| 220 | PRINTF ("asserted\n"); |
| 221 | } else { |
| 222 | immap->im_ioport.iop_padat |= |
| 223 | (0x8000 >> FPGA_PROGRAM_BIT_NUM); |
| 224 | PRINTF ("deasserted\n"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 225 | } |
| 226 | return assert; |
| 227 | } |
| 228 | |
| 229 | |
| 230 | /* |
| 231 | * Test the state of the active-low FPGA INIT line. Return 1 on INIT |
| 232 | * asserted (low). |
| 233 | */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 234 | int fpga_init_fn (int cookie) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 235 | { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 236 | volatile immap_t *immap = (immap_t *) CFG_IMMR; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 237 | |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 238 | PRINTF ("%s:%d: INIT check... ", __FUNCTION__, __LINE__); |
| 239 | if (immap->im_cpm.cp_pbdat & (0x80000000 >> FPGA_INIT_BIT_NUM)) { |
| 240 | PRINTF ("high\n"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 241 | return 0; |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 242 | } else { |
| 243 | PRINTF ("low\n"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 244 | return 1; |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | |
| 249 | /* |
| 250 | * Test the state of the active-high FPGA DONE pin |
| 251 | */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 252 | int fpga_done_fn (int cookie) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 253 | { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 254 | volatile immap_t *immap = (immap_t *) CFG_IMMR; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 255 | |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 256 | PRINTF ("%s:%d: DONE check... ", __FUNCTION__, __LINE__); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 257 | if (immap->im_cpm.cp_pbdat & (0x80000000 >> FPGA_DONE_BIT_NUM)) { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 258 | PRINTF ("high\n"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 259 | return FPGA_SUCCESS; |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 260 | } else { |
| 261 | PRINTF ("low\n"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 262 | return FPGA_FAIL; |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | |
| 267 | /* |
| 268 | * Read FPGA SelectMap data. |
| 269 | */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 270 | int fpga_read_data_fn (unsigned char *data, int cookie) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 271 | { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 272 | vu_char *p = (vu_char *) SELECTMAP_BASE; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 273 | |
| 274 | *data = *p; |
| 275 | #if 0 |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 276 | PRINTF ("%s: Read 0x%x into 0x%p\n", __FUNCTION__, (int) data, data); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 277 | #endif |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 278 | return (int) data; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 279 | } |
| 280 | |
| 281 | |
| 282 | /* |
| 283 | * Write data to the FPGA SelectMap port |
| 284 | */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 285 | int fpga_write_data_fn (unsigned char data, int flush, int cookie) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 286 | { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 287 | vu_char *p = (vu_char *) SELECTMAP_BASE; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 288 | |
| 289 | #if 0 |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 290 | PRINTF ("%s: Write Data 0x%x\n", __FUNCTION__, (int) data); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 291 | #endif |
| 292 | *p = data; |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 293 | return (int) data; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 294 | } |
| 295 | |
| 296 | |
| 297 | /* |
| 298 | * Abort and FPGA operation |
| 299 | */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 300 | int fpga_abort_fn (int cookie) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 301 | { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 302 | PRINTF ("%s:%d: FPGA program sequence aborted\n", |
| 303 | __FUNCTION__, __LINE__); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 304 | return FPGA_FAIL; |
| 305 | } |
| 306 | |
| 307 | |
| 308 | /* |
| 309 | * FPGA pre-configuration function. Just make sure that |
| 310 | * FPGA reset is asserted to keep the FPGA from starting up after |
| 311 | * configuration. |
| 312 | */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 313 | int fpga_pre_config_fn (int cookie) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 314 | { |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 315 | PRINTF ("%s:%d: FPGA pre-configuration\n", __FUNCTION__, __LINE__); |
| 316 | fpga_reset (TRUE); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 317 | return 0; |
| 318 | } |
| 319 | |
| 320 | |
| 321 | /* |
| 322 | * FPGA post configuration function. Blip the FPGA reset line and then see if |
| 323 | * the FPGA appears to be running. |
| 324 | */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 325 | int fpga_post_config_fn (int cookie) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 326 | { |
| 327 | int rc; |
| 328 | |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 329 | PRINTF ("%s:%d: FPGA post configuration\n", __FUNCTION__, __LINE__); |
| 330 | fpga_reset (TRUE); |
| 331 | udelay (1000); |
| 332 | fpga_reset (FALSE); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 333 | udelay (1000); |
| 334 | |
| 335 | /* |
| 336 | * Use the FPGA,s inverting bus test register to do a simple test of the |
| 337 | * processor interface. |
| 338 | */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 339 | rc = test_fpga_ibtr (); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 340 | return rc; |
| 341 | } |
| 342 | |
| 343 | |
| 344 | /* |
| 345 | * Clock, chip select and write signal assert functions and error check |
| 346 | * and busy functions. These are only stubs because the GEN860T selectmap |
| 347 | * interface handles sequencing of control signals automatically (it uses |
| 348 | * a memory-mapped interface to the FPGA SelectMap port). The design of |
| 349 | * the interface guarantees that the SelectMap port cannot be overrun so |
| 350 | * no busy check is needed. A configuration error is signalled by INIT |
| 351 | * going low during configuration, so there is no need for a separate error |
| 352 | * function. |
| 353 | */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 354 | int fpga_clk_fn (int assert_clk, int flush, int cookie) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 355 | { |
| 356 | return assert_clk; |
| 357 | } |
| 358 | |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 359 | int fpga_cs_fn (int assert_cs, int flush, int cookie) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 360 | { |
| 361 | return assert_cs; |
| 362 | } |
| 363 | |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 364 | int fpga_wr_fn (int assert_write, int flush, int cookie) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 365 | { |
| 366 | return assert_write; |
| 367 | } |
| 368 | |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 369 | int fpga_err_fn (int cookie) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 370 | { |
| 371 | return 0; |
| 372 | } |
| 373 | |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 374 | int fpga_busy_fn (int cookie) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 375 | { |
| 376 | return 0; |
| 377 | } |
| 378 | #endif |
| 379 | |
| 380 | /* vim: set ts=4 tw=78 sw=4: */ |