2 * Defines for the IBM RGMII bridge
4 * Based on ocp_zmii.h/ibm_emac_zmii.h
5 * Armin Kuster akuster@mvista.com
7 * Copyright 2004 MontaVista Software, Inc.
8 * Matt Porter <mporter@kernel.crashing.org>
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
16 #ifndef _IBM_EMAC_RGMII_H_
17 #define _IBM_EMAC_RGMII_H_
19 #include <linux/config.h>
22 typedef struct rgmii_regs
{
23 u32 fer
; /* Function enable register */
24 u32 ssr
; /* Speed select register */
27 #define RGMII_INPUTS 4
30 struct ibm_ocp_rgmii
{
31 struct rgmii_regs
*base
;
32 int mode
[RGMII_INPUTS
];
33 int users
; /* number of EMACs using this RGMII bridge */
36 /* Fuctional Enable Reg */
37 #define RGMII_FER_MASK(x) (0x00000007 << (4*x))
38 #define RGMII_RTBI 0x00000004
39 #define RGMII_RGMII 0x00000005
40 #define RGMII_TBI 0x00000006
41 #define RGMII_GMII 0x00000007
43 /* Speed Selection reg */
45 #define RGMII_SP2_100 0x00000002
46 #define RGMII_SP2_1000 0x00000004
47 #define RGMII_SP3_100 0x00000200
48 #define RGMII_SP3_1000 0x00000400
50 #define RGMII_MII2_SPDMASK 0x00000007
51 #define RGMII_MII3_SPDMASK 0x00000700
53 #define RGMII_MII2_100MB RGMII_SP2_100 & ~RGMII_SP2_1000
54 #define RGMII_MII2_1000MB RGMII_SP2_1000 & ~RGMII_SP2_100
55 #define RGMII_MII2_10MB ~(RGMII_SP2_100 | RGMII_SP2_1000)
56 #define RGMII_MII3_100MB RGMII_SP3_100 & ~RGMII_SP3_1000
57 #define RGMII_MII3_1000MB RGMII_SP3_1000 & ~RGMII_SP3_100
58 #define RGMII_MII3_10MB ~(RGMII_SP3_100 | RGMII_SP3_1000)
65 #endif /* _IBM_EMAC_RGMII_H_ */