diff options
author | Simon Glass <sjg@chromium.org> | 2015-04-05 16:07:42 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-18 11:11:37 -0600 |
commit | 5b4c6f299c6d2176dd87d284acd3f58a955eb16a (patch) | |
tree | 1b4fe6a9fcddb9695376b92a227b92580f9943a1 /board/sunxi/gmac.c | |
parent | 75577ba45a42420d91ccfd9b9ce4ea1298f507ef (diff) | |
download | u-boot-imx-5b4c6f299c6d2176dd87d284acd3f58a955eb16a.zip u-boot-imx-5b4c6f299c6d2176dd87d284acd3f58a955eb16a.tar.gz u-boot-imx-5b4c6f299c6d2176dd87d284acd3f58a955eb16a.tar.bz2 |
dm: sunxi: Support driver model for Ethernet
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>
Diffstat (limited to 'board/sunxi/gmac.c')
-rw-r--r-- | board/sunxi/gmac.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/board/sunxi/gmac.c b/board/sunxi/gmac.c index 63a7360..d90eed4 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_GPA_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 } |