summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-12-07 16:43:21 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-12-07 16:43:21 +0100
commit8f32824c6e374092f3c1dec431e5e83f839353fe (patch)
tree9ceed735e77d1329ebf70c9f9abb78263358d2dd /include
parent759946809a350b0a8158842924ab139e93eeef13 (diff)
parentbba73109ce1f54c7ffca044b00aacb320be888c2 (diff)
downloadbarebox-8f32824c6e374092f3c1dec431e5e83f839353fe.tar.gz
barebox-8f32824c6e374092f3c1dec431e5e83f839353fe.tar.xz
Merge branch 'for-next/phylib'
Conflicts: drivers/net/phy/phy.c
Diffstat (limited to 'include')
-rw-r--r--include/driver.h5
-rw-r--r--include/linux/micrel_phy.h30
-rw-r--r--include/linux/phy.h21
3 files changed, 55 insertions, 1 deletions
diff --git a/include/driver.h b/include/driver.h
index c2beeb8eb7..98df4a12e7 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -148,6 +148,11 @@ struct driver_d {
int register_driver(struct driver_d *);
int register_device(struct device_d *);
+/* manualy probe a device
+ * the driver need to be specified
+ */
+int device_probe(struct device_d *dev);
+
/* Unregister a device. This function can fail, e.g. when the device
* has children.
*/
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h
new file mode 100644
index 0000000000..adfe8c058f
--- /dev/null
+++ b/include/linux/micrel_phy.h
@@ -0,0 +1,30 @@
+/*
+ * include/linux/micrel_phy.h
+ *
+ * Micrel PHY IDs
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ */
+
+#ifndef _MICREL_PHY_H
+#define _MICREL_PHY_H
+
+#define MICREL_PHY_ID_MASK 0x00fffff0
+
+#define PHY_ID_KSZ8873MLL 0x000e7237
+#define PHY_ID_KSZ9021 0x00221610
+#define PHY_ID_KS8737 0x00221720
+#define PHY_ID_KSZ8021 0x00221555
+#define PHY_ID_KSZ8041 0x00221510
+#define PHY_ID_KSZ8051 0x00221550
+/* both for ks8001 Rev. A/B, and for ks8721 Rev 3. */
+#define PHY_ID_KSZ8001 0x0022161A
+
+/* struct phy_device dev_flags definitions */
+#define MICREL_PHY_50MHZ_CLK 0x00000001
+
+#endif /* _MICREL_PHY_H */
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 4f14daef65..b39eca5fbf 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -60,7 +60,8 @@ typedef enum {
#define MII_BUS_ID_SIZE (20 - 3)
#define PHYLIB_FORCE_10 (1 << 0)
-#define PHYLIB_FORCE_LINK (1 << 1)
+#define PHYLIB_FORCE_100 (1 << 1)
+#define PHYLIB_FORCE_LINK (1 << 2)
#define PHYLIB_CAPABLE_1000M (1 << 0)
@@ -225,10 +226,20 @@ struct phy_driver {
#define PHY_ANY_ID "MATCH ANY PHY"
#define PHY_ANY_UID 0xffffffff
+/* A Structure for boards to register fixups with the PHY Lib */
+struct phy_fixup {
+ struct list_head list;
+ char bus_id[20];
+ u32 phy_uid;
+ u32 phy_uid_mask;
+ int (*run)(struct phy_device *phydev);
+};
+
int phy_driver_register(struct phy_driver *drv);
int phy_drivers_register(struct phy_driver *new_driver, int n);
struct phy_device *get_phy_device(struct mii_bus *bus, int addr);
int phy_init(void);
+int phy_init_hw(struct phy_device *phydev);
/**
* phy_read - Convenience function for reading a given PHY register
@@ -266,5 +277,13 @@ int genphy_config_advert(struct phy_device *phydev);
int genphy_setup_forced(struct phy_device *phydev);
int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id);
+int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
+ int (*run)(struct phy_device *));
+int phy_register_fixup_for_id(const char *bus_id,
+ int (*run)(struct phy_device *));
+int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
+ int (*run)(struct phy_device *));
+int phy_scan_fixups(struct phy_device *phydev);
+
extern struct bus_type mdio_bus_type;
#endif /* __PHYDEV_H__ */