Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
U
uboot-imx
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
8
Issues
8
List
Boards
Labels
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Librem5
uboot-imx
Commits
d697d79f
Commit
d697d79f
authored
May 23, 2011
by
Michael Schwingen
Committed by
Albert ARIBAUD
Jun 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IXP NPE: add support for fixed-speed MII ports
Signed-off-by:
Michael Schwingen
<
michael@schwingen.org
>
parent
080b7643
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
25 deletions
+42
-25
arch/arm/cpu/ixp/npe/npe.c
arch/arm/cpu/ixp/npe/npe.c
+42
-25
No files found.
arch/arm/cpu/ixp/npe/npe.c
View file @
d697d79f
...
...
@@ -359,36 +359,53 @@ static int npe_init(struct eth_device *dev, bd_t * bis)
debug
(
"%s: 1
\n
"
,
__FUNCTION__
);
miiphy_read
(
dev
->
name
,
p_npe
->
phy_no
,
MII_BMSR
,
&
reg_short
);
/*
* Wait if PHY is capable of autonegotiation and autonegotiation is not complete
*/
if
((
reg_short
&
BMSR_ANEGCAPABLE
)
&&
!
(
reg_short
&
BMSR_ANEGCOMPLETE
))
{
puts
(
"Waiting for PHY auto negotiation to complete"
);
i
=
0
;
while
(
!
(
reg_short
&
BMSR_ANEGCOMPLETE
))
{
/*
* Timeout reached ?
*/
if
(
i
>
PHY_AUTONEGOTIATE_TIMEOUT
)
{
puts
(
" TIMEOUT !
\n
"
);
break
;
}
#ifdef CONFIG_MII_NPE0_FIXEDLINK
if
(
0
==
p_npe
->
eth_id
)
{
speed
=
CONFIG_MII_NPE0_SPEED
;
duplex
=
CONFIG_MII_NPE0_FULLDUPLEX
?
FULL
:
HALF
;
}
else
#endif
#ifdef CONFIG_MII_NPE1_FIXEDLINK
if
(
1
==
p_npe
->
eth_id
)
{
speed
=
CONFIG_MII_NPE1_SPEED
;
duplex
=
CONFIG_MII_NPE1_FULLDUPLEX
?
FULL
:
HALF
;
}
else
#endif
{
miiphy_read
(
dev
->
name
,
p_npe
->
phy_no
,
MII_BMSR
,
&
reg_short
);
/*
* Wait if PHY is capable of autonegotiation and
* autonegotiation is not complete
*/
if
((
reg_short
&
BMSR_ANEGCAPABLE
)
&&
!
(
reg_short
&
BMSR_ANEGCOMPLETE
))
{
puts
(
"Waiting for PHY auto negotiation to complete"
);
i
=
0
;
while
(
!
(
reg_short
&
BMSR_ANEGCOMPLETE
))
{
/*
* Timeout reached ?
*/
if
(
i
>
PHY_AUTONEGOTIATE_TIMEOUT
)
{
puts
(
" TIMEOUT !
\n
"
);
break
;
}
if
((
i
++
%
1000
)
==
0
)
{
putc
(
'.'
);
miiphy_read
(
dev
->
name
,
p_npe
->
phy_no
,
MII_BMSR
,
&
reg_short
);
if
((
i
++
%
1000
)
==
0
)
{
putc
(
'.'
);
miiphy_read
(
dev
->
name
,
p_npe
->
phy_no
,
MII_BMSR
,
&
reg_short
);
}
udelay
(
1000
);
/* 1 ms */
}
udelay
(
1000
);
/* 1 ms */
puts
(
" done
\n
"
);
/* another 500 ms (results in faster booting) */
udelay
(
500000
);
}
puts
(
" done
\n
"
);
udelay
(
500000
);
/* another 500 ms (results in faster booting) */
speed
=
miiphy_speed
(
dev
->
name
,
p_npe
->
phy_no
);
duplex
=
miiphy_duplex
(
dev
->
name
,
p_npe
->
phy_no
);
}
speed
=
miiphy_speed
(
dev
->
name
,
p_npe
->
phy_no
);
duplex
=
miiphy_duplex
(
dev
->
name
,
p_npe
->
phy_no
);
if
(
p_npe
->
print_speed
)
{
p_npe
->
print_speed
=
0
;
printf
(
"ENET Speed is %d Mbps - %s duplex connection
\n
"
,
...
...
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