From: Vipin Kumar <vipin.kumar@st.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH resend 2/2] net/macb: Add arch specific routine to get mdio control
Date: Wed, 12 Dec 2012 16:07:41 +0530 [thread overview]
Message-ID: <50C85E75.8090307@st.com> (raw)
In-Reply-To: <8ff845e533e9d174c6fe70cc8a6be5ec753bd071.1354777675.git.vipin.kumar@st.com>
ping. one more :)
On 12/6/2012 12:40 PM, Vipin KUMAR wrote:
> From: Shiraz Hashim<shiraz.hashim@st.com>
>
> SPEAr310 and SPEAr320 Ethernet interfaces share same MDIO lines to control their
> respective phys. Currently their is a fixed configuration in which only a
> particular MAC can use the MDIO lines.
>
> Call an arch specific function to take control of specific mdio lines at
> runtime.
>
> Signed-off-by: Shiraz Hashim<shiraz.hashim@st.com>
> Signed-off-by: Vipin Kumar<vipin.kumar@st.com>
> ---
> drivers/net/macb.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> index 8bacbda..45fbbd7 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -163,6 +163,13 @@ static u16 macb_mdio_read(struct macb_device *macb, u8 reg)
> return MACB_BFEXT(DATA, frame);
> }
>
> +static void __def_arch_get_mdio_control(const char *name)
> +{
> + return;
> +}
> +int arch_get_mdio_control(const char *name)
> + __attribute__((weak, alias("__def_arch_get_mdio_control")));
> +
> #if defined(CONFIG_CMD_MII)
>
> int macb_miiphy_read(const char *devname, u8 phy_adr, u8 reg, u16 *value)
> @@ -173,6 +180,7 @@ int macb_miiphy_read(const char *devname, u8 phy_adr, u8 reg, u16 *value)
> if ( macb->phy_addr != phy_adr )
> return -1;
>
> + arch_get_mdio_control(devname);
> *value = macb_mdio_read(macb, reg);
>
> return 0;
> @@ -186,6 +194,7 @@ int macb_miiphy_write(const char *devname, u8 phy_adr, u8 reg, u16 value)
> if ( macb->phy_addr != phy_adr )
> return -1;
>
> + arch_get_mdio_control(devname);
> macb_mdio_write(macb, reg, value);
>
> return 0;
> @@ -377,6 +386,7 @@ static int macb_phy_init(struct macb_device *macb)
> int media, speed, duplex;
> int i;
>
> + arch_get_mdio_control(netdev->name);
> #ifdef CONFIG_MACB_SEARCH_PHY
> /* Auto-detect phy_addr */
> if (!macb_phy_find(macb)) {
next prev parent reply other threads:[~2012-12-12 10:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-06 7:10 [U-Boot] [PATCH resend 1/2] net/designware: Do not select MIIPORT for RGMII interface Vipin Kumar
2012-12-06 7:10 ` [U-Boot] [PATCH resend 2/2] net/macb: Add arch specific routine to get mdio control Vipin Kumar
2012-12-12 10:37 ` Vipin Kumar [this message]
2012-12-12 11:07 ` Stefan Roese
2012-12-12 11:13 ` Vipin Kumar
2012-12-12 10:01 ` [U-Boot] [PATCH resend 1/2] net/designware: Do not select MIIPORT for RGMII interface Vipin Kumar
2012-12-12 10:09 ` Stefan Roese
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=50C85E75.8090307@st.com \
--to=vipin.kumar@st.com \
--cc=u-boot@lists.denx.de \
/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