From: David Daney <ddaney@caviumnetworks.com>
To: David Daney <ddaney@caviumnetworks.com>
Cc: devicetree-discuss@lists.ozlabs.org, grant.likely@secretlab.ca,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
Cyril Chemparathy <cyril@ti.com>,
Arnaud Patard <arnaud.patard@rtp-net.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: [PATCH 1/2] of/phylib: Use device tree properties to initialize Marvell PHYs.
Date: Wed, 17 Nov 2010 16:01:19 -0800 [thread overview]
Message-ID: <4CE46CCF.4080707@caviumnetworks.com> (raw)
In-Reply-To: <1290038071-13296-2-git-send-email-ddaney@caviumnetworks.com>
On 11/17/2010 03:54 PM, David Daney wrote:
> Some aspects of PHY initialization are board dependent, things like
> indicator LED connections and some clocking modes cannot be determined
> by probing. The dev_flags element of struct phy_device can be used to
> control these things if an appropriate value can be passed from the
> Ethernet driver. We run into problems however if the PHY connections
> are specified by the device tree. There is no way for the Ethernet
> driver to know what flags it should pass.
>
> If we are using the device tree, the struct phy_device will be
> populated with the device tree node corresponding to the PHY, and we
> can extract extra configuration information from there.
>
> The next question is what should the format of that information be?
> It is highly device specific, and the device tree representation
> should not be tied to any arbitrary kernel defined constants. A
> straight forward representation is just to specify the exact bits that
> should be set using the "marvell,reg-init" property:
>
> phy5: ethernet-phy@5 {
> reg =<5>;
> device_type = "ethernet-phy";
> marvell,reg-init =
> <0x00030010 0x5777>, /* Reg 3,16<- 0x5777 */
> <0x00030011 0x00aa>, /* Reg 3,17<- 0x00aa */
> <0x00030012 0x4105>, /* Reg 3,18<- 0x4105 */
> <0x00030013 0x0060>; /* Reg 3,19<- 0x0060 */
> <0x00020015 0x00300000>; /* clear bits 4..5 of Reg 2,21 */
Well, of course these mask bits are reversed. That last line should
really be:
<0x00020015 0xffcf0000>; /* clear bits 4..5 of Reg 2,21 */
> };
>
> The Marvell PHYs have a page select register at register 22 (0x16), we
> can specify any register by its page and register number. These are
> encoded in the high and low parts of the first word. The second word
> contains a mask and value to be ORed in its high and low parts.
> property, the PHY initialization is unchanged.
[...]
David Daney
WARNING: multiple messages have this Message-ID (diff)
From: David Daney <ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
To: David Daney <ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Cyril Chemparathy <cyril-l0cyMroinI0@public.gmane.org>,
Arnaud Patard
<arnaud.patard-dQbF7i+pzddAfugRpC6u6w@public.gmane.org>
Subject: Re: [PATCH 1/2] of/phylib: Use device tree properties to initialize Marvell PHYs.
Date: Wed, 17 Nov 2010 16:01:19 -0800 [thread overview]
Message-ID: <4CE46CCF.4080707@caviumnetworks.com> (raw)
In-Reply-To: <1290038071-13296-2-git-send-email-ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
On 11/17/2010 03:54 PM, David Daney wrote:
> Some aspects of PHY initialization are board dependent, things like
> indicator LED connections and some clocking modes cannot be determined
> by probing. The dev_flags element of struct phy_device can be used to
> control these things if an appropriate value can be passed from the
> Ethernet driver. We run into problems however if the PHY connections
> are specified by the device tree. There is no way for the Ethernet
> driver to know what flags it should pass.
>
> If we are using the device tree, the struct phy_device will be
> populated with the device tree node corresponding to the PHY, and we
> can extract extra configuration information from there.
>
> The next question is what should the format of that information be?
> It is highly device specific, and the device tree representation
> should not be tied to any arbitrary kernel defined constants. A
> straight forward representation is just to specify the exact bits that
> should be set using the "marvell,reg-init" property:
>
> phy5: ethernet-phy@5 {
> reg =<5>;
> device_type = "ethernet-phy";
> marvell,reg-init =
> <0x00030010 0x5777>, /* Reg 3,16<- 0x5777 */
> <0x00030011 0x00aa>, /* Reg 3,17<- 0x00aa */
> <0x00030012 0x4105>, /* Reg 3,18<- 0x4105 */
> <0x00030013 0x0060>; /* Reg 3,19<- 0x0060 */
> <0x00020015 0x00300000>; /* clear bits 4..5 of Reg 2,21 */
Well, of course these mask bits are reversed. That last line should
really be:
<0x00020015 0xffcf0000>; /* clear bits 4..5 of Reg 2,21 */
> };
>
> The Marvell PHYs have a page select register at register 22 (0x16), we
> can specify any register by its page and register number. These are
> encoded in the high and low parts of the first word. The second word
> contains a mask and value to be ORed in its high and low parts.
> property, the PHY initialization is unchanged.
[...]
David Daney
next prev parent reply other threads:[~2010-11-18 0:01 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-17 23:54 [PATCH 0/2] of/phylib: Use device tree properties for PHY configuration David Daney
2010-11-17 23:54 ` David Daney
2010-11-17 23:54 ` [PATCH 1/2] of/phylib: Use device tree properties to initialize Marvell PHYs David Daney
2010-11-17 23:54 ` David Daney
2010-11-18 0:01 ` David Daney [this message]
2010-11-18 0:01 ` David Daney
[not found] ` <1290038071-13296-2-git-send-email-ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2010-11-18 5:38 ` [1/2] " Milton Miller
2010-11-18 17:40 ` David Daney
2010-11-18 17:40 ` David Daney
2010-11-18 19:32 ` [PATCH 1/2] " Cyril Chemparathy
2010-11-18 20:40 ` Grant Likely
2010-11-18 20:40 ` Grant Likely
2010-11-18 23:48 ` David Daney
2010-11-18 23:48 ` David Daney
2010-11-19 0:39 ` Grant Likely
2010-11-19 0:39 ` Grant Likely
2010-11-17 23:54 ` [PATCH 2/2] phylib: Add support for Marvell 88E1149R devices David Daney
2010-11-17 23:54 ` David Daney
2010-11-18 19:46 ` David Miller
2010-11-18 19:46 ` David Miller
2010-11-18 20:44 ` Grant Likely
2010-11-18 20:44 ` Grant Likely
2010-11-18 20:57 ` David Miller
2010-11-18 20:57 ` David Miller
2010-11-18 21:06 ` David Daney
2010-11-18 21:06 ` David Daney
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=4CE46CCF.4080707@caviumnetworks.com \
--to=ddaney@caviumnetworks.com \
--cc=arnaud.patard@rtp-net.org \
--cc=benh@kernel.crashing.org \
--cc=cyril@ti.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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.