From: Ian Campbell <ijc+uboot@hellion.org.uk>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH 12/13] dm: sunxi: Support driver model for Ethernet
Date: Tue, 03 Mar 2015 08:40:12 +0000 [thread overview]
Message-ID: <1425372012.12103.31.camel@hellion.org.uk> (raw)
In-Reply-To: <1425227620-6656-12-git-send-email-sjg@chromium.org>
On Sun, 2015-03-01 at 09:33 -0700, Simon Glass 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.
I wonder if for this sort of thing designware_initialize couldn't become
a nop so we can avoid some level of ifdefs?
Anyway, that's just minor, of larger concern is all the CONFIG_RGMII and
CONFIG_GMII stuff which is just above the context here. Doesn't that
need to become DM driven for this to be useful?
In fact, doesn't the pinmux generally need to become DM driven?
Or is this just a partial stepping stone to DM Ethernet support and not
a complete transition? (I wonder if I am confusing Device Model with
Device Tree here and this is all about the former, albeit the former is
often driven from the latter...)
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> board/sunxi/gmac.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/board/sunxi/gmac.c b/board/sunxi/gmac.c
> index 8849132..ce7831d 100644
> --- a/board/sunxi/gmac.c
> +++ b/board/sunxi/gmac.c
> @@ -80,11 +80,16 @@ int sunxi_gmac_initialize(bd_t *bis)
> sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC);
> #endif
>
> -#ifdef CONFIG_RGMII
> +#ifdef CONFIG_DM_ETH
> + printf("eth init\n");
> + 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
> }
next prev parent reply other threads:[~2015-03-03 8:40 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-01 16:33 [U-Boot] [RFC PATCH 01/13] Use 'U-Boot' instead of 'U-boot' in CONFIG_BOOTP_VCI_STRING Simon Glass
2015-03-01 16:33 ` [U-Boot] [RFC PATCH 02/13] net: Fix eth_get_dev_by_name() warning Simon Glass
2015-03-01 17:02 ` Joe Hershberger
2015-03-01 16:33 ` [U-Boot] [RFC PATCH 03/13] sunxi: Replace the pcDuino3 config with FDT version Simon Glass
2015-03-03 8:34 ` Ian Campbell
2015-03-03 13:29 ` Hans de Goede
2015-03-03 14:01 ` Simon Glass
2015-03-01 16:33 ` [U-Boot] [RFC PATCH 04/13] Kconfig: Move CONFIG_DESIGNWARE_ETH to Kconfig Simon Glass
2015-03-01 17:08 ` Joe Hershberger
2015-03-01 16:33 ` [U-Boot] [RFC PATCH 05/13] dts: sunxi: Bring in Ethernet device tree bindings Simon Glass
2015-03-03 8:36 ` Ian Campbell
2015-03-03 23:40 ` Simon Glass
2015-03-04 8:53 ` Ian Campbell
2015-03-01 16:33 ` [U-Boot] [RFC PATCH 06/13] dm: core: Support allocating driver-private data for DMA Simon Glass
2015-03-01 16:33 ` [U-Boot] [RFC PATCH 07/13] dm: net: Use existing Ethernet init for driver model Simon Glass
2015-03-01 17:14 ` Joe Hershberger
2015-03-01 16:33 ` [U-Boot] [RFC PATCH 08/13] Avoid calling print_eths() with " Simon Glass
2015-03-01 17:23 ` Joe Hershberger
2015-03-01 16:33 ` [U-Boot] [RFC PATCH 09/13] dm: net: Adjust PHY interface to work with CONFIG_DM_ETH Simon Glass
2015-03-01 17:46 ` Joe Hershberger
2015-03-01 16:33 ` [U-Boot] [RFC PATCH 10/13] dm: net: Tidy up designware driver ready for driver model Simon Glass
2015-03-01 17:49 ` Joe Hershberger
2015-03-01 16:33 ` [U-Boot] [RFC PATCH 11/13] dm: net: Adjust designware driver to support " Simon Glass
2015-03-01 17:51 ` Joe Hershberger
2015-03-01 16:33 ` [U-Boot] [RFC PATCH 12/13] dm: sunxi: Support driver model for Ethernet Simon Glass
2015-03-01 17:51 ` Joe Hershberger
2015-03-03 8:40 ` Ian Campbell [this message]
2015-03-03 23:40 ` Simon Glass
2015-03-01 16:33 ` [U-Boot] [RFC PATCH 13/13] dm: sunxi: Use driver model for Ethernet on Linksprite pcDuino3 Simon Glass
2015-03-03 8:41 ` Ian Campbell
2015-03-03 23:40 ` Simon Glass
2015-03-04 8:54 ` Ian Campbell
2015-03-02 13:59 ` [U-Boot] [RFC PATCH 01/13] Use 'U-Boot' instead of 'U-boot' in CONFIG_BOOTP_VCI_STRING Tom Rini
2015-03-02 22:14 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1425372012.12103.31.camel@hellion.org.uk \
--to=ijc+uboot@hellion.org.uk \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox