1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * drivers/net/ethernet/ibm/emac/tah.h
5 * Driver for PowerPC 4xx on-chip ethernet controller, TAH support.
7 * Copyright 2007 Benjamin Herrenschmidt, IBM Corp.
8 * <benh@kernel.crashing.org>
10 * Based on the arch/ppc version of the driver:
12 * Copyright 2004 MontaVista Software, Inc.
13 * Matt Porter <mporter@kernel.crashing.org>
15 * Copyright (c) 2005 Eugene Surovegin <ebs@ebshome.net>
18 #ifndef __IBM_NEWEMAC_TAH_H
19 #define __IBM_NEWEMAC_TAH_H
38 struct tah_regs __iomem
*base
;
40 /* Only one EMAC whacks us at a time */
43 /* number of EMACs using this TAH */
46 /* OF device instance */
47 struct platform_device
*ofdev
;
52 #define TAH_MR_CVR 0x80000000
53 #define TAH_MR_SR 0x40000000
54 #define TAH_MR_ST_256 0x01000000
55 #define TAH_MR_ST_512 0x02000000
56 #define TAH_MR_ST_768 0x03000000
57 #define TAH_MR_ST_1024 0x04000000
58 #define TAH_MR_ST_1280 0x05000000
59 #define TAH_MR_ST_1536 0x06000000
60 #define TAH_MR_TFS_16KB 0x00000000
61 #define TAH_MR_TFS_2KB 0x00200000
62 #define TAH_MR_TFS_4KB 0x00400000
63 #define TAH_MR_TFS_6KB 0x00600000
64 #define TAH_MR_TFS_8KB 0x00800000
65 #define TAH_MR_TFS_10KB 0x00a00000
66 #define TAH_MR_DTFP 0x00100000
67 #define TAH_MR_DIG 0x00080000
69 #ifdef CONFIG_IBM_EMAC_TAH
73 int tah_attach(struct platform_device
*ofdev
, int channel
);
74 void tah_detach(struct platform_device
*ofdev
, int channel
);
75 void tah_reset(struct platform_device
*ofdev
);
76 int tah_get_regs_len(struct platform_device
*ofdev
);
77 void *tah_dump_regs(struct platform_device
*ofdev
, void *buf
);
82 # define tah_exit() do { } while(0)
83 # define tah_attach(x,y) (-ENXIO)
84 # define tah_detach(x,y) do { } while(0)
85 # define tah_reset(x) do { } while(0)
86 # define tah_get_regs_len(x) 0
87 # define tah_dump_regs(x,buf) (buf)
89 #endif /* !CONFIG_IBM_EMAC_TAH */
91 #endif /* __IBM_NEWEMAC_TAH_H */