Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
60c284ac
Commit
60c284ac
authored
Dec 31, 2002
by
Wolfgang Denk
Committed by
Linus Torvalds
Dec 31, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PPC32: Add code to support the AMD AM79C874 PHY to the MPC8xx FEC driver.
parent
62fb9622
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
2 deletions
+78
-2
arch/ppc/8xx_io/Kconfig
arch/ppc/8xx_io/Kconfig
+4
-0
arch/ppc/8xx_io/fec.c
arch/ppc/8xx_io/fec.c
+74
-2
No files found.
arch/ppc/8xx_io/Kconfig
View file @
60c284ac
...
...
@@ -51,6 +51,10 @@ config USE_MDIO
all MII code can be omitted. Say N here if unsure or if you don't
need link status reports.
config FEC_AM79C874
bool "Support AMD79C874 PHY"
depends on USE_MDIO
config FEC_LXT970
bool "Support LXT970 PHY"
depends on USE_MDIO
...
...
arch/ppc/8xx_io/fec.c
View file @
60c284ac
...
...
@@ -23,6 +23,9 @@
* Make use of MII for PHY control configurable.
* Some fixes.
* Copyright (c) 2000-2002 Wolfgang Denk, DENX Software Engineering.
*
* Support for AMD AM79C874 added.
* Thomas Lange, thomas@corelatus.com
*/
#include <linux/config.h>
...
...
@@ -1131,9 +1134,74 @@ static phy_info_t phy_info_qs6612 = {
},
};
#endif
/* CONFIG_FEC_QS6612 */
/* ------------------------------------------------------------------------- */
/* The Advanced Micro Devices AM79C874 is used on the ICU862 */
#ifdef CONFIG_FEC_AM79C874
/* register definitions for the 79C874 */
#define MII_AM79C874_MFR 16
/* Miscellaneous Features Register */
#define MII_AM79C874_ICSR 17
/* Interrupt Control/Status Register */
#define MII_AM79C874_DR 18
/* Diagnostic Register */
#define MII_AM79C874_PMLR 19
/* Power Management & Loopback Register */
#define MII_AM79C874_MCR 21
/* Mode Control Register */
#define MII_AM79C874_DC 23
/* Disconnect Counter */
#define MII_AM79C874_REC 24
/* Receiver Error Counter */
static
void
mii_parse_amd79c874_dr
(
uint
mii_reg
,
struct
net_device
*
dev
,
uint
data
)
{
volatile
struct
fec_enet_private
*
fep
=
dev
->
priv
;
uint
s
=
fep
->
phy_status
;
s
&=
~
(
PHY_STAT_SPMASK
);
/* Register 18: Bit 10 is data rate, 11 is Duplex */
switch
((
mii_reg
>>
10
)
&
3
)
{
case
0
:
s
|=
PHY_STAT_10HDX
;
break
;
case
1
:
s
|=
PHY_STAT_100HDX
;
break
;
case
2
:
s
|=
PHY_STAT_10FDX
;
break
;
case
3
:
s
|=
PHY_STAT_100FDX
;
break
;
}
fep
->
phy_status
=
s
;
}
static
phy_info_t
phy_info_amd79c874
=
{
0x00022561
,
"AM79C874"
,
(
const
phy_cmd_t
[])
{
/* config */
// { mk_mii_write(MII_REG_ANAR, 0x021), NULL }, /* 10 Mbps, HD */
{
mk_mii_read
(
MII_REG_CR
),
mii_parse_cr
},
{
mk_mii_read
(
MII_REG_ANAR
),
mii_parse_anar
},
{
mk_mii_end
,
}
},
(
const
phy_cmd_t
[])
{
/* startup - enable interrupts */
{
mk_mii_write
(
MII_AM79C874_ICSR
,
0xff00
),
NULL
},
{
mk_mii_write
(
MII_REG_CR
,
0x1200
),
NULL
},
/* autonegotiate */
{
mk_mii_end
,
}
},
(
const
phy_cmd_t
[])
{
/* ack_int */
/* find out the current status */
{
mk_mii_read
(
MII_REG_SR
),
mii_parse_sr
},
{
mk_mii_read
(
MII_AM79C874_DR
),
mii_parse_amd79c874_dr
},
/* we only need to read ICSR to acknowledge */
{
mk_mii_read
(
MII_AM79C874_ICSR
),
NULL
},
{
mk_mii_end
,
}
},
(
const
phy_cmd_t
[])
{
/* shutdown - disable interrupts */
{
mk_mii_write
(
MII_AM79C874_ICSR
,
0x0000
),
NULL
},
{
mk_mii_end
,
}
},
};
#endif
/* CONFIG_FEC_AM79C874 */
static
phy_info_t
*
phy_info
[]
=
{
...
...
@@ -1147,7 +1215,11 @@ static phy_info_t *phy_info[] = {
#ifdef CONFIG_FEC_QS6612
&
phy_info_qs6612
,
#endif
/* CONFIG_FEC_LXT971 */
#endif
/* CONFIG_FEC_QS6612 */
#ifdef CONFIG_FEC_AM79C874
&
phy_info_amd79c874
,
#endif
/* CONFIG_FEC_AM79C874 */
NULL
};
...
...
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