[U-Boot] [PATCH] socfpga: initialize designware ethernet

Pavel Machek pavel at denx.de
Fri Jul 11 12:40:06 CEST 2014


On Fri 2014-07-11 11:49:49, Marek Vasut wrote:
> On Friday, July 11, 2014 at 11:45:56 AM, Pavel Machek wrote:
> [...]
> > diff --git a/board/altera/socfpga/socfpga_cyclone5.c
> > b/board/altera/socfpga/socfpga_cyclone5.c index a960eb6..2214ab7 100644
> > --- a/board/altera/socfpga/socfpga_cyclone5.c
> > +++ b/board/altera/socfpga/socfpga_cyclone5.c
> > @@ -1,5 +1,6 @@
> >  /*
> >   *  Copyright (C) 2012 Altera Corporation <www.altera.com>
> > + *  Copyright (C) 2014 Pavel Machek, pavel at denx.de
> 
> NAK ;-) Can you please keep the email address in this extremely relevant comment 
> in the same format as above (in the <> chars) .

Umm, note that above is web address and mine is email address :-).

> > @@ -67,5 +68,11 @@ int overwrite_console(void)
> >  /* We know all the init functions have been run now */
> >  int board_eth_init(bd_t *bis)
> >  {
> > +#if !defined(CONFIG_SOCFPGA_VIRTUAL_TARGET) && !defined(CONFIG_SPL_BUILD)
> > +       /* initialize and register the emac */
> > +	int rval = designware_initialize(CONFIG_EMAC_BASE,
> > CONFIG_PHY_INTERFACE_MODE); +	return rval;
> > +#else
> >  	return 0;
> > +#endif
> >  }
> 
> Can this all not go into cpu_eth_init() and into arch/arm/... instead ?

No idea. When I move it to arch/arm/, like this, it still works, so I
guess it can be moved.

Should I prepare new patch?
									Pavel

diff --git a/arch/arm/cpu/armv7/socfpga/misc.c b/arch/arm/cpu/armv7/socfpga/misc.c
index 2f1c716..6c64f28 100644
--- a/arch/arm/cpu/armv7/socfpga/misc.c
+++ b/arch/arm/cpu/armv7/socfpga/misc.c
@@ -6,6 +6,8 @@
 
 #include <common.h>
 #include <asm/io.h>
+#include <miiphy.h>
+#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -14,3 +16,19 @@ int dram_init(void)
 	gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
 	return 0;
 }
+
+
+/*
+ * DesignWare Ethernet initialization
+ */
+/* We know all the init functions have been run now */
+int board_eth_init(bd_t *bis)
+{
+#if !defined(CONFIG_SOCFPGA_VIRTUAL_TARGET) && !defined(CONFIG_SPL_BUILD)
+       /* initialize and register the emac */
+	return designware_initialize(CONFIG_EMAC_BASE,
+				     CONFIG_PHY_INTERFACE_MODE);
+#else
+	return 0;
+#endif
+}
diff --git a/board/altera/socfpga/socfpga_cyclone5.c b/board/altera/socfpga/socfpga_cyclone5.c
index 2214ab7..5cbe695 100644
--- a/board/altera/socfpga/socfpga_cyclone5.c
+++ b/board/altera/socfpga/socfpga_cyclone5.c
@@ -8,8 +8,6 @@
 #include <common.h>
 #include <asm/arch/reset_manager.h>
 #include <asm/io.h>
-#include <miiphy.h>
-#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -61,18 +59,3 @@ int overwrite_console(void)
 	return 0;
 }
 #endif
-
-/*
- * DesignWare Ethernet initialization
- */
-/* We know all the init functions have been run now */
-int board_eth_init(bd_t *bis)
-{
-#if !defined(CONFIG_SOCFPGA_VIRTUAL_TARGET) && !defined(CONFIG_SPL_BUILD)
-       /* initialize and register the emac */
-	int rval = designware_initialize(CONFIG_EMAC_BASE, CONFIG_PHY_INTERFACE_MODE);
-	return rval;
-#else
-	return 0;
-#endif
-}


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


More information about the U-Boot mailing list