if (priv->id == ID_MT7621)
                mt7530_rmw(priv, MT7530_MFC, CPU_MASK, CPU_EN | CPU_PORT(port));
 
+       /* Add the CPU port to the CPU port bitmap for MT7531 and the switch on
+        * the MT7988 SoC. Trapped frames will be forwarded to the CPU port that
+        * is affine to the inbound user port.
+        */
+       if (priv->id == ID_MT7531 || priv->id == ID_MT7988)
+               mt7530_set(priv, MT7531_CFC, MT7531_CPU_PMAP(BIT(port)));
+
        /* CPU port gets connected to all user ports of
         * the switch.
         */
 mt7531_setup_common(struct dsa_switch *ds)
 {
        struct mt7530_priv *priv = ds->priv;
-       struct dsa_port *cpu_dp;
        int ret, i;
 
-       /* BPDU to CPU port */
-       dsa_switch_for_each_cpu_port(cpu_dp, ds) {
-               mt7530_rmw(priv, MT7531_CFC, MT7531_CPU_PMAP_MASK,
-                          BIT(cpu_dp->index));
-               break;
-       }
+       /* Trap BPDUs to the CPU port(s) */
        mt7530_rmw(priv, MT753X_BPC, MT753X_BPDU_PORT_FW_MASK,
                   MT753X_BPDU_CPU_ONLY);
 
 
 #define  MT7531_MIRROR_PORT_GET(x)     (((x) >> 16) & MIRROR_MASK)
 #define  MT7531_MIRROR_PORT_SET(x)     (((x) & MIRROR_MASK) << 16)
 #define  MT7531_CPU_PMAP_MASK          GENMASK(7, 0)
+#define  MT7531_CPU_PMAP(x)            FIELD_PREP(MT7531_CPU_PMAP_MASK, x)
 
 #define MT753X_MIRROR_REG(id)          ((((id) == ID_MT7531) || ((id) == ID_MT7988)) ? \
                                         MT7531_CFC : MT7530_MFC)