summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/freescale/fsl_pq_mdio.c
Commit message (Collapse)AuthorAgeFilesLines
* net/fsl_pq_mdio: Replace spin_event_timeout() with arch independentClaudiu Manoil2014-10-091-13/+23
| | | | | | | | spin_event_timeout() is PPC dependent, use an arch independent equivalent instead. Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/fsl_pq_mdio: Use ioread/iowrite32be() portable accessorsClaudiu Manoil2014-10-091-14/+14
| | | | | | | in_be32()/out_be32() are not defined by ARM. Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/fsl_pq_mdio: Fix asm/ucc.h compile error for ARMClaudiu Manoil2014-10-091-0/+2
| | | | | | | | | | The UCC specific code included in fsl_pq_mdio.c (with function calls from asm/ucc.h) is already guarded by these config options, so this ARM build fix only provides consistency with the rest UCC specific code. Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net: delete non-required instances of include <linux/init.h>Paul Gortmaker2014-01-161-1/+0Star
| | | | | | | | | | | | | None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. This covers everything under drivers/net except for wireless, which has been submitted separately. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: fsl_pq_mdio: remove unnecessary dev_set_drvdata()Libo Chen2013-08-211-2/+0Star
| | | | | | | | Unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Libo Chen <libo.chen@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: fsl_pq_mdio: use platform_{get,set}_drvdata()Libo Chen2013-08-211-1/+1
| | | | | | | | | Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen <libo.chen@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/fsl_pq_mdio: add support for the Fman 1G MDIO controllerTimur Tabi2012-08-301-0/+9
| | | | | | | | | The MDIO controller on the Frame Manager (Fman) is compatible with the QE and Gianfar MDIO controllers, but we don't care about the TBI because the Ethernet drivers (FMD) take care of programming it. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/fsl-pq-mdio: coalesce multiple memory allocations into oneTimur Tabi2012-08-301-28/+14Star
| | | | | | | | | Take advantage of the new mdiobus_alloc_size() function to combine three different memory allocations into one. This also simplies the error handling. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/fsl_pq_mdio: streamline probing of MDIO nodesTimur Tabi2012-08-301-152/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | Make the device tree probe function more data-driven, so that it no longer searches the 'compatible' property more than once. The of_device_id[] array allows for per-entry private data, so we use that to store details about each type of node that the driver supports. This removes the need to check the 'compatible' property inside the probe function. The driver supports four types on MDIO devices: 1) Gianfar MDIO nodes that only map the MII registers 2) Gianfar MDIO nodes that map the full MDIO register set 3) eTSEC2 MDIO nodes (which map the full MDIO register set) 4) QE MDIO nodes (which map only the MII registers) Gianfar, eTSEC2, and QE have different mappings for the TBIPA register, which is needed to initialize the TBI PHY. In addition, the QE needs a special hack because of the way the device tree is ordered. All of this information is encapsulated in the fsl_pq_mdio_data structure, so when an MDIO node is probed, per-device data and functions are used to determine how to initialize the device. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/fsl_pq_mdio: various small fixesTimur Tabi2012-08-301-14/+13Star
| | | | | | | | | | | | | 1) Replace printk with dev_err 2) Fix some whitespace mistakes 3) Rename "ofdev" to "pdev", since it's a platform_device now 4) Fix an inadvertent compound statement by replacing commas with semicolons Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/fsl_pq_mdio: merge some functions togetherTimur Tabi2012-08-301-66/+26Star
| | | | | | | | | A few small functions were called only by other functions in the same file, so merge them together. One function, for example, was calculating the device address even though the caller was doing the same thing. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/fsl_pq_mdio: trim #include statementsTimur Tabi2012-08-301-13/+1Star
| | | | | | | Remove several unnecessary #include statements. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/freescale: do not export any functions from fsl_pq_mdio.cTimur Tabi2012-08-301-7/+31
| | | | | | | | | | None of the functions in fsl_pq_mdio.c are used by any other source file, so there's no point in exporting them. Merge the header file into the source file, make all the functions static, remove any EXPORT_SYMBOL statements, and delete any #include "fsl_pq_mdio.h" statements. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/fsl_pq_mdio: use spin_event_timeout() to poll the indicator registerTimur Tabi2012-07-101-10/+19
| | | | | | | | | | | | Macro spin_event_timeout() was designed for simple polling of hardware registers with a timeout, so use it when we poll the MIIMIND register. This allows us to return an error code instead of polling indefinitely. Note that PHY_INIT_TIMEOUT is a count of loop iterations, so we can't use it for spin_event_timeout(), which asks for microseconds. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Fix non TBI PHY access; a bad merge undid bug fix in a previous commit.Kenth Eriksson2012-04-011-6/+6
| | | | | | | | | The merge done in commit b26e478f undid bug fix in commit c3e072f8 ("net: fsl_pq_mdio: fix non tbi phy access"), with the result that non TBI (e.g. MDIO) PHYs cannot be accessed. Signed-off-by: Kenth Eriksson <kenth.eriksson@transmode.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2011-12-161-7/+6Star
|\ | | | | | | | | | | | | Conflicts: drivers/net/ethernet/freescale/fsl_pq_mdio.c net/batman-adv/translation-table.c net/ipv6/route.c
| * fsl_pq_mdio: Clean up tbi address configurationAndy Fleming2011-12-071-45/+8Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code for setting the address of the internal TBI PHY was convoluted enough without a maze of ifdefs. Clean it up a bit so we allow the logic to fail down to -ENODEV at the end of the if/else ladder, rather than using ifdefs to repeat the same failure code over and over. Also, remove the support for the auto-configuration. I'm not aware of anyone using it, and it ends up using the bus mutex before it's been initialized. Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net/ethernet: convert drivers/net/ethernet/* to use module_platform_driver()Axel Lin2011-11-291-10/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch converts the drivers in drivers/net/ethernet/* to use the module_platform_driver() macro which makes the code smaller and a bit simpler. Cc: "David S. Miller" <davem@davemloft.net> Cc: Pantelis Antoniou <pantelis.antoniou@gmail.com> Cc: Vitaly Bordug <vbordug@ru.mvista.com> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Nicolas Pitre <nico@fluxnic.net> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com> Cc: Marc Kleine-Budde <mkl@pengutronix.de> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Cc: Jiri Pirko <jpirko@redhat.com> Cc: Daniel Hellstrom <daniel@gaisler.com> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: Tobias Klauser <tklauser@distanz.ch> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Jiri Kosina <jkosina@suse.cz> Cc: Richard Cochran <richard.cochran@omicron.at> Cc: Jonas Bonn <jonas@southpole.se> Cc: Sebastian Poehn <sebastian.poehn@belden.com> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Wan ZongShun <mcuos.com@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: fsl_pq_mdio: fix non tbi phy accessBaruch Siach2011-11-141-6/+6
| | | | | | | | | | | | | | | | | | Since 952c5ca1 (fsl_pq_mdio: Clean up tbi address configuration) .probe returns -EBUSY when the "tbi-phy" node is missing. Fix this. Cc: Andy Fleming <afleming@freescale.com> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: David S. Miller <davem@davemloft.net>
* | fsl_pq_mdio: Clean up tbi address configurationAndy Fleming2011-11-141-45/+8Star
|/ | | | | | | | | | | | | | | The code for setting the address of the internal TBI PHY was convoluted enough without a maze of ifdefs. Clean it up a bit so we allow the logic to fail down to -ENODEV at the end of the if/else ladder, rather than using ifdefs to repeat the same failure code over and over. Also, remove the support for the auto-configuration. I'm not aware of anyone using it, and it ends up using the bus mutex before it's been initialized. Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* freescale: Move the Freescale driversJeff Kirsher2011-08-121-0/+494
Move the Freescale drivers into drivers/net/ethernet/freescale/ and make the necessary Kconfig and Makefile changes. CC: Sandeep Gopalpet <sandeep.kumar@freescale.com> CC: Andy Fleming <afleming@freescale.com> CC: Shlomi Gridish <gridish@freescale.com> CC: Li Yang <leoli@freescale.com> CC: Pantelis Antoniou <pantelis.antoniou@gmail.com> CC: Vitaly Bordug <vbordug@ru.mvista.com> CC: Dan Malek <dmalek@jlc.net> CC: Sylvain Munaut <tnt@246tNt.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>