All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Fabio <pozzi.fabio@gmail.com>
Cc: Andy Fleming <afleming@freescale.com>, linuxppc-dev@lists.ozlabs.org
Subject: Re: Help initialize phy-less ethernet in 2.6.38
Date: Thu, 29 Mar 2012 13:35:28 -0500	[thread overview]
Message-ID: <4F74AB70.7070209@freescale.com> (raw)
In-Reply-To: <CAP-cLV5pF-j_izadBSVD7p4hQte96O_g2udCxi=9tkaPwxEsaw@mail.gmail.com>

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

  reply	other threads:[~2012-03-29 18:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-28 16:13 Help initialize phy-less ethernet in 2.6.38 Fabio
2012-03-29 18:35 ` Scott Wood [this message]
2012-03-29 19:56   ` Fabio
2012-03-29 20:30     ` Scott Wood
2012-04-03 11:04       ` Fabio

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=4F74AB70.7070209@freescale.com \
    --to=scottwood@freescale.com \
    --cc=afleming@freescale.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=pozzi.fabio@gmail.com \
    /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.