All of lore.kernel.org
 help / color / mirror / Atom feed
From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3] ARM: at91: Fix link breakage when !CONFIG_PHYLIB
Date: Mon, 27 May 2013 14:05:13 +0200	[thread overview]
Message-ID: <51A34BF9.5000905@atmel.com> (raw)
In-Reply-To: <1369651702-9207-1-git-send-email-alexandre.belloni@free-electrons.com>

On 27/05/2013 12:48, Alexandre Belloni :
> Fixes:
> arch/arm/mach-at91/built-in.o: In function `ksz9021rn_phy_fixup':
> :(.text+0x1174): undefined reference to `mdiobus_write'
> :(.text+0x1188): undefined reference to `mdiobus_write'
> :(.text+0x119c): undefined reference to `mdiobus_write'
> :(.text+0x11b0): undefined reference to `mdiobus_write'
> arch/arm/mach-at91/built-in.o: In function `sama5_dt_device_init':
> :(.init.text+0x1e34): undefined reference to `phy_register_fixup_for_uid'
>
> when CONFIG_PHYLIB is not selected.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> ---
> Changes in v3:
> 	added SoB
> 	added Acked-By

A v3 is not needed simply for this. Thanks, anyway!

One question though: why not just add

         select PHYLIB

In Kconfig entry:

  config MACH_SAMA5_DT

?

(note that I like to play with everybody's nerves ;-))

Bye,

> Changes in v2:
> 	use IS_BUILTIN
> 	use CONFIG_PHYLIB and not CONFIG_PHY
>
>   arch/arm/mach-at91/board-dt-sama5.c | 22 ++++++++++++----------
>   1 file changed, 12 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c
> index 705305e..e9ce541 100644
> --- a/arch/arm/mach-at91/board-dt-sama5.c
> +++ b/arch/arm/mach-at91/board-dt-sama5.c
> @@ -47,22 +47,24 @@ static int ksz9021rn_phy_fixup(struct phy_device *phy)
>   #define GMII_ERCR	11
>   #define GMII_ERDWR	12
>
> -	/* Set delay values */
> -	value = GMII_RCCPSR | 0x8000;
> -	phy_write(phy, GMII_ERCR, value);
> -	value = 0xF2F4;
> -	phy_write(phy, GMII_ERDWR, value);
> -	value = GMII_RRDPSR | 0x8000;
> -	phy_write(phy, GMII_ERCR, value);
> -	value = 0x2222;
> -	phy_write(phy, GMII_ERDWR, value);
> +	if (IS_BUILTIN(CONFIG_PHYLIB)) {
> +		/* Set delay values */
> +		value = GMII_RCCPSR | 0x8000;
> +		phy_write(phy, GMII_ERCR, value);
> +		value = 0xF2F4;
> +		phy_write(phy, GMII_ERDWR, value);
> +		value = GMII_RRDPSR | 0x8000;
> +		phy_write(phy, GMII_ERCR, value);
> +		value = 0x2222;
> +		phy_write(phy, GMII_ERDWR, value);
> +	}
>
>   	return 0;
>   }
>
>   static void __init sama5_dt_device_init(void)
>   {
> -	if (of_machine_is_compatible("atmel,sama5d3xcm"))
> +	if (of_machine_is_compatible("atmel,sama5d3xcm") && IS_BUILTIN(CONFIG_PHYLIB))
>   		phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
>   			ksz9021rn_phy_fixup);
>
>


-- 
Nicolas Ferre

WARNING: multiple messages have this Message-ID (diff)
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>,
	"Jean-Christophe Plagniol-Villard" <plagnioj@jcrosoft.com>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	Ludovic Desroches <ludovic.desroches@atmel.com>
Subject: Re: [PATCH v3] ARM: at91: Fix link breakage when !CONFIG_PHYLIB
Date: Mon, 27 May 2013 14:05:13 +0200	[thread overview]
Message-ID: <51A34BF9.5000905@atmel.com> (raw)
In-Reply-To: <1369651702-9207-1-git-send-email-alexandre.belloni@free-electrons.com>

On 27/05/2013 12:48, Alexandre Belloni :
> Fixes:
> arch/arm/mach-at91/built-in.o: In function `ksz9021rn_phy_fixup':
> :(.text+0x1174): undefined reference to `mdiobus_write'
> :(.text+0x1188): undefined reference to `mdiobus_write'
> :(.text+0x119c): undefined reference to `mdiobus_write'
> :(.text+0x11b0): undefined reference to `mdiobus_write'
> arch/arm/mach-at91/built-in.o: In function `sama5_dt_device_init':
> :(.init.text+0x1e34): undefined reference to `phy_register_fixup_for_uid'
>
> when CONFIG_PHYLIB is not selected.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> ---
> Changes in v3:
> 	added SoB
> 	added Acked-By

A v3 is not needed simply for this. Thanks, anyway!

One question though: why not just add

         select PHYLIB

In Kconfig entry:

  config MACH_SAMA5_DT

?

(note that I like to play with everybody's nerves ;-))

Bye,

> Changes in v2:
> 	use IS_BUILTIN
> 	use CONFIG_PHYLIB and not CONFIG_PHY
>
>   arch/arm/mach-at91/board-dt-sama5.c | 22 ++++++++++++----------
>   1 file changed, 12 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c
> index 705305e..e9ce541 100644
> --- a/arch/arm/mach-at91/board-dt-sama5.c
> +++ b/arch/arm/mach-at91/board-dt-sama5.c
> @@ -47,22 +47,24 @@ static int ksz9021rn_phy_fixup(struct phy_device *phy)
>   #define GMII_ERCR	11
>   #define GMII_ERDWR	12
>
> -	/* Set delay values */
> -	value = GMII_RCCPSR | 0x8000;
> -	phy_write(phy, GMII_ERCR, value);
> -	value = 0xF2F4;
> -	phy_write(phy, GMII_ERDWR, value);
> -	value = GMII_RRDPSR | 0x8000;
> -	phy_write(phy, GMII_ERCR, value);
> -	value = 0x2222;
> -	phy_write(phy, GMII_ERDWR, value);
> +	if (IS_BUILTIN(CONFIG_PHYLIB)) {
> +		/* Set delay values */
> +		value = GMII_RCCPSR | 0x8000;
> +		phy_write(phy, GMII_ERCR, value);
> +		value = 0xF2F4;
> +		phy_write(phy, GMII_ERDWR, value);
> +		value = GMII_RRDPSR | 0x8000;
> +		phy_write(phy, GMII_ERCR, value);
> +		value = 0x2222;
> +		phy_write(phy, GMII_ERDWR, value);
> +	}
>
>   	return 0;
>   }
>
>   static void __init sama5_dt_device_init(void)
>   {
> -	if (of_machine_is_compatible("atmel,sama5d3xcm"))
> +	if (of_machine_is_compatible("atmel,sama5d3xcm") && IS_BUILTIN(CONFIG_PHYLIB))
>   		phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
>   			ksz9021rn_phy_fixup);
>
>


-- 
Nicolas Ferre

  parent reply	other threads:[~2013-05-27 12:05 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-27 10:48 [PATCH v3] ARM: at91: Fix link breakage when !CONFIG_PHYLIB Alexandre Belloni
2013-05-27 10:48 ` Alexandre Belloni
2013-05-27 11:26 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-27 11:26   ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-27 12:50   ` Alexandre Belloni
2013-05-27 12:50     ` Alexandre Belloni
2013-05-27 12:59     ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-27 12:59       ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-27 16:04       ` Alexandre Belloni
2013-05-27 16:04         ` Alexandre Belloni
2013-05-27 12:05 ` Nicolas Ferre [this message]
2013-05-27 12:05   ` Nicolas Ferre
2013-05-27 12:42   ` Arnd Bergmann
2013-05-27 12:42     ` Arnd Bergmann
2013-06-04 13:49     ` Nicolas Ferre
2013-06-04 13:49       ` Nicolas Ferre
2013-06-04 14:12       ` Alexandre Belloni
2013-06-04 14:12         ` Alexandre Belloni
2013-06-04 15:12         ` Arnd Bergmann
2013-06-04 15:12           ` Arnd Bergmann
2013-05-27 12:43   ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-27 12:43     ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-27 12:46   ` Alexandre Belloni
2013-05-27 12:46     ` Alexandre Belloni

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=51A34BF9.5000905@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.