phymod_custom_config.h (4665B)
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 * System interface definitions for Switch SDK 8 */ 9 10 #ifndef __PHYMOD_CUSTOM_CONFIG_H__ 11 #define __PHYMOD_CUSTOM_CONFIG_H__ 12 13 #include <shared/bsl.h> 14 #include <shared/error.h> 15 16 #include <sal/core/libc.h> 17 #include <sal/core/alloc.h> 18 19 #include <sal/core/thread.h> 20 #include <sal/core/time.h> 21 22 23 #define PHYMOD_EAGLE_SUPPORT 24 #define PHYMOD_FALCON_SUPPORT 25 #define PHYMOD_FALCON16_SUPPORT 26 #define PHYMOD_MERLIN16_SUPPORT 27 #define PHYMOD_QSGMIIE_SUPPORT 28 #define PHYMOD_TSCE_SUPPORT 29 #define PHYMOD_TSCF_SUPPORT 30 #define PHYMOD_TSCF16_SUPPORT 31 #define PHYMOD_TSCE16_SUPPORT 32 #define PHYMOD_VIPER_SUPPORT 33 #define PHYMOD_FURIA_SUPPORT 34 #define PHYMOD_SESTO_SUPPORT 35 #define PHYMOD_QUADRA28_SUPPORT 36 #define PHYMOD_QTCE_SUPPORT 37 #define PHYMOD_HURACAN_SUPPORT 38 #define PHYMOD_MADURA_SUPPORT 39 #define PHYMOD_DINO_SUPPORT 40 #define PHYMOD_PHY8806X_SUPPORT 41 #define PHYMOD_TSCE_DPLL_SUPPORT 42 #define PHYMOD_EAGLE_DPLL_SUPPORT 43 #define PHYMOD_BLACKHAWK_SUPPORT 44 #define PHYMOD_TSCBH_SUPPORT 45 #define PHYMOD_TSCF_GEN3_SUPPORT 46 #define PHYMOD_FALCON_DPLL_SUPPORT 47 #define PHYMOD_QTCE16_SUPPORT 48 #define PHYMOD_NULL_SUPPORT 49 50 #define PHYMOD_DEBUG_ERROR(stuff_) \ 51 LOG_ERROR(BSL_LS_SOC_PHYMOD, stuff_) 52 53 #define PHYMOD_DEBUG_VERBOSE(stuff_) \ 54 LOG_VERBOSE(BSL_LS_SOC_PHYMOD, stuff_) 55 56 #define PHYMOD_DEBUG_WARN(stuff_) \ 57 LOG_WARN(BSL_LS_SOC_PHYMOD, stuff_) 58 59 #define PHYMOD_DIAG_OUT(stuff_) \ 60 cli_out stuff_ 61 62 /* Do not map directly to SAL function */ 63 #define PHYMOD_USLEEP soc_phymod_usleep 64 #define PHYMOD_SLEEP soc_phymod_sleep 65 #define PHYMOD_STRCMP soc_phymod_strcmp 66 #define PHYMOD_MEMSET soc_phymod_memset 67 #define PHYMOD_MEMCPY soc_phymod_memcpy 68 #define PHYMOD_MALLOC soc_phymod_alloc 69 #define PHYMOD_FREE soc_phymod_free 70 71 /* These functions map directly to SAL functions */ 72 #define PHYMOD_STRLEN sal_strlen 73 #define PHYMOD_STRSTR sal_strstr 74 #define PHYMOD_STRCHR sal_strchr 75 #define PHYMOD_STRNCMP sal_strncmp 76 #define PHYMOD_SNPRINTF sal_snprintf 77 #define PHYMOD_SPRINTF sal_sprintf 78 #define PHYMOD_STRCAT sal_strcat 79 #define PHYMOD_STRNCAT sal_strncat 80 #define PHYMOD_STRCPY sal_strcpy 81 #define PHYMOD_STRNCPY sal_strncpy 82 #define PHYMOD_ATOI sal_atoi 83 #define PHYMOD_THREAD_CREATE sal_thread_create 84 #define PHYMOD_TIME_USECS sal_time_usecs 85 #define PHYMOD_SRAND sal_srand 86 #define PHYMOD_RAND sal_rand 87 #define PHYMOD_SPL sal_spl 88 #define PHYMOD_SPLHI sal_splhi 89 90 #ifdef __KERNEL__ 91 #define PHYMOD_STRTOUL simple_strtol 92 #else 93 #ifndef __int8_t_defined 94 #define __int8_t_defined 95 typedef signed char int8_t; 96 typedef signed short int int16_t; 97 typedef signed int int32_t; 98 #endif 99 typedef unsigned char uint8_t; 100 typedef unsigned short int uint16_t; 101 #ifndef __uint32_t_defined 102 typedef unsigned int uint32_t; 103 #endif 104 #define PHYMOD_STRTOUL sal_strtoul 105 #endif 106 107 #include <sal/appl/io.h> 108 #define PHYMOD_PRINTF sal_printf 109 110 /* Use SDK-versions of stdint types */ 111 #define PHYMOD_CONFIG_DEFINE_UINT8_T 0 112 #define uint8_t uint8 113 #define PHYMOD_CONFIG_DEFINE_UINT16_T 0 114 #define uint16_t uint16 115 #define PHYMOD_CONFIG_DEFINE_UINT32_T 0 116 #define uint32_t uint32 117 #define PHYMOD_CONFIG_DEFINE_UINT64_T 0 118 #define uint64_t uint64 119 120 #define PHYMOD_CONFIG_DEFINE_INT8_T 0 121 #define PHYMOD_CONFIG_DEFINE_INT16_T 0 122 #define PHYMOD_CONFIG_DEFINE_INT32_T 0 123 124 /* No need to define size_t */ 125 #define PHYMOD_CONFIG_DEFINE_SIZE_T 0 126 127 /* Allow floating point except for Linux kernel builds */ 128 #ifndef __KERNEL__ 129 #define PHYMOD_CONFIG_INCLUDE_FLOATING_POINT 1 130 #endif 131 132 /* Include register reset values in PHY symbol tables */ 133 #define PHYMOD_CONFIG_INCLUDE_RESET_VALUES 1 134 135 /* Match PHYMOD error code with shared error codes */ 136 #define PHYMOD_CONFIG_DEFINE_ERROR_CODES 0 137 138 typedef enum { 139 PHYMOD_E_NONE = _SHR_E_NONE, 140 PHYMOD_E_INTERNAL = _SHR_E_INTERNAL, 141 PHYMOD_E_MEMORY = _SHR_E_MEMORY, 142 PHYMOD_E_IO = _SHR_E_INTERNAL, 143 PHYMOD_E_PARAM = _SHR_E_PARAM, 144 PHYMOD_E_CORE = _SHR_E_PORT, 145 PHYMOD_E_PHY = _SHR_E_PORT, 146 PHYMOD_E_BUSY = _SHR_E_BUSY, 147 PHYMOD_E_FAIL = _SHR_E_FAIL, 148 PHYMOD_E_TIMEOUT = _SHR_E_TIMEOUT, 149 PHYMOD_E_RESOURCE = _SHR_E_RESOURCE, 150 PHYMOD_E_CONFIG = _SHR_E_CONFIG, 151 PHYMOD_E_UNAVAIL = _SHR_E_UNAVAIL, 152 PHYMOD_E_INIT = _SHR_E_INIT, 153 PHYMOD_E_EMPTY = _SHR_E_EMPTY, 154 PHYMOD_E_LIMIT = _SHR_E_LIMIT /* Must come last */ 155 } phymod_error_t; 156 157 #endif /* __PHYMOD_CUSTOM_CONFIG_H__ */