aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ppc/ibm_ocp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-ppc/ibm_ocp.h')
-rw-r--r--include/asm-ppc/ibm_ocp.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/asm-ppc/ibm_ocp.h b/include/asm-ppc/ibm_ocp.h
index 3f7b5669e6d5..6f10a25bd628 100644
--- a/include/asm-ppc/ibm_ocp.h
+++ b/include/asm-ppc/ibm_ocp.h
@@ -67,6 +67,7 @@ struct ocp_func_emac_data {
67 int phy_mode; /* PHY type or configurable mode */ 67 int phy_mode; /* PHY type or configurable mode */
68 u8 mac_addr[6]; /* EMAC mac address */ 68 u8 mac_addr[6]; /* EMAC mac address */
69 u32 phy_map; /* EMAC phy map */ 69 u32 phy_map; /* EMAC phy map */
70 u32 phy_feat_exc; /* Excluded PHY features */
70}; 71};
71 72
72/* Sysfs support */ 73/* Sysfs support */
@@ -83,6 +84,7 @@ OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mdio_idx) \
83OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, tah_idx) \ 84OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, tah_idx) \
84OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, phy_mode) \ 85OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, phy_mode) \
85OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "0x%08x\n", emac, phy_map) \ 86OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "0x%08x\n", emac, phy_map) \
87OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "0x%08x\n", emac, phy_feat_exc)\
86 \ 88 \
87void ocp_show_emac_data(struct device *dev) \ 89void ocp_show_emac_data(struct device *dev) \
88{ \ 90{ \
@@ -98,8 +100,22 @@ void ocp_show_emac_data(struct device *dev) \
98 device_create_file(dev, &dev_attr_emac_tah_idx); \ 100 device_create_file(dev, &dev_attr_emac_tah_idx); \
99 device_create_file(dev, &dev_attr_emac_phy_mode); \ 101 device_create_file(dev, &dev_attr_emac_phy_mode); \
100 device_create_file(dev, &dev_attr_emac_phy_map); \ 102 device_create_file(dev, &dev_attr_emac_phy_map); \
103 device_create_file(dev, &dev_attr_emac_phy_feat_exc); \
101} 104}
102 105
106/*
107 * PHY mode settings (EMAC <-> ZMII/RGMII bridge <-> PHY)
108 */
109#define PHY_MODE_NA 0
110#define PHY_MODE_MII 1
111#define PHY_MODE_RMII 2
112#define PHY_MODE_SMII 3
113#define PHY_MODE_RGMII 4
114#define PHY_MODE_TBI 5
115#define PHY_MODE_GMII 6
116#define PHY_MODE_RTBI 7
117#define PHY_MODE_SGMII 8
118
103#ifdef CONFIG_40x 119#ifdef CONFIG_40x
104/* 120/*
105 * Helper function to copy MAC addresses from the bd_t to OCP EMAC 121 * Helper function to copy MAC addresses from the bd_t to OCP EMAC
@@ -133,6 +149,7 @@ struct ocp_func_mal_data {
133 int txde_irq; /* TX Descriptor Error IRQ */ 149 int txde_irq; /* TX Descriptor Error IRQ */
134 int rxde_irq; /* RX Descriptor Error IRQ */ 150 int rxde_irq; /* RX Descriptor Error IRQ */
135 int serr_irq; /* MAL System Error IRQ */ 151 int serr_irq; /* MAL System Error IRQ */
152 int dcr_base; /* MALx_CFG DCR number */
136}; 153};
137 154
138#define OCP_SYSFS_MAL_DATA() \ 155#define OCP_SYSFS_MAL_DATA() \
@@ -143,6 +160,7 @@ OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, rxeob_irq) \
143OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, txde_irq) \ 160OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, txde_irq) \
144OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, rxde_irq) \ 161OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, rxde_irq) \
145OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, serr_irq) \ 162OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, serr_irq) \
163OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, dcr_base) \
146 \ 164 \
147void ocp_show_mal_data(struct device *dev) \ 165void ocp_show_mal_data(struct device *dev) \
148{ \ 166{ \
@@ -153,6 +171,7 @@ void ocp_show_mal_data(struct device *dev) \
153 device_create_file(dev, &dev_attr_mal_txde_irq); \ 171 device_create_file(dev, &dev_attr_mal_txde_irq); \
154 device_create_file(dev, &dev_attr_mal_rxde_irq); \ 172 device_create_file(dev, &dev_attr_mal_rxde_irq); \
155 device_create_file(dev, &dev_attr_mal_serr_irq); \ 173 device_create_file(dev, &dev_attr_mal_serr_irq); \
174 device_create_file(dev, &dev_attr_mal_dcr_base); \
156} 175}
157 176
158/* 177/*