summaryrefslogtreecommitdiffstats
path: root/include/asm-m68k/mac_psc.h
blob: de22bbefe590c282741adfec872cde7c97e68532 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
 *	Apple Peripheral System Controller (PSC)
 *
 *	The PSC is used on the AV Macs to control IO functions not handled
 *	by the VIAs (Ethernet, DSP, SCC).
 */
 
#define PSCBASE		0x50F31000

/*
 *	The IER/IFR registers work like the VIA, except that it has 4
 *	of them each on different interrupt levels.
 */
 
#define pIFR3		0x130
#define pIFR4		0x140
#define pIFR5		0x150
#define pIFR6		0x160

#define pIER3		0x134
#define pIER4		0x144
#define pIER5		0x154
#define pIER6		0x164

/*
 *	Ethernet Control Registers
 */
 
#define PSC_ENETRD_CTL  0xc10
#define PSC_ENETWR_CTL  0xc20

/*
 *	Receive DMA channel (add +0x10 for 2nd channel)
 */
 
#define PSC_ENETRD_ADDR 0x1020 
#define PSC_ENETRD_LEN  0x1024
#define PSC_ENETRD_CMD  0x1028

/*
 *	Transmit DMA channel (add +0x10 for 2nd channel)
 */
 
#define PSC_ENETWR_ADDR 0x1040
#define PSC_ENETWR_LEN  0x1044
#define PSC_ENETWR_CMD  0x1048

/*
 *	Access functions
 */
 
extern volatile unsigned char *psc;

extern inline void psc_write_word(int offset, u16 data)
{
	*((volatile u16 *)(psc+offset)) = data;
}

extern inline void psc_write_long(int offset, u32 data)
{
	*((volatile u32 *)(psc+offset)) = data;
}

extern inline u16 psc_read_word(int offset)
{
	return *((volatile u16 *)(psc+offset));
}

extern inline u32 psc_read_long(int offset)
{
	return *((volatile u32 *)(psc+offset));
}