Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sami Nurmenniemi
u-boot-stm32
Commits
7298c94c
Commit
7298c94c
authored
Jul 02, 2013
by
Sergei Poselenov
Browse files
RT #82124. Removed unused m2s_phy_link_setup() from m2s_eth.c
parent
69c92d82
Changes
1
Hide whitespace changes
Inline
Side-by-side
drivers/net/m2s_eth.c
View file @
7298c94c
...
...
@@ -294,7 +294,6 @@ static int m2s_mii_write(char *devname, u8 addr, u8 reg, u16 val);
#ifndef CONFIG_M2S_ETH_MODE_SGMII
static
int
m2s_phy_probe
(
void
);
static
int
m2s_phy_link_setup
(
void
);
#endif
static
void
m2s_mac_dump_regs
(
char
*
who
);
...
...
@@ -1006,68 +1005,6 @@ out:
return
rv
;
}
/*
* Setup link status
*/
static
int
m2s_phy_link_setup
(
void
)
{
int
rv
,
timeout
;
u16
val
;
/*
* Get current link status
*/
rv
=
miiphy_link
(
M2S_MII_NAME
,
m2s_phy_addr
);
if
(
rv
==
1
)
goto
link_up
;
/*
* Enable auto-negotiation
*/
printf
(
"Auto-negotiation..."
);
rv
=
miiphy_read
(
M2S_MII_NAME
,
m2s_phy_addr
,
PHY_BMCR
,
&
val
);
if
(
rv
!=
0
)
goto
out
;
rv
=
miiphy_write
(
M2S_MII_NAME
,
m2s_phy_addr
,
PHY_BMCR
,
val
|
PHY_BMCR_AUTON
|
PHY_BMCR_RST_NEG
);
if
(
rv
!=
0
)
goto
out
;
/*
* Wait until auto-negotiation completes
*/
timeout
=
M2S_AUTONEG_TOUT
;
while
(
timeout
--
)
{
rv
=
miiphy_read
(
M2S_MII_NAME
,
m2s_phy_addr
,
PHY_BMSR
,
&
val
);
if
(
rv
!=
0
)
{
printf
(
"mii err %d.
\n
"
,
rv
);
goto
done
;
}
if
(
!
(
val
&
PHY_BMSR_AUTN_COMP
))
{
udelay
(
1000
);
continue
;
}
break
;
}
if
(
timeout
)
printf
(
"completed.
\n
"
);
else
printf
(
"timeout.
\n
"
);
done:
rv
=
miiphy_link
(
M2S_MII_NAME
,
m2s_phy_addr
);
if
(
rv
==
0
)
{
printf
(
"Link is DOWN.
\n
"
);
rv
=
-
ENETUNREACH
;
goto
out
;
}
link_up:
printf
(
"Link is UP.
\n
"
);
rv
=
0
;
out:
return
rv
;
}
#endif
/******************************************************************************
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment