116 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			116 lines
		
	
	
		
			3.3 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 _AHB_H
 | ||
|  | #define _AHB_H
 | ||
|  | 
 | ||
|  | #include "os_types.h"
 | ||
|  | 
 | ||
|  | #if HW_PLATFORM > HW_PLATFORM_SIMU
 | ||
|  | #include "ahb_hw.h"
 | ||
|  | #endif
 | ||
|  | 
 | ||
|  | #ifdef __cplusplus
 | ||
|  | extern "C" { | ||
|  | #endif
 | ||
|  | 
 | ||
|  | void ahb_reset(); | ||
|  | void ahb_enable(); | ||
|  | 
 | ||
|  | /* dma module function */ | ||
|  | void ahb_sw_dma0_enable(void); | ||
|  | void ahb_sw_dma0_disable(void); | ||
|  | void ahb_sw_dma0_reset(void); | ||
|  | void ahb_sw_dma1_enable(void); | ||
|  | void ahb_sw_dma1_disable(void); | ||
|  | void ahb_sw_dma1_reset(void); | ||
|  | 
 | ||
|  | /* ada module function */ | ||
|  | void ahb_ada_enable(void); | ||
|  | void ahb_ada_disable(void); | ||
|  | void ahb_ada_reset(void); | ||
|  | uint32_t ahb_ada_is_enable(void); | ||
|  | 
 | ||
|  | /* gmac module function */ | ||
|  | void ahb_gmac_enable(void); | ||
|  | void ahb_gmac_disable(void); | ||
|  | void ahb_gmac_reset(void); | ||
|  | 
 | ||
|  | /* mac module function */ | ||
|  | void ahb_mac_enable(void); | ||
|  | void ahb_mac_disable(void); | ||
|  | void ahb_mac_reset(void); | ||
|  | void ahb_mac_reset_hold(void); | ||
|  | void ahb_mac_reset_release(void); | ||
|  | 
 | ||
|  | /* phy module function */ | ||
|  | void ahb_phy_mac_enable(void); | ||
|  | void ahb_phy_enable(void); | ||
|  | void ahb_phy_disable(void); | ||
|  | void ahb_phy_reset(void); | ||
|  | void ahb_phy_reset_hold(void); | ||
|  | void ahb_phy_reset_release(void); | ||
|  | void ahb_phy_reg_reset(void); | ||
|  | void ahb_phy_ana_reset(void); | ||
|  | void ahb_bb_adc_scale_set(uint32_t scale); | ||
|  | void ahb_bb_dac_scale_set(uint32_t scale); | ||
|  | 
 | ||
|  | /* snapshot module function */ | ||
|  | void ahb_snapshot_enable(); | ||
|  | void ahb_snapshot_disable(); | ||
|  | void ahb_snapshot_reset(); | ||
|  | 
 | ||
|  | /* scratch register function */ | ||
|  | void ahb_scratch_reg_set(uint32_t scratch_id, uint32_t val); | ||
|  | uint32_t ahb_scratch_reg_get(uint32_t scratch_id); | ||
|  | 
 | ||
|  | /* cache function */ | ||
|  | void ahb_cache_enable(); | ||
|  | void ahb_cache_disable(); | ||
|  | void ahb_cache_reset(); | ||
|  | void ahb_cache_clear(void); | ||
|  | void ahb_cache_fill_valid_space(); | ||
|  | void ahb_set_cache_buffer_mode(); | ||
|  | void ahb_cache_space_dis(); | ||
|  | void ahb_cache_space_ena(); | ||
|  | void ahb_cache_space_dis_for_flash_write(); | ||
|  | void ahb_cache_space_ena_for_flash_write(); | ||
|  | 
 | ||
|  | /* dmc cache function, only kl2 support, but phy_tools.c need */ | ||
|  | void ahb_dmc_cache_clear(); | ||
|  | void ahb_dmc_cache_rst_clear(); | ||
|  | 
 | ||
|  | /* get flash base address(cache mapped address) */ | ||
|  | uint32_t ahb_get_flash_base(void); | ||
|  | 
 | ||
|  | void ahb_hram_adc_mode_enable(uint32_t hram_bitmap); | ||
|  | void ahb_hram_adc_mode_disable(uint32_t hram_bitmap); | ||
|  | 
 | ||
|  | uint32_t ahb_reg0_unlock_get(void); | ||
|  | void ahb_reg0_unlock_set(uint32_t unlock); | ||
|  | 
 | ||
|  | void ahb_clk_mpll_set(uint32_t enable, uint32_t div); | ||
|  | void ahb_clk_clock_set(uint32_t ahb_sel, uint32_t apb_sel, uint32_t apb_div); | ||
|  | void ahb_clk_debug_output_cfg(uint32_t type, uint32_t div); | ||
|  | void ahb_clk_clock_get(uint32_t *p_ahb_sel, uint32_t *p_apb_sel, | ||
|  |     uint32_t *p_apb_div); | ||
|  | void ahb_rf_brg_async(); | ||
|  | 
 | ||
|  | 
 | ||
|  | #ifdef __cplusplus
 | ||
|  | } | ||
|  | #endif
 | ||
|  | 
 | ||
|  | #endif //_AHB_H
 |