cycx_drv.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * cycx_drv.h CYCX Support Module. Kernel API Definitions.
  3. *
  4. * Author: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
  5. *
  6. * Copyright: (c) 1998-2003 Arnaldo Carvalho de Melo
  7. *
  8. * Based on sdladrv.h by Gene Kozin <genek@compuserve.com>
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License
  12. * as published by the Free Software Foundation; either version
  13. * 2 of the License, or (at your option) any later version.
  14. * ============================================================================
  15. * 1999/10/23 acme cycxhw_t cleanup
  16. * 1999/01/03 acme more judicious use of data types...
  17. * uclong, ucchar, etc deleted, the u8, u16, u32
  18. * types are the portable way to go.
  19. * 1999/01/03 acme judicious use of data types... u16, u32, etc
  20. * 1998/12/26 acme FIXED_BUFFERS, CONF_OFFSET,
  21. * removal of cy_read{bwl}
  22. * 1998/08/08 acme Initial version.
  23. */
  24. #ifndef _CYCX_DRV_H
  25. #define _CYCX_DRV_H
  26. #define CYCX_WINDOWSIZE 0x4000 /* default dual-port memory window size */
  27. #define GEN_CYCX_INTR 0x02
  28. #define RST_ENABLE 0x04
  29. #define START_CPU 0x06
  30. #define RST_DISABLE 0x08
  31. #define FIXED_BUFFERS 0x08
  32. #define TEST_PATTERN 0xaa55
  33. #define CMD_OFFSET 0x20
  34. #define CONF_OFFSET 0x0380
  35. #define RESET_OFFSET 0x3c00 /* For reset file load */
  36. #define DATA_OFFSET 0x0100 /* For code and data files load */
  37. #define START_OFFSET 0x3ff0 /* 80186 starts here */
  38. /**
  39. * struct cycx_hw - Adapter hardware configuration
  40. * @fwid - firmware ID
  41. * @irq - interrupt request level
  42. * @dpmbase - dual-port memory base
  43. * @dpmsize - dual-port memory size
  44. * @reserved - reserved for future use
  45. */
  46. struct cycx_hw {
  47. u32 fwid;
  48. int irq;
  49. void __iomem *dpmbase;
  50. u32 dpmsize;
  51. u32 reserved[5];
  52. };
  53. /* Function Prototypes */
  54. extern int cycx_setup(struct cycx_hw *hw, void *sfm, u32 len, unsigned long base);
  55. extern int cycx_down(struct cycx_hw *hw);
  56. extern int cycx_peek(struct cycx_hw *hw, u32 addr, void *buf, u32 len);
  57. extern int cycx_poke(struct cycx_hw *hw, u32 addr, void *buf, u32 len);
  58. extern int cycx_exec(void __iomem *addr);
  59. extern void cycx_intr(struct cycx_hw *hw);
  60. #endif /* _CYCX_DRV_H */