1 /*
2 *
3 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
4 *
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the
16 * distribution.
17 *
18 * Neither the name of Texas Instruments Incorporated nor the names of
19 * its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 */
38 #ifndef BTBLWRAP_H
39 #define BTBLWRAP_H
40 /********************************************************************************
41 * FILE PURPOSE: Define the IBL wrapper for the TI boot table processor
42 ********************************************************************************
43 * FILE NAM:E btblwrap.h
44 *
45 * DESCRIPTION: Definitions required for the IBL wrapper of the TI boot table
46 * processor
47 *
48 ********************************************************************************/
50 /* chipStartCore does nothing, since multiple core start is not supported */
51 #define chipStartCore(x,y,z)
53 /* A minimal boot stats structure */
54 typedef struct bootTblStats_s {
56 UINT32 num_sections;
57 UINT32 num_pdma_copies;
59 } bootTblStats_t;
62 typedef struct bootStats_s {
64 bootTblStats_t btbl;
66 } bootStats_t;
68 extern bootStats_t bootStats;
70 /****************************************************************************
71 * Definition: The c64x boot table tools will always pad boot table
72 * entries to 32 bit elements. The boot table works in 16 bit
73 * element sizes. If the size is not an even number of 16 bit
74 * elements, add one word of padding.
75 ****************************************************************************/
76 #define chipAddBtblUint16Pad(x) (((x)+1) & 0xfffffffe)
78 /* Return values */
79 #define CORE_NOERR 0
81 /* Module number */
82 #define BOOT_MODULE_ID_CHIP 0
83 #define BOOT_MODULE_ID_BTBL 1
85 /* Error code creation */
86 #define BOOT_ERROR_CODE(modnum,errnum) (((modnum) << 16) | (errnum))
88 /* Fatal error handling */
89 #define BOOT_EXCEPTION btblBootException
91 /* Macros */
92 #define CHIP_UINT16_TO_BYTES(x) ((x) << 1)
93 #define CHIP_BYTES_TO_UINT16(x) (((x) + 1) >> 1)
96 /* No interblock processing required */
97 #define chipBtblBlockDone()
99 /* No tracing dummy function */
100 #define chipDummy(x)
103 /* gem.c prototypes */
104 UINT16 coreCopyData (UINT32 dest_addr, UINT16 *p_data, UINT32 sizeBytes, UINT16 start_vector);
106 /* btblwrap.c prototypes */
107 void btblBootException (UINT32 ecode);
109 /* The block size allocated through malloc. Chosen to match the value defined
110 * for the coff loader. malloc is used so the same heap section can be used. */
111 #define TI_BTBL_BLOCK_SIZE 0x4000
113 /* Read/Write 32bit values */
114 #define chipStoreWord(x,y) *(x) = (y)
115 #define chipReadWord(x) *(x)
117 /* Boot table wrapper error codes */
118 #define BTBL_WRAP_ECODE_MALLOC_FAIL 100
119 #define BTBL_WRAP_ECODE_READ_FAIL 101
120 #define BTBL_WRAP_ECODE_BTBL_FAIL 102
123 #endif /* BTBLWRAP_H */