summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/misc'Sascha Hauer2017-10-191-4/+69
|\
| * Marvell: implement marvell_of_reg_initClément Leger2017-10-161-4/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | From ed1cbcd05d5efeb4012d77a9a4ab9c1da0449bdc Mon Sep 17 00:00:00 2001 From: Clement Leger <clement.leger@kalray.eu> Date: Tue, 10 Oct 2017 14:29:49 +0200 Subject: [PATCH] Marvell: implement marvell_of_reg_init Implement marvell_of_reg_init in order to use marvell,reg-init property from device-tree. The code is taken from Linux kernel and slighlty modify to fit barebox structures. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: phy: add ar8327 driverOleksij Rempel2017-09-203-0/+286
|/ | | | | | | | The Atheros ar8327 is a seven port gigabit ethernet switch. This patch adds a driver for the phys in it. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Phy: Check NULL bus case and undetected phy via ofClément Leger2017-09-061-0/+5
| | | | | | | | | | | | | | | From 5e87dc2c24051c2cd2985e513c5a825d51d9bb00 Mon Sep 17 00:00:00 2001 From: Clement Leger <clement.leger@kalray.eu> Date: Tue, 5 Sep 2017 10:37:23 +0200 Subject: [PATCH] Phy: Check NULL bus case and undetected phy via of phy_device_connect can be called with NULL miibus for automatic match with the phy described in the device tree. In the case where the phy was not detected for some unknown reason, the next calls will be done with a NULL bus. This will lead to undefined behavior and more probably crashes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* phy: don't crash if we have no parentOleksij Rempel2017-09-061-1/+1
| | | | | | | | current code will crash if DT has no PHY entry. With this patch we will test if parent exist, before testing the parent device node. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* param: make parameter functions more consistentSascha Hauer2017-04-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | This patch creates a consitent set of device parameter functions. With this we have: dev_add_param_<type><access> "type" is one of: int32, uint32, int64, uint64, string, mac, ipv4, enum, bitmask The improvement here is that we now can exactly specify the width of the int type parameters and also correctly distinguish between signed and unsigned variables which means that a variable no longer ends up with INT_MAX when it's assigned -1. "access" can be empty for regular read/write parameter, "_ro" for readonly parameters which get their value from a variable pointer in the background or "_fixed" for parameters which are set to a fixed value (without a pointer in the background). Some more exotic types are not (yet) implemented, like dev_add_param_ip_ro. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net'Sascha Hauer2017-04-071-0/+126
|\
| * net/phy: marvell: import support for 88E1111 from the LinuxPeter Mamonov2017-03-301-0/+126
| | | | | | | | | | Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: phy: mdio-gpio.c: fix "no previous prototype" warningAntony Pavlov2017-03-301-1/+1
|/ | | | | | | | | | | | The patch fixes this compiler's warning: drivers/net/phy/mdio-gpio.c:48:24: warning: no previous prototype for 'mdio_gpio_of_get_info' [-Wmissing-prototypes] struct mdio_gpio_info *mdio_gpio_of_get_info(struct device_d *dev) ^ Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net/phy: marvell: add support for 88e1510 to marvell phy driverUwe Kleine-König2017-01-131-3/+201
| | | | | | | This is mostly copied verbatim from the Linux driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net/phy: marvell: improve config_aneg for 88E1121R and 88E1318SUwe Kleine-König2017-01-131-2/+76
| | | | | | | This is taken from the Linux driver Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net/phy: marvell: align definition of MII_88E1121_PHY_MSCR to Linux driverUwe Kleine-König2017-01-131-3/+3
| | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net/phy: marvell: change spacing to be more similar to the Linux driverUwe Kleine-König2017-01-131-28/+28
| | | | | | | | To make the barebox driver more similar to the Linux driver, only use a single space before the = in member initialisation. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net/phy: marvell: rename phy_driver array to match Linux driverUwe Kleine-König2017-01-131-2/+3
| | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net/phy: marvell: 88E1540 LED registers already exist on 88E1121Uwe Kleine-König2017-01-131-5/+5
| | | | | | | So rename accordingly to match the definition used by Linux Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net/phy: marvell: rename 88E1545 to 88E1540Uwe Kleine-König2017-01-131-2/+2
| | | | | | | The Linux driver calls it 88E1540 so do it here, too. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: micrel: Do not overwrite reserved bitsSascha Hauer2016-11-081-1/+5
| | | | | | | | | | | | | | ksz8021_config_init() unconditionally sets the KSZPHY_OMSO_RMII_OVERRIDE bit. This is since the initial micrel phy commit, so it's not reproducible where this comes from and why this is done. Neither U-Boot nor the kernel ever touch this bit and so should we. Also, instead of doing a write only operation, read/modify/write the bit we actually want to change. This fixes operation on a KSZ8081MLX which is a MII only phy. KSZPHY_OMSO_RMII_OVERRIDE is reserved here and must be written to 0. KSZPHY_OMSO_MII_OVERRIDE is default 1 and must be written as 1. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net/phy: marvell: fix error handlingUwe Kleine-König2016-10-041-1/+2
| | | | | | | Without first assigning to ret it doesn't make sense to check it. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: of_phy_register_fixed_link(): drop redundant initializationAntony Pavlov2016-08-221-2/+0
| | | | | | | | | The phy_device_create() function makes all necessary phydev initialization so we can drop phydev->pause and phydev->link initialization in the of_phy_register_fixed_link() function. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: make locally used of_phy_register_fixed_link() staticAntony Pavlov2016-06-161-1/+2
| | | | | | | | | | The patch fixes this compiler's warning: drivers/net/phy/phy.c:303:20: warning: no previous prototype for ‘of_phy_register_fixed_link’ [-Wmissing-prototypes] Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2016-06-141-1/+1
|\
| * net: phy: micrel: KSZ9081/KSZ8091: Disable broadcast modeTeresa Remmet2016-05-131-1/+1
| | | | | | | | | | | | | | | | | | KSZ9081 only supports two phy ids 0x0 and 0x3. 0x0 is also used as broadcast address. Disable broadcast, so that id 0x0 can be used as unique address on a shared bus. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Fix genphy_restart_aneg() for Micrel's ksz9031.grodriguez2016-06-141-1/+8
|/ | | | | | | | | Commit da89ee8f2e04 ("Center FLP timing at 16ms") breaks genphy_restart_aneg() for Micrel's ksz9031. According to the datasheet, the ksz9031 requires a wait of 1ms after clearing the PDOWN bit and before read/write access to any PHY registers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: Add fixed link supportSascha Hauer2016-05-091-8/+41
| | | | | | | | | | Some network devices, especially when connected to a switch, are connected via a fixed link. This patch adds support for a fixed phy configured through device tree. TODO: Add support for the "speed" and "full-duplex" properties. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Wjatscheslaw Stoljarski <wjatscheslaw.stoljarski@kiwigrid.com>
* net: phy: micrel: Add workaround for bad autonegPhilipp Zabel2016-02-041-1/+22
| | | | | | | | | | | | | Based on kernel commit d2fd719bcb0e ("net/phy: micrel: Add workaround for bad autoneg") by Nathan Sullivan <nathan.sullivan@ni.com>: Very rarely, the KSZ9031 will appear to complete autonegotiation, but will drop all traffic afterwards. When this happens, the idle error count will read 0xFF after autonegotiation completes. Reset the PHY when in that state. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: micrel: Center FLP timing at 16msPhilipp Zabel2016-02-041-1/+16
| | | | | | | | Based on kernel commit 6270e1ae804a ("net/phy: micrel: Center FLP timing at 16ms") by Jaeden Amero <jaeden.amero@ni.com>: Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: micrel: Be more const correctPhilipp Zabel2016-02-041-12/+12
| | | | | | | | | | | | | | Based on kernel commit 3c9a9f7fb0ee ("net/phy: micrel: Be more const correct") by Jaeden Amero <jaeden.amero@ni.com>: In a few places in this driver, we weren't using const where we could have. Use const more. In addition, change the arrays of strings in ksz9031_config_init() to be not only const, but also static. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: micrel: use BIT macroPhilipp Zabel2016-02-041-9/+9
| | | | | | | | Based on kernel commit 00aee095000c ("net: phy: micrel: use BIT macro") by Johan Hovold <johan@kernel.org>. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: micrel: Staticise ksz8873mll_read_status()Philipp Zabel2016-02-041-1/+1
| | | | | | | | | | | | | Based on kernel commit 32d73b144eac ("net: phy: micrel: Staticise ksz8873mll_read_status()") by Jingoo Han <jg1.han@samsung.com>: ksz8873mll_read_status() is used only in this file. Fix the following sparse warning: drivers/net/phy/micrel.c:147:5: warning: symbol 'ksz8873mll_read_status' was not declared. Should it be static? Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* miitool: Add code to register a PHYAndrey Smirnov2016-02-041-2/+7
| | | | | | | | | | | | | This commit changes the behaviour of the 'miitool'. Now in order to show PHY's link information 'miitool' should be invoked as such: miitool -s [PHY] Also, implment code to allow to register a dummy PHY device in order to be able to perform raw MDIO bus access. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mdio_bus: Change PHY's naming schemeAndrey Smirnov2016-02-032-3/+7
| | | | | | | | | | | | | Change the way PHY devices are named upon creation. This commit replaces sequentialy numbered "/dev/phy%d" with "/dev/mdio%d-phy%02x". This way it is significanlty easier to identify which PHY in real-life (e.g. on a schematic) corresponds to which device in /dev. Also, replace asprintf with xasprintf to provide some form of memory allocation failure checking. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mdio_bus: Add mdiobus_get_bus() functionAndrey Smirnov2016-02-031-0/+19
| | | | | | | Add mdiobus_get_bus() -- a function to get a MDIO bus by its number Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mdio_bus: Change dev_info to dev_dbgAndrey Smirnov2016-02-031-1/+1
| | | | | | | | | Change dev_info to dev_dbg in mdiobus_detect for displaying phy's registration status as it is in of_mdiobus_register_phy(). While that information is useful for debugging, user doesn't really need to see that information every time they call miitool for the first time. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Port bitbanged MDIO code from Linux kernelAndrey Gusakov2016-02-034-0/+476
| | | | | | | | | Port bitbanged MDIO framework and gpiolib MDIO bus driver that uses it from Linux kernel. Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: wait for link OK after successfull autonegotiationAnton Bondarenko2015-11-051-5/+8
| | | | | | | | | It may take some time for PHY to indicate link OK status after autonegotiation completed. This change addresses this case and prevent network commands fails due to the delay. Signed-off-by: Anton Bondarenko <anton.bondarenko.sama@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: at803x: Use genphy_config_initSascha Hauer2015-07-292-35/+4
| | | | | | | | Based on the Linux commit: 6ff01db net: phy: at803x: use genphy_config_init() Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'pu/am335x'Sascha Hauer2015-05-281-0/+11
|\
| * net: phy: Add missing phy_unregister_deviceSascha Hauer2015-04-281-0/+11
| | | | | | | | | | | | The counterpart of phy_register_device is missing. Add it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mvebu'Sascha Hauer2015-05-061-0/+31
|\ \
| * | net: phy: Support Marvell 88E1318S PHYSebastian Hesselbarth2015-04-271-0/+31
| |/ | | | | | | | | | | | | This adds support for the Marvell 88E1318S Gigabit Ethernet PHY. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / net: phy: Do not double remove phy deviceSascha Hauer2015-05-051-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | This fixes: 80264a8 driver: Call bus->remove instead of driver->remove On mvebu it happens that: Upon device shutdown, when iterating through the active device list, the phy0 device is removed before mdio-mvebu. Then, when the mdio bus device is removed, the phy0 device is removed again, here: mdio_bus_remove(on mdio-mvebu) mvebu_mdio_remove mdiobus_unregister unregister_device mdio_bus_remove(on phy0) Fix this by setting the mdio busses phy_map[phy->addr] to NULL when unregistering the phy device, so that mdiobus_unregister no longer finds a valid phy_device when iterating over the busses device list. Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
* net: phy: Support Marvell 88EE1543 PHYEzequiel Garcia2014-11-111-0/+9
| | | | | | | | | | | | This commit adds support for Marvell's 88E1543 PHY chip. This chip is almost identical to the 88EE1545, except the 88E1545 supports QSGMII and the 88EE1543 supports SGMII. Therefore, the same configuration function is used for both PHYs. For now, the only initialization provided for the 88EE1543 is the LED setup. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: Support Marvell 88EE1545 PHYEzequiel Garcia2014-11-111-0/+58
| | | | | | | | This commit adds support for Marvell's 88E1545 PHY chip. In particular, this allows to support QSGMII interfaces. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: marvell: Fix array identationEzequiel Garcia2014-11-111-9/+9
| | | | | | | | Just a cosmetic clean-up to fix the indentation of the entries in the phys array. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2014-11-051-1/+85
|\
| * net: phy: micrel: Add OF conf. support for ksz9031Wadim Egorov2014-11-031-1/+85
| | | | | | | | | | | | | | | | | | | | | | Adds support for ksz9031 PAD skew configuration over devicetree. Based on a patch from the linux kernel. Author: Hubert Chaumette <hchaumette@adeneo-embedded.com> Original commit: 6e4b82730c7525504fc485b370c7f09e594e2e96 Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: micrel: Add ksz8081 supportJan Weitzel2014-10-081-1/+9
|/ | | | | Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/resource-err-ptr'Sascha Hauer2014-10-021-2/+3
|\
| * resource: Let dev_get_mem_region return an error pointerSascha Hauer2014-09-161-2/+3
| | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
* | Merge branch 'for-next/phycore-imx6'Sascha Hauer2014-10-021-2/+2
|\ \