TSW (Time-Sensitive Switch) driver API definitions. More...
Go to the source code of this file.
Data Structures | |
| struct | tx_hdr_desc_t |
| TSW TX header descriptor structure. More... | |
| struct | rx_hdr_desc_t |
| TSW RX header descriptor structure. More... | |
| struct | tsw_frame_action_config_t |
| TSW frame action configuration structure. More... | |
| struct | tsw_frame_t |
| TSW frame structure. More... | |
| struct | tsw_dma_config_t |
| TSW DMA configuration structure. More... | |
| struct | tsw_shap_tas_listlen_t |
| TSW SHAP TAS list length structure. More... | |
| struct | tsw_tas_controllist_entry_t |
| TSW TAS control list entry structure. More... | |
| struct | tsw_tas_config_t |
| struct | tsw_cbs_config_t |
| TSW CBS (Credit-Based Shaper) configuration structure. More... | |
| struct | tsw_tsf_t |
| TSW timestamp FIFO entry structure. More... | |
| struct | tsw_fpe_mms_status_t |
| TSW FPE MMS status structure. More... | |
| struct | tsw_fpe_config_t |
| TSW FPE configuration structure. More... | |
| struct | tsw_cb_stmid_lookup_mac_t |
| TSW CB STMID lookup MAC structure. More... | |
| struct | tsw_cb_stmid_active_mac_t |
| TSW CB STMID active MAC structure. More... | |
| struct | tsw_cb_stmid_entry_t |
| TSW CB STMID entry structure. More... | |
| struct | tsw_cb_frer_xrfunc_config_t |
| TSW CB FRER XR function configuration structure. More... | |
| struct | tsw_cb_frer_sid_func_config_t |
| TSW CB FRER SID function configuration structure. More... | |
| struct | tsw_cb_frer_latent_error_dectecton_config_t |
| TSW CB FRER latent error detection configuration structure. More... | |
| struct | tsw_cb_frer_recovery_func_config_t |
| TSW CB FRER recovery function configuration structure. More... | |
| struct | tsw_psfer_gate_control_list_entry_t |
| TSW PSFER gate control list entry structure. More... | |
| struct | tsw_psfer_gate_control_list_config_t |
| TSW PSFER gate control list configuration structure. More... | |
| struct | tsw_cb_frer_frame_count_egress_t |
| TSW CB FRER frame count egress structure. More... | |
| struct | tsw_psfp_gate_static_mode_config_t |
| TSW PSFP gate static mode configuration structure. More... | |
| struct | tsw_psfp_gate_dynamic_mode_config_t |
| TSW PSFP gate dynamic mode configuration structure. More... | |
| struct | tsw_psfp_flow_meter_xir_config_t |
| TSW PSFP flow meter XIR configuration structure. More... | |
| struct | tsw_psfp_flow_meter_config_t |
| TSW PSFP flow meter configuration structure. More... | |
| struct | tsw_psfp_filter_config_t |
| TSW PSFP filter configuration structure. More... | |
Macros | |
| #define | MAC_LO(mac) (uint32_t)(mac[0] | (mac[1] << 8) | (mac[2] << 16) | (mac[3] << 24)) |
| Extract lower 32 bits of MAC address. More... | |
| #define | MAC_HI(mac) (uint32_t)(mac[4] | (mac[5] << 8)) |
| Extract upper 16 bits of MAC address. More... | |
| #define | MAC_MDIO_CTRL_OP_WR (0x01) |
| MDIO control operation: Write. More... | |
| #define | MAC_MDIO_CTRL_OP_RD (0x02) |
| MDIO control operation: Read. More... | |
| #define | TSW_SEND_DESC_COUNT (16U) |
| Default send descriptor count. More... | |
| #define | TSW_RECV_DESC_COUNT (16U) |
| Default receive descriptor count. More... | |
| #define | TSW_SEND_BUFF_LEN (1536U) |
| Default send buffer length in bytes. More... | |
| #define | TSW_RECV_BUFF_LEN (1536U) |
| Default receive buffer length in bytes. More... | |
| #define | TSW_NS_IN_ONE_SEC (1000000000UL) |
| Nanoseconds in one second. More... | |
| #define | TSW_BUS_FREQ (100000000UL) |
| TSW bus frequency in Hz. More... | |
| #define | TSW_MM2S_DMA_WAIT_CBUFF_TIMEOUT (1000U) |
| MM2S DMA wait circular buffer timeout value. More... | |
| #define | TSW_MM2S_DMA_CHECK_RBUFE_TIMEOUT (1000U) |
| MM2S DMA check receive buffer empty timeout value. More... | |
| #define | TSW_ENET_MAC (6U) |
| Ethernet MAC address size in bytes. More... | |
| #define | TSW_FPE_MMS_MIN_VTIME_MIN (1U) |
| FPE MMS minimum verify time minimum value (1ms) More... | |
| #define | TSW_FPE_MMS_MAX_VTIME_MAX (128U) |
| FPE MMS maximum verify time maximum value (128ms) More... | |
Functions | |
| void | tsw_get_default_dma_config (tsw_dma_config_t *config) |
| Get default DMA configuration. More... | |
| void | tsw_init_send (TSW_Type *ptr, tsw_dma_config_t *config) |
| Initialize TSW send DMA. More... | |
| void | tsw_init_recv (TSW_Type *ptr, tsw_dma_config_t *config) |
| Initialize TSW receive DMA. More... | |
| hpm_stat_t | tsw_send_frame (TSW_Type *ptr, uint8_t *buffer, uint16_t length, uint8_t id) |
| Send a frame to CPU port. More... | |
| hpm_stat_t | tsw_send_frame_check_response (TSW_Type *ptr, uint8_t *buffer, uint16_t length, uint8_t id) |
| Send a frame to CPU port and check response. More... | |
| hpm_stat_t | tsw_commit_recv_desc (TSW_Type *ptr, uint8_t *buffer, uint16_t length, uint8_t id) |
| Commit a receive DMA descriptor. More... | |
| hpm_stat_t | tsw_recv_frame (TSW_Type *ptr, tsw_frame_t *frame) |
| Receive a frame from CPU port. More... | |
| void | tsw_mac_lookup_bypass (TSW_Type *ptr, uint8_t dst_port) |
| Lookup Bypass Setting. More... | |
| void | tsw_set_cam_vlan_port (TSW_Type *ptr) |
| CAM VLAN Port Setting. More... | |
| hpm_stat_t | tsw_ep_set_mdio_config (TSW_Type *ptr, uint8_t port, uint8_t clk_div) |
| MDIO Interface Config. More... | |
| hpm_stat_t | tsw_ep_mdio_read (TSW_Type *ptr, uint8_t port, uint32_t phy_addr, uint32_t reg_addr, uint16_t *data) |
| MDIO Read. More... | |
| hpm_stat_t | tsw_ep_mdio_write (TSW_Type *ptr, uint8_t port, uint32_t phy_addr, uint32_t reg_addr, uint16_t data) |
| MDIO Write. More... | |
| hpm_stat_t | tsw_ep_enable_mac_ctrl (TSW_Type *ptr, uint8_t port, tsw_mac_type_t mac_type) |
| Enable MAC Controller. More... | |
| hpm_stat_t | tsw_ep_disable_mac_ctrl (TSW_Type *ptr, uint8_t port, tsw_mac_type_t mac_type) |
| Disable MAC Controller. More... | |
| hpm_stat_t | tsw_ep_enable_all_mac_ctrl (TSW_Type *ptr, tsw_mac_type_t mac_type) |
| Enable All MAC Controllers. More... | |
| hpm_stat_t | tsw_ep_disable_all_mac_ctrl (TSW_Type *ptr, tsw_mac_type_t mac_type) |
| Disable All MAC Controllers. More... | |
| hpm_stat_t | tsw_ep_set_mac_addr (TSW_Type *ptr, uint8_t port, uint8_t *mac_addr, bool promisc) |
| Set MAC Address. More... | |
| hpm_stat_t | tsw_ep_set_mac_mode (TSW_Type *ptr, uint8_t port, uint8_t gmii) |
| Set MAC Mode. More... | |
| hpm_stat_t | tsw_ep_set_xmac_mode (TSW_Type *ptr, uint8_t port, uint8_t gmii, tsw_mac_type_t mac_type) |
| Set MAC Mode For Specified MAC. More... | |
| void | tsw_port_gpr (TSW_Type *ptr, uint8_t port, uint8_t speed, uint8_t itf, uint8_t tx_dly, uint8_t rx_dly) |
| Set Port GPR. More... | |
| void | tsw_set_port_speed (TSW_Type *ptr, uint8_t port, uint8_t speed) |
| Set TSW port speed. More... | |
| void | tsw_set_port_interface (TSW_Type *ptr, uint8_t port, uint8_t itf) |
| Set TSW port interface type. More... | |
| void | tsw_set_port_clock_delay (TSW_Type *ptr, uint8_t port, uint8_t tx_dly, uint8_t rx_dly) |
| Set TSW port clock delay. More... | |
| void | tsw_get_default_frame_action_config (TSW_Type *ptr, tsw_frame_action_config_t *config) |
| Get Default Frame Action Config. More... | |
| hpm_stat_t | tsw_set_frame_action (TSW_Type *ptr, tsw_frame_action_config_t *config, uint8_t type) |
| Set Frame Action. More... | |
| void | tsw_set_internal_frame_action (TSW_Type *ptr, uint8_t dest_port) |
| Set Internal Frame Action. More... | |
| void | tsw_set_broadcast_frame_action (TSW_Type *ptr, uint8_t dest_port) |
| Set Broadcast Frame Action. More... | |
| void | tsw_set_unknown_frame_action (TSW_Type *ptr, uint8_t dest_port) |
| Set Unknow Frame Action. More... | |
| void | tsw_clear_internal_frame_action (TSW_Type *ptr, uint8_t dest_port) |
| Clear Internal Frame Action. More... | |
| void | tsw_clear_broadcast_frame_action (TSW_Type *ptr, uint8_t dest_port) |
| Clear Broadcast Frame Action. More... | |
| void | tsw_clear_unknown_frame_action (TSW_Type *ptr, uint8_t dest_port) |
| Clear Unknown Frame Action. More... | |
| void | tsw_set_lookup_table (TSW_Type *ptr, uint16_t entry_num, uint8_t dest_port, uint64_t dest_mac) |
| Set Lookup Table. More... | |
| void | tsw_clear_cam (TSW_Type *ptr) |
| Clear CAM. More... | |
| void | tsw_enable_store_forward_mode (TSW_Type *ptr, uint8_t port) |
| Enable RXFIFO to store and forward mode. More... | |
| void | tsw_disable_store_forward_mode (TSW_Type *ptr, uint8_t port) |
| Disable RXFIFO to store and forward mode. More... | |
| hpm_stat_t | tsw_get_rtc_time_increment (TSW_Type *ptr, uint32_t *increment) |
| Get RTC timer increment value. More... | |
| hpm_stat_t | tsw_set_rtc_time_increment (TSW_Type *ptr, uint32_t increment) |
| Set RTC timer increment value. More... | |
| hpm_stat_t | tsw_get_rtc_current_time (TSW_Type *ptr, uint32_t *sec, uint32_t *nsec) |
| Get RTC current time. More... | |
| hpm_stat_t | tsw_get_rtc_offset (TSW_Type *ptr, int64_t *sec, uint32_t *nsec) |
| Get RTC offset. More... | |
| hpm_stat_t | tsw_set_rtc_offset (TSW_Type *ptr, int64_t sec, uint32_t nsec) |
| Set RTC offset. More... | |
| hpm_stat_t | tsw_set_rtc_offset_change (TSW_Type *ptr, uint32_t change) |
| Set RTC offset change. More... | |
| hpm_stat_t | tsw_set_tsync_timer_hclkdiv (TSW_Type *ptr, uint8_t port, uint32_t host_clkdiv) |
| Set TSYNC timer host clock divider. More... | |
| hpm_stat_t | tsw_tsync_timer_control (TSW_Type *ptr, uint8_t port, uint8_t index, uint32_t period, uint32_t enable) |
| TSYNC timer control. More... | |
| hpm_stat_t | tsw_tsync_timer_interrupt_enable (TSW_Type *ptr, uint8_t port) |
| TSYNC timer interrupt enable. More... | |
| hpm_stat_t | tsw_tsync_update_data (TSW_Type *ptr, uint8_t port, uint32_t bin, uint32_t binofs, uint32_t srcaddr, uint8_t lenbytes) |
| TSYNC update data. More... | |
| hpm_stat_t | tsw_tsync_update_len (TSW_Type *ptr, uint8_t port, uint32_t bin, uint8_t lenbytes, uint8_t tqueue) |
| TSYNC update length. More... | |
| hpm_stat_t | tsw_tsync_trigger_tx (TSW_Type *ptr, uint8_t port, uint32_t bin) |
| TSYNC trigger TX. More... | |
| hpm_stat_t | tsw_tsync_get_txtimestamp (TSW_Type *ptr, uint8_t port, uint32_t bin, uint32_t *timestamplo, uint32_t *timestamphi) |
| TSYNC get TX timestamp. More... | |
| hpm_stat_t | tsw_tsync_get_rxtimestamp (TSW_Type *ptr, uint8_t port, uint32_t *timestamplo, uint32_t *timestamphi) |
| TSYNC get RX timestamp. More... | |
| hpm_stat_t | tsw_tsync_disable_current_events (TSW_Type *ptr, uint8_t port, uint32_t *disabled) |
| TSYNC disable current events. More... | |
| hpm_stat_t | tsw_tsync_get_rxstatus (TSW_Type *ptr, uint8_t port, uint8_t *ov, uint8_t *avnxt, uint8_t *rxsel) |
| TSYNC get RX status. More... | |
| hpm_stat_t | tsw_tsync_next_rxbuffer (TSW_Type *ptr, uint8_t port) |
| TSYNC next RX buffer. More... | |
| hpm_stat_t | tsw_tsync_clear_overflow (TSW_Type *ptr, uint8_t port) |
| TSYNC clear overflow status. More... | |
| hpm_stat_t | tsw_tsync_get_txdone (TSW_Type *ptr, uint8_t port, uint32_t *done) |
| TSYNC get tx done status. More... | |
| hpm_stat_t | tsw_tsync_clear_txdone (TSW_Type *ptr, uint8_t port, uint32_t done) |
| TSYNC clear tx done status. More... | |
| hpm_stat_t | tsw_tsync_get_tmrdone (TSW_Type *ptr, uint8_t port, uint32_t *done) |
| TSYNC get tmr done status. More... | |
| hpm_stat_t | tsw_shap_get_tas_listlen (TSW_Type *ptr, uint8_t port, tsw_shap_tas_listlen_t *listlen) |
| TSW get shap tas listlen. More... | |
| hpm_stat_t | tsw_shap_set_tas_cycletime (TSW_Type *ptr, uint8_t port, uint32_t cycle_time) |
| SHAP set tas cycle. More... | |
| hpm_stat_t | tsw_shap_set_tas_controllist (TSW_Type *ptr, uint8_t port, uint32_t index, tsw_tas_controllist_entry_t *entry) |
| SHAP set tas controllist. More... | |
| hpm_stat_t | tsw_shap_get_tas_controllist (TSW_Type *ptr, uint8_t port, uint32_t index, tsw_tas_controllist_entry_t *entry) |
| SHAP get tas controllist. More... | |
| hpm_stat_t | tsw_shap_set_tas_max_sdu_ticks (TSW_Type *ptr, uint8_t port, uint8_t index, uint32_t ticks) |
| Set tas maximum SDU ticks. More... | |
| hpm_stat_t | tsw_shap_get_tas_max_sdu_ticks (TSW_Type *ptr, uint8_t port, uint8_t index, uint32_t *ticks) |
| Get tas maximum SDU ticks. More... | |
| hpm_stat_t | tsw_set_pps_tod_output (TSW_Type *ptr) |
| Set pps tod output. More... | |
| hpm_stat_t | tsw_shap_enable_tas (TSW_Type *ptr, uint8_t port) |
| Enable TAS. More... | |
| hpm_stat_t | tsw_shap_disable_tas (TSW_Type *ptr, uint8_t port) |
| Disable TAS. More... | |
| hpm_stat_t | tsw_shap_set_tas_listlen (TSW_Type *ptr, uint8_t port, uint32_t listlen) |
| Set TAS list length. More... | |
| hpm_stat_t | tsw_shap_set_tas_basetime (TSW_Type *ptr, uint8_t port, uint32_t basetime_sec, uint32_t basetime_ns) |
| Set TAS base time. More... | |
| hpm_stat_t | tsw_shap_tas_change_config (TSW_Type *ptr, uint8_t port) |
| Trigger to change TAS config. More... | |
| hpm_stat_t | tsw_shap_get_tas_crsr (TSW_Type *ptr, uint8_t port, uint32_t *crsr) |
| Get TAS cycle time. More... | |
| hpm_stat_t | tsw_shap_set_tas (TSW_Type *ptr, uint8_t port, tsw_tas_config_t *config) |
| Set TAS config. More... | |
| hpm_stat_t | tsw_shap_set_cbs (TSW_Type *ptr, uint8_t port, uint8_t index, tsw_cbs_config_t *config) |
| Set CBS config. More... | |
| hpm_stat_t | tsw_get_txtimestampfifo_used (TSW_Type *ptr, uint8_t port, uint32_t *count) |
| Get used count from the TX-Timestamp FIFO. More... | |
| hpm_stat_t | tsw_get_txtimestampfifo_entry (TSW_Type *ptr, uint8_t port, tsw_tsf_t *entry) |
| Get TX-Timestamp FIFO entry. More... | |
| hpm_stat_t | tsw_fpe_get_default_mms_ctrl_config (TSW_Type *ptr, uint8_t port, tsw_fpe_config_t *config) |
| Get default MMS config. More... | |
| hpm_stat_t | tsw_fpe_enable_mms (TSW_Type *ptr, uint8_t port) |
| Enable MMS. More... | |
| hpm_stat_t | tsw_fpe_disable_mms (TSW_Type *ptr, uint8_t port) |
| Disable MMS. More... | |
| hpm_stat_t | tsw_fpe_set_mms_ctrl (TSW_Type *ptr, uint8_t port, tsw_fpe_config_t *config) |
| Set MMS config. More... | |
| hpm_stat_t | tsw_fpe_reset_mms_statistics_counter (TSW_Type *ptr, uint8_t port, tsw_fpe_mms_statistics_counter_t counter) |
| Reset MMS statistics counter. More... | |
| hpm_stat_t | tsw_fpe_get_mms_statistics_counter (TSW_Type *ptr, uint8_t port, tsw_fpe_mms_statistics_counter_t counter, uint32_t *value) |
| Get MMS statistics counter. More... | |
| hpm_stat_t | tsw_cb_stmid_ingress_set_entry (TSW_Type *ptr, tsw_cb_stmid_entry_t *entry) |
| Set STMID entry for ingress. More... | |
| hpm_stat_t | tsw_cb_stmid_ingress_get_entry (TSW_Type *ptr, tsw_cb_stmid_entry_t *entry) |
| Get STMID entry for ingress. More... | |
| hpm_stat_t | tsw_cb_stmid_egress_set_entry (TSW_Type *ptr, tsw_cb_stmid_entry_t *entry) |
| Set STMID entry for egress. More... | |
| hpm_stat_t | tsw_cb_frer_ingress_enable_rtag (TSW_Type *ptr) |
| Enable RTAG with CB frer for ingress. More... | |
| hpm_stat_t | tsw_cb_frer_egress_set_sid_func (TSW_Type *ptr, tsw_cb_frer_sid_func_config_t *config) |
| specify recovery functions for stream for egress More... | |
| hpm_stat_t | tsw_cb_frer_egress_set_recovery_func (TSW_Type *ptr, tsw_cb_frer_recovery_func_config_t *config) |
| Set up recovery functions for stream with CB frer for egress. More... | |
| hpm_stat_t | tsw_cb_frer_egress_clear_latten_error_flag (TSW_Type *ptr) |
| Clear latten error flag. More... | |
| hpm_stat_t | tsw_cb_frer_egress_get_count (TSW_Type *ptr, tsw_cb_frer_frame_count_egress_t *count) |
| Get count of latten error. More... | |
| hpm_stat_t | tsw_cb_frer_set_msec_cycles (TSW_Type *ptr, uint32_t msec_cycles) |
| Set system cycle numbers for one millisecond. More... | |
| hpm_stat_t | tsw_psfp_set_filter (TSW_Type *ptr, tsw_psfp_filter_config_t *config) |
| Set PSFP filter. More... | |
| hpm_stat_t | tsw_psfp_set_gate_static_mode (TSW_Type *ptr, tsw_psfp_gate_static_mode_config_t *config) |
| Set PSFP gate with static mode. More... | |
| hpm_stat_t | tsw_psfp_set_gate_dynamic_mode (TSW_Type *ptr, tsw_psfp_gate_dynamic_mode_config_t *config) |
| Set PSFP gate with dynamic mode. More... | |
| hpm_stat_t | tsw_psfp_set_flow_meter (TSW_Type *ptr, tsw_psfp_flow_meter_config_t *config) |
| Set PSFP flow meter. More... | |
TSW (Time-Sensitive Switch) driver API definitions.
This file provides the API definitions for the TSW peripheral driver. The TSW is a time-sensitive network switch that supports various time-sensitive networking features including TAS (Time-Aware Shaper), CBS (Credit-Based Shaper), FPE (Frame Preemption), FRER (Frame Replication and Elimination for Reliability), and PSFP (Per-Stream Filtering and Policing).