blob: 9299b5dd7eb1d3c0f699bead79abe016deaa9b1a [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Eugene Surovegin37448f72005-10-10 16:58:14 -07002 * drivers/net/ibm_emac/ibm_emac_tah.h
3 *
4 * Driver for PowerPC 4xx on-chip ethernet controller, TAH support.
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 *
6 * Copyright 2004 MontaVista Software, Inc.
7 * Matt Porter <mporter@kernel.crashing.org>
8 *
Eugene Surovegin37448f72005-10-10 16:58:14 -07009 * Copyright (c) 2005 Eugene Surovegin <ebs@ebshome.net>
10 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070011 * 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.
15 */
16
17#ifndef _IBM_EMAC_TAH_H
18#define _IBM_EMAC_TAH_H
19
Eugene Surovegin37448f72005-10-10 16:58:14 -070020#include <linux/config.h>
21#include <linux/init.h>
22#include <asm/ocp.h>
23
Linus Torvalds1da177e2005-04-16 15:20:36 -070024/* TAH */
Eugene Surovegin37448f72005-10-10 16:58:14 -070025struct tah_regs {
26 u32 revid;
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 u32 pad[3];
Eugene Surovegin37448f72005-10-10 16:58:14 -070028 u32 mr;
29 u32 ssr0;
30 u32 ssr1;
31 u32 ssr2;
32 u32 ssr3;
33 u32 ssr4;
34 u32 ssr5;
35 u32 tsr;
36};
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
38/* TAH engine */
Eugene Surovegin37448f72005-10-10 16:58:14 -070039#define TAH_MR_CVR 0x80000000
40#define TAH_MR_SR 0x40000000
41#define TAH_MR_ST_256 0x01000000
42#define TAH_MR_ST_512 0x02000000
43#define TAH_MR_ST_768 0x03000000
44#define TAH_MR_ST_1024 0x04000000
45#define TAH_MR_ST_1280 0x05000000
46#define TAH_MR_ST_1536 0x06000000
47#define TAH_MR_TFS_16KB 0x00000000
48#define TAH_MR_TFS_2KB 0x00200000
49#define TAH_MR_TFS_4KB 0x00400000
50#define TAH_MR_TFS_6KB 0x00600000
51#define TAH_MR_TFS_8KB 0x00800000
52#define TAH_MR_TFS_10KB 0x00a00000
53#define TAH_MR_DTFP 0x00100000
54#define TAH_MR_DIG 0x00080000
55
56#ifdef CONFIG_IBM_EMAC_TAH
57int tah_attach(void *emac) __init;
58
59void __tah_fini(struct ocp_device *ocpdev) __exit;
60static inline void tah_fini(struct ocp_device *ocpdev)
61{
62 if (ocpdev)
63 __tah_fini(ocpdev);
64}
65
66void __tah_reset(struct ocp_device *ocpdev);
67static inline void tah_reset(struct ocp_device *ocpdev)
68{
69 if (ocpdev)
70 __tah_reset(ocpdev);
71}
72
73int __tah_get_regs_len(struct ocp_device *ocpdev);
74static inline int tah_get_regs_len(struct ocp_device *ocpdev)
75{
76 return ocpdev ? __tah_get_regs_len(ocpdev) : 0;
77}
78
79void *tah_dump_regs(struct ocp_device *ocpdev, void *buf);
80#else
81# define tah_attach(x) 0
82# define tah_fini(x) ((void)0)
83# define tah_reset(x) ((void)0)
84# define tah_get_regs_len(x) 0
85# define tah_dump_regs(x,buf) (buf)
86#endif /* !CONFIG_IBM_EMAC_TAH */
Linus Torvalds1da177e2005-04-16 15:20:36 -070087
88#endif /* _IBM_EMAC_TAH_H */