Skip to contentSkip to conversation

Gbe Controller driver support for kirkwood SOCs

PATCH Superseded Prafulla Wadaskar 3 participants 11 messages May 4, 2009 – Jun 8, 2009 Network drivers

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Gbe Controller driver support for kirkwood SOCs

Contributors:
Yotam Admon <[email protected]>
Michael Blostein <michaelbl at marvell.com

Reviewed by: Ronen Shitrit <[email protected]>

---
Change log:
v2: entire rewrite/restructure of v1
used small names for variable/function names readl/writel used to access SoC registers
Soc registers accssed using pointers through net device struct miiphy registration done for external smi read/write access miiphy_link used to detect phy link presence
cleaned for cosmetic changes

 cpu/arm926ejs/kirkwood/cpu.c |    8 +
 drivers/net/Makefile         |    1 +
 drivers/net/kirkwood_egiga.c | 1669 ++++++++++++++++++++++++++++++++++++++++++
 drivers/net/kirkwood_egiga.h |  828 +++++++++++++++++++++
 include/netdev.h             |    1 +
 5 files changed, 2507 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/kirkwood_egiga.c
 create mode 100644 drivers/net/kirkwood_egiga.h
cpu/arm926ejs/kirkwood/cpu.c +8 -0
index bfbbe05..8ed184c 100644
@@ -293,3 +293,11 @@ int arch_misc_init(void)
 	return 0;
 }
 #endif /* CONFIG_ARCH_MISC_INIT */
+
+#ifdef CONFIG_KIRKWOOD_EGIGA
+int cpu_eth_init(bd_t *bis)
+{
+	kirkwood_egiga_initialize(bis);
+	return 0;
+}
+#endif
drivers/net/Makefile +1 -0
index a360a50..f0c5654 100644
@@ -40,6 +40,7 @@ COBJS-$(CONFIG_ENC28J60) += enc28j60.o
 COBJS-$(CONFIG_FSLDMAFEC) += fsl_mcdmafec.o mcfmii.o
 COBJS-$(CONFIG_GRETH) += greth.o
 COBJS-$(CONFIG_INCA_IP_SWITCH) += inca-ip_sw.o
+COBJS-$(CONFIG_KIRKWOOD_EGIGA) += kirkwood_egiga.o
 COBJS-$(CONFIG_DRIVER_KS8695ETH) += ks8695eth.o
 COBJS-$(CONFIG_DRIVER_LAN91C96) += lan91c96.o
 COBJS-$(CONFIG_MACB) += macb.o
drivers/net/kirkwood_egiga.c new file +1669 -0

1,669 lines not on this page · raw message

drivers/net/kirkwood_egiga.h new file +828 -0

828 lines not on this page · raw message

include/netdev.h +1 -0
index 68d664c..932d986 100644
@@ -80,6 +80,7 @@ int fec_initialize (bd_t *bis);
 int greth_initialize(bd_t *bis);
 void gt6426x_eth_initialize(bd_t *bis);
 int inca_switch_initialize(bd_t *bis);
+int kirkwood_egiga_initialize(bd_t *bis);
 int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
 int mcdmafec_initialize(bd_t *bis);
 int mcffec_initialize(bd_t *bis);
Signature · 1 line
1.5.3.4
#1 lore raw

PATCH v2 1/1 Gbe Controller driver support for kirkwood SOCs

Hi All

Ping....
I didn't here any feedback from anyone, waiting for your valued comments :-(

Regards..
Prafulla . .

Quoted 33 lines

-----Original Message-----
From: Prafulla Wadaskar [mailto:prafulla at marvell.com]
Sent: Monday, May 04, 2009 11:27 PM
To: u-boot at lists.denx.de
Cc: Prabhanjan Sarnaik; Ronen Shitrit; Ashish Karkare; Prafulla Wadaskar
Subject: [PATCH v2] Gbe Controller driver support for kirkwood SOCs

Contributors:
Yotam Admon <[email protected]>
Michael Blostein <[email protected]

Reviewed by: Ronen Shitrit <[email protected]>

---
Change log:
v2: entire rewrite/restructure of v1
used small names for variable/function names readl/writel used to access SoC registers
Soc registers accssed using pointers through net device struct miiphy registration done for external smi read/write access miiphy_link used to detect phy link presence
cleaned for cosmetic changes

 cpu/arm926ejs/kirkwood/cpu.c |    8 +
 drivers/net/Makefile         |    1 +
 drivers/net/kirkwood_egiga.c | 1669 
++++++++++++++++++++++++++++++++++++++++++
 drivers/net/kirkwood_egiga.h |  828 +++++++++++++++++++++
 include/netdev.h             |    1 +
 5 files changed, 2507 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/kirkwood_egiga.c
 create mode 100644 drivers/net/kirkwood_egiga.h
#2 lore raw

PATCH v2 1/1 Gbe Controller driver support for kirkwood SOCs

Hi Prafulla,

Quoted 6 lines · Prafulla Wadaskar

Hi All

Ping....
I didn't here any feedback from anyone, waiting for your valued comments :-(

I've started reviewing this driver - it's a lot to digest (2500 lines!?!). Please think a little about what features are really needed here. For example, do you really need RMON in a bootloader? I'll try to provide more specific feedback soon.

Quoted 4 lines

Regards..
Prafulla . .

regards,
Ben

#3 lore raw

PATCH v2 1/1 Gbe Controller driver support for kirkwood SOCs

Quoted 8 lines
Quoted 7 lines · Prafulla Wadaskar

Hi All

Ping....
I didn't here any feedback from anyone, waiting for your valued comments :-(

Quoted 4 lines

I've started reviewing this driver - it's a lot to digest (2500 lines!?!). Please think a little about what features are really needed here. For example, do you really need RMON in a bootloader? I'll try to provide more specific feedback soon.

I will say YES here :-)
I have used it for network debugging and very useful during bring up activity. But for normal operation it is not required
Regards..
Prafulla . .

Quoted 4 lines
Quoted 1 line

regards,
Ben

#4 lore raw

PATCH v3 1/1 Gbe Controller driver support for kirkwood SOCs

Contributors:
Yotam Admon <[email protected]>
Michael Blostein <michaelbl at marvell.com

Reviewed by: Ronen Shitrit <[email protected]>

---
Change log:
v2: entire rewrite/restructure of v1
used small names for variable/function names readl/writel used to access SoC registers
Soc registers accssed using pointers through net device struct miiphy registration done for external smi read/write access miiphy_link used to detect phy link presence
cleaned for cosmetic changes

v3: asm/arch/kirkwood.h included in c file

 cpu/arm926ejs/kirkwood/cpu.c |    8 +
 drivers/net/Makefile         |    1 +
 drivers/net/kirkwood_egiga.c | 1669 ++++++++++++++++++++++++++++++++++++++++++
 drivers/net/kirkwood_egiga.h |  828 +++++++++++++++++++++
 include/netdev.h             |    1 +
 5 files changed, 2507 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/kirkwood_egiga.c
 create mode 100644 drivers/net/kirkwood_egiga.h
cpu/arm926ejs/kirkwood/cpu.c +8 -0
index c1e9146..b440008 100644
@@ -295,3 +295,11 @@ int arch_misc_init(void)
 	return 0;
 }
 #endif /* CONFIG_ARCH_MISC_INIT */
+
+#ifdef CONFIG_KIRKWOOD_EGIGA
+int cpu_eth_init(bd_t *bis)
+{
+	kirkwood_egiga_initialize(bis);
+	return 0;
+}
+#endif
drivers/net/Makefile +1 -0
index a360a50..f0c5654 100644
@@ -40,6 +40,7 @@ COBJS-$(CONFIG_ENC28J60) += enc28j60.o
 COBJS-$(CONFIG_FSLDMAFEC) += fsl_mcdmafec.o mcfmii.o
 COBJS-$(CONFIG_GRETH) += greth.o
 COBJS-$(CONFIG_INCA_IP_SWITCH) += inca-ip_sw.o
+COBJS-$(CONFIG_KIRKWOOD_EGIGA) += kirkwood_egiga.o
 COBJS-$(CONFIG_DRIVER_KS8695ETH) += ks8695eth.o
 COBJS-$(CONFIG_DRIVER_LAN91C96) += lan91c96.o
 COBJS-$(CONFIG_MACB) += macb.o
drivers/net/kirkwood_egiga.c new file +1669 -0

1,669 lines not on this page · raw message

drivers/net/kirkwood_egiga.h new file +828 -0

828 lines not on this page · raw message

include/netdev.h +1 -0
index 4f2b23a..3f2dc83 100644
@@ -52,6 +52,7 @@ int fec_initialize (bd_t *bis);
 int greth_initialize(bd_t *bis);
 void gt6426x_eth_initialize(bd_t *bis);
 int inca_switch_initialize(bd_t *bis);
+int kirkwood_egiga_initialize(bd_t *bis);
 int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
 int mcdmafec_initialize(bd_t *bis);
 int mcffec_initialize(bd_t *bis);
Signature · 1 line
1.5.3.3
#5 lore raw

PATCH v2 1/1 Gbe Controller driver support for kirkwood SOCs

In reply to Ben Warren

Hi Ben,

How are you?
Seems to be very busy as usual.... :-)

Can you pls kindly take out some time to review these patches.
hopefully they are as per your requirements since we have invested considerable time to make them up to the mark.
May be-you can accept them :-)
http://lists.denx.de/pipermail/u-boot/2009-May/053111.html
http://lists.denx.de/pipermail/u-boot/2009-May/052905.html
Just to share with you,
in netdev.h- though struct and enums defined looks similar-
I have used separate struct and enums for both mv88e61xx and mv88e1116 because only basic init support is available in those drives, but in coming time there will be more features added to them. I think since these are initial drivers in net/phy/ we should provide common/phy.h and keep netdev.h untouched
What do you think?

Also you might be ready with review comments for this
http://lists.denx.de/pipermail/u-boot/2009-May/053113.html
Nothing much changed in v4 compared to patch version v1.
few global comments that I received for this patch from you are-
1. the code is too big.
2. can you strip down features to minimum
Just to reply these:
the entire egiga driver is kept as separate driver .c and .h,
I am in progress to reuse the code from other drivers.
The features are kept minimal required but I can cut down some of features like "update network statistics" so as to make code size small and acceptable :-) Still your comments will help me to provide better code...

Last but not least
Shall I resend above patches if you feel this is more comfortable for you?

Regards..
Prafulla. . .

Quoted 30 lines

-----Original Message-----
From: Ben Warren [mailto:biggerbadderben at gmail.com]
Sent: Tuesday, May 12, 2009 12:38 PM
To: Prafulla Wadaskar
Cc: u-boot at lists.denx.de; Ashish Karkare; Prabhanjan Sarnaik; Ronen Shitrit
Subject: Re: [U-Boot] [PATCH v2] Gbe Controller driver support for kirkwood SOCs

Hi Prafulla,

Quoted 7 lines · Prafulla Wadaskar

Hi All

Ping....
I didn't here any feedback from anyone, waiting for your valued comments :-(

I've started reviewing this driver - it's a lot to digest (2500 lines!?!). Please think a little about what features are really needed here. For example, do you really need RMON in a bootloader? I'll try to provide more specific feedback soon.

Quoted 4 lines

Regards..
Prafulla . .

regards,
Ben

#6 lore raw

PATCH v2 1/1 Gbe Controller driver support for kirkwood SOCs

Hi Prafulla,

Quoted 3 lines · Prafulla Wadaskar

Hi Ben,

How are you?

Not bad, thanks for asking!

Quoted 3 lines

Seems to be very busy as usual.... :-)

Yeah, very busy but that's still not a good excuse. I usually respond quickly to small changes but not so much with the big ones because I want to make sure they get a thorough review. I'm planning on spending a few hours tonight going through my queue, and your patches are prominent.

regards,
Ben

#7 lore raw

PATCH v2 1/1 Gbe Controller driver support for kirkwood SOCs

In reply to Prafulla Wadaskar

Hi Prafulla,

Quoted 10 lines · Prafulla Wadaskar

Hi Ben,

How are you?
Seems to be very busy as usual.... :-)

Can you pls kindly take out some time to review these patches.
hopefully they are as per your requirements since we have invested considerable time to make them up to the mark. May be-you can accept them :-)
http://lists.denx.de/pipermail/u-boot/2009-May/053111.html

We don't currently have a proper PHY framework in place, although over the years there's been much talk in this area. For now I'll pass on this one.

Quoted 2 lines

http://lists.denx.de/pipermail/u-boot/2009-May/052905.html

I've pulled this into net/next. Thanks for spinning it so many times.

Quoted 7 lines

Just to share with you,
in netdev.h- though struct and enums defined looks similar-
I have used separate struct and enums for both mv88e61xx and mv88e1116 because only basic init support is available in those drives, but in coming time there will be more features added to them. I think since these are initial drivers in net/phy/ we should provide common/phy.h and keep netdev.h untouched
What do you think?

As I mentioned above, the existing PHY infrastructure is weak. The switch driver is fine here, but I don't want to add any regular PHYs without a properly designed interface. A lot of work has been done in this area but hasn't been published yet. Stay tuned...

Quoted 13 lines

Also you might be ready with review comments for this
http://lists.denx.de/pipermail/u-boot/2009-May/053113.html
Nothing much changed in v4 compared to patch version v1.
few global comments that I received for this patch from you are-
1. the code is too big.
2. can you strip down features to minimum
Just to reply these:
the entire egiga driver is kept as separate driver .c and .h,
I am in progress to reuse the code from other drivers.
The features are kept minimal required but I can cut down some of features like "update network statistics" so as to make code size small and acceptable :-) Still your comments will help me to provide better code...

The driver is really big, which isn't necessarily a show stopper. I'd like to see you #ifdef CONFIG_xxx out the non-essential stuff (statistics etc.) so that users aren't forced to compile it in. Also, please put the changes to cpu.c into a different patch.

Quoted 7 lines

Last but not least
Shall I resend above patches if you feel this is more comfortable for you?

Regards..
Prafulla. . .

Thanks for being so flexible.

regards,
Ben

#8 lore raw

PATCH v2 1/1 Gbe Controller driver support for kirkwood SOCs

Dear Ben,

Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 3 lines

http://lists.denx.de/pipermail/u-boot/2009-May/052905.html

I've pulled this into net/next. Thanks for spinning it so many times.

Can you please send a pull request for next soon? Thanks in advance.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
C++ is the best example of second-system effect since OS/360.
#9 lore raw

PATCH v2 1/1 Gbe Controller driver support for kirkwood SOCs

Quoted 7 lines · Wolfgang Denk

Dear Ben,

Quoted 3 lines · In message <[email protected]> you wrote:
Quoted 3 lines

http://lists.denx.de/pipermail/u-boot/2009-May/052905.html

Quoted 10 lines
Quoted 2 lines

I've pulled this into net/next. Thanks for spinning it so many times.

Can you please send a pull request for next soon? Thanks in advance.

Best regards,

Wolfgang Denk

You bet.

Ben

#10 lore raw

PATCH v2 1/1 Gbe Controller driver support for kirkwood SOCs

Quoted 23 lines

-----Original Message-----
From: Ben Warren [mailto:biggerbadderben at gmail.com]
Sent: Friday, June 05, 2009 10:04 PM
To: Wolfgang Denk
Cc: Prafulla Wadaskar; u-boot at lists.denx.de; Ashish Karkare; Prabhanjan Sarnaik; Ronen Shitrit
Subject: Re: [U-Boot] [PATCH v2] Gbe Controller driver support for kirkwood SOCs

Quoted 8 lines · Wolfgang Denk

Dear Ben,

Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 3 lines

http://lists.denx.de/pipermail/u-boot/2009-May/052905.html

I've pulled this into net/next. Thanks for spinning it so

many times.

Quoted 2 lines
Quoted 1 line
Quoted 8 lines
Quoted 7 lines

Can you please send a pull request for next soon? Thanks in advance.

Best regards,

Wolfgang Denk

You bet.

May be it is little bit confusing.
I think Wolfgang is talking with reference to Marvell MV88E61XX Switch Driver which is already in next branch. Whereas subject for this mail is different.

We wish to see MV88E61XX driver in, there are some other users for this too..

Regards..
Prafulla . .

Quoted 3 lines

Ben