[qca-ssdk]: add ctrlpkt entry for stp when init instead of network file.
Change-Id: If76b9ce0657d3ee80d90ef32b21f0e27a84102ed
Signed-off-by: zhongjia <zhongjia@codeaurora.org>
diff --git a/src/init/ssdk_hppe.c b/src/init/ssdk_hppe.c
index 46e604c..2d8ad2e 100755
--- a/src/init/ssdk_hppe.c
+++ b/src/init/ssdk_hppe.c
@@ -19,6 +19,7 @@
#include "fal.h"
#include "ref_vsi.h"
#include "ssdk_clk.h"
+#include "hsl_phy.h"
static sw_error_t qca_hppe_vsi_hw_init(a_uint32_t dev_id)
{
@@ -55,6 +56,36 @@
return SW_OK;
}
+#define RFDB_PROFILE_ID_STP 31
+static sw_error_t qca_hppe_ctlpkt_hw_init(a_uint32_t dev_id)
+{
+ fal_mac_addr_t mcast_mac_addr;
+ fal_ctrlpkt_action_t ctrlpkt_action;
+ fal_ctrlpkt_profile_t ctrlpkt_profile;
+ sw_error_t rv = SW_OK;
+
+ memset(&ctrlpkt_action, 0, sizeof(ctrlpkt_action));
+ memset(&ctrlpkt_profile, 0, sizeof(ctrlpkt_profile));
+ memset(&mcast_mac_addr, 0, sizeof(mcast_mac_addr));
+
+ mcast_mac_addr.uc[0] = 0x01;
+ mcast_mac_addr.uc[1] = 0x80;
+ mcast_mac_addr.uc[2] = 0xc2;
+ rv = fal_mgmtctrl_rfdb_profile_set(dev_id, RFDB_PROFILE_ID_STP,
+ &mcast_mac_addr);
+ SW_RTN_ON_ERROR(rv);
+
+ ctrlpkt_action.action = FAL_MAC_RDT_TO_CPU;
+ ctrlpkt_action.in_stp_bypass = A_TRUE;
+
+ ctrlpkt_profile.action = ctrlpkt_action;
+ ctrlpkt_profile.port_map = qca_ssdk_port_bmp_get(dev_id);
+ ctrlpkt_profile.rfdb_profile_bitmap = (1 << RFDB_PROFILE_ID_STP);
+ rv = fal_mgmtctrl_ctrlpkt_profile_add(dev_id, &ctrlpkt_profile);
+
+ return rv;
+}
+
#ifndef HAWKEYE_CHIP
static sw_error_t
qca_hppe_fpga_xgmac_gpio_enable(a_uint32_t dev_id)
@@ -1072,6 +1103,9 @@
SW_RTN_ON_ERROR(rv);
rv = qca_hppe_interface_mode_init(dev_id, cfg->mac_mode, cfg->mac_mode1,
cfg->mac_mode2);
+ SW_RTN_ON_ERROR(rv);
+ rv = qca_hppe_ctlpkt_hw_init(dev_id);
+ SW_RTN_ON_ERROR(rv);
#ifndef HAWKEYE_CHIP
rv = qca_hppe_fpga_ports_enable(dev_id);
#endif