
On Wed, Apr 8, 2009 at 1:30 PM, Prafulla Wadaskar prafulla@marvell.com wrote:
--- /dev/null +++ b/drivers/net/mv88e61xx.c @@ -0,0 +1,291 @@ +/*
- (C) Copyright 2009
- Marvell Semiconductor <www.marvell.com>
- Prafulla Wadaskar prafulla@marvell.com
- See file CREDITS for list of people who contributed to this
- project.
- 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.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301 USA
- */
+#include <common.h>
+#if defined (CONFIG_SWITCH_MV88E61XX)
+/* Enabled ports can be enabled in board header file */ +#if defined (CONFIG_MV88E61XX_ENABLED_PORTS) +#define MV88E61XX_ENABLED_PORTS CONFIG_MV88E61XX_ENABLED_PORTS +#else +#define MV88E61XX_ENABLED_PORTS (BIT0 | BIT1 | BIT2 | \
- BIT3 | BIT4 | BIT5)
+#endif
+#if defined (CONFIG_88E6161) +#define MV88E61XX_NAME "88E6161" +#elif defined (CONFIG_88E6165) +#define MV88E61XX_NAME "88E6165" +#else +#define MV88E61XX_NAME "88E61XX" +#endif
Is this discoverable at runtime? What if there's a system that supports using multiple different types of MV88E61xx? I know it's a bit of a crazy idea, but board designers like to screw around with software developers like that.
+#define MV88E61XX_PHY_TIMEOUT 100000 +#define MV88E61XX_MAX_PORTS_NUM 0x6
Is this a limitation of the 88e61xx architecture, or just the max number on all of the currently shipping versions?
+#ifdef CONFIG_KIRKWOOD_EGIGA +#define smi_wr_reg eth_smi_reg_write +#define smi_rd_reg eth_smi_reg_read +#else /* add new interface above this */ +#error Unsupported interface +#endif
This sort of thing is discouraged. Why does this driver need to know about the ethernet controller? Perhaps function pointers are needed?
Andy