All of lore.kernel.org
 help / color / mirror / Atom feed
* Help initialize phy-less ethernet in 2.6.38
@ 2012-03-28 16:13 Fabio
  2012-03-29 18:35 ` Scott Wood
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio @ 2012-03-28 16:13 UTC (permalink / raw)
  To: linuxppc-dev

Hi all,
I am a newbie trying to get the FCC1 ethernet interface to work on a
custom board.
The hardware used is based on mpc8270 which is connected via FCC1 to a
phy-less interface linked to another microcontroller.
FCC1 should be recognized as eth0 by the linux kernel and it should
receive data when set up in promiscuous mode.
Currently during the boot it seems that the device initialization goes
ok but I can't understand why I can't receive data when I put the
interface in promiscuous mode.
Going into details I can see that the fs_enet probe function gets called.
I customized it to setup the fs_platform_info structure using the
values taken from the old kernel driver for now.
The only fields I cannot setup are the bus_id,phy_irq,phy_addr because
they are not part of the fs_platform_info data structure anymore.
I can't see any errors during the initialization, but I can't receive
data on the interface.

I think the problem can be in an interrupt misconfiguration but I
haven't figured out how to configure the ethernet dts part in the
right way or how to handle the phy-less situation correctly.


--- dts snippet ---
			eth0: ethernet@11300 {
				device_type = "network";
				compatible =  "fsl,cpm2-fcc-enet";
				reg = <0x11300 0x20 0x8400 0x100 0x11390 0x1>;
				local-mac-address = [ 00 01 02 03 04 05 ];
				interrupts = <32 8>;
				interrupt-parent = <&PIC>;
				linux,network-index = <0>;
				fsl,cpm-command = <0x12000300>;
			};
---

Thanks in advance,



-- 
Fabio Pozzi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Help initialize phy-less ethernet in 2.6.38
  2012-03-28 16:13 Help initialize phy-less ethernet in 2.6.38 Fabio
@ 2012-03-29 18:35 ` Scott Wood
  2012-03-29 19:56   ` Fabio
  0 siblings, 1 reply; 5+ messages in thread
From: Scott Wood @ 2012-03-29 18:35 UTC (permalink / raw)
  To: Fabio; +Cc: Andy Fleming, linuxppc-dev

On 03/28/2012 11:13 AM, Fabio wrote:
> Hi all,
> I am a newbie trying to get the FCC1 ethernet interface to work on a
> custom board.
> The hardware used is based on mpc8270 which is connected via FCC1 to a
> phy-less interface linked to another microcontroller.
> FCC1 should be recognized as eth0 by the linux kernel and it should
> receive data when set up in promiscuous mode.
> Currently during the boot it seems that the device initialization goes
> ok but I can't understand why I can't receive data when I put the
> interface in promiscuous mode.

Is the problem only with promiscuous mode, or do you have problems with
normal operation as well (receiving broadcast packets and packets
addressed to you, sending pakcets, etc)?

> Going into details I can see that the fs_enet probe function gets called.
> I customized it to setup the fs_platform_info structure using the
> values taken from the old kernel driver for now.

Which old kernel driver?  Why do you need to mess with fs_platform_info?

> The only fields I cannot setup are the bus_id,phy_irq,phy_addr because
> they are not part of the fs_platform_info data structure anymore.

All this stuff comes from the device tree.

> I can't see any errors during the initialization, but I can't receive
> data on the interface.
> 
> I think the problem can be in an interrupt misconfiguration but I
> haven't figured out how to configure the ethernet dts part in the
> right way or how to handle the phy-less situation correctly.

Why do you think the interrupt is misconfigured?

For phy-less you should have a fixed-link property.  For some reason
this property is documented only in
Documentation/devicetree/bindings/net/fsl-tsec-phy.txt, but it is
applicable here as well.

Looking at the code, though, I'm not sure if this stuff still works --
e.g. I don't see where any fields of fixed-link but the ID are used, or
what's supposed to happen when of_phy_connect_fixed_link() calls
phy_connect().

> --- dts snippet ---
> 			eth0: ethernet@11300 {
> 				device_type = "network";
> 				compatible =  "fsl,cpm2-fcc-enet";
> 				reg = <0x11300 0x20 0x8400 0x100 0x11390 0x1>;
> 				local-mac-address = [ 00 01 02 03 04 05 ];
> 				interrupts = <32 8>;
> 				interrupt-parent = <&PIC>;
> 				linux,network-index = <0>;
> 				fsl,cpm-command = <0x12000300>;
> 			};

Some of this stuff shouldn't be needed anymore (device-type,
linux,network-index), and you should use a real MAC address, but
otherwise this looks right.

-Scott

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Help initialize phy-less ethernet in 2.6.38
  2012-03-29 18:35 ` Scott Wood
@ 2012-03-29 19:56   ` Fabio
  2012-03-29 20:30     ` Scott Wood
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio @ 2012-03-29 19:56 UTC (permalink / raw)
  To: Scott Wood; +Cc: Andy Fleming, linuxppc-dev

> Which old kernel driver? =C2=A0Why do you need to mess with fs_platform_i=
nfo?
I have to port a custom platform driver written for 2.6.10 to support
this custom board.
That driver directly initializes the fs_platform_info data structure,
so after some failed attempts I thought to directly assign some values
to the fs_platform_info structure to see reuse part of the old code,
just to get the device to work.

> Why do you think the interrupt is misconfigured?
Because I don't get any error during boot or when I run ifconfig, but
I don't see
any interrupt if I run 'cat /proc/interrupts':
---
           CPU0
 16:        136   CPM2 SIU         Level        cpm_uart
 32:          0   CPM2 SIU         Level        fs_enet-mac
LOC:       1219   Local timer interrupts
SPU:          0   Spurious interrupts
CNT:          0   Performance monitoring interrupts
MCE:          0   Machine check exceptions
----

>Looking at the code, though, I'm not sure if this stuff still works --
>e.g. I don't see where any fields of fixed-link but the ID are used, or
>what's supposed to happen when of_phy_connect_fixed_link() calls
>phy_connect().
If it isn't so, do you have any suggestion about how to re-add this
functionality to the existing code?

I will make some other tests taking as an example the mgcoge.dts which
seems the most similar to my custom board.

Thanks in advance,

--=20
Fabio Pozzi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Help initialize phy-less ethernet in 2.6.38
  2012-03-29 19:56   ` Fabio
@ 2012-03-29 20:30     ` Scott Wood
  2012-04-03 11:04       ` Fabio
  0 siblings, 1 reply; 5+ messages in thread
From: Scott Wood @ 2012-03-29 20:30 UTC (permalink / raw)
  To: Fabio; +Cc: Andy Fleming, linuxppc-dev

On 03/29/2012 02:56 PM, Fabio wrote:
>> Which old kernel driver?  Why do you need to mess with fs_platform_info?
> I have to port a custom platform driver written for 2.6.10 to support
> this custom board.

So it's old arch/ppc stuff.  Now fs_platform_info is driver-internal and
info comes from the device tree.  You shouldn't touch the struct directly.

>> Why do you think the interrupt is misconfigured?
> Because I don't get any error during boot or when I run ifconfig, but
> I don't see
> any interrupt if I run 'cat /proc/interrupts':

That could mean that something else is failing, such that you don't
have the activity that would cause an interrupt.

>> Looking at the code, though, I'm not sure if this stuff still works --
>> e.g. I don't see where any fields of fixed-link but the ID are used, or
>> what's supposed to happen when of_phy_connect_fixed_link() calls
>> phy_connect().
> If it isn't so, do you have any suggestion about how to re-add this
> functionality to the existing code?

Andy, do you know what the state of this stuff is?

-Scott

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Help initialize phy-less ethernet in 2.6.38
  2012-03-29 20:30     ` Scott Wood
@ 2012-04-03 11:04       ` Fabio
  0 siblings, 0 replies; 5+ messages in thread
From: Fabio @ 2012-04-03 11:04 UTC (permalink / raw)
  To: Scott Wood; +Cc: Andy Fleming, linuxppc-dev

> So it's old arch/ppc stuff. =C2=A0Now fs_platform_info is driver-internal=
 and
> info comes from the device tree. =C2=A0You shouldn't touch the struct dir=
ectly.
Now I moved all the initialization functions to the platform driver in
arch/powerpc/platform/82xx and the external ethernet on FCC2 still
works, so at least it seems that
the problem is related to the fixed-link initialization of FCC1.

>>> Looking at the code, though, I'm not sure if this stuff still works --
>>> e.g. I don't see where any fields of fixed-link but the ID are used, or
>>> what's supposed to happen when of_phy_connect_fixed_link() calls
>>> phy_connect().

The fixed-link fields are used inside arch/powerpc/sysdev/fsl_soc.c in
the function
of_add_fixed_phys.
I'm trying to understand what I am missing to configure or initialize
to get the same behaviour as in the old kernel but I failed to do so
until now.
If you have any suggestion it will be of great help for me.
Thanks in advance



--=20
Fabio Pozzi

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-04-03 11:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-28 16:13 Help initialize phy-less ethernet in 2.6.38 Fabio
2012-03-29 18:35 ` Scott Wood
2012-03-29 19:56   ` Fabio
2012-03-29 20:30     ` Scott Wood
2012-04-03 11:04       ` Fabio

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.