summaryrefslogtreecommitdiff
path: root/include/micrel.h
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2019-10-30 14:21:52 +0800
committerIru Cai <mytbk920423@gmail.com>2019-10-30 14:48:38 +0800
commitae51f41d14f548d494ac41e0d21137c5a4c3f59c (patch)
tree6ddb9d1aaa7bd5bad5bbf8497edc2e08ff208d79 /include/micrel.h
downloaduext4-ae51f41d14f548d494ac41e0d21137c5a4c3f59c.tar.xz
import the U-Boot code and make it compile
Diffstat (limited to 'include/micrel.h')
-rw-r--r--include/micrel.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/micrel.h b/include/micrel.h
new file mode 100644
index 0000000..3e6b531
--- /dev/null
+++ b/include/micrel.h
@@ -0,0 +1,39 @@
+#ifndef _MICREL_H
+
+#define MII_KSZ9021_EXT_COMMON_CTRL 0x100
+#define MII_KSZ9021_EXT_STRAP_STATUS 0x101
+#define MII_KSZ9021_EXT_OP_STRAP_OVERRIDE 0x102
+#define MII_KSZ9021_EXT_OP_STRAP_STATUS 0x103
+#define MII_KSZ9021_EXT_RGMII_CLOCK_SKEW 0x104
+#define MII_KSZ9021_EXT_RGMII_RX_DATA_SKEW 0x105
+#define MII_KSZ9021_EXT_RGMII_TX_DATA_SKEW 0x106
+#define MII_KSZ9021_EXT_ANALOG_TEST 0x107
+/* Register operations */
+#define MII_KSZ9031_MOD_REG 0x0000
+/* Data operations */
+#define MII_KSZ9031_MOD_DATA_NO_POST_INC 0x4000
+#define MII_KSZ9031_MOD_DATA_POST_INC_RW 0x8000
+#define MII_KSZ9031_MOD_DATA_POST_INC_W 0xC000
+
+#define MII_KSZ9031_EXT_RGMII_CTRL_SIG_SKEW 0x4
+#define MII_KSZ9031_EXT_RGMII_RX_DATA_SKEW 0x5
+#define MII_KSZ9031_EXT_RGMII_TX_DATA_SKEW 0x6
+#define MII_KSZ9031_EXT_RGMII_CLOCK_SKEW 0x8
+
+#define MII_KSZ9031_FLP_BURST_TX_LO 0x3
+#define MII_KSZ9031_FLP_BURST_TX_HI 0x4
+
+/* Registers */
+#define MMD_ACCESS_CONTROL 0xd
+#define MMD_ACCESS_REG_DATA 0xe
+
+struct phy_device;
+int ksz9021_phy_extended_write(struct phy_device *phydev, int regnum, u16 val);
+int ksz9021_phy_extended_read(struct phy_device *phydev, int regnum);
+
+int ksz9031_phy_extended_write(struct phy_device *phydev, int devaddr,
+ int regnum, u16 mode, u16 val);
+int ksz9031_phy_extended_read(struct phy_device *phydev, int devaddr,
+ int regnum, u16 mode);
+
+#endif