mirror of
git://nv-tegra.nvidia.com/kernel/nvethernetrm.git
synced 2025-12-23 09:56:41 +03:00
nvethernetrm: move core_backup to osi_common.h
Issue: RFE: move struct core_backup to osi_common.h
Fix:
1. Moved core_backup to osi_common.h
2. Added generic osi_mac_restore_registers() and osi_mac_save_registers()
Api's in osi_common.c
Bug 2804631
Change-Id: I5bc71666e104f2e729024e096bd51ce350f2a1f0
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2286642
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Bhadram Varka
parent
198951cc39
commit
b993a0368d
@@ -263,6 +263,12 @@
|
||||
#define OSI_INVALID_CHAN_NUM 0xFFU
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Max num of MAC core registers to backup. It should be max of or >=
|
||||
* (EQOS_MAX_BAK_IDX=380, MGBE_MAX_BAK_IDX, coreX,...etc) backup registers.
|
||||
*/
|
||||
#define CORE_MAX_BAK_IDX 400U
|
||||
|
||||
/**
|
||||
* @addtogroup EQOS-MAC EQOS MAC HW supported features
|
||||
*
|
||||
@@ -504,6 +510,16 @@ struct osi_hw_features {
|
||||
unsigned int aux_snap_num;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief core_backup - Struct used to store backup of core HW registers.
|
||||
*/
|
||||
struct core_backup {
|
||||
/** Array of reg MMIO addresses (base of MAC core + offset of reg) */
|
||||
void *reg_addr[CORE_MAX_BAK_IDX];
|
||||
/** Array of value stored in each corresponding register */
|
||||
unsigned int reg_val[CORE_MAX_BAK_IDX];
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief osi_lock_init - Initialize lock to unlocked state.
|
||||
*
|
||||
@@ -664,4 +680,30 @@ void osi_get_hw_features(void *base, struct osi_hw_features *hw_feat);
|
||||
*
|
||||
*/
|
||||
void osi_memset(void *s, unsigned int c, unsigned long count);
|
||||
|
||||
/*
|
||||
* @brief Function to store a backup of MAC register space during SOC suspend.
|
||||
*
|
||||
* Algorithm: Read registers to be backed up as per struct core_backup and
|
||||
* store the register values in memory.
|
||||
*
|
||||
* @param[in] config: Pointer to core_backup structure.
|
||||
* @param[in] max_regs: Max num of registers to backup.
|
||||
*
|
||||
* @retval none
|
||||
*/
|
||||
void mac_save_registers(struct core_backup *const config);
|
||||
|
||||
/**
|
||||
* @brief Function to restore the backup of MAC registers during SOC resume.
|
||||
*
|
||||
* Algorithm: Restore the register values from the in memory backup taken using
|
||||
* osi_save_registers().
|
||||
*
|
||||
* @param[in] config: Pointer to core_backup structure.
|
||||
* @param[in] max_regs: Max num of registers to restore.
|
||||
*
|
||||
* @retval none
|
||||
*/
|
||||
void mac_restore_registers(struct core_backup *const config);
|
||||
#endif /* OSI_COMMON_H */
|
||||
|
||||
Reference in New Issue
Block a user