* [U-Boot] [PATCH resend 1/2] net/designware: Do not select MIIPORT for RGMII interface
@ 2012-12-06 7:10 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
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Vipin Kumar @ 2012-12-06 7:10 UTC (permalink / raw)
To: u-boot
Do not select MIIPORT for RGMII interface
Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
---
drivers/net/designware.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index bf21a08..46f6601 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -113,7 +113,9 @@ static int mac_reset(struct eth_device *dev)
int timeout = CONFIG_MACRESET_TIMEOUT;
writel(DMAMAC_SRST, &dma_p->busmode);
- writel(MII_PORTSELECT, &mac_p->conf);
+
+ if (priv->interface != PHY_INTERFACE_MODE_RGMII)
+ writel(MII_PORTSELECT, &mac_p->conf);
start = get_timer(0);
while (get_timer(start) < timeout) {
--
1.8.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH resend 2/2] net/macb: Add arch specific routine to get mdio control
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 ` Vipin Kumar
2012-12-12 10:37 ` Vipin Kumar
2012-12-12 11:07 ` Stefan Roese
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
2 siblings, 2 replies; 7+ messages in thread
From: Vipin Kumar @ 2012-12-06 7:10 UTC (permalink / raw)
To: u-boot
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)) {
--
1.8.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH resend 1/2] net/designware: Do not select MIIPORT for RGMII interface
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:01 ` Vipin Kumar
2012-12-12 10:09 ` Stefan Roese
2 siblings, 0 replies; 7+ messages in thread
From: Vipin Kumar @ 2012-12-12 10:01 UTC (permalink / raw)
To: u-boot
ping
On 12/6/2012 12:40 PM, Vipin KUMAR wrote:
> Do not select MIIPORT for RGMII interface
>
> Signed-off-by: Vipin Kumar<vipin.kumar@st.com>
> ---
> drivers/net/designware.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/designware.c b/drivers/net/designware.c
> index bf21a08..46f6601 100644
> --- a/drivers/net/designware.c
> +++ b/drivers/net/designware.c
> @@ -113,7 +113,9 @@ static int mac_reset(struct eth_device *dev)
> int timeout = CONFIG_MACRESET_TIMEOUT;
>
> writel(DMAMAC_SRST,&dma_p->busmode);
> - writel(MII_PORTSELECT,&mac_p->conf);
> +
> + if (priv->interface != PHY_INTERFACE_MODE_RGMII)
> + writel(MII_PORTSELECT,&mac_p->conf);
>
> start = get_timer(0);
> while (get_timer(start)< timeout) {
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH resend 1/2] net/designware: Do not select MIIPORT for RGMII interface
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: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
2 siblings, 0 replies; 7+ messages in thread
From: Stefan Roese @ 2012-12-12 10:09 UTC (permalink / raw)
To: u-boot
On 12/06/2012 08:10 AM, Vipin Kumar wrote:
> Do not select MIIPORT for RGMII interface
>
> Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
Acked-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH resend 2/2] net/macb: Add arch specific routine to get mdio control
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
2012-12-12 11:07 ` Stefan Roese
1 sibling, 0 replies; 7+ messages in thread
From: Vipin Kumar @ 2012-12-12 10:37 UTC (permalink / raw)
To: u-boot
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)) {
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH resend 2/2] net/macb: Add arch specific routine to get mdio control
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
@ 2012-12-12 11:07 ` Stefan Roese
2012-12-12 11:13 ` Vipin Kumar
1 sibling, 1 reply; 7+ messages in thread
From: Stefan Roese @ 2012-12-12 11:07 UTC (permalink / raw)
To: u-boot
On 12/06/2012 08:10 AM, 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.
"there is" instead of "their is"
> 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")));
__weak from linux/compiler.h please
Otherwise:
Acked-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH resend 2/2] net/macb: Add arch specific routine to get mdio control
2012-12-12 11:07 ` Stefan Roese
@ 2012-12-12 11:13 ` Vipin Kumar
0 siblings, 0 replies; 7+ messages in thread
From: Vipin Kumar @ 2012-12-12 11:13 UTC (permalink / raw)
To: u-boot
On 12/12/2012 4:37 PM, Stefan Roese wrote:
> On 12/06/2012 08:10 AM, 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.
>
> "there is" instead of "their is"
>
Thanks. I would change this in v2
>> 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")));
>
> __weak from linux/compiler.h please
>
in v2
> Otherwise:
>
> Acked-by: Stefan Roese<sr@denx.de>
>
> Thanks,
> Stefan
>
>
Vipin
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-12-12 11:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox