amigayle.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. ** asm-m68k/amigayle.h -- This header defines the registers of the gayle chip
  3. ** found on the Amiga 1200
  4. ** This information was found by disassembling card.resource,
  5. ** so the definitions may not be 100% correct
  6. ** anyone has an official doc ?
  7. **
  8. ** Copyright 1997 by Alain Malek
  9. **
  10. ** This file is subject to the terms and conditions of the GNU General Public
  11. ** License. See the file COPYING in the main directory of this archive
  12. ** for more details.
  13. **
  14. ** Created: 11/28/97 by Alain Malek
  15. */
  16. #ifndef _M68K_AMIGAYLE_H_
  17. #define _M68K_AMIGAYLE_H_
  18. #include <linux/types.h>
  19. #include <asm/amigahw.h>
  20. /* memory layout */
  21. #define GAYLE_RAM (0x600000+zTwoBase)
  22. #define GAYLE_RAMSIZE (0x400000)
  23. #define GAYLE_ATTRIBUTE (0xa00000+zTwoBase)
  24. #define GAYLE_ATTRIBUTESIZE (0x020000)
  25. #define GAYLE_IO (0xa20000+zTwoBase) /* 16bit and even 8bit registers */
  26. #define GAYLE_IOSIZE (0x010000)
  27. #define GAYLE_IO_8BITODD (0xa30000+zTwoBase) /* odd 8bit registers */
  28. /* offset for accessing odd IO registers */
  29. #define GAYLE_ODD (GAYLE_IO_8BITODD-GAYLE_IO-1)
  30. /* GAYLE registers */
  31. struct GAYLE {
  32. u_char cardstatus;
  33. u_char pad0[0x1000-1];
  34. u_char intreq;
  35. u_char pad1[0x1000-1];
  36. u_char inten;
  37. u_char pad2[0x1000-1];
  38. u_char config;
  39. u_char pad3[0x1000-1];
  40. };
  41. #define GAYLE_ADDRESS (0xda8000) /* gayle main registers base address */
  42. #define GAYLE_RESET (0xa40000) /* write 0x00 to start reset,
  43. read 1 byte to stop reset */
  44. #define gayle (*(volatile struct GAYLE *)(zTwoBase+GAYLE_ADDRESS))
  45. #define gayle_reset (*(volatile u_char *)(zTwoBase+GAYLE_RESET))
  46. #define gayle_attribute ((volatile u_char *)(GAYLE_ATTRIBUTE))
  47. #if 0
  48. #define gayle_inb(a) readb( GAYLE_IO+(a)+(((a)&1)*GAYLE_ODD) )
  49. #define gayle_outb(v,a) writeb( v, GAYLE_IO+(a)+(((a)&1)*GAYLE_ODD) )
  50. #define gayle_inw(a) readw( GAYLE_IO+(a) )
  51. #define gayle_outw(v,a) writew( v, GAYLE_IO+(a) )
  52. #endif
  53. /* GAYLE_CARDSTATUS bit def */
  54. #define GAYLE_CS_CCDET 0x40 /* credit card detect */
  55. #define GAYLE_CS_BVD1 0x20 /* battery voltage detect 1 */
  56. #define GAYLE_CS_SC 0x20 /* credit card status change */
  57. #define GAYLE_CS_BVD2 0x10 /* battery voltage detect 2 */
  58. #define GAYLE_CS_DA 0x10 /* digital audio */
  59. #define GAYLE_CS_WR 0x08 /* write enable (1 == enabled) */
  60. #define GAYLE_CS_BSY 0x04 /* credit card busy */
  61. #define GAYLE_CS_IRQ 0x04 /* interrupt request */
  62. /* GAYLE_IRQ bit def */
  63. #define GAYLE_IRQ_IDE 0x80
  64. #define GAYLE_IRQ_CCDET 0x40
  65. #define GAYLE_IRQ_BVD1 0x20
  66. #define GAYLE_IRQ_SC 0x20
  67. #define GAYLE_IRQ_BVD2 0x10
  68. #define GAYLE_IRQ_DA 0x10
  69. #define GAYLE_IRQ_WR 0x08
  70. #define GAYLE_IRQ_BSY 0x04
  71. #define GAYLE_IRQ_IRQ 0x04
  72. #define GAYLE_IRQ_IDEACK1 0x02
  73. #define GAYLE_IRQ_IDEACK0 0x01
  74. /* GAYLE_CONFIG bit def
  75. (bit 0-1 for program voltage, bit 2-3 for access speed */
  76. #define GAYLE_CFG_0V 0x00
  77. #define GAYLE_CFG_5V 0x01
  78. #define GAYLE_CFG_12V 0x02
  79. #define GAYLE_CFG_100NS 0x08
  80. #define GAYLE_CFG_150NS 0x04
  81. #define GAYLE_CFG_250NS 0x00
  82. #define GAYLE_CFG_720NS 0x0c
  83. struct gayle_ide_platform_data {
  84. unsigned long base;
  85. unsigned long irqport;
  86. int explicit_ack; /* A1200 IDE needs explicit ack */
  87. };
  88. #endif /* asm-m68k/amigayle.h */