xref: /openbmc/linux/arch/arm/mach-rpc/ecard.h (revision bef7a78d)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  *  ecard.h
4  *
5  *  Copyright 2007 Russell King
6  */
7 
8 /* Definitions internal to ecard.c - for it's use only!!
9  *
10  * External expansion card header as read from the card
11  */
12 struct ex_ecid {
13 	unsigned char	r_irq:1;
14 	unsigned char	r_zero:1;
15 	unsigned char	r_fiq:1;
16 	unsigned char	r_id:4;
17 	unsigned char	r_a:1;
18 
19 	unsigned char	r_cd:1;
20 	unsigned char	r_is:1;
21 	unsigned char	r_w:2;
22 	unsigned char	r_r1:4;
23 
24 	unsigned char	r_r2:8;
25 
26 	unsigned char	r_prod[2];
27 
28 	unsigned char	r_manu[2];
29 
30 	unsigned char	r_country;
31 
32 	unsigned char	r_fiqmask;
33 	unsigned char	r_fiqoff[3];
34 
35 	unsigned char	r_irqmask;
36 	unsigned char	r_irqoff[3];
37 };
38 
39 /*
40  * Chunk directory entry as read from the card
41  */
42 struct ex_chunk_dir {
43 	unsigned char r_id;
44 	unsigned char r_len[3];
45 	unsigned long r_start;
46 	union {
47 		char string[256];
48 		char data[1];
49 	} d;
50 #define c_id(x)		((x)->r_id)
51 #define c_len(x)	((x)->r_len[0]|((x)->r_len[1]<<8)|((x)->r_len[2]<<16))
52 #define c_start(x)	((x)->r_start)
53 };
54 
55 typedef enum ecard_type {		/* Cards address space		*/
56 	ECARD_IOC,
57 	ECARD_MEMC,
58 	ECARD_EASI
59 } card_type_t;
60 
61 typedef enum {				/* Speed for ECARD_IOC space	*/
62 	ECARD_SLOW	 = 0,
63 	ECARD_MEDIUM	 = 1,
64 	ECARD_FAST	 = 2,
65 	ECARD_SYNC	 = 3
66 } card_speed_t;
67