]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/ibl.git/blob - src/util/romparse/romparse.h
Build: update setupenvLnx.sh to do error checking
[keystone-rtos/ibl.git] / src / util / romparse / romparse.h
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 _ROMPARSE_H
39 #define _ROMPARSE_H
40 /*************************************************************************************
41  * FILE PURPOSE: Define boot data structures
42  *************************************************************************************
43  * FILE NAME: romparse.h
44  *
45  * DESCRIPTION: Defines the structures used to create the boot parameter
46  *                              table
47  *
48  *************************************************************************************/
49  
50 /* tiboot.h defines the boot parameters structure that will be created */
51 #if defined(c6472)
52  #include "tiboot_c6472.h"
53 #elif defined(c6474) || defined(c6474l)
54  #include "tiboot_c6474.h"
55 #elif defined(c6455)
56  #include "tiboot_c6455.h"
57 #elif defined(c6457)
58  #include "tiboot_c6457.h"
59 #elif defined(c66x)
60  #include "tiboot_c66x.h"
61 #else
62  #error invalid or missing device specification
63 #endif
65 /* Define the number of boot parameter tables that will be put on the rom */
66 #define NUM_BOOT_PARAM_TABLES   8
68 /* Define the size reserved for the PCI configuration table */
69 #define PCI_EEAI_PARAM_SIZE    0x20
71 /* Define a structure mapping the boot parameter table number to a program file
72  * to an eeprom byte address */
73 #define MAX_FNAME_LEN        132
74 #define MAX_DATA_LEN_32bit   32768
75 typedef struct {
76   char fname[MAX_FNAME_LEN];
77   int  sizeBytes;
78   unsigned int  addressBytes;
79   unsigned int data[MAX_DATA_LEN_32bit];
80   int  tag[NUM_BOOT_PARAM_TABLES];          /* identifies boot parameter tables which use this file */
81   int  align;                               /* alignment requirements for the file */
82 } progFile_t;
84 /* Define the PCI parameter structure */
85 #define PCI_DATA_LEN_32bit  8
86 typedef struct {
87   char fname[MAX_FNAME_LEN];
88   int sizeBytes;
89   int addressBytes;
90   unsigned int data[PCI_DATA_LEN_32bit];
91 } pciFile_t;
94 /* Distinguish between a layout and pad */
95 #define PLT_PAD     10
96 #define PLT_FILE    11
97 typedef struct {
98   int type;
99   int index;
100 } plt_t;
102 /* Define a layout table. A layout table is a block of data which contains the addresses
103  * of data files. Each address is 32 bits, with the upper 16 bits specifying the i2c 
104  * id, the lower address the byte address of the 1st block in the table */
105 #define MAX_LAYOUTS         2
106 #define MAX_LAYOUT_FILES    8
107 typedef struct  {
108   int nPlt;                      /* Number of elements in the plt array */
109   plt_t plt[MAX_LAYOUT_FILES];   /* Index of each file/pad in order */
110   
111   unsigned int address;         /* I2c data address of the table */
112   unsigned int dev_addr;        /* I2c device address of the table */
113   int align;
114 } layout_t;
117 /* Pad section. The pad section creates a gap in the i2c memory map */
118 #define MAX_PADS        8
119 typedef struct  {
120   int          id;
121   unsigned int address;     /* I2C data address */
122   unsigned int dev_addr;    /* I2C device address */
123   unsigned int len;
124 } pad_t;
127 /* Layout/pad interleave. The rom specification must be in order, so this structure tracks
128  * the arrangement of layouts and pads */
129 typedef struct
131   int type;   /* Either PAD or LAYOUT */
132   int index;  /* The array index for the pad/layout */
133   
134 } padLayoutOrder_t;
139 #endif /* ROMPARSE_H */