diff mbox

[U-Boot,v3,08/10] sunxi: Add emac glue, enable emac on the cubieboard

Message ID 1402306622-18485-9-git-send-email-hdegoede@redhat.com
State Accepted
Delegated to: Ian Campbell
Headers show

Commit Message

Hans de Goede June 9, 2014, 9:37 a.m. UTC
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
---
 arch/arm/cpu/armv7/sunxi/board.c | 8 ++++++++
 boards.cfg                       | 2 +-
 include/configs/sunxi-common.h   | 5 +++++
 3 files changed, 14 insertions(+), 1 deletion(-)

Comments

Siarhei Siamashka July 23, 2014, 6:18 p.m. UTC | #1
On Mon,  9 Jun 2014 11:37:00 +0200
Hans de Goede <hdegoede@redhat.com> wrote:

> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> Acked-by: Ian Campbell <ijc@hellion.org.uk>
> ---
>  arch/arm/cpu/armv7/sunxi/board.c | 8 ++++++++
>  boards.cfg                       | 2 +-
>  include/configs/sunxi-common.h   | 5 +++++
>  3 files changed, 14 insertions(+), 1 deletion(-)

Again, this may be not a valid reason to complain (sorry if this is
the case), but combining generic sunxi code changes in sunxi/board.c
with the individual board support tweaks in boards.cfg is rather
cherry-pick/revert unfriendly.
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c
index 0118f5b..1e506b5 100644
--- a/arch/arm/cpu/armv7/sunxi/board.c
+++ b/arch/arm/cpu/armv7/sunxi/board.c
@@ -117,6 +117,14 @@  int cpu_eth_init(bd_t *bis)
 {
 	int rc;
 
+#ifdef CONFIG_SUNXI_EMAC
+	rc = sunxi_emac_initialize(bis);
+	if (rc < 0) {
+		printf("sunxi: failed to initialize emac\n");
+		return rc;
+	}
+#endif
+
 #ifdef CONFIG_SUNXI_GMAC
 	rc = sunxi_gmac_initialize(bis);
 	if (rc < 0) {
diff --git a/boards.cfg b/boards.cfg
index bbe2b04..1fe9f80 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -375,7 +375,7 @@  Active  arm         armv7          s5pc1xx     samsung         goni
 Active  arm         armv7          s5pc1xx     samsung         smdkc100            smdkc100                              -                                                                                                                                 Minkyu Kang <mk7.kang@samsung.com>
 Active  arm         armv7          socfpga     altera          socfpga             socfpga_cyclone5                      -                                                                                                                                 -
 Active  arm         armv7          sunxi       -               sunxi               A13-OLinuXinoM                        sun5i:A13_OLINUXINOM,SPL,CONS_INDEX=2                                                                                             Hans de Goede <hdegoede@redhat.com>
-Active  arm         armv7          sunxi       -               sunxi               Cubieboard                            sun4i:CUBIEBOARD,SPL                                                                                                              Hans de Goede <hdegoede@redhat.com>
+Active  arm         armv7          sunxi       -               sunxi               Cubieboard                            sun4i:CUBIEBOARD,SPL,SUNXI_EMAC                                                                                                   Hans de Goede <hdegoede@redhat.com>
 Active  arm         armv7          sunxi       -               sunxi               Cubietruck                            sun7i:CUBIETRUCK,SPL,SUNXI_GMAC,RGMII                                                                                             -
 Active  arm         armv7          sunxi       -               sunxi               Cubietruck_FEL                        sun7i:CUBIETRUCK,SPL_FEL,SUNXI_GMAC,RGMII                                                                                         -
 Active  arm         armv7          sunxi       -               sunxi               r7-tv-dongle                          sun5i:R7DONGLE,SPL                                                                                                                Hans de Goede <hdegoede@redhat.com>
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 1d1c87d..3f04890 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -165,6 +165,11 @@ 
 #define CONFIG_CONS_INDEX              1       /* UART0 */
 #endif
 
+/* Ethernet support */
+#ifdef CONFIG_SUNXI_EMAC
+#define CONFIG_MII			/* MII PHY management		*/
+#endif
+
 #ifdef CONFIG_SUNXI_GMAC
 #define CONFIG_DESIGNWARE_ETH		/* GMAC can use designware driver */
 #define CONFIG_DW_AUTONEG