|
@@ -94,6 +94,7 @@
|
|
|
|
|
|
|
|
/* offset relative to base of XGBE_SS_REG_INDEX */
|
|
/* offset relative to base of XGBE_SS_REG_INDEX */
|
|
|
#define XGBE10_SGMII_MODULE_OFFSET 0x100
|
|
#define XGBE10_SGMII_MODULE_OFFSET 0x100
|
|
|
|
|
+#define IS_SS_ID_XGBE(d) ((d)->ss_version == XGBE_SS_VERSION_10)
|
|
|
/* offset relative to base of XGBE_SM_REG_INDEX */
|
|
/* offset relative to base of XGBE_SM_REG_INDEX */
|
|
|
#define XGBE10_HOST_PORT_OFFSET 0x34
|
|
#define XGBE10_HOST_PORT_OFFSET 0x34
|
|
|
#define XGBE10_SLAVE_PORT_OFFSET 0x64
|
|
#define XGBE10_SLAVE_PORT_OFFSET 0x64
|
|
@@ -1746,6 +1747,17 @@ static void keystone_set_msglevel(struct net_device *ndev, u32 value)
|
|
|
netcp->msg_enable = value;
|
|
netcp->msg_enable = value;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+static struct gbe_intf *keystone_get_intf_data(struct netcp_intf *netcp)
|
|
|
|
|
+{
|
|
|
|
|
+ struct gbe_intf *gbe_intf;
|
|
|
|
|
+
|
|
|
|
|
+ gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
|
|
|
|
|
+ if (!gbe_intf)
|
|
|
|
|
+ gbe_intf = netcp_module_get_intf_data(&xgbe_module, netcp);
|
|
|
|
|
+
|
|
|
|
|
+ return gbe_intf;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
static void keystone_get_stat_strings(struct net_device *ndev,
|
|
static void keystone_get_stat_strings(struct net_device *ndev,
|
|
|
uint32_t stringset, uint8_t *data)
|
|
uint32_t stringset, uint8_t *data)
|
|
|
{
|
|
{
|
|
@@ -1754,7 +1766,7 @@ static void keystone_get_stat_strings(struct net_device *ndev,
|
|
|
struct gbe_priv *gbe_dev;
|
|
struct gbe_priv *gbe_dev;
|
|
|
int i;
|
|
int i;
|
|
|
|
|
|
|
|
- gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
|
|
|
|
|
|
|
+ gbe_intf = keystone_get_intf_data(netcp);
|
|
|
if (!gbe_intf)
|
|
if (!gbe_intf)
|
|
|
return;
|
|
return;
|
|
|
gbe_dev = gbe_intf->gbe_dev;
|
|
gbe_dev = gbe_intf->gbe_dev;
|
|
@@ -1778,7 +1790,7 @@ static int keystone_get_sset_count(struct net_device *ndev, int stringset)
|
|
|
struct gbe_intf *gbe_intf;
|
|
struct gbe_intf *gbe_intf;
|
|
|
struct gbe_priv *gbe_dev;
|
|
struct gbe_priv *gbe_dev;
|
|
|
|
|
|
|
|
- gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
|
|
|
|
|
|
|
+ gbe_intf = keystone_get_intf_data(netcp);
|
|
|
if (!gbe_intf)
|
|
if (!gbe_intf)
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
gbe_dev = gbe_intf->gbe_dev;
|
|
gbe_dev = gbe_intf->gbe_dev;
|
|
@@ -1896,7 +1908,7 @@ static void keystone_get_ethtool_stats(struct net_device *ndev,
|
|
|
struct gbe_intf *gbe_intf;
|
|
struct gbe_intf *gbe_intf;
|
|
|
struct gbe_priv *gbe_dev;
|
|
struct gbe_priv *gbe_dev;
|
|
|
|
|
|
|
|
- gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
|
|
|
|
|
|
|
+ gbe_intf = keystone_get_intf_data(netcp);
|
|
|
if (!gbe_intf)
|
|
if (!gbe_intf)
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
@@ -1920,7 +1932,7 @@ static int keystone_get_link_ksettings(struct net_device *ndev,
|
|
|
if (!phy)
|
|
if (!phy)
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
- gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
|
|
|
|
|
|
|
+ gbe_intf = keystone_get_intf_data(netcp);
|
|
|
if (!gbe_intf)
|
|
if (!gbe_intf)
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
@@ -1953,7 +1965,7 @@ static int keystone_set_link_ksettings(struct net_device *ndev,
|
|
|
if (!phy)
|
|
if (!phy)
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
- gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
|
|
|
|
|
|
|
+ gbe_intf = keystone_get_intf_data(netcp);
|
|
|
if (!gbe_intf)
|
|
if (!gbe_intf)
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
@@ -2311,7 +2323,7 @@ static void gbe_init_host_port(struct gbe_priv *priv)
|
|
|
int bypass_en = 1;
|
|
int bypass_en = 1;
|
|
|
|
|
|
|
|
/* Host Tx Pri */
|
|
/* Host Tx Pri */
|
|
|
- if (IS_SS_ID_NU(priv))
|
|
|
|
|
|
|
+ if (IS_SS_ID_NU(priv) || IS_SS_ID_XGBE(priv))
|
|
|
writel(HOST_TX_PRI_MAP_DEFAULT,
|
|
writel(HOST_TX_PRI_MAP_DEFAULT,
|
|
|
GBE_REG_ADDR(priv, host_port_regs, tx_pri_map));
|
|
GBE_REG_ADDR(priv, host_port_regs, tx_pri_map));
|
|
|
|
|
|