[processor-sdk/pdk.git] / packages / ti / drv / pa / example / emacExample / src / armv7 / linux / fw_test.h
1 /**
2 * @file fw_test.h
3 *
4 * @brief
5 * Holds all the constants and API definitions required by the example
6 * application to run.
7 *
8 * \par
9 * ============================================================================
10 * @n (C) Copyright 2012-2013, Texas Instruments, Inc.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 *
16 * Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 *
19 * Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the
22 * distribution.
23 *
24 * Neither the name of Texas Instruments Incorporated nor the names of
25 * its contributors may be used to endorse or promote products derived
26 * from this software without specific prior written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 */
41 #ifndef _FW_TEST_H_
42 #define _FW_TEST_H_
44 /* C Standard library Include */
45 #include <stdio.h>
46 /* System level header files */
47 #include <stdint.h>
48 #include <stdlib.h>
50 #include <sys/types.h>
51 #include <string.h>
52 #include <ti/drv/pa/pa.h>
54 /* CPPI LLD include */
55 #include <ti/drv/cppi/cppi_drv.h>
56 #include <ti/drv/cppi/cppi_desc.h>
58 /* QMSS LLD include */
59 #include <ti/drv/qmss/qmss_drv.h>
62 #define System_printf printf
63 extern void System_flush(void);
65 /* OSAL functions */
66 void fw_osalInit(void);
67 void fw_osalshutdown(void);
68 void Osal_fwCsEnter (uint32_t *key);
69 void Osal_fwCsExit (uint32_t key);
71 /*
72 * Shut off: remark #880-D: parameter "descType" was never referenced
73 *
74 * This is better than removing the argument since removal would break
75 * backwards compatibility
76 */
77 #ifdef _TMS320C6X
78 #elif defined(__GNUC__)
79 /* Same for GCC:
80 * warning: unused parameter descType [-Wunused-parameter]
81 */
82 #pragma GCC diagnostic push
83 #pragma GCC diagnostic ignored "-Wmissing-braces"
84 #pragma GCC diagnostic ignored "-Wunused-function"
85 #endif
88 typedef uint16_t fw_Bool_t;
89 #define fw_TRUE 1
90 #define fw_FALSE 0
92 /* Total Permanent memory required in Example
93 * for Packet buffers & descriptor buffers
94 * Allocating entire MSMC
95 */
96 #define MSMC_TEST_PERM_MEM_SZ (2*1024*1024)
98 /* Physical address map & size for various subsystems */
99 #define QMSS_CFG_BASE_ADDR CSL_QMSS_CFG_BASE
100 #define QMSS_CFG_BLK_SZ (0x00200000)
101 #define QMSS_DATA_BASE_ADDR CSL_QMSS_DATA_BASE
102 #define QMSS_DATA_BLK_SZ (0x00100000)
103 #define SRIO_CFG_BASE_ADDR CSL_SRIO_CFG_REGS
104 #define SRIO_CFG_BLK_SZ (132*1024)
105 #define PASS_CFG_BASE_ADDR CSL_NETCP_CFG_REGS
106 #define PASS_CFG_BLK_SZ (16*1024*1024)
107 #define MSMC_SRAM_BASE_ADDR CSL_MSMC_SRAM_REGS
109 /* Global variables to hold virtual address of various subsystems */
110 void *fw_qmssCfgVaddr;
111 void *fw_qmssDataVaddr;
112 void *fw_srioCfgVaddr;
113 void *fw_passCfgVaddr;
116 /** Enable Extended Debug with printfs */
117 //#define EXT_DEBUG 1
119 /* Invalidate cache. This should invalidate Cache
120 * Wait until operation is complete. Currently stub function
121 */
122 #define SYS_CACHE_INV(addr, size, code) Osal_invalidateCache(addr,size)
124 /* Writeback L2 cache. This should Writeback L1D as well.
125 * Wait until operation is complete. Currently stub function
126 */
127 #define SYS_CACHE_WB(addr, size, code) Osal_writeBackCache(addr,size)
129 /* GCC align attribute */
130 #define ALIGN(x) __attribute__((aligned (x)))
132 #endif