| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2006-2011, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bxvd_platform.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/67 $ |
|---|
| 12 | * $brcm_Date: 12/20/11 3:45p $ |
|---|
| 13 | * |
|---|
| 14 | * [File Description:] |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/portinginterface/xvd/7401/bxvd_platform.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/67 12/20/11 3:45p davidp |
|---|
| 21 | * SW7360-4: Add 7360 support. |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/66 12/5/11 2:55p davidp |
|---|
| 24 | * SW7435-8: Add support for 7435 platform. |
|---|
| 25 | * |
|---|
| 26 | * Hydra_Software_Devel/65 10/10/11 5:33p davidp |
|---|
| 27 | * SW7429-17: Add support for 7429 platform. |
|---|
| 28 | * |
|---|
| 29 | * Hydra_Software_Devel/64 4/4/11 4:39p davidp |
|---|
| 30 | * SW7425-284: Define XPT Rave Context info symbolic contants. |
|---|
| 31 | * |
|---|
| 32 | * Hydra_Software_Devel/63 3/21/11 1:53p davidp |
|---|
| 33 | * SWDTV-5972: Add support for 35233 platform. |
|---|
| 34 | * |
|---|
| 35 | * Hydra_Software_Devel/62 1/24/11 5:34p davidp |
|---|
| 36 | * SWBLURAY-23545: Add support for 7640 platform. |
|---|
| 37 | * |
|---|
| 38 | * Hydra_Software_Devel/61 12/17/10 9:30a davidp |
|---|
| 39 | * SW7552-11: Add 7552 platform. |
|---|
| 40 | * |
|---|
| 41 | * Hydra_Software_Devel/60 11/19/10 6:45p davidp |
|---|
| 42 | * SW7344-5: Add support for 7344 and 7346 platforms. |
|---|
| 43 | * |
|---|
| 44 | * Hydra_Software_Devel/59 11/15/10 2:50p davidp |
|---|
| 45 | * SW35125-20: Add XVD support for 35125. |
|---|
| 46 | * |
|---|
| 47 | * Hydra_Software_Devel/58 10/21/10 2:58p davidp |
|---|
| 48 | * SW7231-8: Add support for 7231 and 7135 platforms. |
|---|
| 49 | * |
|---|
| 50 | * Hydra_Software_Devel/57 10/20/10 1:32p davidp |
|---|
| 51 | * SW7425-16: Remove FGT support. |
|---|
| 52 | * |
|---|
| 53 | * Hydra_Software_Devel/56 9/10/10 3:17p davidp |
|---|
| 54 | * SW7358-11: Add support for AVD Rev K chips, 7358, 7422 and 7425. |
|---|
| 55 | * |
|---|
| 56 | * Hydra_Software_Devel/55 2/17/10 2:50p davidp |
|---|
| 57 | * SW7468-74: Add support for IP licensing, save chip product revision |
|---|
| 58 | * register address in xvd handle. |
|---|
| 59 | * |
|---|
| 60 | * Hydra_Software_Devel/54 11/16/09 6:33p davidp |
|---|
| 61 | * SW7468-14: Add support for 7468 and 7408 platforms. |
|---|
| 62 | * |
|---|
| 63 | * Hydra_Software_Devel/53 9/21/09 2:53p davidp |
|---|
| 64 | * SW35230-3: Add support for 35230 platform. |
|---|
| 65 | * |
|---|
| 66 | * Hydra_Software_Devel/52 8/31/09 8:43a davidp |
|---|
| 67 | * SW7630-31: Add support for 7630 platform. |
|---|
| 68 | * |
|---|
| 69 | * Hydra_Software_Devel/51 8/14/09 10:44a pblanco |
|---|
| 70 | * PR27168: Change UD offset to address conversion routine family |
|---|
| 71 | * prototype from void return type to BERR_Code return type. |
|---|
| 72 | * |
|---|
| 73 | * Hydra_Software_Devel/50 7/23/09 1:44p davidp |
|---|
| 74 | * PR55546: Add 7125 support to xvd. |
|---|
| 75 | * |
|---|
| 76 | * Hydra_Software_Devel/49 7/17/09 4:28p davidp |
|---|
| 77 | * PR55227: Add support for 7340 and 7342 support. |
|---|
| 78 | * |
|---|
| 79 | * Hydra_Software_Devel/48 6/4/09 4:05p davidp |
|---|
| 80 | * PR54107: Add support for 35130 platform, create Rev J platform family. |
|---|
| 81 | * |
|---|
| 82 | * Hydra_Software_Devel/47 4/3/09 5:40p davidp |
|---|
| 83 | * PR53571: Add initial 7635 support. |
|---|
| 84 | * |
|---|
| 85 | * Hydra_Software_Devel/46 1/30/09 1:15p davidp |
|---|
| 86 | * PR51623: Add support for 7336 chip. |
|---|
| 87 | * |
|---|
| 88 | * Hydra_Software_Devel/45 12/23/08 1:19p davidp |
|---|
| 89 | * PR50640: Add support for 7405 C0. |
|---|
| 90 | * |
|---|
| 91 | * Hydra_Software_Devel/44 10/15/08 5:17p davidp |
|---|
| 92 | * PR47748: Add support for 7420 platform |
|---|
| 93 | * |
|---|
| 94 | * Hydra_Software_Devel/43 8/6/08 12:36p davidp |
|---|
| 95 | * PR43585: Add 7601 platform specific support to XVD. |
|---|
| 96 | * |
|---|
| 97 | * Hydra_Software_Devel/42 3/7/08 10:38a nilesh |
|---|
| 98 | * PR40349: Update memory tables according to AVD Mosaic API doc v2.19 |
|---|
| 99 | * |
|---|
| 100 | * Hydra_Software_Devel/41 2/20/08 6:48p davidp |
|---|
| 101 | * PR39495: Add support for 3556, clone of 7405 using AVD core rev i0. |
|---|
| 102 | * |
|---|
| 103 | * Hydra_Software_Devel/40 2/13/08 5:05p nilesh |
|---|
| 104 | * PR39469: Update memory tables according to AVD Mosaic API doc v2.18 |
|---|
| 105 | * |
|---|
| 106 | * Hydra_Software_Devel/39 1/29/08 7:33p davidp |
|---|
| 107 | * PR39098: 3548 support uses AVD core rev i0 version. |
|---|
| 108 | * |
|---|
| 109 | * Hydra_Software_Devel/38 1/29/08 6:00p davidp |
|---|
| 110 | * PR39098: Remove unused register items from revE0 register structure. |
|---|
| 111 | * |
|---|
| 112 | * Hydra_Software_Devel/37 1/24/08 11:40a nilesh |
|---|
| 113 | * PR38570: Merge CABAC worklist API changes to mainline |
|---|
| 114 | * |
|---|
| 115 | * Hydra_Software_Devel/PR38570/1 1/21/08 5:11p nilesh |
|---|
| 116 | * PR38570: Added support for cabac worklist buffer and size parameter to |
|---|
| 117 | * AVD ChannelOpen |
|---|
| 118 | * |
|---|
| 119 | * Hydra_Software_Devel/36 11/28/07 4:39p pblanco |
|---|
| 120 | * PR36901: Clone 7325 from 7405. |
|---|
| 121 | * |
|---|
| 122 | * Hydra_Software_Devel/35 11/13/07 5:38p davidp |
|---|
| 123 | * PR36901: Add support for 97335, use BXVD_CHIP families, 97335 is same |
|---|
| 124 | * as 97405. |
|---|
| 125 | * |
|---|
| 126 | * Hydra_Software_Devel/34 11/13/07 3:09p nilesh |
|---|
| 127 | * PR36450: FW Image Load now uses inner offset as defined in firmware |
|---|
| 128 | * file instead of a hard coded value |
|---|
| 129 | * |
|---|
| 130 | * Hydra_Software_Devel/33 11/6/07 5:53p davidp |
|---|
| 131 | * PR27168: Remove use of BXVD_P_ChipEnable_RevE1 routine and associated |
|---|
| 132 | * data structure, use RevE0 |
|---|
| 133 | * |
|---|
| 134 | * Hydra_Software_Devel/32 11/6/07 2:20p davidp |
|---|
| 135 | * PR27168: Remove use of SETUP_HEAP macro and associated routines per |
|---|
| 136 | * code review |
|---|
| 137 | * |
|---|
| 138 | * Hydra_Software_Devel/31 9/28/07 12:23p nilesh |
|---|
| 139 | * PR27168: Consolidate constants to bxvd_platform.h and rename according |
|---|
| 140 | * to XVD conventions |
|---|
| 141 | * |
|---|
| 142 | * Hydra_Software_Devel/30 9/24/07 8:57a pblanco |
|---|
| 143 | * PR35020: Added 7325 platform case. |
|---|
| 144 | * |
|---|
| 145 | * Hydra_Software_Devel/29 8/13/07 4:08p nilesh |
|---|
| 146 | * PR29915: Multi-decode merge to mainline |
|---|
| 147 | * |
|---|
| 148 | * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/6 8/10/07 1:07p davidp |
|---|
| 149 | * PR29915: Remove unneeded validate macro, use correct parameter for |
|---|
| 150 | * validate_pdefsettings macro. |
|---|
| 151 | * |
|---|
| 152 | * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/5 7/10/07 7:40p nilesh |
|---|
| 153 | * PR29915: Cleaned up 7405 platform code |
|---|
| 154 | * |
|---|
| 155 | * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/4 7/3/07 12:08p nilesh |
|---|
| 156 | * PR29915: Added FGT support |
|---|
| 157 | * |
|---|
| 158 | * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/3 6/19/07 12:12p nilesh |
|---|
| 159 | * PR29915: Merge from mainline |
|---|
| 160 | * |
|---|
| 161 | * Hydra_Software_Devel/28 6/11/07 10:56a pblanco |
|---|
| 162 | * PR28215: Changed stripe width value constant to be the same as VDC enum |
|---|
| 163 | * value. |
|---|
| 164 | * |
|---|
| 165 | * Hydra_Software_Devel/27 5/15/07 1:20p pblanco |
|---|
| 166 | * PR28215: Added support for variable stripe width and multiple. |
|---|
| 167 | * |
|---|
| 168 | * Hydra_Software_Devel/26 5/14/07 11:30a nilesh |
|---|
| 169 | * PR30249: Merged UOD 2.x changes to mainline |
|---|
| 170 | * |
|---|
| 171 | * Hydra_Software_Devel/PR30249/1 5/10/07 2:09p nilesh |
|---|
| 172 | * PR30249: Added support for new stripe_multiple parameter in AVD Init |
|---|
| 173 | * |
|---|
| 174 | * Hydra_Software_Devel/25 4/24/07 1:44p nilesh |
|---|
| 175 | * PR22766: Added support for platform specific FGT buffer allocation |
|---|
| 176 | * |
|---|
| 177 | * Hydra_Software_Devel/24 4/19/07 10:01a pblanco |
|---|
| 178 | * PR27645: Added 7405 to platform list. |
|---|
| 179 | * |
|---|
| 180 | * Hydra_Software_Devel/23 2/27/07 3:16p pblanco |
|---|
| 181 | * PR22867: Changed core include to E1 for 7118 |
|---|
| 182 | * |
|---|
| 183 | * Hydra_Software_Devel/22 2/6/07 9:14a pblanco |
|---|
| 184 | * PR26188: 7400B0 code changes. |
|---|
| 185 | * |
|---|
| 186 | * Hydra_Software_Devel/21 11/17/06 4:05p davidp |
|---|
| 187 | * PR25671: Add 7403 platform support. |
|---|
| 188 | * |
|---|
| 189 | * Hydra_Software_Devel/20 10/19/06 2:56p nilesh |
|---|
| 190 | * PR23113: Enforced include order of bxvd.h and bxvd_platform.h to |
|---|
| 191 | * prevent incorrect #defines |
|---|
| 192 | * |
|---|
| 193 | * Hydra_Software_Devel/19 9/8/06 10:38a nilesh |
|---|
| 194 | * PR23113: Update to use core rev e1 |
|---|
| 195 | * |
|---|
| 196 | * Hydra_Software_Devel/18 8/21/06 3:20p nilesh |
|---|
| 197 | * PR22673: Fix for possible macro namespace conflicts |
|---|
| 198 | * |
|---|
| 199 | * Hydra_Software_Devel/17 8/9/06 12:53p nilesh |
|---|
| 200 | * PR23113: Added AVD rev E0 include file for 7440 |
|---|
| 201 | * |
|---|
| 202 | * Hydra_Software_Devel/16 8/9/06 11:26a nilesh |
|---|
| 203 | * PR22673: Added documentation about XVD code restructure |
|---|
| 204 | * |
|---|
| 205 | * Hydra_Software_Devel/15 8/9/06 11:17a nilesh |
|---|
| 206 | * PR23113: Add framework to support 7440 XVD |
|---|
| 207 | * |
|---|
| 208 | * Hydra_Software_Devel/14 8/7/06 11:47a nilesh |
|---|
| 209 | * PR22673: Renamed incorrect rev G to rev E0 |
|---|
| 210 | * |
|---|
| 211 | * Hydra_Software_Devel/13 8/1/06 5:58p davidp |
|---|
| 212 | * PR22673: Add verify watchdog fired platform routine. |
|---|
| 213 | * |
|---|
| 214 | * Hydra_Software_Devel/12 7/31/06 7:50p davidp |
|---|
| 215 | * PR22673: Add picture buffer address macros for chip specific use. |
|---|
| 216 | * |
|---|
| 217 | * Hydra_Software_Devel/11 7/27/06 8:14p davidp |
|---|
| 218 | * PR22673: Move chip specific send FW command code to platform files. |
|---|
| 219 | * |
|---|
| 220 | * Hydra_Software_Devel/10 7/26/06 4:50p davidp |
|---|
| 221 | * PR22673: Cleanup more platform specific code, add hHWMemHeap element in |
|---|
| 222 | * Xvd handle. |
|---|
| 223 | * |
|---|
| 224 | * Hydra_Software_Devel/9 7/24/06 10:58a davidp |
|---|
| 225 | * PR22673: Added SetupFWBuffer platform routines. |
|---|
| 226 | * |
|---|
| 227 | * Hydra_Software_Devel/8 7/21/06 12:02p pblanco |
|---|
| 228 | * PR22673: Fixed bug referencing the proper area for userdata memory. |
|---|
| 229 | * |
|---|
| 230 | * Hydra_Software_Devel/7 7/21/06 9:49a pblanco |
|---|
| 231 | * PR22673: Added userdata offset to address conversion code. |
|---|
| 232 | * |
|---|
| 233 | * Hydra_Software_Devel/6 7/20/06 6:33p davidp |
|---|
| 234 | * PR22673: Add init register pointers and mask platform routines. |
|---|
| 235 | * |
|---|
| 236 | * Hydra_Software_Devel/5 7/20/06 2:23p nilesh |
|---|
| 237 | * PR22673: Created BXVD_P_CONTEXT_PLATFORM macro to allow platform- |
|---|
| 238 | * specific fields in BXVD_P_Context struct |
|---|
| 239 | * |
|---|
| 240 | * Hydra_Software_Devel/4 7/19/06 11:49a pblanco |
|---|
| 241 | * PR22673: Fix code for 7400. |
|---|
| 242 | * |
|---|
| 243 | * Hydra_Software_Devel/3 7/19/06 11:23a pblanco |
|---|
| 244 | * PR22673: Added the remainder of bxvd_priv.c conditionalized code to |
|---|
| 245 | * platform and core modules. |
|---|
| 246 | * |
|---|
| 247 | * Hydra_Software_Devel/2 7/18/06 3:30p pblanco |
|---|
| 248 | * PR22673: Moved FW load to platform appropriate modules for 7400, 7401 |
|---|
| 249 | * and 7118. |
|---|
| 250 | * |
|---|
| 251 | * Hydra_Software_Devel/1 7/18/06 12:10a nilesh |
|---|
| 252 | * PR22673: Code restructure for 97400, 97401 B0, and 97118 |
|---|
| 253 | * |
|---|
| 254 | * Hydra_Software_Devel/PR22673/1 7/17/06 2:19p nilesh |
|---|
| 255 | * PR22673: Code Restructure |
|---|
| 256 | * |
|---|
| 257 | ***************************************************************************/ |
|---|
| 258 | |
|---|
| 259 | /*************************************************************************** |
|---|
| 260 | XVD Code Stucture |
|---|
| 261 | |
|---|
| 262 | Overview |
|---|
| 263 | -------- |
|---|
| 264 | |
|---|
| 265 | XVD was restructured in July/Aug 2006 (See PR22673) to better support |
|---|
| 266 | multiple chips and revisions using the same code base. Prior to the |
|---|
| 267 | restructure, the code was littered with chip/revision #ifdefs that |
|---|
| 268 | made the code difficult to understand and maintain. |
|---|
| 269 | |
|---|
| 270 | The restructure goals, though all very important, were prioritized as |
|---|
| 271 | follows: |
|---|
| 272 | |
|---|
| 273 | 1) Readability - the code flow/logic should be easily readable to |
|---|
| 274 | someone who is looking at the code for the first time. We wanted |
|---|
| 275 | to split the "what" from the "how". i.e. We wanted the |
|---|
| 276 | high-level functionality to be apparent by hiding the details of |
|---|
| 277 | the actual implementation. |
|---|
| 278 | |
|---|
| 279 | 2) Debuggability - We wanted to minimize the impact on run-time |
|---|
| 280 | debugging using tools like gdb. e.g. it should be possible to |
|---|
| 281 | know exactly which function implementation is being executed by |
|---|
| 282 | looking at the function call trace. The function names should |
|---|
| 283 | not be ambigious. |
|---|
| 284 | |
|---|
| 285 | 3) Maintainability - often times, the chip families share 90%+ of |
|---|
| 286 | the code. There are subtle differences in things such as |
|---|
| 287 | register names or init values. We wanted an simple mechanism to |
|---|
| 288 | share code among chip families and revisions. |
|---|
| 289 | |
|---|
| 290 | 4) Modularity - multiple chips may need to be supported in parallel |
|---|
| 291 | by different developers. We wanted to minimize the possibility |
|---|
| 292 | of changes in one chip affecting another. Unfortunately, this |
|---|
| 293 | goal is somewhat converse of the previous goal. |
|---|
| 294 | |
|---|
| 295 | Approach |
|---|
| 296 | -------- |
|---|
| 297 | |
|---|
| 298 | The XVD implementation was categorized as either common XVD code, |
|---|
| 299 | platform specific code, or code specific to a AVD decoder core. The |
|---|
| 300 | bulk of the code is common to all XVD decoders and platforms, and |
|---|
| 301 | forms the main line. Platform and core code is broken out into |
|---|
| 302 | functions and macros which implement the specific requirements of the |
|---|
| 303 | respective hardware. |
|---|
| 304 | |
|---|
| 305 | |
|---|
| 306 | Definitions |
|---|
| 307 | ----------- |
|---|
| 308 | |
|---|
| 309 | common code: non-platform specific XVD code. Uses macros to call |
|---|
| 310 | the chip-specific implementations. |
|---|
| 311 | |
|---|
| 312 | top-level platform header: bxvd_platform.h. Included by the common |
|---|
| 313 | code. Defines the function prototypes and |
|---|
| 314 | ensures all required chip-specific |
|---|
| 315 | definitions have been made. Includes the |
|---|
| 316 | appropriate platform and chip specific |
|---|
| 317 | platform headers based on the value of |
|---|
| 318 | BCHP_CHIP. |
|---|
| 319 | |
|---|
| 320 | chip-specific platform header: bxvd_platform_xxxx.h (where xxxx is |
|---|
| 321 | the chip, e.g. 7401). This file is |
|---|
| 322 | never included directly by the common |
|---|
| 323 | code. It defines all the required |
|---|
| 324 | macros. |
|---|
| 325 | |
|---|
| 326 | core-specific platform header: bxvd_core_xxxx.h (where xxxx is the |
|---|
| 327 | core, e.g. avd_reve0). Defines |
|---|
| 328 | core-specific macros. |
|---|
| 329 | |
|---|
| 330 | |
|---|
| 331 | Implementation |
|---|
| 332 | -------------- |
|---|
| 333 | |
|---|
| 334 | The chip-specific implementations were abstracted out of the main XVD |
|---|
| 335 | code and moved to chip-specific files using function macros. e.g., |
|---|
| 336 | the old interrupt setup code (100+ lines) in BXVD_Open() was replaced |
|---|
| 337 | with the following 1 line macro: |
|---|
| 338 | |
|---|
| 339 | rc = BXVD_P_SETUP_INTERRUPTS(pXvd); |
|---|
| 340 | |
|---|
| 341 | The chip-specific platform header needs *3* different definitions in |
|---|
| 342 | order for the function abstraction to work. (We will use 7401B0, for |
|---|
| 343 | the examples below): |
|---|
| 344 | |
|---|
| 345 | 1) The macro itself needs to be defined to specify which |
|---|
| 346 | implementation to call: (in bxvd_platform_7401.h) |
|---|
| 347 | |
|---|
| 348 | #define BXVD_P_SETUP_INTERRUPTS BXVD_P_SetupInterrupts_7401B0 |
|---|
| 349 | |
|---|
| 350 | |
|---|
| 351 | 2) The implementation needs to be conditionally compiled in. (For |
|---|
| 352 | any platform, all source files are included as part of the build |
|---|
| 353 | to enable sharing of code between platforms). The header needs to |
|---|
| 354 | enable a particular version to be compiled in: (in |
|---|
| 355 | bxvd_platform_7401.h) |
|---|
| 356 | |
|---|
| 357 | #define USE_SETUP_INTERRUPTS_7401B0 1 |
|---|
| 358 | |
|---|
| 359 | The corresponding implementation is conditionally wrapped around |
|---|
| 360 | this define: (in bxvd_platform_7401.c) |
|---|
| 361 | |
|---|
| 362 | #if USE_SETUP_INTERRUPTS_7401B0 |
|---|
| 363 | BERR_Code BXVD_P_SetupInterrupts_7401B0( BXVD_Handle hXvd) |
|---|
| 364 | { |
|---|
| 365 | ... |
|---|
| 366 | } |
|---|
| 367 | #endif |
|---|
| 368 | |
|---|
| 369 | |
|---|
| 370 | 3) In order for the common code to compile without "missing |
|---|
| 371 | prototype" warnings, the function prototype for the specific |
|---|
| 372 | implementation needs to be declared: (in bxvd_platform_7401.h) |
|---|
| 373 | |
|---|
| 374 | SETUP_INTERRUPTS_PROTOTYPE(7401B0); |
|---|
| 375 | |
|---|
| 376 | To enforce prototype consistency amongst various platforms, the |
|---|
| 377 | prototype declaration in the chip-specific header is done via a |
|---|
| 378 | macro that is defined in the top-level platform header: (in |
|---|
| 379 | bxvd_platform.h) |
|---|
| 380 | |
|---|
| 381 | #define SETUP_INTERRUPTS_PROTOTYPE(family) \ |
|---|
| 382 | BERR_Code BXVD_P_SetupInterrupts_##family \ |
|---|
| 383 | ( \ |
|---|
| 384 | BXVD_Handle hXvd \ |
|---|
| 385 | ) |
|---|
| 386 | |
|---|
| 387 | |
|---|
| 388 | The top-level header also verifies that the required definitions have |
|---|
| 389 | been declared by the chip-specific header: (in bxvd_platform.h) |
|---|
| 390 | |
|---|
| 391 | #ifndef BXVD_P_SETUP_INTERRUPTS |
|---|
| 392 | #error BXVD_P_SETUP_INTERRUPTS is undefined! |
|---|
| 393 | #endif |
|---|
| 394 | |
|---|
| 395 | ***************************************************************************/ |
|---|
| 396 | |
|---|
| 397 | #include "bxvd.h" |
|---|
| 398 | |
|---|
| 399 | #include "bstd.h" |
|---|
| 400 | #include "bchp.h" |
|---|
| 401 | |
|---|
| 402 | #ifndef _BXVD_PLATFORM_H_ |
|---|
| 403 | #define _BXVD_PLATFORM_H_ |
|---|
| 404 | |
|---|
| 405 | #include "bxvd_userdata.h" |
|---|
| 406 | |
|---|
| 407 | /* prototype definition macros */ |
|---|
| 408 | #define BXVD_P_SETUP_INTERRUPTS_PROTOTYPE(family) \ |
|---|
| 409 | BERR_Code BXVD_P_SetupInterrupts_##family \ |
|---|
| 410 | ( \ |
|---|
| 411 | BXVD_Handle hXvd \ |
|---|
| 412 | ) |
|---|
| 413 | |
|---|
| 414 | #define BXVD_P_SETUP_WATCHDOG_PROTOTYPE(family) \ |
|---|
| 415 | BERR_Code BXVD_P_SetupWatchdog_##family \ |
|---|
| 416 | ( \ |
|---|
| 417 | BXVD_Handle hXvd \ |
|---|
| 418 | ) |
|---|
| 419 | |
|---|
| 420 | #define BXVD_P_FW_LOAD_PROTOTYPE(family) \ |
|---|
| 421 | BERR_Code BXVD_P_FWLoad_##family \ |
|---|
| 422 | ( \ |
|---|
| 423 | BXVD_Handle hXvd, \ |
|---|
| 424 | uint32_t uiDecoderInstance \ |
|---|
| 425 | ) |
|---|
| 426 | |
|---|
| 427 | #define BXVD_P_CHIP_ENABLE_PROTOTYPE(family) \ |
|---|
| 428 | BERR_Code BXVD_P_ChipEnable_##family \ |
|---|
| 429 | ( \ |
|---|
| 430 | BXVD_Handle hXvd \ |
|---|
| 431 | ) |
|---|
| 432 | |
|---|
| 433 | #define BXVD_P_CHIP_RESET_PROTOTYPE(family) \ |
|---|
| 434 | BERR_Code BXVD_P_ChipReset_##family \ |
|---|
| 435 | ( \ |
|---|
| 436 | BXVD_Handle hXvd \ |
|---|
| 437 | ) |
|---|
| 438 | |
|---|
| 439 | #define BXVD_P_INIT_REG_PTRS_PROTOTYPE(family) \ |
|---|
| 440 | void BXVD_P_InitRegPtrs_##family \ |
|---|
| 441 | ( \ |
|---|
| 442 | BXVD_Handle hXvd \ |
|---|
| 443 | ) |
|---|
| 444 | |
|---|
| 445 | #define BXVD_P_SETUP_FW_MEMORY_PROTOTYPE(family) \ |
|---|
| 446 | BERR_Code BXVD_P_SetupFWMemory_##family \ |
|---|
| 447 | ( \ |
|---|
| 448 | BXVD_Handle hXvd \ |
|---|
| 449 | ) |
|---|
| 450 | |
|---|
| 451 | #define BXVD_P_TEAR_DOWN_FW_MEMORY_PROTOTYPE(family) \ |
|---|
| 452 | BERR_Code BXVD_P_TearDownFWMemory_##family \ |
|---|
| 453 | ( \ |
|---|
| 454 | BXVD_Handle hXvd \ |
|---|
| 455 | ) |
|---|
| 456 | |
|---|
| 457 | #define BXVD_P_VERIFY_WATCHDOG_FIRED_PROTOTYPE(family) \ |
|---|
| 458 | bool BXVD_P_VerifyWatchdogFired_##family \ |
|---|
| 459 | ( \ |
|---|
| 460 | BXVD_Handle hXvd, \ |
|---|
| 461 | int param2 \ |
|---|
| 462 | ) |
|---|
| 463 | |
|---|
| 464 | #define BXVD_P_CONVERT_UD_OFF2ADDR_PROTOTYPE(family) \ |
|---|
| 465 | BERR_Code BXVD_P_ConvertUDOff2Addr_##family \ |
|---|
| 466 | ( \ |
|---|
| 467 | BXVD_Userdata_Handle hUserData, \ |
|---|
| 468 | unsigned long fwUserDataAddr, \ |
|---|
| 469 | unsigned long *pulUserDataAddr \ |
|---|
| 470 | ) |
|---|
| 471 | |
|---|
| 472 | #if ((BCHP_CHIP == 7405) && ((BCHP_VER == BCHP_VER_A0) || (BCHP_VER == BCHP_VER_A1))) || \ |
|---|
| 473 | (BCHP_CHIP == 7335) || \ |
|---|
| 474 | (BCHP_CHIP == 7325) |
|---|
| 475 | |
|---|
| 476 | /* 7405 A0 rev H core */ |
|---|
| 477 | #define BXVD_CHIP 740510 |
|---|
| 478 | |
|---|
| 479 | #elif ((BCHP_CHIP == 7405) && (BCHP_VER >= BCHP_VER_B0)) || \ |
|---|
| 480 | (BCHP_CHIP == 3548) || \ |
|---|
| 481 | (BCHP_CHIP == 3556) || \ |
|---|
| 482 | (BCHP_CHIP == 7336) || \ |
|---|
| 483 | (BCHP_CHIP == 7340) || \ |
|---|
| 484 | (BCHP_CHIP == 7342) || \ |
|---|
| 485 | (BCHP_CHIP == 7125) || \ |
|---|
| 486 | (BCHP_CHIP == 7408) || \ |
|---|
| 487 | (BCHP_CHIP == 7468) |
|---|
| 488 | |
|---|
| 489 | /* 7405 B0 rev I core */ |
|---|
| 490 | #define BXVD_CHIP 740520 |
|---|
| 491 | |
|---|
| 492 | #elif (BCHP_CHIP == 35230) || \ |
|---|
| 493 | (BCHP_CHIP == 7550) || \ |
|---|
| 494 | (BCHP_CHIP == 7630) || \ |
|---|
| 495 | (BCHP_CHIP == 35125) |
|---|
| 496 | |
|---|
| 497 | /* Rev J core */ |
|---|
| 498 | #define BXVD_CHIP 'J' |
|---|
| 499 | |
|---|
| 500 | #elif (BCHP_CHIP == 7135) || \ |
|---|
| 501 | (BCHP_CHIP == 7231) || \ |
|---|
| 502 | (BCHP_CHIP == 7344) || \ |
|---|
| 503 | (BCHP_CHIP == 7346) || \ |
|---|
| 504 | (BCHP_CHIP == 7358) || \ |
|---|
| 505 | (BCHP_CHIP == 7360) || \ |
|---|
| 506 | (BCHP_CHIP == 7422) || \ |
|---|
| 507 | (BCHP_CHIP == 7425) || \ |
|---|
| 508 | (BCHP_CHIP == 7429) || \ |
|---|
| 509 | (BCHP_CHIP == 7435) || \ |
|---|
| 510 | (BCHP_CHIP == 7552) || \ |
|---|
| 511 | (BCHP_CHIP == 7640) || \ |
|---|
| 512 | (BCHP_CHIP == 35233) |
|---|
| 513 | /* Rev K core */ |
|---|
| 514 | #define BXVD_CHIP 'K' |
|---|
| 515 | |
|---|
| 516 | #else |
|---|
| 517 | #define BXVD_CHIP BCHP_CHIP |
|---|
| 518 | #endif |
|---|
| 519 | |
|---|
| 520 | /* chip specific includes */ |
|---|
| 521 | #if (BXVD_CHIP == 7401) |
|---|
| 522 | #include "bxvd_core_avd_reve0.h" |
|---|
| 523 | #include "bxvd_platform_7401.h" |
|---|
| 524 | #elif (BXVD_CHIP == 7403) |
|---|
| 525 | #include "bxvd_core_avd_reve0.h" |
|---|
| 526 | #include "bxvd_platform_7403.h" |
|---|
| 527 | #elif (BXVD_CHIP == 7118) |
|---|
| 528 | #include "bxvd_core_avd_reve0.h" |
|---|
| 529 | #include "bxvd_platform_7118.h" |
|---|
| 530 | #elif (BXVD_CHIP == 7400) |
|---|
| 531 | #include "bxvd_core_avd_reve0.h" |
|---|
| 532 | #include "bxvd_platform_7400.h" |
|---|
| 533 | #elif (BXVD_CHIP == 7440) |
|---|
| 534 | #include "bxvd_core_avd_reve0.h" |
|---|
| 535 | #include "bxvd_platform_7440.h" |
|---|
| 536 | #elif (BXVD_CHIP == 740510) |
|---|
| 537 | #include "bxvd_core_avd_revh0.h" |
|---|
| 538 | #include "bxvd_platform_7405.h" |
|---|
| 539 | #elif (BXVD_CHIP == 740520) |
|---|
| 540 | #include "bxvd_core_avd_revi0.h" |
|---|
| 541 | #include "bxvd_platform_7405.h" |
|---|
| 542 | #elif (BXVD_CHIP == 7601) |
|---|
| 543 | #include "bxvd_core_avd_reve0.h" |
|---|
| 544 | #include "bxvd_platform_7601.h" |
|---|
| 545 | #elif (BXVD_CHIP == 7635) |
|---|
| 546 | #include "bxvd_core_avd_reve0.h" |
|---|
| 547 | #include "bxvd_platform_7601.h" |
|---|
| 548 | #elif (BXVD_CHIP == 7420) |
|---|
| 549 | #include "bxvd_core_avd_revi0.h" |
|---|
| 550 | #include "bxvd_platform_7420.h" |
|---|
| 551 | #elif (BXVD_CHIP == 'J') |
|---|
| 552 | #include "bxvd_core_avd_revj0.h" |
|---|
| 553 | #include "bxvd_platform_revj0.h" |
|---|
| 554 | #elif (BXVD_CHIP == 'K') |
|---|
| 555 | #include "bxvd_core_avd_revk0.h" |
|---|
| 556 | #include "bxvd_platform_revk0.h" |
|---|
| 557 | #else |
|---|
| 558 | #error Unsupported BCHP_CHIP version! |
|---|
| 559 | #endif |
|---|
| 560 | |
|---|
| 561 | /* make sure the required definitions exist */ |
|---|
| 562 | #ifndef BXVD_P_SETUP_INTERRUPTS |
|---|
| 563 | #error BXVD_P_SETUP_INTERRUPTS is undefined! |
|---|
| 564 | #endif |
|---|
| 565 | |
|---|
| 566 | #ifndef BXVD_P_SETUP_WATCHDOG |
|---|
| 567 | #error BXVD_P_SETUP_WATCHDOG is undefined! |
|---|
| 568 | #endif |
|---|
| 569 | |
|---|
| 570 | #ifndef BXVD_P_SETUP_FW_MEMORY |
|---|
| 571 | #error BXVD_P_SETUP_FW_MEMORY is undefined! |
|---|
| 572 | #endif |
|---|
| 573 | |
|---|
| 574 | #ifndef BXVD_P_TEAR_DOWN_FW_MEMORY |
|---|
| 575 | #error BXVD_P_TEAR_DOWN_FW_MEMORY is undefined! |
|---|
| 576 | #endif |
|---|
| 577 | |
|---|
| 578 | #ifndef BXVD_P_FW_LOAD |
|---|
| 579 | #error BXVD_P_FW_LOAD is undefined! |
|---|
| 580 | #endif |
|---|
| 581 | |
|---|
| 582 | #ifndef BXVD_P_CHIP_ENABLE |
|---|
| 583 | #error BXVD_P_CHIP_ENABLE is undefined! |
|---|
| 584 | #endif |
|---|
| 585 | |
|---|
| 586 | #ifndef BXVD_P_RESET_CHIP |
|---|
| 587 | #error BXVD_P_RESET_CHIP is undefined! |
|---|
| 588 | #endif |
|---|
| 589 | |
|---|
| 590 | #ifndef BXVD_P_INIT_REG_PTRS |
|---|
| 591 | #error BXVD_P_INIT_REG_PTRS is undefined! |
|---|
| 592 | #endif |
|---|
| 593 | |
|---|
| 594 | #ifndef BXVD_P_CONVERT_UD_OFF2ADDR |
|---|
| 595 | #error BXVD_P_CONVERT_UD_OFF2ADDR is undefined! |
|---|
| 596 | #endif |
|---|
| 597 | |
|---|
| 598 | #ifndef BXVD_P_WRITE_FWCMD_TO_MBX |
|---|
| 599 | #error BXVD_P_WRITE_FWCMD_TO_MBX is undefined! |
|---|
| 600 | #endif |
|---|
| 601 | |
|---|
| 602 | #ifndef BXVD_P_WRITE_FWRSP_MBX |
|---|
| 603 | #error BXVD_P_WRITE_FWRSP_MBX is indefined! |
|---|
| 604 | #endif |
|---|
| 605 | |
|---|
| 606 | #ifndef BXVD_P_VERIFY_WATCHDOG_FIRED |
|---|
| 607 | #error BXVD_P_VERIFY_WATCHDOG_FIRED is undefined! |
|---|
| 608 | #endif |
|---|
| 609 | |
|---|
| 610 | #ifndef BXVD_P_VALIDATE_PDEFSETTINGS |
|---|
| 611 | #define BXVD_P_VALIDATE_PDEFSETTINGS(pDefSettings) pDefSettings = pDefSettings |
|---|
| 612 | #endif |
|---|
| 613 | |
|---|
| 614 | #ifndef BXVD_P_CONTEXT_PLATFORM |
|---|
| 615 | /* BXVD_P_Context_Platform can be overridden to define platform |
|---|
| 616 | * specific variables in the BXVD_P_Context structure. */ |
|---|
| 617 | #define BXVD_P_CONTEXT_PLATFORM |
|---|
| 618 | #endif |
|---|
| 619 | |
|---|
| 620 | #ifndef BXVD_P_AVD_INIT_STRIPE_MULTIPLE |
|---|
| 621 | /* BXVD_P_AVD_INIT_STRIPE_MULTIPLE can be overridden to specify a |
|---|
| 622 | * different stripe multiple */ |
|---|
| 623 | #define BXVD_P_AVD_INIT_STRIPE_MULTIPLE 0 |
|---|
| 624 | #endif |
|---|
| 625 | |
|---|
| 626 | #ifndef BXVD_P_AVD_INIT_STRIPE_WIDTH |
|---|
| 627 | /* BXVD_P_AVD_INIT_STRIPE_WIDTH can be overridden to specify a |
|---|
| 628 | * different stripe multiple */ |
|---|
| 629 | #define BXVD_P_AVD_INIT_STRIPE_WIDTH 0 |
|---|
| 630 | #endif |
|---|
| 631 | |
|---|
| 632 | #ifndef BXVD_P_AVD_CORE_BAUD_RATE |
|---|
| 633 | /* BXVD_P_AVD_CORE_BAUD_RATE can be overridden to specify a different |
|---|
| 634 | * baud rate */ |
|---|
| 635 | #define BXVD_P_AVD_CORE_BAUD_RATE 115200 /* OL & IL UART baud rate */ |
|---|
| 636 | #endif |
|---|
| 637 | |
|---|
| 638 | #ifndef BXVD_P_AVD_CORE_UART_FREQ |
|---|
| 639 | /* BXVD_P_AVD_CORE_UART_FREQ can be overridden to specify a different |
|---|
| 640 | * frequency */ |
|---|
| 641 | #define BXVD_P_AVD_CORE_UART_FREQ (200*1000000) /* UART clock frequency */ |
|---|
| 642 | #endif |
|---|
| 643 | |
|---|
| 644 | #ifndef BXVD_P_WATCHDOG_TIMEOUT |
|---|
| 645 | /* BXVD_P_WATCHDOG_TIMEOUT can be overridden to specify a different |
|---|
| 646 | * watchdog timeout value */ |
|---|
| 647 | #define BXVD_P_WATCHDOG_TIMEOUT 0x0bebc200 |
|---|
| 648 | #endif |
|---|
| 649 | |
|---|
| 650 | #ifndef BXVD_P_FW_IMAGE_SIZE |
|---|
| 651 | /* BXVD_P_FW_IMAGE_SIZE can be overridden to specify a different |
|---|
| 652 | * firmware image size */ |
|---|
| 653 | #define BXVD_P_FW_IMAGE_SIZE 0x100000 |
|---|
| 654 | #endif |
|---|
| 655 | |
|---|
| 656 | #ifndef BXVD_P_CHIP_PRODUCT_REVISION |
|---|
| 657 | /* BXVD_P_AVD_CHIP_PROD_REVISION can be overridden to specify a |
|---|
| 658 | * platform specific value */ |
|---|
| 659 | #define BXVD_P_CHIP_PRODUCT_REVISION BCHP_SUN_TOP_CTRL_PROD_REVISION |
|---|
| 660 | #endif |
|---|
| 661 | |
|---|
| 662 | #ifndef BXVD_P_RAVE_CONTEXT_SIZE |
|---|
| 663 | /* BXVD_P_RAVE_XXXX register info can be overridden to specify a |
|---|
| 664 | * platform specific value */ |
|---|
| 665 | #define BXVD_P_RAVE_CONTEXT_SIZE 0 |
|---|
| 666 | #define BXVD_P_RAVE_CX_HOLD_CLR_STATUS 0 |
|---|
| 667 | #define BXVD_P_RAVE_PACKET_COUNT 0 |
|---|
| 668 | #endif |
|---|
| 669 | |
|---|
| 670 | #endif /* _BXVD_PLATFORM_H_ */ |
|---|