Home | History | Annotate | Line # | Download | only in amiga
      1 /*	$NetBSD: gayle.h,v 1.3 2014/01/03 00:33:06 rkujawa Exp $	*/
      2 #ifndef AMIGA_GAYLE_H_
      3 #define AMIGA_GAYLE_H_
      4 
      5 #include <sys/types.h>
      6 
      7 #define GAYLE_IDE_BASE          0xDA0000
      8 #define GAYLE_IDE_BASE_A4000	0xDD2020
      9 #define GAYLE_IDE_INTREQ_A4000		0x1000	/* with stride of 1 */
     10 
     11 #define GAYLE_REGS_BASE		0xDA8000
     12 
     13 #define GAYLE_PCC_STATUS		0x0
     14 
     15 /* Depending on the mode the card is in, most of the bits have different
     16    meanings */
     17 #define GAYLE_CCMEM_DETECT			__BIT(6)
     18 #define GAYLE_CCMEM_BVD1			__BIT(5)
     19 #define GAYLE_CCMEM_BVD2			__BIT(4)
     20 #define GAYLE_CCMEM_WP				__BIT(3)
     21 #define GAYLE_CCMEM_BUSY			__BIT(2)
     22 
     23 #define GAYLE_CCIO_STSCHG			__BIT(5)
     24 #define GAYLE_CCIO_SPKR				__BIT(4)
     25 #define GAYLE_CCIO_IREQ				__BIT(2)
     26 
     27 #define GAYLE_INTREQ			0x1 /* 0x1000 */
     28 #define GAYLE_INTENA			0x2 /* 0x2000 */
     29 
     30 #define GAYLE_INT_IDE				__BIT(7)
     31 #define GAYLE_INT_DETECT			__BIT(6)
     32 #define GAYLE_INT_BVD1				__BIT(5)
     33 #define GAYLE_INT_STSCHG			__BIT(5)
     34 #define GAYLE_INT_BVD2				__BIT(4)
     35 #define GAYLE_INT_SPKR				__BIT(4)
     36 #define GAYLE_INT_WP				__BIT(3)
     37 #define GAYLE_INT_BUSY				__BIT(2)
     38 #define GAYLE_INT_IREQ				__BIT(2)
     39 #define GAYLE_INT_IDEACK0			__BIT(1)
     40 #define GAYLE_INT_IDEACK1			__BIT(0)
     41 
     42 #define GAYLE_INT_IDEACK			(GAYLE_INT_IDEACK0 | GAYLE_INT_IDEACK1)
     43 
     44 #define GAYLE_PCC_CONFIG		0x3 /* 0x3000 */
     45 
     46 #define GAYLE_PCMCIA_START	0xA00000
     47 #define GAYLE_PCMCIA_ATTR_START	0xA00000
     48 #define GAYLE_PCMCIA_ATTR_END	0xA20000
     49 
     50 #define GAYLE_PCMCIA_IO_START	0xA20000
     51 #define GAYLE_PCMCIA_IO_END	0xA40000
     52 
     53 #define GAYLE_PCMCIA_RESET	0xA40000
     54 #define GAYLE_PCMCIA_END	0xA42000
     55 #define NPCMCIAPG		btoc(GAYLE_PCMCIA_END - GAYLE_PCMCIA_START)
     56 
     57 /*
     58  * Convenience functions for expansions that have Gayle and even those that
     59  * don't have real Gayle but have implemented some portions of it for the sake
     60  * of compatibility.
     61  */
     62 void gayle_init(void);
     63 uint8_t gayle_intr_status(void);
     64 uint8_t gayle_intr_enable_read(void);
     65 void gayle_intr_enable_write(uint8_t);
     66 void gayle_intr_enable_set(uint8_t);
     67 void gayle_intr_ack(uint8_t);
     68 uint8_t gayle_pcmcia_status_read(void);
     69 void gayle_pcmcia_status_write(uint8_t);
     70 uint8_t gayle_pcmcia_config_read(void);
     71 void gayle_pcmcia_config_write(uint8_t);
     72 
     73 #endif /* AMIGA_GAYLE_H_ */
     74