Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
u-boot-stm32
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sami Nurmenniemi
u-boot-stm32
Commits
c10887f3
Commit
c10887f3
authored
Oct 21, 2017
by
Sergei Poselenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RM 2035 (RT #140914). A2F-SOM: Change PHY link status detection, as per Linux code.
Now 10Mb/s link works in U-Boot.
parent
e4558659
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
drivers/net/core10100.c
drivers/net/core10100.c
+11
-9
include/miiphy.h
include/miiphy.h
+2
-0
No files found.
drivers/net/core10100.c
View file @
c10887f3
...
...
@@ -140,7 +140,7 @@ static int phy_init(struct core10100_dev *bp)
/* get link status */
static
int
phy_link_stat
(
struct
core10100_dev
*
bp
)
{
u16
val
;
u16
val
,
lpa
,
adv
;
u32
link_stat
=
0
;
/* If not initialized, return no link */
...
...
@@ -155,17 +155,19 @@ static int phy_link_stat(struct core10100_dev *bp)
if
(
val
&
PHY_BMSR_LS
)
{
link_stat
|=
LINK_UP
;
}
/* Read autonegotiations results, code from linux/drivers/net/phy/phy_device.c, genphy_read_status() */
lpa
=
mii_read
(
bp
,
PHY_ANLPAR
);
adv
=
mii_read
(
bp
,
PHY_ANAR
);
lpa
&=
adv
;
/* Read link speed and duplex */
val
=
mii_read
(
bp
,
PHY_BMCR
);
/* Update link speed */
if
(
val
&
(
PHY_BMSR_100TXH
|
PHY_BMSR_100TXF
))
{
if
(
lpa
&
(
PHY_ANLPAR_100HALF
|
PHY_ANLPAR_100FULL
)){
link_stat
|=
LINK_100
;
}
/* Update link speed */
if
(
val
&
PHY_BMSR_EXT_STAT
)
{
if
(
lpa
&
PHY_ANLPAR_100FULL
){
link_stat
|=
LINK_FD
;
}
}
else
if
(
lpa
&
PHY_ANLPAR_10FD
)
{
link_stat
|=
LINK_FD
;
}
...
...
include/miiphy.h
View file @
c10887f3
...
...
@@ -162,7 +162,9 @@ int bb_miiphy_write (char *devname, unsigned char addr,
#define PHY_ANLPAR_PAUSE 0x0400
#define PHY_ANLPAR_T4 0x0200
#define PHY_ANLPAR_TXFD 0x0100
#define PHY_ANLPAR_100FULL 0x0100
#define PHY_ANLPAR_TX 0x0080
#define PHY_ANLPAR_100HALF 0x0080
#define PHY_ANLPAR_10FD 0x0040
#define PHY_ANLPAR_10 0x0020
#define PHY_ANLPAR_100 0x0380
/* we can run at 100 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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