Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Eugene Surovegin | 37448f7 | 2005-10-10 16:58:14 -0700 | [diff] [blame] | 2 | * drivers/net/ibm_emac/ibm_emac_tah.h |
| 3 | * |
| 4 | * Driver for PowerPC 4xx on-chip ethernet controller, TAH support. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | * |
| 6 | * Copyright 2004 MontaVista Software, Inc. |
| 7 | * Matt Porter <mporter@kernel.crashing.org> |
| 8 | * |
Eugene Surovegin | 37448f7 | 2005-10-10 16:58:14 -0700 | [diff] [blame] | 9 | * Copyright (c) 2005 Eugene Surovegin <ebs@ebshome.net> |
| 10 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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. |
| 15 | */ |
| 16 | |
| 17 | #ifndef _IBM_EMAC_TAH_H |
| 18 | #define _IBM_EMAC_TAH_H |
| 19 | |
Eugene Surovegin | 37448f7 | 2005-10-10 16:58:14 -0700 | [diff] [blame] | 20 | #include <linux/init.h> |
| 21 | #include <asm/ocp.h> |
| 22 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | /* TAH */ |
Eugene Surovegin | 37448f7 | 2005-10-10 16:58:14 -0700 | [diff] [blame] | 24 | struct tah_regs { |
| 25 | u32 revid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | u32 pad[3]; |
Eugene Surovegin | 37448f7 | 2005-10-10 16:58:14 -0700 | [diff] [blame] | 27 | u32 mr; |
| 28 | u32 ssr0; |
| 29 | u32 ssr1; |
| 30 | u32 ssr2; |
| 31 | u32 ssr3; |
| 32 | u32 ssr4; |
| 33 | u32 ssr5; |
| 34 | u32 tsr; |
| 35 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | |
| 37 | /* TAH engine */ |
Eugene Surovegin | 37448f7 | 2005-10-10 16:58:14 -0700 | [diff] [blame] | 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 |
| 54 | |
| 55 | #ifdef CONFIG_IBM_EMAC_TAH |
| 56 | int tah_attach(void *emac) __init; |
| 57 | |
Eugene Surovegin | 0ec6d95 | 2007-05-16 11:57:37 -0700 | [diff] [blame] | 58 | void __tah_fini(struct ocp_device *ocpdev); |
Eugene Surovegin | 37448f7 | 2005-10-10 16:58:14 -0700 | [diff] [blame] | 59 | static inline void tah_fini(struct ocp_device *ocpdev) |
| 60 | { |
| 61 | if (ocpdev) |
| 62 | __tah_fini(ocpdev); |
| 63 | } |
| 64 | |
| 65 | void __tah_reset(struct ocp_device *ocpdev); |
| 66 | static inline void tah_reset(struct ocp_device *ocpdev) |
| 67 | { |
| 68 | if (ocpdev) |
| 69 | __tah_reset(ocpdev); |
| 70 | } |
| 71 | |
| 72 | int __tah_get_regs_len(struct ocp_device *ocpdev); |
| 73 | static inline int tah_get_regs_len(struct ocp_device *ocpdev) |
| 74 | { |
| 75 | return ocpdev ? __tah_get_regs_len(ocpdev) : 0; |
| 76 | } |
| 77 | |
| 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 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 86 | |
| 87 | #endif /* _IBM_EMAC_TAH_H */ |