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/config.h> |
| 21 | #include <linux/init.h> |
| 22 | #include <asm/ocp.h> |
| 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | /* TAH */ |
Eugene Surovegin | 37448f7 | 2005-10-10 16:58:14 -0700 | [diff] [blame] | 25 | struct tah_regs { |
| 26 | u32 revid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | u32 pad[3]; |
Eugene Surovegin | 37448f7 | 2005-10-10 16:58:14 -0700 | [diff] [blame] | 28 | 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
| 38 | /* TAH engine */ |
Eugene Surovegin | 37448f7 | 2005-10-10 16:58:14 -0700 | [diff] [blame] | 39 | #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 |
| 57 | int tah_attach(void *emac) __init; |
| 58 | |
| 59 | void __tah_fini(struct ocp_device *ocpdev) __exit; |
| 60 | static inline void tah_fini(struct ocp_device *ocpdev) |
| 61 | { |
| 62 | if (ocpdev) |
| 63 | __tah_fini(ocpdev); |
| 64 | } |
| 65 | |
| 66 | void __tah_reset(struct ocp_device *ocpdev); |
| 67 | static inline void tah_reset(struct ocp_device *ocpdev) |
| 68 | { |
| 69 | if (ocpdev) |
| 70 | __tah_reset(ocpdev); |
| 71 | } |
| 72 | |
| 73 | int __tah_get_regs_len(struct ocp_device *ocpdev); |
| 74 | static inline int tah_get_regs_len(struct ocp_device *ocpdev) |
| 75 | { |
| 76 | return ocpdev ? __tah_get_regs_len(ocpdev) : 0; |
| 77 | } |
| 78 | |
| 79 | void *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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | |
| 88 | #endif /* _IBM_EMAC_TAH_H */ |