1c609719bSwdenk /* 2c609719bSwdenk * (C) Copyright 2002 3c609719bSwdenk * Rich Ireland, Enterasys Networks, rireland@enterasys.com. 4c609719bSwdenk * Keith Outwater, keith_outwater@mvis.com 5c609719bSwdenk * 6c609719bSwdenk * See file CREDITS for list of people who contributed to this 7c609719bSwdenk * project. 8c609719bSwdenk * 9c609719bSwdenk * This program is free software; you can redistribute it and/or 10c609719bSwdenk * modify it under the terms of the GNU General Public License as 11c609719bSwdenk * published by the Free Software Foundation; either version 2 of 12c609719bSwdenk * the License, or (at your option) any later version. 13c609719bSwdenk * 14c609719bSwdenk * This program is distributed in the hope that it will be useful, 15c609719bSwdenk * but WITHOUT ANY WARRANTY; without even the implied warranty of 16c609719bSwdenk * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17c609719bSwdenk * GNU General Public License for more details. 18c609719bSwdenk * 19c609719bSwdenk * You should have received a copy of the GNU General Public License 20c609719bSwdenk * along with this program; if not, write to the Free Software 21c609719bSwdenk * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 22c609719bSwdenk * MA 02111-1307 USA 23c609719bSwdenk * 24c609719bSwdenk */ 25c609719bSwdenk 26c609719bSwdenk #ifndef _VIRTEX2_H_ 27c609719bSwdenk #define _VIRTEX2_H_ 28c609719bSwdenk 29c609719bSwdenk #include <xilinx.h> 30c609719bSwdenk 31*e6a857daSWolfgang Denk extern int Virtex2_load(Xilinx_desc *desc, const void *image, size_t size); 32*e6a857daSWolfgang Denk extern int Virtex2_dump(Xilinx_desc *desc, const void *buf, size_t bsize); 33c609719bSwdenk extern int Virtex2_info(Xilinx_desc *desc); 34c609719bSwdenk 35c609719bSwdenk /* 36c609719bSwdenk * Slave SelectMap Implementation function table. 37c609719bSwdenk */ 38c609719bSwdenk typedef struct { 39c609719bSwdenk Xilinx_pre_fn pre; 40c609719bSwdenk Xilinx_pgm_fn pgm; 41c609719bSwdenk Xilinx_init_fn init; 42c609719bSwdenk Xilinx_err_fn err; 43c609719bSwdenk Xilinx_done_fn done; 44c609719bSwdenk Xilinx_clk_fn clk; 45c609719bSwdenk Xilinx_cs_fn cs; 46c609719bSwdenk Xilinx_wr_fn wr; 47c609719bSwdenk Xilinx_rdata_fn rdata; 48c609719bSwdenk Xilinx_wdata_fn wdata; 49c609719bSwdenk Xilinx_busy_fn busy; 50c609719bSwdenk Xilinx_abort_fn abort; 51c609719bSwdenk Xilinx_post_fn post; 52c609719bSwdenk } Xilinx_Virtex2_Slave_SelectMap_fns; 53c609719bSwdenk 54c609719bSwdenk /* Slave Serial Implementation function table */ 55c609719bSwdenk typedef struct { 56c609719bSwdenk Xilinx_pgm_fn pgm; 57c609719bSwdenk Xilinx_clk_fn clk; 58c609719bSwdenk Xilinx_rdata_fn rdata; 59c609719bSwdenk Xilinx_wdata_fn wdata; 60c609719bSwdenk } Xilinx_Virtex2_Slave_Serial_fns; 61c609719bSwdenk 62c609719bSwdenk /* Device Image Sizes (in bytes) 63c609719bSwdenk *********************************************************************/ 64c609719bSwdenk #define XILINX_XC2V40_SIZE (338208 / 8) 65c609719bSwdenk #define XILINX_XC2V80_SIZE (597408 / 8) 66c609719bSwdenk #define XILINX_XC2V250_SIZE (1591584 / 8) 67c609719bSwdenk #define XILINX_XC2V500_SIZE (2557857 / 8) 68c609719bSwdenk #define XILINX_XC2V1000_SIZE (3749408 / 8) 69c609719bSwdenk #define XILINX_XC2V1500_SIZE (5166240 / 8) 70c609719bSwdenk #define XILINX_XC2V2000_SIZE (6808352 / 8) 71c609719bSwdenk #define XILINX_XC2V3000_SIZE (9589408 / 8) 72c609719bSwdenk #define XILINX_XC2V4000_SIZE (14220192 / 8) 73c609719bSwdenk #define XILINX_XC2V6000_SIZE (19752096 / 8) 74c609719bSwdenk #define XILINX_XC2V8000_SIZE (26185120 / 8) 75c609719bSwdenk #define XILINX_XC2V10000_SIZE (33519264 / 8) 76c609719bSwdenk 77c609719bSwdenk /* Descriptor Macros 78c609719bSwdenk *********************************************************************/ 79c609719bSwdenk #define XILINX_XC2V40_DESC(iface, fn_table, cookie) \ 80c609719bSwdenk { Xilinx_Virtex2, iface, XILINX_XC2V40_SIZE, fn_table, cookie } 81c609719bSwdenk 82c609719bSwdenk #define XILINX_XC2V80_DESC(iface, fn_table, cookie) \ 83c609719bSwdenk { Xilinx_Virtex2, iface, XILINX_XC2V80_SIZE, fn_table, cookie } 84c609719bSwdenk 85c609719bSwdenk #define XILINX_XC2V250_DESC(iface, fn_table, cookie) \ 86c609719bSwdenk { Xilinx_Virtex2, iface, XILINX_XC2V250_SIZE, fn_table, cookie } 87c609719bSwdenk 88c609719bSwdenk #define XILINX_XC2V500_DESC(iface, fn_table, cookie) \ 89c609719bSwdenk { Xilinx_Virtex2, iface, XILINX_XC2V500_SIZE, fn_table, cookie } 90c609719bSwdenk 91c609719bSwdenk #define XILINX_XC2V1000_DESC(iface, fn_table, cookie) \ 92c609719bSwdenk { Xilinx_Virtex2, iface, XILINX_XC2V1000_SIZE, fn_table, cookie } 93c609719bSwdenk 94c609719bSwdenk #define XILINX_XC2V1500_DESC(iface, fn_table, cookie) \ 95c609719bSwdenk { Xilinx_Virtex2, iface, XILINX_XC2V1500_SIZE, fn_table, cookie } 96c609719bSwdenk 97c609719bSwdenk #define XILINX_XC2V2000_DESC(iface, fn_table, cookie) \ 98c609719bSwdenk { Xilinx_Virtex2, iface, XILINX_XC2V2000_SIZE, fn_table, cookie } 99c609719bSwdenk 100c609719bSwdenk #define XILINX_XC2V3000_DESC(iface, fn_table, cookie) \ 101c609719bSwdenk { Xilinx_Virtex2, iface, XILINX_XC2V3000_SIZE, fn_table, cookie } 102c609719bSwdenk 103c609719bSwdenk #define XILINX_XC2V4000_DESC(iface, fn_table, cookie) \ 104c609719bSwdenk { Xilinx_Virtex2, iface, XILINX_XC2V4000_SIZE, fn_table, cookie } 105c609719bSwdenk 106c609719bSwdenk #define XILINX_XC2V6000_DESC(iface, fn_table, cookie) \ 107c609719bSwdenk { Xilinx_Virtex2, iface, XILINX_XC2V6000_SIZE, fn_table, cookie } 108c609719bSwdenk 109c609719bSwdenk #define XILINX_XC2V8000_DESC(iface, fn_table, cookie) \ 110c609719bSwdenk { Xilinx_Virtex2, iface, XILINX_XC2V8000_SIZE, fn_table, cookie } 111c609719bSwdenk 112c609719bSwdenk #define XILINX_XC2V10000_DESC(iface, fn_table, cookie) \ 113c609719bSwdenk { Xilinx_Virtex2, iface, XILINX_XC2V10000_SIZE, fn_table, cookie } 114c609719bSwdenk 115c609719bSwdenk #endif /* _VIRTEX2_H_ */ 116