1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#ifndef __IBM_NEWEMAC_TAH_H
23#define __IBM_NEWEMAC_TAH_H
24
25
26struct tah_regs {
27 u32 revid;
28 u32 pad[3];
29 u32 mr;
30 u32 ssr0;
31 u32 ssr1;
32 u32 ssr2;
33 u32 ssr3;
34 u32 ssr4;
35 u32 ssr5;
36 u32 tsr;
37};
38
39
40
41struct tah_instance {
42 struct tah_regs __iomem *base;
43
44
45 struct mutex lock;
46
47
48 int users;
49
50
51 struct of_device *ofdev;
52};
53
54
55
56#define TAH_MR_CVR 0x80000000
57#define TAH_MR_SR 0x40000000
58#define TAH_MR_ST_256 0x01000000
59#define TAH_MR_ST_512 0x02000000
60#define TAH_MR_ST_768 0x03000000
61#define TAH_MR_ST_1024 0x04000000
62#define TAH_MR_ST_1280 0x05000000
63#define TAH_MR_ST_1536 0x06000000
64#define TAH_MR_TFS_16KB 0x00000000
65#define TAH_MR_TFS_2KB 0x00200000
66#define TAH_MR_TFS_4KB 0x00400000
67#define TAH_MR_TFS_6KB 0x00600000
68#define TAH_MR_TFS_8KB 0x00800000
69#define TAH_MR_TFS_10KB 0x00a00000
70#define TAH_MR_DTFP 0x00100000
71#define TAH_MR_DIG 0x00080000
72
73#ifdef CONFIG_IBM_NEW_EMAC_TAH
74
75extern int tah_init(void);
76extern void tah_exit(void);
77extern int tah_attach(struct of_device *ofdev, int channel);
78extern void tah_detach(struct of_device *ofdev, int channel);
79extern void tah_reset(struct of_device *ofdev);
80extern int tah_get_regs_len(struct of_device *ofdev);
81extern void *tah_dump_regs(struct of_device *ofdev, void *buf);
82
83#else
84
85# define tah_init() 0
86# define tah_exit() do { } while(0)
87# define tah_attach(x,y) (-ENXIO)
88# define tah_detach(x,y) do { } while(0)
89# define tah_reset(x) do { } while(0)
90# define tah_get_regs_len(x) 0
91# define tah_dump_regs(x,buf) (buf)
92
93#endif
94
95#endif
96