87 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			87 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| 
								 | 
							
								/****************************************************************************
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
							 | 
						||
| 
								 | 
							
								be copied by any method or incorporated into another program without
							 | 
						||
| 
								 | 
							
								the express written consent of Aerospace C.Power. This Information or any portion
							 | 
						||
| 
								 | 
							
								thereof remains the property of Aerospace C.Power. The Information contained herein
							 | 
						||
| 
								 | 
							
								is believed to be accurate and Aerospace C.Power assumes no responsibility or
							 | 
						||
| 
								 | 
							
								liability for its use in any way and conveys no license or title under
							 | 
						||
| 
								 | 
							
								any patent or copyright and makes no representation or warranty that this
							 | 
						||
| 
								 | 
							
								Information is free from patent or copyright infringement.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								****************************************************************************/
							 | 
						||
| 
								 | 
							
								#include "chip_reg_base.h"
							 | 
						||
| 
								 | 
							
								#include "iot_config.h"
							 | 
						||
| 
								 | 
							
								#include "iot_errno_api.h"
							 | 
						||
| 
								 | 
							
								#include "iot_io_api.h"
							 | 
						||
| 
								 | 
							
								#include "iot_system.h"
							 | 
						||
| 
								 | 
							
								#include "hw_reg_api.h"
							 | 
						||
| 
								 | 
							
								#include "hw_phy_api.h"
							 | 
						||
| 
								 | 
							
								#include "phy_perf.h"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#include "phy_dfe_reg.h"
							 | 
						||
| 
								 | 
							
								#include "phy_rxtd_reg.h"
							 | 
						||
| 
								 | 
							
								#include "phy_rx_fd_reg.h"
							 | 
						||
| 
								 | 
							
								#include "phy_tx_reg.h"
							 | 
						||
| 
								 | 
							
								#include "phy_reg.h"
							 | 
						||
| 
								 | 
							
								#include "phy_rxtd_reg.h"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								void phy_chn_spike_check(void)
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								#if PHY_FORCE_SPIKE_CHECK
							 | 
						||
| 
								 | 
							
								    if ((1 == g_phy_cpu_share_ctxt.pt_mode_entry) || \
							 | 
						||
| 
								 | 
							
								        (MP_MODE == phy_get_fw_mode())) {
							 | 
						||
| 
								 | 
							
								        PHY_RXTD_WRITE_REG(CFG_BB_RXTD_SPARE2_ADDR, 0);
							 | 
						||
| 
								 | 
							
								    } else {
							 | 
						||
| 
								 | 
							
								        PHY_RXTD_WRITE_REG(CFG_BB_RXTD_SPARE2_ADDR, 0x5A5A5A5A);
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								    if (phy_spike_shift_en_get()) {
							 | 
						||
| 
								 | 
							
								        if (1 == g_phy_cpu_share_ctxt.pt_mode_entry) {
							 | 
						||
| 
								 | 
							
								            PHY_RXTD_WRITE_REG(CFG_BB_RXTD_SPARE2_ADDR, 0);
							 | 
						||
| 
								 | 
							
								        } else {
							 | 
						||
| 
								 | 
							
								            PHY_RXTD_WRITE_REG(CFG_BB_RXTD_SPARE2_ADDR, 0x5A5A5A5A);
							 | 
						||
| 
								 | 
							
								        }
							 | 
						||
| 
								 | 
							
								    } else {
							 | 
						||
| 
								 | 
							
								        PHY_RXTD_WRITE_REG(CFG_BB_RXTD_SPARE2_ADDR, 0);
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								void phy_spike_check_set(uint8_t seg_pwr_en, uint8_t seg_pwr_mask_en,
							 | 
						||
| 
								 | 
							
								    uint8_t coeff)
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								    (void)seg_pwr_en;
							 | 
						||
| 
								 | 
							
								    (void)seg_pwr_mask_en;
							 | 
						||
| 
								 | 
							
								    (void)coeff;
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								void phy_impuse_cancel_set(uint8_t mode, uint8_t clip_ratio,
							 | 
						||
| 
								 | 
							
								    uint8_t blank_ratio)
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								    (void)mode;
							 | 
						||
| 
								 | 
							
								    (void)clip_ratio;
							 | 
						||
| 
								 | 
							
								    (void)blank_ratio;
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								void phy_hpf_set(uint8_t hpf_bypass, uint8_t hpf_alpha)
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								    (void)hpf_bypass;
							 | 
						||
| 
								 | 
							
								    (void)hpf_alpha;
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								void phy_ana_rx_fe_selc_hpf(uint8_t data)
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								    (void)data;
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								void phy_ana_rx_fe_selc_pgf_bq(uint8_t data)
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								    (void)data;
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/*todo: spur check different between kl and kl2 */
							 | 
						||
| 
								 | 
							
								
							 |