Some Davinci processors supports the Application
Image Script (AIS) boot process. The patch adds the generation
of the AIS image inside the mkimage tool to make possible
to generate a bootable U-boot without external tools
(TI Davinci AIS Generator).
Signed-off-by: Stefano Babic sba...@denx.de
CC: Wolfgang Denk w...@denx.de
---
Changes:
- removed warning in gcc 4.6 iwhen -Wunused-but-set-variable is set
- drop remained warnings raised by checkpatch
common/image.c |1 +
include/image.h |1 +
tools/Makefile |4 +-
tools/aisimage.c | 451 ++
tools/aisimage.h | 97
tools/mkimage.c |2 +
tools/mkimage.h |1 +
7 files changed, 556 insertions(+), 1 deletions(-)
create mode 100644 tools/aisimage.c
create mode 100644 tools/aisimage.h
diff --git a/common/image.c b/common/image.c
index d38ce4a..f2804f8 100644
--- a/common/image.c
+++ b/common/image.c
@@ -146,6 +146,7 @@ static const table_entry_t uimage_type[] = {
{ IH_TYPE_KWBIMAGE, kwbimage, Kirkwood Boot Image,},
{ IH_TYPE_IMXIMAGE, imximage, Freescale i.MX Boot Image,},
{ IH_TYPE_UBLIMAGE, ublimage, Davinci UBL image,},
+ { IH_TYPE_AISIMAGE, aisimage, Davinci AIS image,},
{ -1, , , },
};
diff --git a/include/image.h b/include/image.h
index cca1cc5..52a0cb4 100644
--- a/include/image.h
+++ b/include/image.h
@@ -159,6 +159,7 @@
#define IH_TYPE_IMXIMAGE 10 /* Freescale IMXBoot Image */
#define IH_TYPE_UBLIMAGE 11 /* Davinci UBL Image*/
#define IH_TYPE_OMAPIMAGE 12 /* TI OMAP Config Header Image */
+#define IH_TYPE_AISIMAGE 13 /* TI Davinci AIS Image */
/*
* Compression Types
diff --git a/tools/Makefile b/tools/Makefile
index fc741d3..df56a25 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -86,6 +86,7 @@ NOPED_OBJ_FILES-y += fit_image.o
OBJ_FILES-$(CONFIG_CMD_NET) += gen_eth_addr.o
OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o
OBJ_FILES-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes.o
+NOPED_OBJ_FILES-y += aisimage.o
NOPED_OBJ_FILES-y += kwbimage.o
NOPED_OBJ_FILES-y += imximage.o
NOPED_OBJ_FILES-y += omapimage.o
@@ -184,7 +185,8 @@ $(obj)xway-swap-bytes$(SFX):$(obj)xway-swap-bytes.o
$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
$(HOSTSTRIP) $@
-$(obj)mkimage$(SFX): $(obj)crc32.o \
+$(obj)mkimage$(SFX): $(obj)aisimage.o \
+ $(obj)crc32.o \
$(obj)default_image.o \
$(obj)fit_image.o \
$(obj)image.o \
diff --git a/tools/aisimage.c b/tools/aisimage.c
new file mode 100644
index 000..6a10111
--- /dev/null
+++ b/tools/aisimage.c
@@ -0,0 +1,451 @@
+/*
+ * (C) Copyright 2011
+ * Stefano Babic, DENX Software Engineering, sba...@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+/* Required to obtain the getline prototype from stdio.h */
+#define _GNU_SOURCE
+
+#include mkimage.h
+#include aisimage.h
+#include image.h
+
+#define IS_FNC_EXEC(c) (cmd_table[c].AIS_cmd == AIS_CMD_FNLOAD)
+#define WORD_ALIGN04
+#define WORD_ALIGN(len) (((len)+WORD_ALIGN0-1) ~(WORD_ALIGN0-1))
+#define MAX_CMD_BUFFER 4096
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+
+static uint32_t ais_img_size;
+
+/*
+ * Supported commands for configuration file
+ */
+static table_entry_t aisimage_cmds[] = {
+ {CMD_DATA, DATA, Reg Write Data},
+ {CMD_FILL, FILL, Fill range with pattern},
+ {CMD_CRCON, CRCON,CRC Enable},
+ {CMD_CRCOFF,CRCOFF, CRC Disable},
+ {CMD_CRCCHECK, CRCCHECK, CRC Validate},
+ {CMD_JMPCLOSE, JMPCLOSE, Jump Close},
+ {CMD_JMP, JMP, Jump},
+ {CMD_SEQREAD, SEQREAD, Sequential read},
+ {CMD_PLL0, PLL0, PLL0},
+ {CMD_PLL1, PLL1, PLL1},
+ {CMD_CLK, CLK, Clock configuration},
+