Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
[pv_ops_mirror.git] / drivers / net / ibm_emac / ibm_emac_tah.h
blobccf64915e1e48b06d0a1c0a32e4665ea44d5a92f
1 /*
2 * drivers/net/ibm_emac/ibm_emac_tah.h
4 * Driver for PowerPC 4xx on-chip ethernet controller, TAH support.
6 * Copyright 2004 MontaVista Software, Inc.
7 * Matt Porter <mporter@kernel.crashing.org>
9 * Copyright (c) 2005 Eugene Surovegin <ebs@ebshome.net>
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
17 #ifndef _IBM_EMAC_TAH_H
18 #define _IBM_EMAC_TAH_H
20 #include <linux/init.h>
21 #include <asm/ocp.h>
23 /* TAH */
24 struct tah_regs {
25 u32 revid;
26 u32 pad[3];
27 u32 mr;
28 u32 ssr0;
29 u32 ssr1;
30 u32 ssr2;
31 u32 ssr3;
32 u32 ssr4;
33 u32 ssr5;
34 u32 tsr;
37 /* TAH engine */
38 #define TAH_MR_CVR 0x80000000
39 #define TAH_MR_SR 0x40000000
40 #define TAH_MR_ST_256 0x01000000
41 #define TAH_MR_ST_512 0x02000000
42 #define TAH_MR_ST_768 0x03000000
43 #define TAH_MR_ST_1024 0x04000000
44 #define TAH_MR_ST_1280 0x05000000
45 #define TAH_MR_ST_1536 0x06000000
46 #define TAH_MR_TFS_16KB 0x00000000
47 #define TAH_MR_TFS_2KB 0x00200000
48 #define TAH_MR_TFS_4KB 0x00400000
49 #define TAH_MR_TFS_6KB 0x00600000
50 #define TAH_MR_TFS_8KB 0x00800000
51 #define TAH_MR_TFS_10KB 0x00a00000
52 #define TAH_MR_DTFP 0x00100000
53 #define TAH_MR_DIG 0x00080000
55 #ifdef CONFIG_IBM_EMAC_TAH
56 int tah_attach(void *emac) __init;
58 void __tah_fini(struct ocp_device *ocpdev);
59 static inline void tah_fini(struct ocp_device *ocpdev)
61 if (ocpdev)
62 __tah_fini(ocpdev);
65 void __tah_reset(struct ocp_device *ocpdev);
66 static inline void tah_reset(struct ocp_device *ocpdev)
68 if (ocpdev)
69 __tah_reset(ocpdev);
72 int __tah_get_regs_len(struct ocp_device *ocpdev);
73 static inline int tah_get_regs_len(struct ocp_device *ocpdev)
75 return ocpdev ? __tah_get_regs_len(ocpdev) : 0;
78 void *tah_dump_regs(struct ocp_device *ocpdev, void *buf);
79 #else
80 # define tah_attach(x) 0
81 # define tah_fini(x) ((void)0)
82 # define tah_reset(x) ((void)0)
83 # define tah_get_regs_len(x) 0
84 # define tah_dump_regs(x,buf) (buf)
85 #endif /* !CONFIG_IBM_EMAC_TAH */
87 #endif /* _IBM_EMAC_TAH_H */