public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] net: macb: Fix ETH not found when clock not support
Date: Tue, 14 Feb 2017 08:58:10 +0100	[thread overview]
Message-ID: <58A2B892.8030605@denx.de> (raw)
In-Reply-To: <20170214070404.14240-1-wenyou.yang@atmel.com>

Hello Wenyou,

Am 14.02.2017 um 08:04 schrieb Wenyou Yang:
> For the boards such as smartweb on which the clock driver isn't
> supported, the ethernet fail to be found when booting up with
> the below log.
> ---8<---
> Net:   No ethernet found.
> --->8---
>
> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> ---
>
>   drivers/net/macb.c | 13 +++++++++----
>   1 file changed, 9 insertions(+), 4 deletions(-)

Thanks!

$ git am -3 mbox
Wende an: net: macb: Fix ETH not found when clock not support
Verwende Informationen aus der Staging-Area, um ein Basisverzeichnis nachzustellen ...
M       drivers/net/macb.c
Falle zur?ck zum Patchen der Basis und zum 3-Wege-Merge ...
automatischer Merge von drivers/net/macb.c
pollux:u-boot-smartweb hs [master] $

Is your patch based on current mainline?

Beside of this, it fixed the problem on the smartweb and corvus
board, thanks!

So, please add my:

Tested-by: Heiko Schocher <hs@denx.de>

bye,
Heiko
>
> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> index 67d820fefa..d29e9b2bdd 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -113,7 +113,9 @@ struct macb_device {
>   	struct mii_dev		*bus;
>
>   #ifdef CONFIG_DM_ETH
> +#ifdef CONFIG_CLK
>   	unsigned long		pclk_rate;
> +#endif
>   	phy_interface_t		phy_interface;
>   #endif
>   };
> @@ -756,7 +758,7 @@ static int _macb_write_hwaddr(struct macb_device *macb, unsigned char *enetaddr)
>   static u32 macb_mdc_clk_div(int id, struct macb_device *macb)
>   {
>   	u32 config;
> -#ifdef CONFIG_DM_ETH
> +#if defined(CONFIG_DM_ETH) && defined(CONFIG_CLK)
>   	unsigned long macb_hz = macb->pclk_rate;
>   #else
>   	unsigned long macb_hz = get_macb_pclk_rate(id);
> @@ -778,7 +780,7 @@ static u32 gem_mdc_clk_div(int id, struct macb_device *macb)
>   {
>   	u32 config;
>
> -#ifdef CONFIG_DM_ETH
> +#if defined(CONFIG_DM_ETH) && defined(CONFIG_CLK)
>   	unsigned long macb_hz = macb->pclk_rate;
>   #else
>   	unsigned long macb_hz = get_macb_pclk_rate(id);
> @@ -1002,6 +1004,7 @@ static const struct eth_ops macb_eth_ops = {
>   	.write_hwaddr	= macb_write_hwaddr,
>   };
>
> +#ifdef CONFIG_CLK
>   static int macb_enable_clk(struct udevice *dev)
>   {
>   	struct macb_device *macb = dev_get_priv(dev);
> @@ -1025,13 +1028,13 @@ static int macb_enable_clk(struct udevice *dev)
>
>   	return 0;
>   }
> +#endif
>
>   static int macb_eth_probe(struct udevice *dev)
>   {
>   	struct eth_pdata *pdata = dev_get_platdata(dev);
>   	struct macb_device *macb = dev_get_priv(dev);
>   	const char *phy_mode;
> -	int ret;
>
>   	phy_mode = fdt_getprop(gd->fdt_blob, dev->of_offset, "phy-mode", NULL);
>   	if (phy_mode)
> @@ -1043,9 +1046,11 @@ static int macb_eth_probe(struct udevice *dev)
>
>   	macb->regs = (void *)pdata->iobase;
>
> -	ret = macb_enable_clk(dev);
> +#ifdef CONFIG_CLK
> +	int ret = macb_enable_clk(dev);
>   	if (ret)
>   		return ret;
> +#endif
>
>   	_macb_eth_initialize(macb);
>
>

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

      reply	other threads:[~2017-02-14  7:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14  7:04 [U-Boot] [PATCH] net: macb: Fix ETH not found when clock not support Wenyou Yang
2017-02-14  7:58 ` Heiko Schocher [this message]

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=58A2B892.8030605@denx.de \
    --to=hs@denx.de \
    --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