
From: Julian Pidancet julian.pidancet@citrix.com
This patch takes care of initializing the second PHY of the OpenRD board.
Signed-off-by: Julian Pidancet julian.pidancet@citrix.com
create mode 100644 include/configs/openrd_client.h
diff --git a/MAKEALL b/MAKEALL index a732e6a..ddf4a70 100755 --- a/MAKEALL +++ b/MAKEALL @@ -361,6 +361,7 @@ LIST_ARM9=" \ omap5912osk \ omap730p2 \ openrd_base \ + openrd_client \ rd6281a \ sbc2410x \ scb9328 \ diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c index b395df7..fded3f0 100644 --- a/board/Marvell/openrd/openrd.c +++ b/board/Marvell/openrd/openrd.c @@ -118,12 +118,11 @@ int board_init(void) }
#ifdef CONFIG_RESET_PHY_R -/* Configure and enable MV88E1116 PHY */ -void reset_phy(void) +/* Configure and enable MV88E1116/MV88E1121 PHY */ +void mv_phy_init(char *name) { u16 reg; u16 devadr; - char *name = "egiga0";
if (miiphy_set_current_dev(name)) return; @@ -150,4 +149,19 @@ void reset_phy(void)
printf("88E1116 Initialized on %s\n", name); } + +void reset_phy(void) +{ + mv_phy_init("egiga0"); + +#if (MACH_TYPE_OPENRD == MACH_TYPE_OPENRD_CLIENT) + /* Kirkwood ethernet driver is written with the assumption that in case + * of multiple PHYs, their addresses are consecutive. But unfortunately + * in case of OpenRD-Client, PHY addresses are not consecutive.*/ + miiphy_write("egiga1", 0xEE, 0xEE, 24); + + /* configure and initialize both PHY's */ + mv_phy_init("egiga1"); +#endif +} #endif /* CONFIG_RESET_PHY_R */ diff --git a/boards.cfg b/boards.cfg index 07c904b..5f5d2bf 100644 --- a/boards.cfg +++ b/boards.cfg @@ -97,6 +97,7 @@ suen3 arm arm926ejs km_arm keymile guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood openrd_base arm arm926ejs openrd Marvell kirkwood +openrd_client arm arm926ejs openrd Marvell kirkwood rd6281a arm arm926ejs - Marvell kirkwood sheevaplug arm arm926ejs - Marvell kirkwood dockstar arm arm926ejs - Seagate kirkwood diff --git a/include/configs/openrd_client.h b/include/configs/openrd_client.h new file mode 100644 index 0000000..1ffc29f --- /dev/null +++ b/include/configs/openrd_client.h @@ -0,0 +1,44 @@ +/* + * 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 + */ + +#ifndef _CONFIG_OPENRD_CLIENT_H +#define _CONFIG_OPENRD_CLIENT_H + +#include <configs/openrd.h> + +/* + * Version number information + */ +#define CONFIG_IDENT_STRING "\nOpenRD-Client" + +/* Machine type */ +#define MACH_TYPE_OPENRD MACH_TYPE_OPENRD_CLIENT + +/* + * Ethernet Driver configuration + */ +#ifdef CONFIG_CMD_NET +/* enable both ports */ +#define CONFIG_MVGBE_PORTS {1, 1} +#define CONFIG_PHY_BASE_ADR 0x8 +#define PHY_NO "88E1116" +#endif /* CONFIG_CMD_NET */ + +#endif /* _CONFIG_OPENRD_CLIENT_H */