osi: core: restore HSI configuration

Issue: HSI not enabled in HW after SC7.

Fix: Restore the HSI in resume path.

Bug 4881765

Change-Id: I1c6efbe735ee4da0c2817498b3f71912bc823ff0
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/3221011
(cherry picked from commit ba0960ad43bf22b3254b0213ee596a54c86c67d4)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/3286021
Reviewed-by: Krishna Thota <kthota@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Bhadram Varka
2024-09-30 07:34:15 +00:00
committed by mobile promotions
parent 2078f0d51e
commit 339336ec1a
2 changed files with 27 additions and 2 deletions

View File

@@ -66,6 +66,9 @@
#define DYNAMIC_CFG_EST OSI_BIT(8) #define DYNAMIC_CFG_EST OSI_BIT(8)
#define DYNAMIC_CFG_FPE OSI_BIT(9) #define DYNAMIC_CFG_FPE OSI_BIT(9)
#define DYNAMIC_CFG_FRP OSI_BIT(10) #define DYNAMIC_CFG_FRP OSI_BIT(10)
#ifdef HSI_SUPPORT
#define DYNAMIC_CFG_HSI OSI_BIT(11)
#endif /* HSI_SUPPORT */
#ifndef OSI_STRIPPED_LIB #ifndef OSI_STRIPPED_LIB
#define DYNAMIC_CFG_FC OSI_BIT(1) #define DYNAMIC_CFG_FC OSI_BIT(1)
@@ -84,7 +87,9 @@
#define DYNAMIC_CFG_EST_IDX 8U #define DYNAMIC_CFG_EST_IDX 8U
#define DYNAMIC_CFG_FPE_IDX 9U #define DYNAMIC_CFG_FPE_IDX 9U
#define DYNAMIC_CFG_FRP_IDX 10U #define DYNAMIC_CFG_FRP_IDX 10U
#ifdef HSI_SUPPORT
#define DYNAMIC_CFG_HSI_IDX 11U
#endif /* HSI_SUPPORT */
#define OSI_SUSPENDED OSI_BIT(0) #define OSI_SUSPENDED OSI_BIT(0)
@@ -345,6 +350,10 @@ struct dynamic_cfg {
struct osi_filter l2_filter; struct osi_filter l2_filter;
/** L2 filter configuration */ /** L2 filter configuration */
struct core_l2 l2[EQOS_MAX_MAC_ADDRESS_FILTER]; struct core_l2 l2[EQOS_MAX_MAC_ADDRESS_FILTER];
#ifdef HSI_SUPPORT
/** HSI state */
nveu32_t hsi_en_dis;
#endif /* HSI_SUPPORT */
}; };
/** /**

View File

@@ -2360,11 +2360,19 @@ static void cfg_frp(struct core_local *l_core)
(void)frp_hw_write(osi_core, l_core->ops_p); (void)frp_hw_write(osi_core, l_core->ops_p);
} }
#ifdef HSI_SUPPORT
static void cfg_hsi(struct core_local *l_core)
{
(void)l_core->ops_p->core_hsi_configure((struct osi_core_priv_data *)(void *)l_core,
l_core->cfg.hsi_en_dis);
}
#endif /* HSI_SUPPORT */
static void apply_dynamic_cfg(struct osi_core_priv_data *osi_core) static void apply_dynamic_cfg(struct osi_core_priv_data *osi_core)
{ {
struct core_local *l_core = (struct core_local *)(void *)osi_core; struct core_local *l_core = (struct core_local *)(void *)osi_core;
typedef void (*cfg_fn)(struct core_local *local_core); typedef void (*cfg_fn)(struct core_local *local_core);
const cfg_fn fn[11] = { const cfg_fn fn[12] = {
[DYNAMIC_CFG_L3_L4_IDX] = cfg_l3_l4_filter, [DYNAMIC_CFG_L3_L4_IDX] = cfg_l3_l4_filter,
[DYNAMIC_CFG_L2_IDX] = cfg_l2_filter, [DYNAMIC_CFG_L2_IDX] = cfg_l2_filter,
[DYNAMIC_CFG_RXCSUM_IDX] = cfg_rxcsum, [DYNAMIC_CFG_RXCSUM_IDX] = cfg_rxcsum,
@@ -2374,6 +2382,9 @@ static void apply_dynamic_cfg(struct osi_core_priv_data *osi_core)
[DYNAMIC_CFG_EEE_IDX] = cfg_eee, [DYNAMIC_CFG_EEE_IDX] = cfg_eee,
[DYNAMIC_CFG_PTP_IDX] = cfg_ptp, [DYNAMIC_CFG_PTP_IDX] = cfg_ptp,
#endif /* !OSI_STRIPPED_LIB */ #endif /* !OSI_STRIPPED_LIB */
#ifdef HSI_SUPPORT
[DYNAMIC_CFG_HSI_IDX] = cfg_hsi,
#endif /* HSI_SUPPORT */
[DYNAMIC_CFG_AVB_IDX] = cfg_avb, [DYNAMIC_CFG_AVB_IDX] = cfg_avb,
[DYNAMIC_CFG_EST_IDX] = cfg_est, [DYNAMIC_CFG_EST_IDX] = cfg_est,
[DYNAMIC_CFG_FPE_IDX] = cfg_fpe, [DYNAMIC_CFG_FPE_IDX] = cfg_fpe,
@@ -3257,6 +3268,11 @@ static nve32_t osi_hal_handle_ioctl(struct osi_core_priv_data *osi_core,
ethernet_server_cmd_log("OSI_CMD_HSI_CONFIGURE"); ethernet_server_cmd_log("OSI_CMD_HSI_CONFIGURE");
#endif #endif
ret = ops_p->core_hsi_configure(osi_core, data->arg1_u32); ret = ops_p->core_hsi_configure(osi_core, data->arg1_u32);
if (ret == 0) {
l_core->cfg.hsi_en_dis = data->arg1_u32;
l_core->cfg.flags |= DYNAMIC_CFG_HSI;
}
break; break;
#ifdef NV_VLTEST_BUILD #ifdef NV_VLTEST_BUILD
case OSI_CMD_HSI_INJECT_ERR: case OSI_CMD_HSI_INJECT_ERR: