2005-04-17 06:20:36 +08:00
|
|
|
/*
|
2006-10-04 05:01:26 +08:00
|
|
|
* drivers/net/ibm_emac/ibm_emac_rgmii.h
|
2005-10-11 07:58:14 +08:00
|
|
|
*
|
|
|
|
* Driver for PowerPC 4xx on-chip ethernet controller, RGMII bridge support.
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
|
|
|
* Based on ocp_zmii.h/ibm_emac_zmii.h
|
|
|
|
* Armin Kuster akuster@mvista.com
|
|
|
|
*
|
|
|
|
* Copyright 2004 MontaVista Software, Inc.
|
|
|
|
* Matt Porter <mporter@kernel.crashing.org>
|
|
|
|
*
|
2005-10-11 07:58:14 +08:00
|
|
|
* Copyright (c) 2004, 2005 Zultys Technologies.
|
|
|
|
* Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
|
|
|
|
*
|
2005-04-17 06:20:36 +08:00
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _IBM_EMAC_RGMII_H_
|
|
|
|
#define _IBM_EMAC_RGMII_H_
|
|
|
|
|
|
|
|
|
|
|
|
/* RGMII bridge */
|
2005-10-11 07:58:14 +08:00
|
|
|
struct rgmii_regs {
|
2005-04-17 06:20:36 +08:00
|
|
|
u32 fer; /* Function enable register */
|
|
|
|
u32 ssr; /* Speed select register */
|
2005-10-11 07:58:14 +08:00
|
|
|
};
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* RGMII device */
|
|
|
|
struct ibm_ocp_rgmii {
|
2005-12-01 23:15:21 +08:00
|
|
|
struct rgmii_regs __iomem *base;
|
2005-04-17 06:20:36 +08:00
|
|
|
int users; /* number of EMACs using this RGMII bridge */
|
|
|
|
};
|
|
|
|
|
2005-10-11 07:58:14 +08:00
|
|
|
#ifdef CONFIG_IBM_EMAC_RGMII
|
|
|
|
int rgmii_attach(void *emac) __init;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-05-17 02:57:37 +08:00
|
|
|
void __rgmii_fini(struct ocp_device *ocpdev, int input);
|
2005-10-11 07:58:14 +08:00
|
|
|
static inline void rgmii_fini(struct ocp_device *ocpdev, int input)
|
|
|
|
{
|
|
|
|
if (ocpdev)
|
|
|
|
__rgmii_fini(ocpdev, input);
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-10-11 07:58:14 +08:00
|
|
|
void rgmii_set_speed(struct ocp_device *ocpdev, int input, int speed);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-10-11 07:58:14 +08:00
|
|
|
int __rgmii_get_regs_len(struct ocp_device *ocpdev);
|
|
|
|
static inline int rgmii_get_regs_len(struct ocp_device *ocpdev)
|
|
|
|
{
|
|
|
|
return ocpdev ? __rgmii_get_regs_len(ocpdev) : 0;
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-10-11 07:58:14 +08:00
|
|
|
void *rgmii_dump_regs(struct ocp_device *ocpdev, void *buf);
|
|
|
|
#else
|
|
|
|
# define rgmii_attach(x) 0
|
|
|
|
# define rgmii_fini(x,y) ((void)0)
|
|
|
|
# define rgmii_set_speed(x,y,z) ((void)0)
|
|
|
|
# define rgmii_get_regs_len(x) 0
|
|
|
|
# define rgmii_dump_regs(x,buf) (buf)
|
|
|
|
#endif /* !CONFIG_IBM_EMAC_RGMII */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#endif /* _IBM_EMAC_RGMII_H_ */
|