From d3c9ffd07dbf76b7aff678996374be2352628aa0 Mon Sep 17 00:00:00 2001 From: Albert Aribaud Date: Mon, 12 Jul 2010 22:24:29 +0200 Subject: [PATCH] mvgbe: add support for orion5x GbE controller Add definitions and initialization in orion5x for mvgbe. Add orion5x in mvgbe SoC includes. Signed-off-by: Albert Aribaud Acked-by: Prafulla Wadaskar Signed-off-by: Ben Warren --- arch/arm/cpu/arm926ejs/orion5x/cpu.c | 8 ++++++++ arch/arm/include/asm/arch-kirkwood/kirkwood.h | 6 ++++-- arch/arm/include/asm/arch-orion5x/orion5x.h | 4 ++++ drivers/net/mvgbe.c | 2 ++ drivers/net/mvgbe.h | 2 -- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/arch/arm/cpu/arm926ejs/orion5x/cpu.c b/arch/arm/cpu/arm926ejs/orion5x/cpu.c index 03c6d0677c..f3c1e2192e 100644 --- a/arch/arm/cpu/arm926ejs/orion5x/cpu.c +++ b/arch/arm/cpu/arm926ejs/orion5x/cpu.c @@ -268,3 +268,11 @@ int arch_misc_init(void) return 0; } #endif /* CONFIG_ARCH_MISC_INIT */ + +#ifdef CONFIG_MVGBE +int cpu_eth_init(bd_t *bis) +{ + mvgbe_initialize(bis); + return 0; +} +#endif diff --git a/arch/arm/include/asm/arch-kirkwood/kirkwood.h b/arch/arm/include/asm/arch-kirkwood/kirkwood.h index 5c2586be43..9edb0be5f5 100644 --- a/arch/arm/include/asm/arch-kirkwood/kirkwood.h +++ b/arch/arm/include/asm/arch-kirkwood/kirkwood.h @@ -60,8 +60,10 @@ #define KW_EGIGA0_BASE (KW_REGISTER(0x72000)) #define KW_EGIGA1_BASE (KW_REGISTER(0x76000)) -#define MVGBE0_BASE KW_EGIGA0_BASE -#define MVGBE1_BASE KW_EGIGA1_BASE +/* Kirkwood GbE controller has two ports */ +#define MAX_MVGBE_DEVS 2 +#define MVGBE0_BASE KW_EGIGA0_BASE +#define MVGBE1_BASE KW_EGIGA1_BASE #if defined (CONFIG_KW88F6281) #include diff --git a/arch/arm/include/asm/arch-orion5x/orion5x.h b/arch/arm/include/asm/arch-orion5x/orion5x.h index 4008c842df..d257b66581 100644 --- a/arch/arm/include/asm/arch-orion5x/orion5x.h +++ b/arch/arm/include/asm/arch-orion5x/orion5x.h @@ -56,6 +56,10 @@ #define ORION5X_USB20_PORT1_BASE (ORION5X_REGISTER(0xA0000)) #define ORION5X_EGIGA_BASE (ORION5X_REGISTER(0x72000)) +/* Orion5x GbE controller has a single port */ +#define MAX_MVGBE_DEVS 1 +#define MVGBE0_BASE ORION5X_EGIGA_BASE + #define CONFIG_MAX_RAM_BANK_SIZE (64*1024*1024) /* include here SoC variants. 5181, 5281, 6183 should go here when diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c index e44352c676..cad40237c9 100644 --- a/drivers/net/mvgbe.c +++ b/drivers/net/mvgbe.c @@ -38,6 +38,8 @@ #if defined(CONFIG_KIRKWOOD) #include +#elif defined(CONFIG_ORION5X) +#include #endif #include "mvgbe.h" diff --git a/drivers/net/mvgbe.h b/drivers/net/mvgbe.h index 7db5af450e..3de98d01bd 100644 --- a/drivers/net/mvgbe.h +++ b/drivers/net/mvgbe.h @@ -28,8 +28,6 @@ #ifndef __MVGBE_H__ #define __MVGBE_H__ -#define MAX_MVGBE_DEVS 2 /*controller has two ports */ - /* PHY_BASE_ADR is board specific and can be configured */ #if defined (CONFIG_PHY_BASE_ADR) #define PHY_BASE_ADR CONFIG_PHY_BASE_ADR -- 2.30.2