1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * drivers/net/ethernet/ibm/emac/rgmii.h
5 * Driver for PowerPC 4xx on-chip ethernet controller, RGMII bridge support.
7 * Copyright 2007 Benjamin Herrenschmidt, IBM Corp.
8 * <benh@kernel.crashing.org>
10 * Based on the arch/ppc version of the driver:
12 * Based on ocp_zmii.h/ibm_emac_zmii.h
13 * Armin Kuster akuster@mvista.com
15 * Copyright 2004 MontaVista Software, Inc.
16 * Matt Porter <mporter@kernel.crashing.org>
18 * Copyright (c) 2004, 2005 Zultys Technologies.
19 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
22 #ifndef __IBM_NEWEMAC_RGMII_H
23 #define __IBM_NEWEMAC_RGMII_H
25 /* RGMII bridge type */
26 #define RGMII_STANDARD 0
31 u32 fer
; /* Function enable register */
32 u32 ssr
; /* Speed select register */
36 struct rgmii_instance
{
37 struct rgmii_regs __iomem
*base
;
39 /* RGMII bridge flags */
41 #define EMAC_RGMII_FLAG_HAS_MDIO 0x00000001
43 /* Only one EMAC whacks us at a time */
46 /* number of EMACs using this RGMII bridge */
49 /* OF device instance */
50 struct platform_device
*ofdev
;
53 #ifdef CONFIG_IBM_EMAC_RGMII
56 void rgmii_exit(void);
57 int rgmii_attach(struct platform_device
*ofdev
, int input
, int mode
);
58 void rgmii_detach(struct platform_device
*ofdev
, int input
);
59 void rgmii_get_mdio(struct platform_device
*ofdev
, int input
);
60 void rgmii_put_mdio(struct platform_device
*ofdev
, int input
);
61 void rgmii_set_speed(struct platform_device
*ofdev
, int input
, int speed
);
62 int rgmii_get_regs_len(struct platform_device
*ofdev
);
63 void *rgmii_dump_regs(struct platform_device
*ofdev
, void *buf
);
67 # define rgmii_init() 0
68 # define rgmii_exit() do { } while(0)
69 # define rgmii_attach(x,y,z) (-ENXIO)
70 # define rgmii_detach(x,y) do { } while(0)
71 # define rgmii_get_mdio(o,i) do { } while (0)
72 # define rgmii_put_mdio(o,i) do { } while (0)
73 # define rgmii_set_speed(x,y,z) do { } while(0)
74 # define rgmii_get_regs_len(x) 0
75 # define rgmii_dump_regs(x,buf) (buf)
76 #endif /* !CONFIG_IBM_EMAC_RGMII */
78 #endif /* __IBM_NEWEMAC_RGMII_H */