2008-07-16 13:43:42

by Kumar Gala

[permalink] [raw]
Subject: [PATCH] powerpc/ep8248e: Fix compile problem if !CONFIG_FS_ENET

If we don't enable FS_ENET we get build issues:

arch/powerpc/platforms/built-in.o: In function `ep8248e_mdio_probe':
arch/powerpc/platforms/82xx/ep8248e.c:129: undefined reference to `alloc_mdio_bitbang'
arch/powerpc/platforms/82xx/ep8248e.c:143: undefined reference to `mdiobus_register'

Signed-off-by: Kumar Gala <[email protected]>
---

In my powerpc-next tree.

- k

arch/powerpc/platforms/82xx/ep8248e.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/82xx/ep8248e.c b/arch/powerpc/platforms/82xx/ep8248e.c
index d5770fd..373e993 100644
--- a/arch/powerpc/platforms/82xx/ep8248e.c
+++ b/arch/powerpc/platforms/82xx/ep8248e.c
@@ -59,6 +59,7 @@ static void __init ep8248e_pic_init(void)
of_node_put(np);
}

+#ifdef CONFIG_FS_ENET_MDIO_FCC
static void ep8248e_set_mdc(struct mdiobb_ctrl *ctrl, int level)
{
if (level)
@@ -164,6 +165,7 @@ static struct of_platform_driver ep8248e_mdio_driver = {
.probe = ep8248e_mdio_probe,
.remove = ep8248e_mdio_remove,
};
+#endif

struct cpm_pin {
int port, pin, flags;
@@ -296,7 +298,9 @@ static __initdata struct of_device_id of_bus_ids[] = {
static int __init declare_of_platform_devices(void)
{
of_platform_bus_probe(NULL, of_bus_ids, NULL);
+#ifdef CONFIG_FS_ENET_MDIO_FCC
of_register_platform_driver(&ep8248e_mdio_driver);
+#endif

return 0;
}
--
1.5.5.1


2008-07-16 21:47:36

by Scott Wood

[permalink] [raw]
Subject: Re: [PATCH] powerpc/ep8248e: Fix compile problem if !CONFIG_FS_ENET

On Wed, Jul 16, 2008 at 08:39:12AM -0500, Kumar Gala wrote:
> If we don't enable FS_ENET we get build issues:
>
> arch/powerpc/platforms/built-in.o: In function `ep8248e_mdio_probe':
> arch/powerpc/platforms/82xx/ep8248e.c:129: undefined reference to `alloc_mdio_bitbang'
> arch/powerpc/platforms/82xx/ep8248e.c:143: undefined reference to `mdiobus_register'

How is this possible? CONFIG_EP8248E selects CONFIG_MDIO_BITBANG.

> +#ifdef CONFIG_FS_ENET_MDIO_FCC
> static void ep8248e_set_mdc(struct mdiobb_ctrl *ctrl, int level)
> {
> if (level)
> @@ -164,6 +165,7 @@ static struct of_platform_driver ep8248e_mdio_driver = {
> .probe = ep8248e_mdio_probe,
> .remove = ep8248e_mdio_remove,
> };
> +#endif

This is wrong -- ep8248e doesn't use the FS_ENET_MDIO_FCC code.

-Scott

2008-07-16 22:02:42

by Kumar Gala

[permalink] [raw]
Subject: Re: [PATCH] powerpc/ep8248e: Fix compile problem if !CONFIG_FS_ENET


On Jul 16, 2008, at 4:47 PM, Scott Wood wrote:

> On Wed, Jul 16, 2008 at 08:39:12AM -0500, Kumar Gala wrote:
>> If we don't enable FS_ENET we get build issues:
>>
>> arch/powerpc/platforms/built-in.o: In function `ep8248e_mdio_probe':
>> arch/powerpc/platforms/82xx/ep8248e.c:129: undefined reference to
>> `alloc_mdio_bitbang'
>> arch/powerpc/platforms/82xx/ep8248e.c:143: undefined reference to
>> `mdiobus_register'
>
> How is this possible? CONFIG_EP8248E selects CONFIG_MDIO_BITBANG.
>
>> +#ifdef CONFIG_FS_ENET_MDIO_FCC
>> static void ep8248e_set_mdc(struct mdiobb_ctrl *ctrl, int level)
>> {
>> if (level)
>> @@ -164,6 +165,7 @@ static struct of_platform_driver
>> ep8248e_mdio_driver = {
>> .probe = ep8248e_mdio_probe,
>> .remove = ep8248e_mdio_remove,
>> };
>> +#endif
>
> This is wrong -- ep8248e doesn't use the FS_ENET_MDIO_FCC code.

You're correct this should be CONFIG_MDIO_BITBANG

- k

2008-07-16 22:05:40

by Dave Jones

[permalink] [raw]
Subject: Re: [PATCH] powerpc/ep8248e: Fix compile problem if !CONFIG_FS_ENET

On Wed, Jul 16, 2008 at 04:47:23PM -0500, Scott Wood wrote:
> On Wed, Jul 16, 2008 at 08:39:12AM -0500, Kumar Gala wrote:
> > If we don't enable FS_ENET we get build issues:
> >
> > arch/powerpc/platforms/built-in.o: In function `ep8248e_mdio_probe':
> > arch/powerpc/platforms/82xx/ep8248e.c:129: undefined reference to `alloc_mdio_bitbang'
> > arch/powerpc/platforms/82xx/ep8248e.c:143: undefined reference to `mdiobus_register'
>
> How is this possible? CONFIG_EP8248E selects CONFIG_MDIO_BITBANG.

If CONFIG_PHYLIB=m however, that doesn't make any difference, because
vmlinuz is trying to use a symbol which now lives in a module.

Dave

--
http://www.codemonkey.org.uk

2008-07-16 22:11:03

by Kumar Gala

[permalink] [raw]
Subject: Re: [PATCH] powerpc/ep8248e: Fix compile problem if !CONFIG_FS_ENET


On Jul 16, 2008, at 4:57 PM, Dave Jones wrote:

> On Wed, Jul 16, 2008 at 04:47:23PM -0500, Scott Wood wrote:
>> On Wed, Jul 16, 2008 at 08:39:12AM -0500, Kumar Gala wrote:
>>> If we don't enable FS_ENET we get build issues:
>>>
>>> arch/powerpc/platforms/built-in.o: In function `ep8248e_mdio_probe':
>>> arch/powerpc/platforms/82xx/ep8248e.c:129: undefined reference to
>>> `alloc_mdio_bitbang'
>>> arch/powerpc/platforms/82xx/ep8248e.c:143: undefined reference to
>>> `mdiobus_register'
>>
>> How is this possible? CONFIG_EP8248E selects CONFIG_MDIO_BITBANG.
>
> If CONFIG_PHYLIB=m however, that doesn't make any difference, because
> vmlinuz is trying to use a symbol which now lives in a module.

The mdiobus_register make sense, I'm not sure get why
alloc_mdio_bitbang is undefined.

- k

2008-07-16 22:26:46

by Dave Jones

[permalink] [raw]
Subject: Re: [PATCH] powerpc/ep8248e: Fix compile problem if !CONFIG_FS_ENET

On Wed, Jul 16, 2008 at 05:10:29PM -0500, Kumar Gala wrote:
>
> On Jul 16, 2008, at 4:57 PM, Dave Jones wrote:
>
> > On Wed, Jul 16, 2008 at 04:47:23PM -0500, Scott Wood wrote:
> >> On Wed, Jul 16, 2008 at 08:39:12AM -0500, Kumar Gala wrote:
> >>> If we don't enable FS_ENET we get build issues:
> >>>
> >>> arch/powerpc/platforms/built-in.o: In function `ep8248e_mdio_probe':
> >>> arch/powerpc/platforms/82xx/ep8248e.c:129: undefined reference to
> >>> `alloc_mdio_bitbang'
> >>> arch/powerpc/platforms/82xx/ep8248e.c:143: undefined reference to
> >>> `mdiobus_register'
> >>
> >> How is this possible? CONFIG_EP8248E selects CONFIG_MDIO_BITBANG.
> >
> > If CONFIG_PHYLIB=m however, that doesn't make any difference, because
> > vmlinuz is trying to use a symbol which now lives in a module.
>
> The mdiobus_register make sense, I'm not sure get why
> alloc_mdio_bitbang is undefined.

Erm, same reason. it's built into phy.o, which ends up in the module,
not the vmlinuz.

(also, it doesn't look like it's exported even if it was built-in?)

Dave

--
http://www.codemonkey.org.uk

2008-07-16 22:27:59

by Kumar Gala

[permalink] [raw]
Subject: Re: [PATCH] powerpc/ep8248e: Fix compile problem if !CONFIG_FS_ENET


On Jul 16, 2008, at 5:10 PM, Kumar Gala wrote:

>
> On Jul 16, 2008, at 4:57 PM, Dave Jones wrote:
>
>> On Wed, Jul 16, 2008 at 04:47:23PM -0500, Scott Wood wrote:
>>> On Wed, Jul 16, 2008 at 08:39:12AM -0500, Kumar Gala wrote:
>>>> If we don't enable FS_ENET we get build issues:
>>>>
>>>> arch/powerpc/platforms/built-in.o: In function
>>>> `ep8248e_mdio_probe':
>>>> arch/powerpc/platforms/82xx/ep8248e.c:129: undefined reference to
>>>> `alloc_mdio_bitbang'
>>>> arch/powerpc/platforms/82xx/ep8248e.c:143: undefined reference to
>>>> `mdiobus_register'
>>>
>>> How is this possible? CONFIG_EP8248E selects CONFIG_MDIO_BITBANG.
>>
>> If CONFIG_PHYLIB=m however, that doesn't make any difference, because
>> vmlinuz is trying to use a symbol which now lives in a module.
>
> The mdiobus_register make sense, I'm not sure get why
> alloc_mdio_bitbang is undefined.

nevermind, I now see why the libphy is being built.

- k

2008-07-16 22:56:21

by Kumar Gala

[permalink] [raw]
Subject: Re: [PATCH] powerpc/ep8248e: Fix compile problem if !CONFIG_FS_ENET


On Jul 16, 2008, at 5:19 PM, Dave Jones wrote:

> On Wed, Jul 16, 2008 at 05:10:29PM -0500, Kumar Gala wrote:
>>
>> On Jul 16, 2008, at 4:57 PM, Dave Jones wrote:
>>
>>> On Wed, Jul 16, 2008 at 04:47:23PM -0500, Scott Wood wrote:
>>>> On Wed, Jul 16, 2008 at 08:39:12AM -0500, Kumar Gala wrote:
>>>>> If we don't enable FS_ENET we get build issues:
>>>>>
>>>>> arch/powerpc/platforms/built-in.o: In function
>>>>> `ep8248e_mdio_probe':
>>>>> arch/powerpc/platforms/82xx/ep8248e.c:129: undefined reference to
>>>>> `alloc_mdio_bitbang'
>>>>> arch/powerpc/platforms/82xx/ep8248e.c:143: undefined reference to
>>>>> `mdiobus_register'
>>>>
>>>> How is this possible? CONFIG_EP8248E selects CONFIG_MDIO_BITBANG.
>>>
>>> If CONFIG_PHYLIB=m however, that doesn't make any difference,
>>> because
>>> vmlinuz is trying to use a symbol which now lives in a module.
>>
>> The mdiobus_register make sense, I'm not sure get why
>> alloc_mdio_bitbang is undefined.
>
> Erm, same reason. it's built into phy.o, which ends up in the module,
> not the vmlinuz.
>
> (also, it doesn't look like it's exported even if it was built-in?)

It looks like the simplest solution at this point is to
unconditionally select the PHYLIB for this board. We should look at
moving the low level mdio bitbang ops out so they can be built as a
module.

- k

2008-07-21 16:15:12

by Scott Wood

[permalink] [raw]
Subject: Re: [PATCH] powerpc/ep8248e: Fix compile problem if !CONFIG_FS_ENET

On Wed, Jul 16, 2008 at 05:57:45PM -0400, Dave Jones wrote:
> On Wed, Jul 16, 2008 at 04:47:23PM -0500, Scott Wood wrote:
> > On Wed, Jul 16, 2008 at 08:39:12AM -0500, Kumar Gala wrote:
> > > If we don't enable FS_ENET we get build issues:
> > >
> > > arch/powerpc/platforms/built-in.o: In function `ep8248e_mdio_probe':
> > > arch/powerpc/platforms/82xx/ep8248e.c:129: undefined reference to `alloc_mdio_bitbang'
> > > arch/powerpc/platforms/82xx/ep8248e.c:143: undefined reference to `mdiobus_register'
> >
> > How is this possible? CONFIG_EP8248E selects CONFIG_MDIO_BITBANG.
>
> If CONFIG_PHYLIB=m however, that doesn't make any difference, because
> vmlinuz is trying to use a symbol which now lives in a module.

Yuck. If FOO selects BAR, and FOO is 'y', then BAR should be 'y', not 'm'.
If BAR depends on other symbols that are 'm', they should be changed to 'y'.

-Scott

2008-07-21 16:16:36

by Scott Wood

[permalink] [raw]
Subject: Re: [PATCH] powerpc/ep8248e: Fix compile problem if !CONFIG_FS_ENET

On Wed, Jul 16, 2008 at 05:55:17PM -0500, Kumar Gala wrote:
> It looks like the simplest solution at this point is to unconditionally
> select the PHYLIB for this board. We should look at moving the low level
> mdio bitbang ops out so they can be built as a module.

Or exporting the MDIO/MDC pins through the GPIO API.

-Scott