182 lines
		
	
	
		
			5.2 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			182 lines
		
	
	
		
			5.2 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.
 | 
						|
 | 
						|
****************************************************************************/
 | 
						|
 | 
						|
#ifndef _HW_WAR_H_
 | 
						|
#define _HW_WAR_H_
 | 
						|
 | 
						|
#include "iot_config.h"
 | 
						|
 | 
						|
/* define which level would make SW ASSERT when abnormal HW behavior */
 | 
						|
#define PLC_HW_ISSUE_ASSERT_ALL         0
 | 
						|
#define PLC_HW_ISSUE_ASSERT_DEBUG       1
 | 
						|
#define PLC_HW_ISSUE_ASSERT_CRITICAL    3
 | 
						|
#define PLC_HW_ISSUE_ASSERT_BLOCK       5
 | 
						|
#define PLC_HW_ISSUE_ASSERT_LEVEL       PLC_HW_ISSUE_ASSERT_DEBUG
 | 
						|
 | 
						|
/******************hw war macro******************/
 | 
						|
 | 
						|
#ifndef ENA_WAR_421_DEBUG
 | 
						|
#define ENA_WAR_421_DEBUG               1
 | 
						|
#endif
 | 
						|
 | 
						|
/* MAC HW overwrite WAR */
 | 
						|
#define ENA_WAR_396                     0
 | 
						|
#define ENA_WAR_396_DEBUG               1
 | 
						|
 | 
						|
/* sack war */
 | 
						|
#define ENA_WAR_244                     0
 | 
						|
 | 
						|
 | 
						|
/*rawdata mode write fl war*/
 | 
						|
#define ENA_WAR_325                     0
 | 
						|
 | 
						|
#if SUPPORT_SOUTHERN_POWER_GRID
 | 
						|
#define ENA_WAR_NSG_EXTMI               0
 | 
						|
 | 
						|
#define ENA_WAR_SPG_TX_OK               0
 | 
						|
#endif
 | 
						|
 | 
						|
#define ENA_SYNC_DIFF_CCO_PPM           (((PLC_SUPPORT_CCO_ROLE == 0) \
 | 
						|
                                         || MAC_MM_SNIFFER_MODE) \
 | 
						|
                                        && IOT_MP_SUPPORT)
 | 
						|
/* kl2 war for tx ppm
 | 
						|
 * kl3 add the function of tx nn ppm
 | 
						|
 */
 | 
						|
#define ENA_HW_SYNC_PPM_WAR             (0)
 | 
						|
 | 
						|
/* tx ppm per pkt */
 | 
						|
#define ENA_DBG_TX_PPM_PER_PKT          (ENA_SYNC_DIFF_CCO_PPM)
 | 
						|
 | 
						|
/* kl3 mac rx mpdu complete dsr enable bb rx ppm
 | 
						|
 * 0   enable
 | 
						|
 * 1   disable
 | 
						|
 */
 | 
						|
#define ENA_RX_BB_PPM                   0
 | 
						|
 | 
						|
/* nncco war */
 | 
						|
#if PLC_SUPPORT_NEIGHBOR_NW_NEGO
 | 
						|
#define ENA_WAR_NNCCO_FEAT              0
 | 
						|
#else
 | 
						|
#define ENA_WAR_NNCCO_FEAT              0
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef ENA_WAR_440
 | 
						|
#define ENA_WAR_440                     0
 | 
						|
#endif
 | 
						|
 | 
						|
//war for timeout tx abort
 | 
						|
#define WAR_TIMEOUT_TX_ABORT            0
 | 
						|
#define MAC_WAR_244_TIMESTAMPING        0
 | 
						|
 | 
						|
/* war for rx desc not complete for the whole mpdu
 | 
						|
 * SW pop buf from ring for wr idx update
 | 
						|
 * and check the rx_pb_done, once it's set,
 | 
						|
 * SW thought HW has complete the whole buf
 | 
						|
 * but HW maybe complete when multi-pb case
 | 
						|
 * the rx_mpdu_done may update after rx_pb_done
 | 
						|
 * this would make SW think it's an error case
 | 
						|
 * enable the following macro to force SW
 | 
						|
 * wait first pb's attention desc to be rx_mpdu_done
 | 
						|
 * set, if not, SW would keep waiting and hang
 | 
						|
 */
 | 
						|
#define MAC_RX_RING_WAIT_MPDU_DONE      0
 | 
						|
 | 
						|
/* kl3 no need the war, should be 0 */
 | 
						|
#define MAC_WAR_SPLIT_TX_RX_RIFS        0
 | 
						|
 | 
						|
/* debug tx abort for kl3 */
 | 
						|
#define DEG_TX_ABORT                    1
 | 
						|
 | 
						|
/*enable hwretry bcast
 | 
						|
 *hwretry and sw retry can not both enable
 | 
						|
 */
 | 
						|
#ifndef MAC_BCAST_HWRETRY_ENABLE
 | 
						|
#define MAC_BCAST_HWRETRY_ENABLE        1
 | 
						|
#endif
 | 
						|
 | 
						|
/* enable mac rawdata tx start intr for kl2 */
 | 
						|
#define ENA_WAR_CTL     1
 | 
						|
 | 
						|
/* for WAR MAC HW overwrite issue */
 | 
						|
#if !defined(MAC_HW_WAR_RESV_BYTES)
 | 
						|
#define MAC_HW_WAR_RESV_BYTES           (0)
 | 
						|
#endif
 | 
						|
 | 
						|
#if !defined(MAC_HW_WAR_SPG_RESV_SHORT_BYTES)
 | 
						|
#define MAC_HW_WAR_SPG_RESV_SHORT_BYTES (0)
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef DEBUG_NID_ERR
 | 
						|
#define DEBUG_NID_ERR                   (0)
 | 
						|
#endif
 | 
						|
 | 
						|
/* SW SYNC NTB, low 32 bit overflow, high 32 bit not + 1*/
 | 
						|
#ifndef ENA_WAR_911
 | 
						|
#define ENA_WAR_911                     (0)
 | 
						|
#endif
 | 
						|
 | 
						|
/* define high32bit ntb equal 1 */
 | 
						|
#ifndef ENA_HIGH32_EQUAL_ONE
 | 
						|
#define ENA_HIGH32_EQUAL_ONE            (!ENA_WAR_911)
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef WAR_BUGID757_EN
 | 
						|
/* master and role is cco to debug */
 | 
						|
#define WAR_BUGID757_EN                 (1)
 | 
						|
#endif
 | 
						|
 | 
						|
/* kl3 hw bug, rf csma only one hwq can be enabled */
 | 
						|
#ifndef ENA_RF_ONLY_ONE_CSMA_HWQ
 | 
						|
#define ENA_RF_ONLY_ONE_CSMA_HWQ        (HPLC_RF_DEV_SUPPORT && 0)
 | 
						|
#endif
 | 
						|
 | 
						|
/* kl3 hw bug, 4 hwq war */
 | 
						|
#ifndef ENA_RF_MULTI_CSMA_HWQ_WAR
 | 
						|
#define ENA_RF_MULTI_CSMA_HWQ_WAR       (HPLC_RF_DEV_SUPPORT && \
 | 
						|
                                        (!ENA_RF_ONLY_ONE_CSMA_HWQ))
 | 
						|
#endif
 | 
						|
 | 
						|
/* kl3 hw bug, after tx abort happend, mpdu cannot goto next mpdu */
 | 
						|
#ifndef ENA_RF_FORCE_RESET_HWQ
 | 
						|
#define ENA_RF_FORCE_RESET_HWQ          (HPLC_RF_DEV_SUPPORT && 1)
 | 
						|
#endif
 | 
						|
 | 
						|
/* kl3 csma beacon use one hwq */
 | 
						|
#ifndef ENA_RF_CSMA_BCN_HWQ
 | 
						|
#define ENA_RF_CSMA_BCN_HWQ             (!ENA_RF_ONLY_ONE_CSMA_HWQ)
 | 
						|
#endif
 | 
						|
 | 
						|
/* tx raw int */
 | 
						|
#ifndef ENA_TX_RAW_INT
 | 
						|
#define ENA_TX_RAW_INT (1)
 | 
						|
#endif
 | 
						|
 | 
						|
#if (ENA_TX_RAW_INT && ENABLE_CCA_ISR == 1)
 | 
						|
#error "ENA_TX_RAW_INT and ENABLE_CCA_ISR cannot be valid at the same time!"
 | 
						|
#endif
 | 
						|
 | 
						|
/* rf special config for hplc2rf cert test */
 | 
						|
#ifndef ENA_RF_CERT_SPECIAL_CFG
 | 
						|
#define ENA_RF_CERT_SPECIAL_CFG         (HPLC_RF_DEV_SUPPORT && 1)
 | 
						|
#endif
 | 
						|
 | 
						|
/* war for low power mode */
 | 
						|
#define WAR_FOR_LOW_POWER               1
 | 
						|
 | 
						|
/* reset tx fd fsm when tx td done. fix tx sof pb crc error after tx nncco */
 | 
						|
#define ENA_WAR_TX_TD_DONE_RST_TX_FD    1
 | 
						|
 | 
						|
#endif
 |