Remove duplicate definitions in include/lxt971a.h.
Subsystems (2)
PATCH 1/2 Remove duplicate definitions in include/lxt971a.h.
Remove duplicate definitions in include/lxt971a.h.
Remove duplicate registers and bits definitions in include/lxt971a.h for standard MII registers, and use values in include/miiphy.h instead.
Signed-off-by Hugo Villeneuve <[email protected]>
--- cpu/arm920t/at91rm9200/lxt972.c | 15 +++--- cpu/arm926ejs/davinci/lxt972.c | 15 +++--- drivers/net/ns7520_eth.c | 42 +++++++--------- drivers/net/ns9750_eth.c | 59 +++++++++++------------ include/lxt971a.h | 100 --------------------------------------- include/ns7520_eth.h | 1 + include/ns9750_eth.h | 1 + 7 files changed, 65 insertions(+), 168 deletions(-)
cpu/arm920t/at91rm9200/lxt972.c +8 -7
@@ -29,6 +29,7 @@#include <common.h> #include <at91rm9200_net.h> #include <net.h> +#include <miiphy.h> #include <lxt971a.h> #ifdef CONFIG_DRIVER_ETHER
@@ -51,8 +52,8 @@ unsigned int lxt972_IsPhyConnected (AT91PS_EMAC p_mac)unsigned short Id1, Id2;at91rm9200_EmacEnableMDIO (p_mac); -at91rm9200_EmacReadPhy (p_mac,PHY_COMMON_ID1 , &Id1); -at91rm9200_EmacReadPhy (p_mac,PHY_COMMON_ID2 , &Id2); +at91rm9200_EmacReadPhy (p_mac,PHY_PHYIDR1 , &Id1); +at91rm9200_EmacReadPhy (p_mac,PHY_PHYIDR2 , &Id2);at91rm9200_EmacDisableMDIO (p_mac);if ((Id1 == (0x0013 )) && ((Id2 &0xFFF0 ) ==0x78E0 ))
@@ -169,18 +170,18 @@ UCHAR lxt972_AutoNegotiate (AT91PS_EMAC p_mac, int *status)unsigned short value;/* Set lxt972 control register */ -if (!at91rm9200_EmacReadPhy (p_mac,PHY_COMMON_CTRL , &value)) +if (!at91rm9200_EmacReadPhy (p_mac,PHY_BMCR , &value))return FALSE;/* Restart Auto_negotiation */ - value |=PHY_COMMON_CTRL_RES_AUTO ; -if (!at91rm9200_EmacWritePhy (p_mac,PHY_COMMON_CTRL , &value)) + value |=PHY_BMCR_RST_NEG ; +if (!at91rm9200_EmacWritePhy (p_mac,PHY_BMCR , &value))return FALSE;/*check AutoNegotiate complete */ udelay (10000 ); -at91rm9200_EmacReadPhy (p_mac,PHY_COMMON_STAT , &value); -if (!(value &PHY_COMMON_STAT_AN_COMP )) +at91rm9200_EmacReadPhy (p_mac,PHY_BMSR , &value); +if (!(value &PHY_BMSR_AUTN_COMP ))return FALSE;return (lxt972_GetLinkSpeed (p_mac));
cpu/arm926ejs/davinci/lxt972.c +8 -7
@@ -27,6 +27,7 @@#include <common.h> #include <net.h> +#include <miiphy.h> #include <lxt971a.h> #include <asm/arch/emac_defs.h>
@@ -38,9 +39,9 @@ int lxt972_is_phy_connected(int phy_addr) {u_int16_t id1, id2; -if (!dm644x_eth_phy_read (phy_addr,PHY_COMMON_ID1 , &id1)) +if (!dm644x_eth_phy_read (phy_addr,PHY_PHYIDR1 , &id1))return (0 ); -if (!dm644x_eth_phy_read (phy_addr,PHY_COMMON_ID2 , &id2)) +if (!dm644x_eth_phy_read (phy_addr,PHY_PHYIDR2 , &id2))return (0 );if ((id1 == (0x0013 )) && ((id2 &0xfff0 ) ==0x78e0 ))
@@ -119,19 +120,19 @@ int lxt972_auto_negotiate(int phy_addr)u_int16_t tmp; -if (!dm644x_eth_phy_read (phy_addr,PHY_COMMON_CTRL , &tmp)) +if (!dm644x_eth_phy_read (phy_addr,PHY_BMCR , &tmp))return (0 );/* Restart Auto_negotiation */ - tmp |=PHY_COMMON_CTRL_RES_AUTO ; -dm644x_eth_phy_write (phy_addr,PHY_COMMON_CTRL , tmp); + tmp |=PHY_BMCR_RST_NEG ; +dm644x_eth_phy_write (phy_addr,PHY_BMCR , tmp);/*check AutoNegotiate complete */ udelay (10000 ); -if (!dm644x_eth_phy_read (phy_addr,PHY_COMMON_STAT , &tmp)) +if (!dm644x_eth_phy_read (phy_addr,PHY_BMSR , &tmp))return (0 ); -if (!(tmp &PHY_COMMON_STAT_AN_COMP )) +if (!(tmp &PHY_BMSR_AUTN_COMP ))return (0 );return (lxt972_get_link_speed (phy_addr));
drivers/net/ns7520_eth.c +19 -23
79 lines not on this page · raw message
drivers/net/ns9750_eth.c +28 -31
127 lines not on this page · raw message
include/lxt971a.h +0 -100
112 lines not on this page · raw message
include/ns7520_eth.h +1 -0
@@ -24,6 +24,7 @@#ifdef CONFIG_DRIVER_NS7520_ETHERNET +#include <miiphy.h> #include "lxt971a.h" /* The port addresses */
include/ns9750_eth.h +1 -0
@@ -31,6 +31,7 @@#ifdef CONFIG_DRIVER_NS9750_ETHERNET +#include <miiphy.h> #include "lxt971a.h" #define NS9750_ETH_MODULE_BASE (0xA0600000)
Ben Warren
AppliedPATCH 1/2 Remove duplicate definitions in include/lxt971a.h.
Quoted 9 lines · Hugo Villeneuve
Remove duplicate definitions in
include/lxt971a.h.Remove duplicate registers and bits definitions in
include/lxt971a.hfor standard MII registers, and use values ininclude/miiphy.hinstead.Signed-off-by Hugo Villeneuve <[email protected]>
Applied to net repo.
thanks,
Ben