1 /* 2 * (C) Copyright 2002 3 * Rich Ireland, Enterasys Networks, rireland@enterasys.com. 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 #include <fpga.h> 26 27 #ifndef _ALTERA_H_ 28 #define _ALTERA_H_ 29 30 /* 31 * Note that this is just Altera FPGA interface boilerplate. 32 * There is no support for Altera devices yet. 33 * 34 * See include/xilinx.h for a working example. 35 */ 36 37 /* In your board's config.h file you should define CONFIG_FPGA as such: 38 * #define CONFIG_FPGA (CFG_ALTERA_xxx | CFG_ALTERA_IF_xxx ) 39 */ 40 41 /* Altera Model definitions */ 42 #define CFG_ALTERA_xxxx ( CFG_FPGA_ALTERA | CFG_FPGA_DEV( 0x1 )) 43 /* Add new models here */ 44 45 /* Altera Interface definitions */ 46 #define CFG_ALTERA_IF_xxx CFG_FPGA_IF( 0x1 ) 47 /* Add new interfaces here */ 48 49 typedef enum { /* typedef Altera_iface */ 50 min_altera_iface_type, /* insert all new types after this */ 51 /* Add new interfaces here */ 52 max_altera_iface_type /* insert all new types before this */ 53 } Altera_iface; /* end, typedef Altera_iface */ 54 55 typedef enum { /* typedef Altera_Family */ 56 min_altera_type, /* insert all new types after this */ 57 /* Add new models here */ 58 max_altera_type /* insert all new types before this */ 59 } Altera_Family; /* end, typedef Altera_Family */ 60 61 typedef struct { /* typedef Altera_desc */ 62 Altera_Family family; /* part type */ 63 Altera_iface iface; /* interface type */ 64 size_t size; /* bytes of data part can accept */ 65 void * base; /* base interface address */ 66 } Altera_desc; /* end, typedef Altera_desc */ 67 68 extern int altera_load( Altera_desc *desc, void *image, size_t size ); 69 extern int altera_dump( Altera_desc *desc, void *buf, size_t bsize ); 70 extern int altera_info( Altera_desc *desc ); 71 extern int altera_reloc( Altera_desc *desc, ulong reloc_off ); 72 73 #endif /* _ALTERA_H_ */ 74