fifodma_internal.h (3381B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 * 7 * File: fifodma_internal.h 8 * Purpose: Maps out structures used for FIFO DMA operations and 9 * internal routines. 10 */ 11 12 #ifndef _SOC_FIFODMA_INTERNAL_H 13 #define _SOC_FIFODMA_INTERNAL_H 14 15 #include <soc/defs.h> 16 #include <soc/types.h> 17 #include <sal/types.h> 18 #include <sal/core/time.h> 19 #include <sal/core/sync.h> 20 #include <sal/core/thread.h> 21 #include <soc/fifodma.h> 22 23 /* FIFO DMA function pointers */ 24 typedef struct soc_fifodma_drv_s { 25 int (*fifodma_stop)(int unit, int chan); 26 int (*fifodma_start)(int unit, int chan, int is_mem, 27 soc_mem_t mem, soc_reg_t reg, 28 int copyno, int force_entry_size, 29 int host_entries, void *host_buf); 30 int (*fifodma_intr_enable)(int unit, int ch); 31 int (*fifodma_intr_disable)(int unit, int ch); 32 int (*fifodma_get_read_ptr)(int unit, int chan, void **host_ptr, int *count); 33 int (*fifodma_advance_read_ptr)(int unit, int chan, int count); 34 int (*fifodma_num_entries_get)(int unit, int ch, int *count); 35 int (*fifodma_set_entries_read)(int unit, int ch, uint32 num); 36 int (*fifodma_status_clear)(int unit, int chan); 37 int (*fifodma_status_get)(int unit, int chan, uint32 *status); 38 int (*fifodma_masks_get)(int unit, uint32 *hostmem_timeout, 39 uint32 *hostmem_overflow, uint32 *error, uint32 *done); 40 int (*l2mod_sbus_fifo_field_set)(int unit, soc_field_t field, int enable); 41 int (*l2mod_sbus_fifo_field_get)(int unit, soc_field_t field, int *enable); 42 }soc_fifodma_drv_t; 43 44 /******************************************* 45 * @function cmicm_fifodma_init 46 * purpose API to Initialize cmicm FIFO DMA 47 * 48 * @param unit [in] unit 49 * @param drv [out] soc_fifodma_drv_t pointer 50 * 51 * @returns SOC_E_NONE 52 * @returns SOC_E_XXX 53 * 54 * @end 55 */ 56 extern int cmicm_fifodma_init(int unit, soc_fifodma_drv_t *drv); 57 58 /******************************************* 59 * @function cmicm_fifodma_deinit 60 * purpose API to Deinitialize cmicm FIFO DMA 61 * 62 * @param unit [in] unit 63 * @param drv [in] soc_fifodma_drv_t pointer 64 * 65 * @returns SOC_E_NONE 66 67 * 68 * @end 69 */ 70 extern int cmicm_fifodma_deinit(int unit, soc_fifodma_drv_t *drv); 71 72 /******************************************* 73 * @function cmicx_fifodma_ch_endian_set 74 * purpose to set CMICX fifo dma channel endianness 75 * 76 * @param unit [in] unit # 77 * @param chan [in] channel number 78 * @param ch [in] big_endian 79 * 80 * @returns SOC_E_NONE 81 * 82 * @end 83 */ 84 extern int 85 cmicx_fifodma_ch_endian_set(int unit, int channel, int be); 86 87 /******************************************* 88 * @function cmicx_fifodma_init 89 * purpose API to Initialize cmicx FIFO DMA 90 * 91 * @param unit [in] unit 92 * @param drv [out] soc_fifodma_drv_t pointer 93 * 94 * @returns SOC_E_NONE 95 * @returns SOC_E_XXX 96 * 97 * @end 98 */ 99 extern int cmicx_fifodma_init(int unit, soc_fifodma_drv_t *drv); 100 101 /******************************************* 102 * @function cmicx_fifodma_deinit 103 * purpose API to Deinitialize cmicx FIFO DMA 104 * 105 * @param unit [in] unit 106 * @param drv [in] soc_fifodma_drv_t pointer 107 * 108 * @returns SOC_E_NONE 109 110 * 111 * @end 112 */ 113 extern int cmicx_fifodma_deinit(int unit, soc_fifodma_drv_t *drv); 114 115 #endif /* !_SOC_FIFODMA_INTERNAL_H */