summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorVipin KUMAR <vipin.kumar@st.com>2012-05-07 13:06:43 +0530
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-07-07 14:07:40 +0200
commit8eb0ee6a649d09a41155bf6c9dbd4d531ed41f9e (patch)
tree46aec28c0e72412257764894261718c8712012e9 /board
parentdeb005622782bf568a4daa8daeb8adf95b606492 (diff)
SPEAr: Add macb driver support for spear310 and spear320
SPEAr310 and SPEAr320 SoCs have an extra ethernet controller. The driver for this device is already supported by u-boot, so configuring board configuration file and defining base addresses etc to make use of the common driver Signed-off-by: Vipin Kumar <vipin.kumar@st.com> Signed-off-by: Amit Virdi <amit.virdi@st.com> Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'board')
-rw-r--r--board/spear/spear310/spear310.c25
-rw-r--r--board/spear/spear320/spear320.c12
2 files changed, 31 insertions, 6 deletions
diff --git a/board/spear/spear310/spear310.c b/board/spear/spear310/spear310.c
index 043a9f3aee9..c0e68299944 100644
--- a/board/spear/spear310/spear310.c
+++ b/board/spear/spear310/spear310.c
@@ -65,9 +65,28 @@ void board_nand_init()
int board_eth_init(bd_t *bis)
{
+ int ret = 0;
+
#if defined(CONFIG_DESIGNWARE_ETH)
- return designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY);
-#else
- return -1;
+ if (designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY) < 0)
+ ret += -1;
+#endif
+#if defined(CONFIG_MACB)
+ if (macb_eth_initialize(0, (void *)CONFIG_SYS_MACB0_BASE,
+ CONFIG_MACB0_PHY) < 0)
+ ret += -1;
+
+ if (macb_eth_initialize(1, (void *)CONFIG_SYS_MACB1_BASE,
+ CONFIG_MACB1_PHY) < 0)
+ ret += -1;
+
+ if (macb_eth_initialize(2, (void *)CONFIG_SYS_MACB2_BASE,
+ CONFIG_MACB2_PHY) < 0)
+ ret += -1;
+
+ if (macb_eth_initialize(3, (void *)CONFIG_SYS_MACB3_BASE,
+ CONFIG_MACB3_PHY) < 0)
+ ret += -1;
#endif
+ return ret;
}
diff --git a/board/spear/spear320/spear320.c b/board/spear/spear320/spear320.c
index 1b6f362b5d8..e101888e044 100644
--- a/board/spear/spear320/spear320.c
+++ b/board/spear/spear320/spear320.c
@@ -66,9 +66,15 @@ void board_nand_init()
int board_eth_init(bd_t *bis)
{
+ int ret = 0;
#if defined(CONFIG_DESIGNWARE_ETH)
- return designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY);
-#else
- return -1;
+ if (designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY) < 0)
+ ret += -1;
#endif
+#if defined(CONFIG_MACB)
+ if (macb_eth_initialize(0, (void *)CONFIG_SYS_MACB0_BASE,
+ CONFIG_MACB0_PHY) < 0)
+ ret += -1;
+#endif
+ return ret;
}