]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
dpaa2-eth: Update dpni_get_single_step_cfg command
authorRadu Bulie <radu-andrei.bulie@nxp.com>
Fri, 18 Feb 2022 20:22:00 +0000 (22:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jul 2025 16:27:50 +0000 (18:27 +0200)
[ Upstream commit 9572594ecf027a2b1828e42c26fb55cbd3219708 ]

dpni_get_single_step_cfg is an MC firmware command used for
retrieving the contents of SINGLE_STEP 1588 register available
in a DPMAC.

This patch adds a new version of this command that returns as an extra
argument the physical base address of the aforementioned register.
The address will be used to directly modify the contents of the
SINGLE_STEP register instead of invoking the MC command
dpni_set_single_step_cgf. The former approach introduced huge delays on
the TX datapath when one step PTP events were transmitted. This led to low
throughput and high latencies observed in the PTP correction field.

Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: 2def09ead4ad ("dpaa2-eth: fix xdp_rxq_info leak")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/freescale/dpaa2/dpni-cmd.h
drivers/net/ethernet/freescale/dpaa2/dpni.c
drivers/net/ethernet/freescale/dpaa2/dpni.h

index 90453dc7baefeddbea00bcfe5703b20f251d2bb6..a0dfd25c6bd4aa39e08937480443172dd3ac0129 100644 (file)
@@ -94,7 +94,7 @@
 #define DPNI_CMDID_GET_LINK_CFG                                DPNI_CMD(0x278)
 
 #define DPNI_CMDID_SET_SINGLE_STEP_CFG                 DPNI_CMD(0x279)
-#define DPNI_CMDID_GET_SINGLE_STEP_CFG                 DPNI_CMD(0x27a)
+#define DPNI_CMDID_GET_SINGLE_STEP_CFG                 DPNI_CMD_V2(0x27a)
 
 /* Macros for accessing command fields smaller than 1byte */
 #define DPNI_MASK(field)       \
@@ -654,12 +654,16 @@ struct dpni_cmd_single_step_cfg {
        __le16 flags;
        __le16 offset;
        __le32 peer_delay;
+       __le32 ptp_onestep_reg_base;
+       __le32 pad0;
 };
 
 struct dpni_rsp_single_step_cfg {
        __le16 flags;
        __le16 offset;
        __le32 peer_delay;
+       __le32 ptp_onestep_reg_base;
+       __le32 pad0;
 };
 
 #endif /* _FSL_DPNI_CMD_H */
index 6ea7db66a6322bd5c2ff71eb5e24eeaa3307c899..d248a40fbc3f8f7e29921b6fc2c365dd907373c3 100644 (file)
@@ -2037,6 +2037,8 @@ int dpni_get_single_step_cfg(struct fsl_mc_io *mc_io,
        ptp_cfg->ch_update = dpni_get_field(le16_to_cpu(rsp_params->flags),
                                            PTP_CH_UPDATE) ? 1 : 0;
        ptp_cfg->peer_delay = le32_to_cpu(rsp_params->peer_delay);
+       ptp_cfg->ptp_onestep_reg_base =
+                                 le32_to_cpu(rsp_params->ptp_onestep_reg_base);
 
        return err;
 }
index e7b9e195b534b3b01048025c24519d3114da1c55..f854450983983e645cd3e1b28390c51a5cdf86e9 100644 (file)
@@ -1096,12 +1096,18 @@ int dpni_set_tx_shaping(struct fsl_mc_io *mc_io,
  * @peer_delay:        For peer-to-peer transparent clocks add this value to the
  *             correction field in addition to the transient time update.
  *             The value expresses nanoseconds.
+ * @ptp_onestep_reg_base: 1588 SINGLE_STEP register base address. This address
+ *                       is used to update directly the register contents.
+ *                       User has to create an address mapping for it.
+ *
+ *
  */
 struct dpni_single_step_cfg {
        u8      en;
        u8      ch_update;
        u16     offset;
        u32     peer_delay;
+       u32     ptp_onestep_reg_base;
 };
 
 int dpni_set_single_step_cfg(struct fsl_mc_io *mc_io,