diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/davinci_emac.c | 210 | ||||
-rw-r--r-- | drivers/net/e1000/e1000.h | 24 | ||||
-rw-r--r-- | drivers/net/e1000/main.c | 98 |
3 files changed, 194 insertions, 138 deletions
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index 2fccd4681e..ff35b746e2 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c @@ -32,18 +32,16 @@ #include <asm/system.h> #include <linux/phy.h> #include <mach/emac_defs.h> -#include <platform_data/eth-davinci-emac.h> +#include <of_net.h> #include "davinci_emac.h" struct davinci_emac_priv { struct device_d *dev; struct eth_device edev; - struct mii_bus miibus; /* EMAC Addresses */ void __iomem *adap_emac; /* = EMAC_BASE_ADDR */ void __iomem *adap_ewrap; /* = EMAC_WRAPPER_BASE_ADDR */ - void __iomem *adap_mdio; /* = EMAC_MDIO_BASE_ADDR */ /* EMAC descriptors */ void __iomem *emac_desc_base; /* = EMAC_WRAPPER_RAM_ADDR */ @@ -58,8 +56,6 @@ struct davinci_emac_priv { /* PHY-specific information */ phy_interface_t interface; - uint8_t phy_addr; - uint32_t phy_flags; /* mac_addr[0] goes out on the wire first */ uint8_t mac_addr[6]; @@ -86,7 +82,13 @@ static inline void __iomem *HW_TO_BD(uint32_t x) #define HW_TO_BD(x) (x) #endif -static void davinci_eth_mdio_enable(struct davinci_emac_priv *priv) +struct davinci_mdio_priv { + struct device_d *dev; + struct mii_bus miibus; + void __iomem *adap_mdio; /* = EMAC_MDIO_BASE_ADDR */ +}; + +static void davinci_eth_mdio_enable(struct davinci_mdio_priv *priv) { uint32_t clkdiv; @@ -105,13 +107,40 @@ static void davinci_eth_mdio_enable(struct davinci_emac_priv *priv) while (readl(priv->adap_mdio + EMAC_MDIO_CONTROL) & MDIO_CONTROL_IDLE); } +/* wait until hardware is ready for another user access */ +static int wait_for_user_access(struct davinci_mdio_priv *priv, uint32_t *val) +{ + u32 tmp; + uint64_t start = get_time_ns(); + + do { + tmp = readl(priv->adap_mdio + EMAC_MDIO_USERACCESS0); + + if (!(tmp & MDIO_USERACCESS0_GO)) + break; + + if (is_timeout(start, 100 * MSECOND)) { + dev_err(priv->dev, "timeout waiting for user access\n"); + return -ETIMEDOUT; + } + } while (1); + + if (val) + *val = tmp; + + return 0; +} + + static int davinci_miibus_read(struct mii_bus *bus, int addr, int reg) { - struct davinci_emac_priv *priv = bus->priv; + struct davinci_mdio_priv *priv = bus->priv; uint16_t value; - int tmp; + int tmp, ret; - while (readl(priv->adap_mdio + EMAC_MDIO_USERACCESS0) & MDIO_USERACCESS0_GO); + ret = wait_for_user_access(priv, NULL); + if (ret) + return ret; writel(MDIO_USERACCESS0_GO | MDIO_USERACCESS0_WRITE_READ | @@ -119,8 +148,9 @@ static int davinci_miibus_read(struct mii_bus *bus, int addr, int reg) ((addr & 0x1f) << 16), priv->adap_mdio + EMAC_MDIO_USERACCESS0); - /* Wait for command to complete */ - while ((tmp = readl(priv->adap_mdio + EMAC_MDIO_USERACCESS0)) & MDIO_USERACCESS0_GO); + ret = wait_for_user_access(priv, &tmp); + if (ret) + return ret; if (tmp & MDIO_USERACCESS0_ACK) { value = tmp & 0xffff; @@ -134,8 +164,12 @@ static int davinci_miibus_read(struct mii_bus *bus, int addr, int reg) static int davinci_miibus_write(struct mii_bus *bus, int addr, int reg, u16 value) { - struct davinci_emac_priv *priv = bus->priv; - while (readl(priv->adap_mdio + EMAC_MDIO_USERACCESS0) & MDIO_USERACCESS0_GO); + struct davinci_mdio_priv *priv = bus->priv; + int ret; + + ret = wait_for_user_access(priv, NULL); + if (ret) + return ret; dev_dbg(priv->dev, "davinci_miibus_write: addr=0x%02x reg=0x%02x value=0x%04x\n", addr, reg, value); @@ -146,10 +180,7 @@ static int davinci_miibus_write(struct mii_bus *bus, int addr, int reg, u16 valu (value & 0xffff), priv->adap_mdio + EMAC_MDIO_USERACCESS0); - /* Wait for command to complete */ - while (readl(priv->adap_mdio + EMAC_MDIO_USERACCESS0) & MDIO_USERACCESS0_GO); - - return 0; + return wait_for_user_access(priv, NULL); } static int davinci_emac_get_ethaddr(struct eth_device *edev, unsigned char *adr) @@ -173,6 +204,17 @@ static int davinci_emac_set_ethaddr(struct eth_device *edev, const unsigned char static int davinci_emac_init(struct eth_device *edev) { + struct davinci_emac_priv *priv = edev->priv; + uint32_t cnt; + + /* Set DMA head and completion pointers to 0 */ + for(cnt = 0; cnt < 8; cnt++) { + writel(0, (void *)priv->adap_emac + EMAC_TX0HDP + 4 * cnt); + writel(0, (void *)priv->adap_emac + EMAC_RX0HDP + 4 * cnt); + writel(0, (void *)priv->adap_emac + EMAC_TX0CP + 4 * cnt); + writel(0, (void *)priv->adap_emac + EMAC_RX0CP + 4 * cnt); + } + dev_dbg(&edev->dev, "* emac_init\n"); return 0; } @@ -180,7 +222,7 @@ static int davinci_emac_init(struct eth_device *edev) static int davinci_emac_open(struct eth_device *edev) { struct davinci_emac_priv *priv = edev->priv; - uint32_t clkdiv, cnt; + uint32_t cnt; void __iomem *rx_desc; unsigned long mac_hi, mac_lo; int ret; @@ -282,16 +324,10 @@ static int davinci_emac_open(struct eth_device *edev) EMAC_MACCONTROL_RMIISPEED_100), priv->adap_emac + EMAC_MACCONTROL); - /* Init MDIO & get link state */ - clkdiv = (EMAC_MDIO_BUS_FREQ / EMAC_MDIO_CLOCK_FREQ) - 1; - writel((clkdiv & 0xff) | MDIO_CONTROL_ENABLE | MDIO_CONTROL_FAULT, - priv->adap_mdio + EMAC_MDIO_CONTROL); - /* Start receive process */ writel(BD_TO_HW(priv->emac_rx_desc), priv->adap_emac + EMAC_RX0HDP); - ret = phy_device_connect(edev, &priv->miibus, priv->phy_addr, NULL, - priv->phy_flags, priv->interface); + ret = phy_device_connect(edev, NULL, -1, NULL, 0, priv->interface); if (ret) return ret; @@ -500,19 +536,13 @@ out: static int davinci_emac_probe(struct device_d *dev) { struct resource *iores; - struct davinci_emac_platform_data *pdata; struct davinci_emac_priv *priv; - uint64_t start; - uint32_t phy_mask; + uint32_t ctrl_reg_offset; + uint32_t ctrl_ram_offset; + struct device_node *np = dev->device_node; dev_dbg(dev, "+ emac_probe\n"); - if (!dev->platform_data) { - dev_err(dev, "no platform_data\n"); - return -ENODEV; - } - pdata = dev->platform_data; - priv = xzalloc(sizeof(*priv)); dev->priv = priv; @@ -521,22 +551,14 @@ static int davinci_emac_probe(struct device_d *dev) iores = dev_request_mem_resource(dev, 0); if (IS_ERR(iores)) return PTR_ERR(iores); - priv->adap_emac = IOMEM(iores->start); - iores = dev_request_mem_resource(dev, 1); - if (IS_ERR(iores)) - return PTR_ERR(iores); priv->adap_ewrap = IOMEM(iores->start); - iores = dev_request_mem_resource(dev, 2); - if (IS_ERR(iores)) - return PTR_ERR(iores); - priv->adap_mdio = IOMEM(iores->start); + of_property_read_u32(np, "ti,davinci-ctrl-reg-offset", &ctrl_reg_offset); + priv->adap_emac = IOMEM(iores->start) + ctrl_reg_offset; - iores = dev_request_mem_resource(dev, 3); - if (IS_ERR(iores)) - return PTR_ERR(iores); - priv->emac_desc_base = IOMEM(iores->start); + of_property_read_u32(np, "ti,davinci-ctrl-ram-offset", &ctrl_ram_offset); + priv->emac_desc_base = IOMEM(iores->start) + ctrl_ram_offset; /* EMAC descriptors */ priv->emac_rx_desc = priv->emac_desc_base + EMAC_RX_DESC_BASE; @@ -558,37 +580,7 @@ static int davinci_emac_probe(struct device_d *dev) priv->edev.set_ethaddr = davinci_emac_set_ethaddr; priv->edev.parent = dev; - davinci_eth_mdio_enable(priv); - - start = get_time_ns(); - while (1) { - phy_mask = readl(priv->adap_mdio + EMAC_MDIO_ALIVE); - if (phy_mask) { - dev_info(dev, "detected phy mask 0x%x\n", phy_mask); - phy_mask = ~phy_mask; - break; - } - if (is_timeout(start, 256 * MSECOND)) { - dev_err(dev, "no live phy, scanning all\n"); - phy_mask = 0; - break; - } - } - - if (pdata->interface_rmii) - priv->interface = PHY_INTERFACE_MODE_RMII; - else - priv->interface = PHY_INTERFACE_MODE_MII; - priv->phy_addr = pdata->phy_addr; - priv->phy_flags = pdata->force_link ? PHYLIB_FORCE_LINK : 0; - - priv->miibus.read = davinci_miibus_read; - priv->miibus.write = davinci_miibus_write; - priv->miibus.priv = priv; - priv->miibus.parent = dev; - priv->miibus.phy_mask = phy_mask; - - mdiobus_register(&priv->miibus); + priv->interface = of_get_phy_mode(np); eth_register(&priv->edev); @@ -603,9 +595,73 @@ static void davinci_emac_remove(struct device_d *dev) davinci_emac_halt(&priv->edev); } +static __maybe_unused struct of_device_id davinci_emac_dt_ids[] = { + { + .compatible = "ti,am3517-emac", + }, { + /* sentinel */ + } +}; + static struct driver_d davinci_emac_driver = { .name = "davinci_emac", .probe = davinci_emac_probe, .remove = davinci_emac_remove, + .of_compatible = DRV_OF_COMPAT(davinci_emac_dt_ids), }; device_platform_driver(davinci_emac_driver); + +static int davinci_mdio_probe(struct device_d *dev) +{ + struct resource *iores; + struct davinci_mdio_priv *priv; + int ret; + uint32_t clkdiv; + + priv = xzalloc(sizeof(*priv)); + + priv->dev = dev; + priv->miibus.read = davinci_miibus_read; + priv->miibus.write = davinci_miibus_write; + priv->miibus.priv = priv; + priv->miibus.parent = dev; + + iores = dev_request_mem_resource(dev, 0); + if (IS_ERR(iores)) + return PTR_ERR(iores); + + priv->adap_mdio = IOMEM(iores->start); + + davinci_eth_mdio_enable(priv); + + /* Init MDIO & get link state */ + clkdiv = (EMAC_MDIO_BUS_FREQ / EMAC_MDIO_CLOCK_FREQ) - 1; + writel((clkdiv & 0xff) | MDIO_CONTROL_ENABLE | MDIO_CONTROL_FAULT, + priv->adap_mdio + EMAC_MDIO_CONTROL); + + ret = mdiobus_register(&priv->miibus); + if (ret) + goto err; + + return 0; + +err: + free(priv); + + return ret; +} + +static __maybe_unused struct of_device_id davinci_mdio_dt_ids[] = { + { + .compatible = "ti,davinci_mdio", + }, { + /* sentinel */ + } +}; + +static struct driver_d davinci_mdio_driver = { + .name = "davinci_mdio", + .probe = davinci_mdio_probe, + .of_compatible = DRV_OF_COMPAT(davinci_mdio_dt_ids), +}; +device_platform_driver(davinci_mdio_driver); diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index 4a1a1aa336..0a9e107c07 100644 --- a/drivers/net/e1000/e1000.h +++ b/drivers/net/e1000/e1000.h @@ -95,19 +95,17 @@ typedef enum { /* Error Codes */ #define E1000_SUCCESS 0 -#define E1000_ERR_EEPROM 1 -#define E1000_ERR_PHY 2 -#define E1000_ERR_CONFIG 3 -#define E1000_ERR_PARAM 4 -#define E1000_ERR_MAC_TYPE 5 -#define E1000_ERR_PHY_TYPE 6 -#define E1000_ERR_NOLINK 7 -#define E1000_ERR_TIMEOUT 8 -#define E1000_ERR_RESET 9 -#define E1000_ERR_MASTER_REQUESTS_PENDING 10 -#define E1000_ERR_HOST_INTERFACE_COMMAND 11 -#define E1000_BLK_PHY_RESET 12 -#define E1000_ERR_SWFW_SYNC 13 +#define E1000_ERR_EEPROM EIO +#define E1000_ERR_PHY EIO +#define E1000_ERR_CONFIG EINVAL +#define E1000_ERR_PARAM EINVAL +#define E1000_ERR_MAC_TYPE EINVAL +#define E1000_ERR_PHY_TYPE EINVAL +#define E1000_ERR_NOLINK ENETDOWN +#define E1000_ERR_TIMEOUT ETIMEDOUT +#define E1000_ERR_RESET EIO +#define E1000_BLK_PHY_RESET EWOULDBLOCK +#define E1000_ERR_SWFW_SYNC EBUSY /* PCI Device IDs */ #define E1000_DEV_ID_82542 0x1000 diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c index caa7274a8d..0ef8fd6231 100644 --- a/drivers/net/e1000/main.c +++ b/drivers/net/e1000/main.c @@ -231,7 +231,7 @@ static int32_t e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw) if (!timeout) { /* Release semaphores */ e1000_put_hw_eeprom_semaphore(hw); - dev_dbg(hw->dev, "Driver can't access the Eeprom - " + dev_err(hw->dev, "Driver can't access the Eeprom - " "SWESMBI bit is set.\n"); return -E1000_ERR_EEPROM; } @@ -262,7 +262,7 @@ int32_t e1000_swfw_sync_acquire(struct e1000_hw *hw, uint16_t mask) } if (!timeout) { - dev_dbg(hw->dev, "Driver can't access resource, SW_FW_SYNC timeout.\n"); + dev_err(hw->dev, "Driver can't access resource, SW_FW_SYNC timeout.\n"); return -E1000_ERR_SWFW_SYNC; } @@ -332,7 +332,7 @@ static int e1000_get_ethaddr(struct eth_device *edev, unsigned char *adr) for (i = 0; i < NODE_ADDRESS_SIZE; i += 2) { if (e1000_read_eeprom(hw, i >> 1, 1, &eeprom_data) < 0) { - dev_dbg(hw->dev, "EEPROM Read Error\n"); + dev_err(hw->dev, "EEPROM Read Error\n"); return -E1000_ERR_EEPROM; } adr[i] = eeprom_data & 0xff; @@ -832,20 +832,6 @@ static int e1000_setup_link(struct e1000_hw *hw) if (e1000_check_phy_reset_block(hw)) return E1000_SUCCESS; - /* Read and store word 0x0F of the EEPROM. This word contains bits - * that determine the hardware's default PAUSE (flow control) mode, - * a bit that determines whether the HW defaults to enabling or - * disabling auto-negotiation, and the direction of the - * SW defined pins. If there is no SW over-ride of the flow - * control setting, then the variable hw->fc will - * be initialized based on a value in the EEPROM. - */ - if (e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG, 1, - &eeprom_data) < 0) { - dev_dbg(hw->dev, "EEPROM Read Error\n"); - return -E1000_ERR_EEPROM; - } - switch (hw->mac_type) { case e1000_ich8lan: case e1000_82573: @@ -854,6 +840,22 @@ static int e1000_setup_link(struct e1000_hw *hw) hw->fc = e1000_fc_full; break; default: + /* Read and store word 0x0F of the EEPROM. This word + * contains bits that determine the hardware's default + * PAUSE (flow control) mode, a bit that determines + * whether the HW defaults to enabling or disabling + * auto-negotiation, and the direction of the SW + * defined pins. If there is no SW over-ride of the + * flow control setting, then the variable hw->fc will + * be initialized based on a value in the EEPROM. + */ + ret_val = e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG, 1, + &eeprom_data); + if (ret_val < 0) { + dev_err(hw->dev, "EEPROM Read Error\n"); + return ret_val; + } + if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == 0) hw->fc = e1000_fc_none; else if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == EEPROM_WORD0F_ASM_DIR) @@ -1006,7 +1008,7 @@ static int e1000_setup_fiber_link(struct e1000_hw *hw) txcw = E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK; break; default: - dev_dbg(hw->dev, "Flow control param set incorrectly\n"); + dev_err(hw->dev, "Flow control param set incorrectly\n"); return -E1000_ERR_CONFIG; break; } @@ -1044,7 +1046,7 @@ static int e1000_setup_fiber_link(struct e1000_hw *hw) * detect a signal. This will allow us to communicate with * non-autonegotiating link partners. */ - dev_dbg(hw->dev, "Never got a valid link from auto-neg!!!\n"); + dev_err(hw->dev, "Never got a valid link from auto-neg!!!\n"); hw->autoneg_failed = 1; return -E1000_ERR_NOLINK; } else { @@ -1052,7 +1054,7 @@ static int e1000_setup_fiber_link(struct e1000_hw *hw) dev_dbg(hw->dev, "Valid Link Found\n"); } } else { - dev_dbg(hw->dev, "No Signal Detected\n"); + dev_err(hw->dev, "No Signal Detected\n"); return -E1000_ERR_NOLINK; } return 0; @@ -1092,7 +1094,7 @@ static int32_t e1000_copper_link_preconfig(struct e1000_hw *hw) /* Make sure we have a valid PHY */ ret_val = e1000_detect_gig_phy(hw); if (ret_val) { - dev_dbg(hw->dev, "Error, did not detect valid phy.\n"); + dev_err(hw->dev, "Error, did not detect valid phy.\n"); return ret_val; } dev_dbg(hw->dev, "Phy ID = %x \n", hw->phy_id); @@ -1236,7 +1238,7 @@ static int32_t e1000_copper_link_igp_setup(struct e1000_hw *hw) ret_val = e1000_phy_reset(hw); if (ret_val) { - dev_dbg(hw->dev, "Error Resetting the PHY\n"); + dev_err(hw->dev, "Error Resetting the PHY\n"); return ret_val; } @@ -1255,7 +1257,7 @@ static int32_t e1000_copper_link_igp_setup(struct e1000_hw *hw) /* disable lplu d3 during driver init */ ret_val = e1000_set_d3_lplu_state_off(hw); if (ret_val) { - dev_dbg(hw->dev, "Error Disabling LPLU D3\n"); + dev_err(hw->dev, "Error Disabling LPLU D3\n"); return ret_val; } } @@ -1263,7 +1265,7 @@ static int32_t e1000_copper_link_igp_setup(struct e1000_hw *hw) /* disable lplu d0 during driver init */ ret_val = e1000_set_d0_lplu_state_off(hw); if (ret_val) { - dev_dbg(hw->dev, "Error Disabling LPLU D0\n"); + dev_err(hw->dev, "Error Disabling LPLU D0\n"); return ret_val; } @@ -1457,7 +1459,7 @@ static int32_t e1000_copper_link_ggp_setup(struct e1000_hw *hw) /* SW Reset the PHY so all changes take effect */ ret_val = e1000_phy_reset(hw); if (ret_val) { - dev_dbg(hw->dev, "Error Resetting the PHY\n"); + dev_err(hw->dev, "Error Resetting the PHY\n"); return ret_val; } @@ -1586,7 +1588,7 @@ static int32_t e1000_copper_link_mgp_setup(struct e1000_hw *hw) /* SW Reset the PHY so all changes take effect */ ret_val = e1000_phy_reset(hw); if (ret_val) { - dev_dbg(hw->dev, "Error Resetting the PHY\n"); + dev_err(hw->dev, "Error Resetting the PHY\n"); return ret_val; } @@ -1615,7 +1617,7 @@ static int32_t e1000_copper_link_autoneg(struct e1000_hw *hw) dev_dbg(hw->dev, "Reconfiguring auto-neg advertisement params\n"); ret_val = e1000_phy_setup_autoneg(hw); if (ret_val) { - dev_dbg(hw->dev, "Error Setting up Auto-Negotiation\n"); + dev_err(hw->dev, "Error Setting up Auto-Negotiation\n"); return ret_val; } dev_dbg(hw->dev, "Restarting Auto-Neg\n"); @@ -1634,7 +1636,7 @@ static int32_t e1000_copper_link_autoneg(struct e1000_hw *hw) ret_val = e1000_wait_autoneg(hw); if (ret_val) { - dev_dbg(hw->dev, "Error while waiting for autoneg to complete\n"); + dev_err(hw->dev, "Error while waiting for autoneg to complete\n"); return ret_val; } @@ -1663,14 +1665,14 @@ static int32_t e1000_copper_link_postconfig(struct e1000_hw *hw) } else { ret_val = e1000_config_mac_to_phy(hw); if (ret_val) { - dev_dbg(hw->dev, "Error configuring MAC to PHY settings\n"); + dev_err(hw->dev, "Error configuring MAC to PHY settings\n"); return ret_val; } } ret_val = e1000_config_fc_after_link_up(hw); if (ret_val) { - dev_dbg(hw->dev, "Error Configuring Flow Control\n"); + dev_err(hw->dev, "Error Configuring Flow Control\n"); return ret_val; } @@ -1983,7 +1985,7 @@ static int e1000_config_mac_to_phy(struct e1000_hw *hw) * registers depending on negotiated values. */ if (e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data) < 0) { - dev_dbg(hw->dev, "PHY Read Error\n"); + dev_err(hw->dev, "PHY Read Error\n"); return -E1000_ERR_PHY; } if (phy_data & M88E1000_PSSR_DPLX) @@ -2059,7 +2061,7 @@ static int e1000_force_mac_fc(struct e1000_hw *hw) ctrl |= (E1000_CTRL_TFCE | E1000_CTRL_RFCE); break; default: - dev_dbg(hw->dev, "Flow control param set incorrectly\n"); + dev_err(hw->dev, "Flow control param set incorrectly\n"); return -E1000_ERR_CONFIG; } @@ -2098,17 +2100,17 @@ static int32_t e1000_config_fc_after_link_up(struct e1000_hw *hw) * some "sticky" (latched) bits. */ if (e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg) < 0) { - dev_dbg(hw->dev, "PHY Read Error \n"); + dev_err(hw->dev, "PHY Read Error \n"); return -E1000_ERR_PHY; } if (e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg) < 0) { - dev_dbg(hw->dev, "PHY Read Error \n"); + dev_err(hw->dev, "PHY Read Error \n"); return -E1000_ERR_PHY; } if (!(mii_status_reg & MII_SR_AUTONEG_COMPLETE)) { - dev_dbg(hw->dev, "Copper PHY and Auto Neg has not completed.\n"); + dev_err(hw->dev, "Copper PHY and Auto Neg has not completed.\n"); return 0; } @@ -2119,12 +2121,12 @@ static int32_t e1000_config_fc_after_link_up(struct e1000_hw *hw) * negotiated. */ if (e1000_read_phy_reg(hw, PHY_AUTONEG_ADV, &mii_nway_adv_reg) < 0) { - dev_dbg(hw->dev, "PHY Read Error\n"); + dev_err(hw->dev, "PHY Read Error\n"); return -E1000_ERR_PHY; } if (e1000_read_phy_reg(hw, PHY_LP_ABILITY, &mii_nway_lp_ability_reg) < 0) { - dev_dbg(hw->dev, "PHY Read Error\n"); + dev_err(hw->dev, "PHY Read Error\n"); return -E1000_ERR_PHY; } @@ -2250,7 +2252,7 @@ static int32_t e1000_config_fc_after_link_up(struct e1000_hw *hw) */ ret_val = e1000_force_mac_fc(hw); if (ret_val < 0) { - dev_dbg(hw->dev, "Error forcing flow control settings\n"); + dev_err(hw->dev, "Error forcing flow control settings\n"); return ret_val; } @@ -2399,11 +2401,11 @@ static int e1000_wait_autoneg(struct e1000_hw *hw) * Complete bit to be set. */ if (e1000_read_phy_reg(hw, PHY_STATUS, &phy_data) < 0) { - dev_dbg(hw->dev, "PHY Read Error\n"); + dev_err(hw->dev, "PHY Read Error\n"); return -E1000_ERR_PHY; } if (e1000_read_phy_reg(hw, PHY_STATUS, &phy_data) < 0) { - dev_dbg(hw->dev, "PHY Read Error\n"); + dev_err(hw->dev, "PHY Read Error\n"); return -E1000_ERR_PHY; } if (phy_data & MII_SR_AUTONEG_COMPLETE) { @@ -2412,7 +2414,7 @@ static int e1000_wait_autoneg(struct e1000_hw *hw) } mdelay(100); } - dev_dbg(hw->dev, "Auto-Neg timedout.\n"); + dev_err(hw->dev, "Auto-Neg timedout.\n"); return -E1000_ERR_TIMEOUT; } @@ -2578,11 +2580,11 @@ static int e1000_phy_read(struct mii_bus *bus, int phy_addr, int reg_addr) break; } if (!(mdic & E1000_MDIC_READY)) { - dev_dbg(hw->dev, "MDI Read did not complete\n"); + dev_err(hw->dev, "MDI Read did not complete\n"); return -E1000_ERR_PHY; } if (mdic & E1000_MDIC_ERROR) { - dev_dbg(hw->dev, "MDI Error\n"); + dev_err(hw->dev, "MDI Error\n"); return -E1000_ERR_PHY; } return mdic; @@ -2667,7 +2669,7 @@ static int e1000_phy_write(struct mii_bus *bus, int phy_addr, break; } if (!(mdic & E1000_MDIC_READY)) { - dev_dbg(hw->dev, "MDI Write did not complete\n"); + dev_err(hw->dev, "MDI Write did not complete\n"); return -E1000_ERR_PHY; } } else { @@ -2774,7 +2776,7 @@ static int32_t e1000_get_phy_cfg_done(struct e1000_hw *hw) timeout--; } if (!timeout) { - dev_dbg(hw->dev, "MNG configuration cycle has not completed.\n"); + dev_err(hw->dev, "MNG configuration cycle has not completed.\n"); return -E1000_ERR_RESET; } break; @@ -2810,7 +2812,7 @@ static int32_t e1000_phy_hw_reset(struct e1000_hw *hw) swfw = E1000_SWFW_PHY1_SM; if (e1000_swfw_sync_acquire(hw, swfw)) { - dev_dbg(hw->dev, "Unable to acquire swfw sync\n"); + dev_err(hw->dev, "Unable to acquire swfw sync\n"); return -E1000_ERR_SWFW_SYNC; } @@ -3109,12 +3111,12 @@ static int32_t e1000_detect_gig_phy(struct e1000_hw *hw) phy_type = e1000_phy_igb; break; default: - dev_dbg(hw->dev, "Invalid MAC type %d\n", hw->mac_type); + dev_err(hw->dev, "Invalid MAC type %d\n", hw->mac_type); return -E1000_ERR_CONFIG; } if (phy_type == e1000_phy_undefined) { - dev_dbg(hw->dev, "Invalid PHY ID 0x%X\n", hw->phy_id); + dev_err(hw->dev, "Invalid PHY ID 0x%X\n", hw->phy_id); return -EINVAL; } |