[PATCH u-boot 08/12] aspeed: remove CONFIG_MAC_NUM

Cédric Le Goater clg at kaod.org
Fri Oct 7 08:26:41 AEDT 2016


and use the standard CONFIG_HAS_ETHX instead.

Signed-off-by: Cédric Le Goater <clg at kaod.org>
---
 drivers/net/ftgmac100.c       | 11 +++++------
 include/configs/ast-g4-ncsi.h |  4 ++++
 include/configs/ast-g4-phy.h  |  3 ++-
 include/configs/ast-g5-ncsi.h |  4 ++++
 include/configs/ast-g5-phy.h  |  3 ++-
 5 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ftgmac100.c b/drivers/net/ftgmac100.c
index 16cfac87cb8e..b690e6c2330c 100644
--- a/drivers/net/ftgmac100.c
+++ b/drivers/net/ftgmac100.c
@@ -747,14 +747,13 @@ int ftgmac100_initialize(bd_t *bd)
 
 #if 1   //Ryan Chen for more mac use
 	int i, card_number = 0, mac_no;
-	unsigned int			iobase[CONFIG_MAC_NUM];
+	unsigned int iobase[2] = { AST_MAC0_BASE, AST_MAC1_BASE };
 
-	mac_no = CONFIG_MAC_NUM;
-	iobase[0] = AST_MAC0_BASE;
-
-#ifdef AST_MAC1_BASE
-	iobase[1] = AST_MAC1_BASE;
+	mac_no = 1;
+#ifdef CONFIG_HAS_ETH1
+	mac_no++;
 #endif
+
 	for (i = 0; i < mac_no; i++)
 	{
 		ast_scu_multi_func_eth(i);
diff --git a/include/configs/ast-g4-ncsi.h b/include/configs/ast-g4-ncsi.h
index bd7ca818db87..43787f39ac90 100644
--- a/include/configs/ast-g4-ncsi.h
+++ b/include/configs/ast-g4-ncsi.h
@@ -18,5 +18,9 @@
 #include <asm/arch/ast2400_platform.h>
 #include <configs/ast-common.h>
 
+/* Ethernet */
+#define CONFIG_HAS_ETH0
+#define CONFIG_HAS_ETH1
+
 
 #endif	/* __AST_G4_NCSI_CONFIG_H */
diff --git a/include/configs/ast-g4-phy.h b/include/configs/ast-g4-phy.h
index c0208625c9ab..66881f6cb8be 100644
--- a/include/configs/ast-g4-phy.h
+++ b/include/configs/ast-g4-phy.h
@@ -19,7 +19,8 @@
 #include <configs/ast-common.h>
 
 /* Ethernet */
-#define CONFIG_MAC_NUM			2
+#define CONFIG_HAS_ETH0
+#define CONFIG_HAS_ETH1
 #define CONFIG_PHY_MAX_ADDR		32
 
 
diff --git a/include/configs/ast-g5-ncsi.h b/include/configs/ast-g5-ncsi.h
index 049d1a5b0be8..486fe28152c2 100644
--- a/include/configs/ast-g5-ncsi.h
+++ b/include/configs/ast-g5-ncsi.h
@@ -19,6 +19,10 @@
 /* arm1176/start.S */
 #define CONFIG_SYS_UBOOT_BASE		CONFIG_SYS_TEXT_BASE
 
+/* Ethernet */
+#define CONFIG_HAS_ETH0
+#define CONFIG_HAS_ETH1
+
 /* platform.S settings */
 #define	CONFIG_DRAM_ECC_SIZE		0x10000000
 
diff --git a/include/configs/ast-g5-phy.h b/include/configs/ast-g5-phy.h
index 1d8aad815d02..1cd0387b0508 100644
--- a/include/configs/ast-g5-phy.h
+++ b/include/configs/ast-g5-phy.h
@@ -20,7 +20,8 @@
 #define CONFIG_SYS_UBOOT_BASE		CONFIG_SYS_TEXT_BASE
 
 /* Ethernet */
-#define CONFIG_MAC_NUM			2
+#define CONFIG_HAS_ETH0
+#define CONFIG_HAS_ETH1
 #define CONFIG_PHY_MAX_ADDR		32
 
 /* platform.S */
-- 
2.7.4



More information about the openbmc mailing list