From 82a55c1ef87bb6c596b19e83685cc4cbf0344cb3 Mon Sep 17 00:00:00 2001 From: Shengzhou Liu Date: Fri, 22 Nov 2013 17:39:09 +0800 Subject: net/fman: Add support for 10GEC3 and 10GEC4 There are more than two 10GEC in single FMAN in some SoCs(e.g. T2080). This patch adds support for 10GEC3 and 10GEC4. Signed-off-by: Shengzhou Liu --- drivers/net/fm/eth.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'drivers/net/fm/eth.c') diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c index cb099cd8496..218a5ed1750 100644 --- a/drivers/net/fm/eth.c +++ b/drivers/net/fm/eth.c @@ -557,8 +557,16 @@ static int fm_eth_init_mac(struct fm_eth *fm_eth, struct ccsr_fman *reg) num = fm_eth->num; #ifdef CONFIG_SYS_FMAN_V3 - if (fm_eth->type == FM_ETH_10G_E) - num += 8; + if (fm_eth->type == FM_ETH_10G_E) { + /* 10GEC1/10GEC2 use mEMAC9/mEMAC10 + * 10GEC3/10GEC4 use mEMAC1/mEMAC2 + * so it needs to change the num. + */ + if (fm_eth->num >= 2) + num -= 2; + else + num += 8; + } base = ®->memac[num].fm_memac; phyregs = ®->memac[num].fm_memac_mdio; #else -- cgit v1.2.3