mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 21:51:05 +00:00
openfirmware: Add OF phylib support code
Add support for parsing the device tree for PHY devices on an MDIO bus. Currently many of the PowerPC ethernet drivers are open coding a solution for reading data out of the device tree to find the correct PHY device. This patch implements a set of common routines to: a) let MDIO bus drivers register phy_devices described in the tree, and b) let MAC drivers find the correct phy_device via the tree. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
fa94f6d93c
commit
8bc487d150
4 changed files with 168 additions and 0 deletions
22
include/linux/of_mdio.h
Normal file
22
include/linux/of_mdio.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* OF helpers for the MDIO (Ethernet PHY) API
|
||||
*
|
||||
* Copyright (c) 2009 Secret Lab Technologies, Ltd.
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_OF_MDIO_H
|
||||
#define __LINUX_OF_MDIO_H
|
||||
|
||||
#include <linux/phy.h>
|
||||
#include <linux/of.h>
|
||||
|
||||
extern int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np);
|
||||
extern struct phy_device *of_phy_find_device(struct device_node *phy_np);
|
||||
extern struct phy_device *of_phy_connect(struct net_device *dev,
|
||||
struct device_node *phy_np,
|
||||
void (*hndlr)(struct net_device *),
|
||||
u32 flags, phy_interface_t iface);
|
||||
|
||||
#endif /* __LINUX_OF_MDIO_H */
|
Loading…
Add table
Add a link
Reference in a new issue