Patchwork [U-Boot,v3,08/10] NET: mvgbe: add support for Dove

login
register
mail settings
Submitter Sebastian Hesselbarth
Date Jan. 16, 2013, 7:25 p.m.
Message ID <1358364328-14904-9-git-send-email-sebastian.hesselbarth@gmail.com>
Download mbox | patch
Permalink /patch/213022/
State New
Delegated to: Prafulla Wadaskar
Headers show

Comments

Sebastian Hesselbarth - Jan. 16, 2013, 7:25 p.m.
Marvell Dove also uses mvgbe as ethernet driver, therefore add support
for Dove to reuse the current driver.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: u-boot@lists.denx.de
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Rabeeh Khoury <rabeeh@solid-run.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Cc: Andy Fleming <afleming@gmail.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Daniel Stodden <daniel.stodden@gmail.com>
Cc: Luka Perkov <luka@openwrt.org>
---
 drivers/net/mvgbe.c |    2 ++
 drivers/net/mvgbe.h |    7 +++++++
 2 files changed, 9 insertions(+)
Prafulla Wadaskar - Feb. 11, 2013, 3:39 a.m.
> -----Original Message-----
> From: Sebastian Hesselbarth [mailto:sebastian.hesselbarth@gmail.com]
> Sent: 17 January 2013 00:55
> To: Sebastian Hesselbarth
> Cc: u-boot@lists.denx.de; Rabeeh Khoury; Albert Aribaud; Prafulla
> Wadaskar; Andy Fleming; Joe Hershberger; Daniel Stodden; Luka Perkov
> Subject: [PATCH v3 08/10] NET: mvgbe: add support for Dove
> 
> Marvell Dove also uses mvgbe as ethernet driver, therefore add support
> for Dove to reuse the current driver.
> 
> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> ---
> Cc: u-boot@lists.denx.de
> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Cc: Rabeeh Khoury <rabeeh@solid-run.com>
> Cc: Albert Aribaud <albert.u.boot@aribaud.net>
> Cc: Prafulla Wadaskar <prafulla@marvell.com>
> Cc: Andy Fleming <afleming@gmail.com>
> Cc: Joe Hershberger <joe.hershberger@gmail.com>
> Cc: Daniel Stodden <daniel.stodden@gmail.com>
> Cc: Luka Perkov <luka@openwrt.org>
> ---
>  drivers/net/mvgbe.c |    2 ++
>  drivers/net/mvgbe.h |    7 +++++++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c
> index 192c989..590ea0b 100644
> --- a/drivers/net/mvgbe.c
> +++ b/drivers/net/mvgbe.c
> @@ -43,6 +43,8 @@
>  #include <asm/arch/kirkwood.h>
>  #elif defined(CONFIG_ORION5X)
>  #include <asm/arch/orion5x.h>
> +#elif defined(CONFIG_DOVE)
> +#include <asm/arch/dove.h>
>  #endif
> 
>  #include "mvgbe.h"
> diff --git a/drivers/net/mvgbe.h b/drivers/net/mvgbe.h
> index d8a5429..7f5d98f 100644
> --- a/drivers/net/mvgbe.h
> +++ b/drivers/net/mvgbe.h
> @@ -308,10 +308,17 @@
>  #define EBAR_TARGET_GUNIT			0x00000007
> 
>  /* Window attrib */
> +#if defined(CONFIG_DOVE)
> +#define EBAR_DRAM_CS0				0x00000000
> +#define EBAR_DRAM_CS1				0x00000000
> +#define EBAR_DRAM_CS2				0x00000000
> +#define EBAR_DRAM_CS3				0x00000000

What does this means?
May you please explain?

Regards...
Prafulla . . .
Sebastian Hesselbarth - March 3, 2013, 11:43 a.m.
On 02/11/2013 04:39 AM, Prafulla Wadaskar wrote:
>> -----Original Message-----
>> From: Sebastian Hesselbarth [mailto:sebastian.hesselbarth@gmail.com]
>> Sent: 17 January 2013 00:55
>> To: Sebastian Hesselbarth
>> Cc: u-boot@lists.denx.de; Rabeeh Khoury; Albert Aribaud; Prafulla
>> Wadaskar; Andy Fleming; Joe Hershberger; Daniel Stodden; Luka Perkov
>> Subject: [PATCH v3 08/10] NET: mvgbe: add support for Dove
>>
>> Marvell Dove also uses mvgbe as ethernet driver, therefore add support
>> for Dove to reuse the current driver.
>>
>> Signed-off-by: Sebastian Hesselbarth<sebastian.hesselbarth@gmail.com>
>> ---
>> Cc: u-boot@lists.denx.de
>> Cc: Sebastian Hesselbarth<sebastian.hesselbarth@gmail.com>
>> Cc: Rabeeh Khoury<rabeeh@solid-run.com>
>> Cc: Albert Aribaud<albert.u.boot@aribaud.net>
>> Cc: Prafulla Wadaskar<prafulla@marvell.com>
>> Cc: Andy Fleming<afleming@gmail.com>
>> Cc: Joe Hershberger<joe.hershberger@gmail.com>
>> Cc: Daniel Stodden<daniel.stodden@gmail.com>
>> Cc: Luka Perkov<luka@openwrt.org>
>> ---
>>   drivers/net/mvgbe.c |    2 ++
>>   drivers/net/mvgbe.h |    7 +++++++
>>   2 files changed, 9 insertions(+)
>>
>> diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c
>> index 192c989..590ea0b 100644
>> --- a/drivers/net/mvgbe.c
>> +++ b/drivers/net/mvgbe.c
>> @@ -43,6 +43,8 @@
>>   #include<asm/arch/kirkwood.h>
>>   #elif defined(CONFIG_ORION5X)
>>   #include<asm/arch/orion5x.h>
>> +#elif defined(CONFIG_DOVE)
>> +#include<asm/arch/dove.h>
>>   #endif
>>
>>   #include "mvgbe.h"
>> diff --git a/drivers/net/mvgbe.h b/drivers/net/mvgbe.h
>> index d8a5429..7f5d98f 100644
>> --- a/drivers/net/mvgbe.h
>> +++ b/drivers/net/mvgbe.h
>> @@ -308,10 +308,17 @@
>>   #define EBAR_TARGET_GUNIT			0x00000007
>>
>>   /* Window attrib */
>> +#if defined(CONFIG_DOVE)
>> +#define EBAR_DRAM_CS0				0x00000000
>> +#define EBAR_DRAM_CS1				0x00000000
>> +#define EBAR_DRAM_CS2				0x00000000
>> +#define EBAR_DRAM_CS3				0x00000000
>
> What does this means?
> May you please explain?

These are ORed with other BAR values within mvgbe and control access
of mvgbe bus master to sdram. In contrast to Kirkwood, Dove has only
one sdram target interface with attribute 0x0 while Kirkwood has four
different target IDs each for one sdram bank.

Sebastian
Prafulla Wadaskar - March 11, 2013, 7:02 a.m.
> -----Original Message-----
> From: Sebastian Hesselbarth
> [mailto:sebastian.hesselbarth@gmail.com]
> Sent: 03 March 2013 17:14
> To: Prafulla Wadaskar
> Cc: u-boot@lists.denx.de; Rabeeh Khoury; Albert
> Aribaud; Andy Fleming; Joe Hershberger; Daniel Stodden;
> Luka Perkov
> Subject: Re: [PATCH v3 08/10] NET: mvgbe: add support
> for Dove
> 
> On 02/11/2013 04:39 AM, Prafulla Wadaskar wrote:
> >> -----Original Message-----
> >> From: Sebastian Hesselbarth
> [mailto:sebastian.hesselbarth@gmail.com]
> >> Sent: 17 January 2013 00:55
> >> To: Sebastian Hesselbarth
> >> Cc: u-boot@lists.denx.de; Rabeeh Khoury; Albert
> Aribaud; Prafulla
> >> Wadaskar; Andy Fleming; Joe Hershberger; Daniel
> Stodden; Luka Perkov
> >> Subject: [PATCH v3 08/10] NET: mvgbe: add support
> for Dove
> >>
> >> Marvell Dove also uses mvgbe as ethernet driver,
> therefore add support
> >> for Dove to reuse the current driver.
> >>
> >> Signed-off-by: Sebastian
> Hesselbarth<sebastian.hesselbarth@gmail.com>
> >> ---
> >> Cc: u-boot@lists.denx.de
> >> Cc: Sebastian
> Hesselbarth<sebastian.hesselbarth@gmail.com>
> >> Cc: Rabeeh Khoury<rabeeh@solid-run.com>
> >> Cc: Albert Aribaud<albert.u.boot@aribaud.net>
> >> Cc: Prafulla Wadaskar<prafulla@marvell.com>
> >> Cc: Andy Fleming<afleming@gmail.com>
> >> Cc: Joe Hershberger<joe.hershberger@gmail.com>
> >> Cc: Daniel Stodden<daniel.stodden@gmail.com>
> >> Cc: Luka Perkov<luka@openwrt.org>
> >> ---
> >>   drivers/net/mvgbe.c |    2 ++
> >>   drivers/net/mvgbe.h |    7 +++++++
> >>   2 files changed, 9 insertions(+)
> >>
> >> diff --git a/drivers/net/mvgbe.c
> b/drivers/net/mvgbe.c
> >> index 192c989..590ea0b 100644
> >> --- a/drivers/net/mvgbe.c
> >> +++ b/drivers/net/mvgbe.c
> >> @@ -43,6 +43,8 @@
> >>   #include<asm/arch/kirkwood.h>
> >>   #elif defined(CONFIG_ORION5X)
> >>   #include<asm/arch/orion5x.h>
> >> +#elif defined(CONFIG_DOVE)
> >> +#include<asm/arch/dove.h>
> >>   #endif
> >>
> >>   #include "mvgbe.h"
> >> diff --git a/drivers/net/mvgbe.h
> b/drivers/net/mvgbe.h
> >> index d8a5429..7f5d98f 100644
> >> --- a/drivers/net/mvgbe.h
> >> +++ b/drivers/net/mvgbe.h
> >> @@ -308,10 +308,17 @@
> >>   #define EBAR_TARGET_GUNIT			0x00000007
> >>
> >>   /* Window attrib */
> >> +#if defined(CONFIG_DOVE)
> >> +#define EBAR_DRAM_CS0				0x00000000
> >> +#define EBAR_DRAM_CS1				0x00000000
> >> +#define EBAR_DRAM_CS2				0x00000000
> >> +#define EBAR_DRAM_CS3				0x00000000
> >
> > What does this means?
> > May you please explain?
> 
> These are ORed with other BAR values within mvgbe and
> control access
> of mvgbe bus master to sdram. In contrast to Kirkwood,
> Dove has only
> one sdram target interface with attribute 0x0 while
> Kirkwood has four
> different target IDs each for one sdram bank.
> 

Dear Sebastian
Since dove has only one SDRAM bank
You should do
#undef EBAR_DRAM_CS1/2/3 instead of defining them zero, and manage the same effectively in the code.

To me, defining unavailable banks doesn't sound good.

Regards...
Prafulla . . .

Patch

diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c
index 192c989..590ea0b 100644
--- a/drivers/net/mvgbe.c
+++ b/drivers/net/mvgbe.c
@@ -43,6 +43,8 @@ 
 #include <asm/arch/kirkwood.h>
 #elif defined(CONFIG_ORION5X)
 #include <asm/arch/orion5x.h>
+#elif defined(CONFIG_DOVE)
+#include <asm/arch/dove.h>
 #endif
 
 #include "mvgbe.h"
diff --git a/drivers/net/mvgbe.h b/drivers/net/mvgbe.h
index d8a5429..7f5d98f 100644
--- a/drivers/net/mvgbe.h
+++ b/drivers/net/mvgbe.h
@@ -308,10 +308,17 @@ 
 #define EBAR_TARGET_GUNIT			0x00000007
 
 /* Window attrib */
+#if defined(CONFIG_DOVE)
+#define EBAR_DRAM_CS0				0x00000000
+#define EBAR_DRAM_CS1				0x00000000
+#define EBAR_DRAM_CS2				0x00000000
+#define EBAR_DRAM_CS3				0x00000000
+#else
 #define EBAR_DRAM_CS0				0x00000E00
 #define EBAR_DRAM_CS1				0x00000D00
 #define EBAR_DRAM_CS2				0x00000B00
 #define EBAR_DRAM_CS3				0x00000700
+#endif
 
 /* DRAM Target interface */
 #define EBAR_DRAM_NO_CACHE_COHERENCY		0x00000000