Commit 9a2ea26d authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Jakub Kicinski

net: enetc: use common naming scheme for PTGCR and PTGCAPR registers

The Port Time Gating Control Register (PTGCR) and Port Time Gating
Capability Register (PTGCAPR) have definitions in the driver which
aren't in line with the other registers. Rename these.
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 715bf261
...@@ -945,13 +945,13 @@ static inline u32 enetc_usecs_to_cycles(u32 usecs) ...@@ -945,13 +945,13 @@ static inline u32 enetc_usecs_to_cycles(u32 usecs)
} }
/* port time gating control register */ /* port time gating control register */
#define ENETC_QBV_PTGCR_OFFSET 0x11a00 #define ENETC_PTGCR 0x11a00
#define ENETC_QBV_TGE BIT(31) #define ENETC_PTGCR_TGE BIT(31)
#define ENETC_QBV_TGPE BIT(30) #define ENETC_PTGCR_TGPE BIT(30)
/* Port time gating capability register */ /* Port time gating capability register */
#define ENETC_QBV_PTGCAPR_OFFSET 0x11a08 #define ENETC_PTGCAPR 0x11a08
#define ENETC_QBV_MAX_GCL_LEN_MASK GENMASK(15, 0) #define ENETC_PTGCAPR_MAX_GCL_LEN_MASK GENMASK(15, 0)
/* Port time specific departure */ /* Port time specific departure */
#define ENETC_PTCTSDR(n) (0x1210 + 4 * (n)) #define ENETC_PTCTSDR(n) (0x1210 + 4 * (n))
......
...@@ -11,8 +11,7 @@ ...@@ -11,8 +11,7 @@
static u16 enetc_get_max_gcl_len(struct enetc_hw *hw) static u16 enetc_get_max_gcl_len(struct enetc_hw *hw)
{ {
return enetc_rd(hw, ENETC_QBV_PTGCAPR_OFFSET) return enetc_rd(hw, ENETC_PTGCAPR) & ENETC_PTGCAPR_MAX_GCL_LEN_MASK;
& ENETC_QBV_MAX_GCL_LEN_MASK;
} }
void enetc_sched_speed_set(struct enetc_ndev_priv *priv, int speed) void enetc_sched_speed_set(struct enetc_ndev_priv *priv, int speed)
...@@ -65,9 +64,9 @@ static int enetc_setup_taprio(struct net_device *ndev, ...@@ -65,9 +64,9 @@ static int enetc_setup_taprio(struct net_device *ndev,
return -EINVAL; return -EINVAL;
gcl_len = admin_conf->num_entries; gcl_len = admin_conf->num_entries;
tge = enetc_rd(hw, ENETC_QBV_PTGCR_OFFSET); tge = enetc_rd(hw, ENETC_PTGCR);
if (!admin_conf->enable) { if (!admin_conf->enable) {
enetc_wr(hw, ENETC_QBV_PTGCR_OFFSET, tge & ~ENETC_QBV_TGE); enetc_wr(hw, ENETC_PTGCR, tge & ~ENETC_PTGCR_TGE);
priv->active_offloads &= ~ENETC_F_QBV; priv->active_offloads &= ~ENETC_F_QBV;
...@@ -115,11 +114,11 @@ static int enetc_setup_taprio(struct net_device *ndev, ...@@ -115,11 +114,11 @@ static int enetc_setup_taprio(struct net_device *ndev,
cbd.cls = BDCR_CMD_PORT_GCL; cbd.cls = BDCR_CMD_PORT_GCL;
cbd.status_flags = 0; cbd.status_flags = 0;
enetc_wr(hw, ENETC_QBV_PTGCR_OFFSET, tge | ENETC_QBV_TGE); enetc_wr(hw, ENETC_PTGCR, tge | ENETC_PTGCR_TGE);
err = enetc_send_cmd(priv->si, &cbd); err = enetc_send_cmd(priv->si, &cbd);
if (err) if (err)
enetc_wr(hw, ENETC_QBV_PTGCR_OFFSET, tge & ~ENETC_QBV_TGE); enetc_wr(hw, ENETC_PTGCR, tge & ~ENETC_PTGCR_TGE);
enetc_cbd_free_data_mem(priv->si, data_size, tmp, &dma); enetc_cbd_free_data_mem(priv->si, data_size, tmp, &dma);
...@@ -299,7 +298,7 @@ int enetc_setup_tc_txtime(struct net_device *ndev, void *type_data) ...@@ -299,7 +298,7 @@ int enetc_setup_tc_txtime(struct net_device *ndev, void *type_data)
return -EINVAL; return -EINVAL;
/* TSD and Qbv are mutually exclusive in hardware */ /* TSD and Qbv are mutually exclusive in hardware */
if (enetc_rd(hw, ENETC_QBV_PTGCR_OFFSET) & ENETC_QBV_TGE) if (enetc_rd(hw, ENETC_PTGCR) & ENETC_PTGCR_TGE)
return -EBUSY; return -EBUSY;
priv->tx_ring[tc]->tsd_enable = qopt->enable; priv->tx_ring[tc]->tsd_enable = qopt->enable;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment