diff options
author | Scott Wood <scottwood@freescale.com> | 2014-04-08 01:00:49 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-08 19:58:35 (GMT) |
commit | 47d2261a3fa71cde24263559a4219a25e50d8c89 (patch) | |
tree | 28774d5b330ccf1b777a3af222d8356918328013 /drivers/net/phy | |
parent | fb7f27080adc65cd5f341bdf56a1d0c14f316c1b (diff) | |
parent | 5fb9d37f27351e42f002e372074249f92cbdf815 (diff) | |
download | linux-fsl-qoriq-47d2261a3fa71cde24263559a4219a25e50d8c89.tar.xz |
Merge branch 'merge' into sdk-v1.6.x
This reverts v3.13-rc3+ (78fd82238d0e5716) to v3.12, except for
commits which I noticed which appear relevant to the SDK.
Signed-off-by: Scott Wood <scottwood@freescale.com>
Conflicts:
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/kvm/book3s_hv_rmhandlers.S
arch/powerpc/kvm/book3s_interrupts.S
arch/powerpc/kvm/e500.c
arch/powerpc/kvm/e500mc.c
arch/powerpc/sysdev/fsl_soc.h
drivers/Kconfig
drivers/cpufreq/ppc-corenet-cpufreq.c
drivers/dma/fsldma.c
drivers/dma/s3c24xx-dma.c
drivers/misc/Makefile
drivers/mmc/host/sdhci-of-esdhc.c
drivers/mtd/devices/m25p80.c
drivers/net/ethernet/freescale/gianfar.h
drivers/platform/Kconfig
drivers/platform/Makefile
drivers/spi/spi-fsl-espi.c
include/crypto/algapi.h
include/linux/netdev_features.h
include/linux/skbuff.h
include/net/ip.h
net/core/ethtool.c
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/Kconfig | 7 | ||||
-rw-r--r-- | drivers/net/phy/Makefile | 1 | ||||
-rw-r--r-- | drivers/net/phy/at803x.c | 59 | ||||
-rw-r--r-- | drivers/net/phy/marvell.c | 4 | ||||
-rw-r--r-- | drivers/net/phy/mdio-moxart.c | 201 | ||||
-rw-r--r-- | drivers/net/phy/mdio_bus.c | 10 | ||||
-rw-r--r-- | drivers/net/phy/micrel.c | 24 | ||||
-rw-r--r-- | drivers/net/phy/realtek.c | 15 |
8 files changed, 12 insertions, 309 deletions
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index 27c40e4..559ca1c 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -164,13 +164,6 @@ config MDIO_SUN4I interface units of the Allwinner SoC that have an EMAC (A10, A12, A10s, etc.) -config MDIO_MOXART - tristate "MOXA ART MDIO interface support" - depends on ARCH_MOXART - help - This driver supports the MDIO interface found in the network - interface units of the MOXA ART SoC - config MDIO_BUS_MUX tristate depends on OF_MDIO diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile index 01d8afe..6342943 100644 --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile @@ -34,4 +34,3 @@ obj-$(CONFIG_MDIO_BUS_MUX_GPIO) += mdio-mux-gpio.o obj-$(CONFIG_MDIO_BUS_MUX_MMIOREG) += mdio-mux-mmioreg.o obj-$(CONFIG_FSL_10GBASE_KR) += fsl_10gkr.o obj-$(CONFIG_MDIO_SUN4I) += mdio-sun4i.o -obj-$(CONFIG_MDIO_MOXART) += mdio-moxart.o diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index 9fa4a8a..f3778ad 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -103,45 +103,6 @@ static void at803x_get_wol(struct phy_device *phydev, wol->wolopts |= WAKE_MAGIC; } -static int at803x_suspend(struct phy_device *phydev) -{ - int value; - int wol_enabled; - - mutex_lock(&phydev->lock); - - value = phy_read(phydev, AT803X_INTR_ENABLE); - wol_enabled = value & AT803X_WOL_ENABLE; - - value = phy_read(phydev, MII_BMCR); - - if (wol_enabled) - value |= BMCR_ISOLATE; - else - value |= BMCR_PDOWN; - - phy_write(phydev, MII_BMCR, value); - - mutex_unlock(&phydev->lock); - - return 0; -} - -static int at803x_resume(struct phy_device *phydev) -{ - int value; - - mutex_lock(&phydev->lock); - - value = phy_read(phydev, MII_BMCR); - value &= ~(BMCR_PDOWN | BMCR_ISOLATE); - phy_write(phydev, MII_BMCR, value); - - mutex_unlock(&phydev->lock); - - return 0; -} - static int at803x_config_init(struct phy_device *phydev) { int val; @@ -228,12 +189,10 @@ static struct phy_driver at803x_driver[] = { .config_init = at803x_config_init, .set_wol = at803x_set_wol, .get_wol = at803x_get_wol, - .suspend = at803x_suspend, - .resume = at803x_resume, .features = PHY_GBIT_FEATURES, .flags = PHY_HAS_INTERRUPT, - .config_aneg = genphy_config_aneg, - .read_status = genphy_read_status, + .config_aneg = &genphy_config_aneg, + .read_status = &genphy_read_status, .driver = { .owner = THIS_MODULE, }, @@ -243,8 +202,6 @@ static struct phy_driver at803x_driver[] = { .name = "Atheros 8033 ethernet", .phy_id_mask = 0xffffffef, .config_init = at803x_config_init, - .suspend = at803x_suspend, - .resume = at803x_resume, .features = PHY_GBIT_FEATURES, .flags = PHY_HAS_INTERRUPT, .config_aneg = &genphy_config_aneg, @@ -262,12 +219,10 @@ static struct phy_driver at803x_driver[] = { .config_init = at803x_config_init, .set_wol = at803x_set_wol, .get_wol = at803x_get_wol, - .suspend = at803x_suspend, - .resume = at803x_resume, .features = PHY_GBIT_FEATURES, .flags = PHY_HAS_INTERRUPT, - .config_aneg = genphy_config_aneg, - .read_status = genphy_read_status, + .config_aneg = &genphy_config_aneg, + .read_status = &genphy_read_status, .driver = { .owner = THIS_MODULE, }, @@ -279,12 +234,10 @@ static struct phy_driver at803x_driver[] = { .config_init = at803x_config_init, .set_wol = at803x_set_wol, .get_wol = at803x_get_wol, - .suspend = at803x_suspend, - .resume = at803x_resume, .features = PHY_GBIT_FEATURES, .flags = PHY_HAS_INTERRUPT, - .config_aneg = genphy_config_aneg, - .read_status = genphy_read_status, + .config_aneg = &genphy_config_aneg, + .read_status = &genphy_read_status, .driver = { .owner = THIS_MODULE, }, diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index a102cc5..2128c6c 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -34,9 +34,9 @@ #include <linux/marvell_phy.h> #include <linux/of.h> -#include <linux/io.h> +#include <asm/io.h> #include <asm/irq.h> -#include <linux/uaccess.h> +#include <asm/uaccess.h> #define MII_MARVELL_PHY_PAGE 22 diff --git a/drivers/net/phy/mdio-moxart.c b/drivers/net/phy/mdio-moxart.c deleted file mode 100644 index a5741cb..0000000 --- a/drivers/net/phy/mdio-moxart.c +++ /dev/null @@ -1,201 +0,0 @@ -/* MOXA ART Ethernet (RTL8201CP) MDIO interface driver - * - * Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com> - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. - */ - -#include <linux/delay.h> -#include <linux/init.h> -#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/mutex.h> -#include <linux/of_address.h> -#include <linux/of_mdio.h> -#include <linux/phy.h> -#include <linux/platform_device.h> -#include <linux/regulator/consumer.h> - -#define REG_PHY_CTRL 0 -#define REG_PHY_WRITE_DATA 4 - -/* REG_PHY_CTRL */ -#define MIIWR BIT(27) /* init write sequence (auto cleared)*/ -#define MIIRD BIT(26) -#define REGAD_MASK 0x3e00000 -#define PHYAD_MASK 0x1f0000 -#define MIIRDATA_MASK 0xffff - -/* REG_PHY_WRITE_DATA */ -#define MIIWDATA_MASK 0xffff - -struct moxart_mdio_data { - void __iomem *base; -}; - -static int moxart_mdio_read(struct mii_bus *bus, int mii_id, int regnum) -{ - struct moxart_mdio_data *data = bus->priv; - u32 ctrl = 0; - unsigned int count = 5; - - dev_dbg(&bus->dev, "%s\n", __func__); - - ctrl |= MIIRD | ((mii_id << 16) & PHYAD_MASK) | - ((regnum << 21) & REGAD_MASK); - - writel(ctrl, data->base + REG_PHY_CTRL); - - do { - ctrl = readl(data->base + REG_PHY_CTRL); - - if (!(ctrl & MIIRD)) - return ctrl & MIIRDATA_MASK; - - mdelay(10); - count--; - } while (count > 0); - - dev_dbg(&bus->dev, "%s timed out\n", __func__); - - return -ETIMEDOUT; -} - -static int moxart_mdio_write(struct mii_bus *bus, int mii_id, - int regnum, u16 value) -{ - struct moxart_mdio_data *data = bus->priv; - u32 ctrl = 0; - unsigned int count = 5; - - dev_dbg(&bus->dev, "%s\n", __func__); - - ctrl |= MIIWR | ((mii_id << 16) & PHYAD_MASK) | - ((regnum << 21) & REGAD_MASK); - - value &= MIIWDATA_MASK; - - writel(value, data->base + REG_PHY_WRITE_DATA); - writel(ctrl, data->base + REG_PHY_CTRL); - - do { - ctrl = readl(data->base + REG_PHY_CTRL); - - if (!(ctrl & MIIWR)) - return 0; - - mdelay(10); - count--; - } while (count > 0); - - dev_dbg(&bus->dev, "%s timed out\n", __func__); - - return -ETIMEDOUT; -} - -static int moxart_mdio_reset(struct mii_bus *bus) -{ - int data, i; - - for (i = 0; i < PHY_MAX_ADDR; i++) { - data = moxart_mdio_read(bus, i, MII_BMCR); - if (data < 0) - continue; - - data |= BMCR_RESET; - if (moxart_mdio_write(bus, i, MII_BMCR, data) < 0) - continue; - } - - return 0; -} - -static int moxart_mdio_probe(struct platform_device *pdev) -{ - struct device_node *np = pdev->dev.of_node; - struct mii_bus *bus; - struct moxart_mdio_data *data; - struct resource *res; - int ret, i; - - bus = mdiobus_alloc_size(sizeof(*data)); - if (!bus) - return -ENOMEM; - - bus->name = "MOXA ART Ethernet MII"; - bus->read = &moxart_mdio_read; - bus->write = &moxart_mdio_write; - bus->reset = &moxart_mdio_reset; - snprintf(bus->id, MII_BUS_ID_SIZE, "%s-%d-mii", pdev->name, pdev->id); - bus->parent = &pdev->dev; - - bus->irq = devm_kzalloc(&pdev->dev, sizeof(int) * PHY_MAX_ADDR, - GFP_KERNEL); - if (!bus->irq) { - ret = -ENOMEM; - goto err_out_free_mdiobus; - } - - /* Setting PHY_IGNORE_INTERRUPT here even if it has no effect, - * of_mdiobus_register() sets these PHY_POLL. - * Ideally, the interrupt from MAC controller could be used to - * detect link state changes, not polling, i.e. if there was - * a way phy_driver could set PHY_HAS_INTERRUPT but have that - * interrupt handled in ethernet drivercode. - */ - for (i = 0; i < PHY_MAX_ADDR; i++) - bus->irq[i] = PHY_IGNORE_INTERRUPT; - - data = bus->priv; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - data->base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(data->base)) { - ret = PTR_ERR(data->base); - goto err_out_free_mdiobus; - } - - ret = of_mdiobus_register(bus, np); - if (ret < 0) - goto err_out_free_mdiobus; - - platform_set_drvdata(pdev, bus); - - return 0; - -err_out_free_mdiobus: - mdiobus_free(bus); - return ret; -} - -static int moxart_mdio_remove(struct platform_device *pdev) -{ - struct mii_bus *bus = platform_get_drvdata(pdev); - - mdiobus_unregister(bus); - mdiobus_free(bus); - - return 0; -} - -static const struct of_device_id moxart_mdio_dt_ids[] = { - { .compatible = "moxa,moxart-mdio" }, - { } -}; -MODULE_DEVICE_TABLE(of, moxart_mdio_dt_ids); - -static struct platform_driver moxart_mdio_driver = { - .probe = moxart_mdio_probe, - .remove = moxart_mdio_remove, - .driver = { - .name = "moxart-mdio", - .of_match_table = moxart_mdio_dt_ids, - }, -}; - -module_platform_driver(moxart_mdio_driver); - -MODULE_DESCRIPTION("MOXA ART MDIO interface driver"); -MODULE_AUTHOR("Jonas Jensen <jonas.jensen@gmail.com>"); -MODULE_LICENSE("GPL"); diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 5617876..dc92097 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -438,19 +438,17 @@ phy_id_show(struct device *dev, struct device_attribute *attr, char *buf) return sprintf(buf, "0x%.8lx\n", (unsigned long)phydev->phy_id); } -static DEVICE_ATTR_RO(phy_id); -static struct attribute *mdio_dev_attrs[] = { - &dev_attr_phy_id.attr, - NULL, +static struct device_attribute mdio_dev_attrs[] = { + __ATTR_RO(phy_id), + __ATTR_NULL }; -ATTRIBUTE_GROUPS(mdio_dev); struct bus_type mdio_bus_type = { .name = "mdio_bus", .match = mdio_bus_match, .pm = MDIO_BUS_PM_OPS, - .dev_groups = mdio_dev_groups, + .dev_attrs = mdio_dev_attrs, }; EXPORT_SYMBOL(mdio_bus_type); diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 3ae28f4..c31aad0 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -287,8 +287,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = ks8737_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE,}, }, { .phy_id = PHY_ID_KSZ8021, @@ -302,8 +300,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = kszphy_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE,}, }, { .phy_id = PHY_ID_KSZ8031, @@ -317,8 +313,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = kszphy_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE,}, }, { .phy_id = PHY_ID_KSZ8041, @@ -332,8 +326,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = kszphy_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE,}, }, { .phy_id = PHY_ID_KSZ8051, @@ -347,8 +339,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = kszphy_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE,}, }, { .phy_id = PHY_ID_KSZ8001, @@ -361,8 +351,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = kszphy_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE,}, }, { .phy_id = PHY_ID_KSZ8081, @@ -375,8 +363,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = kszphy_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE,}, }, { .phy_id = PHY_ID_KSZ8061, @@ -389,8 +375,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = kszphy_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE,}, }, { .phy_id = PHY_ID_KSZ9021, @@ -403,8 +387,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = ksz9021_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE, }, }, { .phy_id = PHY_ID_KSZ9031, @@ -418,8 +400,6 @@ static struct phy_driver ksphy_driver[] = { .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = ksz9021_config_intr, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE, }, }, { .phy_id = PHY_ID_KSZ8873MLL, @@ -430,8 +410,6 @@ static struct phy_driver ksphy_driver[] = { .config_init = kszphy_config_init, .config_aneg = ksz8873mll_config_aneg, .read_status = ksz8873mll_read_status, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE, }, }, { .phy_id = PHY_ID_KSZ886X, @@ -442,8 +420,6 @@ static struct phy_driver ksphy_driver[] = { .config_init = kszphy_config_init, .config_aneg = genphy_config_aneg, .read_status = genphy_read_status, - .suspend = genphy_suspend, - .resume = genphy_resume, .driver = { .owner = THIS_MODULE, }, } }; diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c index fa1d69a..138de83 100644 --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c @@ -64,18 +64,6 @@ static int rtl8211e_config_intr(struct phy_device *phydev) return err; } -/* RTL8201CP */ -static struct phy_driver rtl8201cp_driver = { - .phy_id = 0x00008201, - .name = "RTL8201CP Ethernet", - .phy_id_mask = 0x0000ffff, - .features = PHY_BASIC_FEATURES, - .flags = PHY_HAS_INTERRUPT, - .config_aneg = &genphy_config_aneg, - .read_status = &genphy_read_status, - .driver = { .owner = THIS_MODULE,}, -}; - /* RTL8211B */ static struct phy_driver rtl8211b_driver = { .phy_id = 0x001cc912, @@ -110,9 +98,6 @@ static int __init realtek_init(void) { int ret; - ret = phy_driver_register(&rtl8201cp_driver); - if (ret < 0) - return -ENODEV; ret = phy_driver_register(&rtl8211b_driver); if (ret < 0) return -ENODEV; |