Marvell: MHSLPONLGCY-166 l2fwserver doesn't work on AvantaMC when working in GMAC's bridge mode

"""
It is needed an additional rule in the 6601 packet processor to route
the broadcast from the SGMII to the CPU. With the current configuration,
the packets sent by the G.hn asking for the L2 upgrade are being
forwarded from the SGMII to the Ethernet PHY without reaching the CPU,
and this is why the l2fwserver doesn’t show any log.

These changes adds the missing rule in the packet processor to be able
to do the upgrade of the G.hn from the 6601.
"""

Corresponding changes also needed in vendor/marvell/applications.
See go/fibercl/82880

3rd Hunk of merge had to be done manually:

@@ -1327,8 +1330,6 @@ INT32 cph_app_rx_bc(INT32 port, struct net_device *dev, struct eth_pbuf *pkt, st
             skb_old->len  -= MV_ETH_CRC_SIZE;  // Remove CRC

             /* If WAN interface is GMAC1, remove MH in upstream  */
-            cph_db_get_param(CPH_DB_PARAM_PROFILE_ID, &profile_id);
-            cph_db_get_param(CPH_DB_PARAM_ACTIVE_PORT, &active_port);
             if ((profile_id == TPM_PON_G1_SGMII_WAN_G0_SINGLE_PORT) && (active_port == MV_APP_GMAC_PORT_1))
             {
               skb_old->data += MV_ETH_MH_SIZE;

In reference to b/33751089

Change-Id: Ibd0c16737539fb9a8febcf2f39b5f925a2b6ad57
diff --git a/arch/arm/plat-feroceon/mv_drivers_lsp/mv_cph/mv_cph_app.c b/arch/arm/plat-feroceon/mv_drivers_lsp/mv_cph/mv_cph_app.c
index 48a59e7..c86e5ea 100755
--- a/arch/arm/plat-feroceon/mv_drivers_lsp/mv_cph/mv_cph_app.c
+++ b/arch/arm/plat-feroceon/mv_drivers_lsp/mv_cph/mv_cph_app.c
@@ -1288,6 +1288,9 @@
     if (state == FALSE)
         return 0;
 
+    cph_db_get_param(CPH_DB_PARAM_PROFILE_ID, &profile_id);
+    cph_db_get_param(CPH_DB_PARAM_ACTIVE_PORT, &active_port);
+
     /* Parse packets */
     skb_old = (struct sk_buff *)(pkt->osInfo);
     skb_new = (struct sk_buff *)(pkt->osInfo);
@@ -1298,8 +1301,8 @@
         return 0;
     }
 
-    /* U/S */
-    if(flow_rule.dir == CPH_DIR_US)
+    /* U/S or in bridged mode between GMAC1 and GMAC0 */
+    if((flow_rule.dir == CPH_DIR_US) || (profile_id == TPM_PON_G1_SGMII_WAN_G0_SINGLE_PORT))
     {  
         /* Forward packet to peer port */
         rc = cph_app_parse_peer_port(port, &peer_port);
@@ -1323,8 +1326,6 @@
                 goto out;
             }
             /* If WAN interface is GMAC1, remove MH in upstream  */
-            cph_db_get_param(CPH_DB_PARAM_PROFILE_ID, &profile_id);
-            cph_db_get_param(CPH_DB_PARAM_ACTIVE_PORT, &active_port);
             if ((profile_id == TPM_PON_G1_SGMII_WAN_G0_SINGLE_PORT) && (active_port == MV_APP_GMAC_PORT_1))
             {
               skb_old->data += MV_ETH_MH_SIZE;