Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323161
b: refs/heads/master
c: 212ea99
h: refs/heads/master
i:
  323159: d619a9b
v: v3
  • Loading branch information
Marek Vasut authored and David S. Miller committed Sep 24, 2012
1 parent 4468b1d commit 0f7bab0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2b018d57ff18e5405823e5cb59651a5b4d946d7b
refs/heads/master: 212ea99a85d30dbc834888384c57ad5abbc67a0a
27 changes: 27 additions & 0 deletions trunk/drivers/net/phy/micrel.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
#include <linux/phy.h>
#include <linux/micrel_phy.h>

/* Operation Mode Strap Override */
#define MII_KSZPHY_OMSO 0x16
#define KSZPHY_OMSO_B_CAST_OFF (1 << 9)
#define KSZPHY_OMSO_RMII_OVERRIDE (1 << 1)
#define KSZPHY_OMSO_MII_OVERRIDE (1 << 0)

/* general Interrupt control/status reg in vendor specific block. */
#define MII_KSZPHY_INTCS 0x1B
#define KSZPHY_INTCS_JABBER (1 << 15)
Expand Down Expand Up @@ -101,6 +107,13 @@ static int kszphy_config_init(struct phy_device *phydev)
return 0;
}

static int ksz8021_config_init(struct phy_device *phydev)
{
const u16 val = KSZPHY_OMSO_B_CAST_OFF | KSZPHY_OMSO_RMII_OVERRIDE;
phy_write(phydev, MII_KSZPHY_OMSO, val);
return 0;
}

static int ks8051_config_init(struct phy_device *phydev)
{
int regval;
Expand All @@ -127,6 +140,19 @@ static struct phy_driver ksphy_driver[] = {
.ack_interrupt = kszphy_ack_interrupt,
.config_intr = ks8737_config_intr,
.driver = { .owner = THIS_MODULE,},
}, {
.phy_id = PHY_ID_KSZ8021,
.phy_id_mask = 0x00ffffff,
.name = "Micrel KSZ8021",
.features = (PHY_BASIC_FEATURES | SUPPORTED_Pause |
SUPPORTED_Asym_Pause),
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = ksz8021_config_init,
.config_aneg = genphy_config_aneg,
.read_status = genphy_read_status,
.ack_interrupt = kszphy_ack_interrupt,
.config_intr = kszphy_config_intr,
.driver = { .owner = THIS_MODULE,},
}, {
.phy_id = PHY_ID_KS8041,
.phy_id_mask = 0x00fffff0,
Expand Down Expand Up @@ -203,6 +229,7 @@ static struct mdio_device_id __maybe_unused micrel_tbl[] = {
{ PHY_ID_KSZ9021, 0x000ffffe },
{ PHY_ID_KS8001, 0x00ffffff },
{ PHY_ID_KS8737, 0x00fffff0 },
{ PHY_ID_KSZ8021, 0x00ffffff },
{ PHY_ID_KS8041, 0x00fffff0 },
{ PHY_ID_KS8051, 0x00fffff0 },
{ }
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/micrel_phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#define PHY_ID_KSZ9021 0x00221610
#define PHY_ID_KS8737 0x00221720
#define PHY_ID_KSZ8021 0x00221555
#define PHY_ID_KS8041 0x00221510
#define PHY_ID_KS8051 0x00221550
/* both for ks8001 Rev. A/B, and for ks8721 Rev 3. */
Expand Down

0 comments on commit 0f7bab0

Please sign in to comment.