altera.h 2.7 KB

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