xref: /openbmc/u-boot/tools/aisimage.h (revision e5841e12)
1 /*
2  * (C) Copyright 2011
3  * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
4  *
5  * See file CREDITS for list of people who contributed to this
6  * project.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of
11  * the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21  * MA 02111-1307 USA
22  */
23 
24 #ifndef _AISIMAGE_H_
25 #define _AISIMAGE_H_
26 
27 /* all values are for little endian systems */
28 #define AIS_MAGIC_WORD	0x41504954
29 #define AIS_FCN_MAX	8
30 
31 enum {
32 	AIS_CMD_LOAD	= 0x58535901,
33 	AIS_CMD_VALCRC	= 0x58535902,
34 	AIS_CMD_ENCRC	= 0x58535903,
35 	AIS_CMD_DISCRC	= 0x58535904,
36 	AIS_CMD_JMP	= 0x58535905,
37 	AIS_CMD_JMPCLOSE = 0x58535906,
38 	AIS_CMD_BOOTTBL	= 0x58535907,
39 	AIS_CMD_FILL	= 0x5853590A,
40 	AIS_CMD_FNLOAD	= 0x5853590D,
41 	AIS_CMD_SEQREAD	= 0x58535963,
42 };
43 
44 struct ais_cmd_load {
45 	uint32_t cmd;
46 	uint32_t addr;
47 	uint32_t size;
48 	uint32_t data[1];
49 };
50 
51 struct ais_cmd_func {
52 	uint32_t cmd;
53 	uint32_t func_args;
54 	uint32_t parms[AIS_FCN_MAX];
55 };
56 
57 struct ais_cmd_jmpclose {
58 	uint32_t cmd;
59 	uint32_t addr;
60 };
61 
62 #define CMD_DATA_STR	"DATA"
63 
64 enum ais_file_cmd {
65 	CMD_INVALID,
66 	CMD_FILL,
67 	CMD_CRCON,
68 	CMD_CRCOFF,
69 	CMD_CRCCHECK,
70 	CMD_JMPCLOSE,
71 	CMD_JMP,
72 	CMD_SEQREAD,
73 	CMD_DATA,
74 	CMD_PLL0,
75 	CMD_PLL1,
76 	CMD_CLK,
77 	CMD_DDR2,
78 	CMD_EMIFA,
79 	CMD_EMIFA_ASYNC,
80 	CMD_PLL,
81 	CMD_PSC,
82 	CMD_PINMUX,
83 	CMD_BOOTTABLE
84 };
85 
86 enum aisimage_fld_types {
87 	CFG_INVALID = -1,
88 	CFG_COMMAND,
89 	CFG_VALUE,
90 };
91 
92 struct ais_header {
93 	uint32_t magic;
94 	char data[1];
95 };
96 
97 #endif /* _AISIMAGE_H_ */
98