linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurentp@cse-semaphore.com>
To: linuxppc-dev@ozlabs.org
Cc: Mark Ware <mark.ware@senetas.com>
Subject: Re: CPM2 mii-bitbang: Allowing mdio on port pins other than port C
Date: Mon, 16 Jun 2008 10:52:53 +0200	[thread overview]
Message-ID: <200806161052.53268.laurentp@cse-semaphore.com> (raw)
In-Reply-To: <49B96DF39F2CDD499DA8B9C7753A060D2275FC@stamp.senetas.com>

[-- Attachment #1: Type: text/plain, Size: 1779 bytes --]

Hi Mark,

On Monday 16 June 2008 08:19, Mark Ware wrote:
> Hello,
> 
> I am preparing a board port (from 2.4.18!) for a proprietary board which
> has it's mdio on a different port than mdc.  The current mii-bitbang
> driver in fs_enet assumes both pins are connected to port C.  I have
> created a fairly simple patch to make this more flexible, but I'm new to
> device trees and am unsure how best to describe the situation in the
> dts.
> 
> The current mdio node for CPM2 looks something like:
> 
> mdio@10d40 {
>   device_type = "mdio";
>   compatible = "fsl,cpm2-mdio-bitbang";
>   #address-cells = <1>;
>   #size-cells = <0>
>   reg = <0x10d40 0x14>;
>   fsl,mdio-pin = <12>;
>   fsl,mdc-pin = <15>;
> }
> 
> I have made mdio work on our board by adding a second reg range and
> using the first one for mdc and the second one for mdio: 
> 
>   reg = <0x10d40 0x14 0x10d60 0x14>;  // mdc=port D, mdio=port A
>   fsl,mdio-pin = <12>;    		  // PD12
>   fsl,mdc-pin = <15>;     		  // PC15
> 
> The code remains backwards compatible, in that if only one reg range is
> present it is used for both.
> 
> Is this a valid (and acceptable) way to extend the reg property?

It is. Sergej Stepanov submitted similar patches some times ago. You can find 
them at

http://www.spinics.net/lists/netdev/msg45778.html
http://www.spinics.net/lists/netdev/msg47159.html

> Is their a cleaner way I should look at?

Using the GPIO lib might be cleaner. Have a look at 
http://www.nabble.com/-PATCH-0-2--MDIO-on-GPIO-support-for-the-fs_enet-driver-ts17468958.html 
for a patch.

Best regards,

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2008-06-16  8:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-16  6:19 CPM2 mii-bitbang: Allowing mdio on port pins other than port C Mark Ware
2008-06-16  8:52 ` Laurent Pinchart [this message]
2008-06-18 12:21   ` Mark Ware
2008-06-18 14:36     ` Laurent Pinchart

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=200806161052.53268.laurentp@cse-semaphore.com \
    --to=laurentp@cse-semaphore.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mark.ware@senetas.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).