18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci** asm-m68k/pcmcia.h -- Amiga Linux PCMCIA Definitions
38c2ecf20Sopenharmony_ci**
48c2ecf20Sopenharmony_ci** Copyright 1997 by Alain Malek
58c2ecf20Sopenharmony_ci**
68c2ecf20Sopenharmony_ci** This file is subject to the terms and conditions of the GNU General Public
78c2ecf20Sopenharmony_ci** License.  See the file COPYING in the main directory of this archive
88c2ecf20Sopenharmony_ci** for more details.
98c2ecf20Sopenharmony_ci**
108c2ecf20Sopenharmony_ci** Created: 12/10/97 by Alain Malek
118c2ecf20Sopenharmony_ci*/
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#ifndef __AMIGA_PCMCIA_H__
148c2ecf20Sopenharmony_ci#define __AMIGA_PCMCIA_H__
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#include <asm/amigayle.h>
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci/* prototypes */
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_civoid pcmcia_reset(void);
218c2ecf20Sopenharmony_ciint pcmcia_copy_tuple(unsigned char tuple_id, void *tuple, int max_len);
228c2ecf20Sopenharmony_civoid pcmcia_program_voltage(int voltage);
238c2ecf20Sopenharmony_civoid pcmcia_access_speed(int speed);
248c2ecf20Sopenharmony_civoid pcmcia_write_enable(void);
258c2ecf20Sopenharmony_civoid pcmcia_write_disable(void);
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_cistatic inline u_char pcmcia_read_status(void)
288c2ecf20Sopenharmony_ci{
298c2ecf20Sopenharmony_ci	return (gayle.cardstatus & 0x7c);
308c2ecf20Sopenharmony_ci}
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_cistatic inline u_char pcmcia_get_intreq(void)
338c2ecf20Sopenharmony_ci{
348c2ecf20Sopenharmony_ci	return (gayle.intreq);
358c2ecf20Sopenharmony_ci}
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_cistatic inline void pcmcia_ack_int(u_char intreq)
388c2ecf20Sopenharmony_ci{
398c2ecf20Sopenharmony_ci	gayle.intreq = 0xf8;
408c2ecf20Sopenharmony_ci}
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_cistatic inline void pcmcia_enable_irq(void)
438c2ecf20Sopenharmony_ci{
448c2ecf20Sopenharmony_ci	gayle.inten |= GAYLE_IRQ_IRQ;
458c2ecf20Sopenharmony_ci}
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_cistatic inline void pcmcia_disable_irq(void)
488c2ecf20Sopenharmony_ci{
498c2ecf20Sopenharmony_ci	gayle.inten &= ~GAYLE_IRQ_IRQ;
508c2ecf20Sopenharmony_ci}
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#define PCMCIA_INSERTED	(gayle.cardstatus & GAYLE_CS_CCDET)
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci/* valid voltages for pcmcia_ProgramVoltage */
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci#define PCMCIA_0V	0
578c2ecf20Sopenharmony_ci#define PCMCIA_5V	5
588c2ecf20Sopenharmony_ci#define PCMCIA_12V	12
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci/* valid speeds for pcmcia_AccessSpeed */
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci#define PCMCIA_SPEED_100NS	100
638c2ecf20Sopenharmony_ci#define PCMCIA_SPEED_150NS	150
648c2ecf20Sopenharmony_ci#define PCMCIA_SPEED_250NS	250
658c2ecf20Sopenharmony_ci#define PCMCIA_SPEED_720NS	720
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci/* PCMCIA Tuple codes */
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci#define CISTPL_NULL		0x00
708c2ecf20Sopenharmony_ci#define CISTPL_DEVICE		0x01
718c2ecf20Sopenharmony_ci#define CISTPL_LONGLINK_CB	0x02
728c2ecf20Sopenharmony_ci#define CISTPL_CONFIG_CB	0x04
738c2ecf20Sopenharmony_ci#define CISTPL_CFTABLE_ENTRY_CB	0x05
748c2ecf20Sopenharmony_ci#define CISTPL_LONGLINK_MFC	0x06
758c2ecf20Sopenharmony_ci#define CISTPL_BAR		0x07
768c2ecf20Sopenharmony_ci#define CISTPL_CHECKSUM		0x10
778c2ecf20Sopenharmony_ci#define CISTPL_LONGLINK_A	0x11
788c2ecf20Sopenharmony_ci#define CISTPL_LONGLINK_C	0x12
798c2ecf20Sopenharmony_ci#define CISTPL_LINKTARGET	0x13
808c2ecf20Sopenharmony_ci#define CISTPL_NO_LINK		0x14
818c2ecf20Sopenharmony_ci#define CISTPL_VERS_1		0x15
828c2ecf20Sopenharmony_ci#define CISTPL_ALTSTR		0x16
838c2ecf20Sopenharmony_ci#define CISTPL_DEVICE_A		0x17
848c2ecf20Sopenharmony_ci#define CISTPL_JEDEC_C		0x18
858c2ecf20Sopenharmony_ci#define CISTPL_JEDEC_A		0x19
868c2ecf20Sopenharmony_ci#define CISTPL_CONFIG		0x1a
878c2ecf20Sopenharmony_ci#define CISTPL_CFTABLE_ENTRY	0x1b
888c2ecf20Sopenharmony_ci#define CISTPL_DEVICE_OC	0x1c
898c2ecf20Sopenharmony_ci#define CISTPL_DEVICE_OA	0x1d
908c2ecf20Sopenharmony_ci#define CISTPL_DEVICE_GEO	0x1e
918c2ecf20Sopenharmony_ci#define CISTPL_DEVICE_GEO_A	0x1f
928c2ecf20Sopenharmony_ci#define CISTPL_MANFID		0x20
938c2ecf20Sopenharmony_ci#define CISTPL_FUNCID		0x21
948c2ecf20Sopenharmony_ci#define CISTPL_FUNCE		0x22
958c2ecf20Sopenharmony_ci#define CISTPL_SWIL		0x23
968c2ecf20Sopenharmony_ci#define CISTPL_END		0xff
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci/* FUNCID */
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci#define CISTPL_FUNCID_MULTI	0x00
1018c2ecf20Sopenharmony_ci#define CISTPL_FUNCID_MEMORY	0x01
1028c2ecf20Sopenharmony_ci#define CISTPL_FUNCID_SERIAL	0x02
1038c2ecf20Sopenharmony_ci#define CISTPL_FUNCID_PARALLEL	0x03
1048c2ecf20Sopenharmony_ci#define CISTPL_FUNCID_FIXED	0x04
1058c2ecf20Sopenharmony_ci#define CISTPL_FUNCID_VIDEO	0x05
1068c2ecf20Sopenharmony_ci#define CISTPL_FUNCID_NETWORK	0x06
1078c2ecf20Sopenharmony_ci#define CISTPL_FUNCID_AIMS	0x07
1088c2ecf20Sopenharmony_ci#define CISTPL_FUNCID_SCSI	0x08
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci#endif
111