diff mbox

[U-Boot,v2,10/11] dm: sunxi: Support driver model for Ethernet

Message ID 1428271663-3814-11-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass April 5, 2015, 10:07 p.m. UTC
Adjust the Ethernet initialisation code to support driver model.
It is no-longer necessary to call designware_initialize(). The device will
be probed when it is used. The PHY type and GMAC base will come from the
device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2:
- Remove unwanted printf()

 board/sunxi/gmac.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Simon Glass April 9, 2015, 3:04 a.m. UTC | #1
On 5 April 2015 at 16:07, Simon Glass <sjg@chromium.org> wrote:
> Adjust the Ethernet initialisation code to support driver model.
> It is no-longer necessary to call designware_initialize(). The device will
> be probed when it is used. The PHY type and GMAC base will come from the
> device tree.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v2:
> - Remove unwanted printf()
>
>  board/sunxi/gmac.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)

Applied to u-boot-dm/next.
diff mbox

Patch

diff --git a/board/sunxi/gmac.c b/board/sunxi/gmac.c
index 8849132..1540633 100644
--- a/board/sunxi/gmac.c
+++ b/board/sunxi/gmac.c
@@ -80,11 +80,15 @@  int sunxi_gmac_initialize(bd_t *bis)
 		sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC);
 #endif
 
-#ifdef CONFIG_RGMII
+#ifdef CONFIG_DM_ETH
+	return 0;
+#else
+# ifdef CONFIG_RGMII
 	return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_RGMII);
-#elif defined CONFIG_GMII
+# elif defined CONFIG_GMII
 	return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_GMII);
-#else
+# else
 	return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_MII);
+# endif
 #endif
 }