summaryrefslogtreecommitdiff
path: root/tools/mtk_image.c
AgeCommit message (Collapse)AuthorFilesLines
2021-03-20tools: mtk_image: add an option to set device header offsetWeijie Gao1-3/+47
This patch adds an option which allows setting the device header offset. This is useful if this tool is used to generate ATF BL2 image of mt7622 for SD cards. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2021-01-18tools: mtk_image: add support for booting ARM64 imagesFabien Parent1-4/+24
mkimage is only able to package aarch32 binaries. Add support for AArch64 images. One can create a ARM64 image using the following command line: mkimage -T mtk_image -a 0x201000 -e 0x201000 -n "media=emmc;arm64=1" -d bl2.bin bl2.img Signed-off-by: Fabien Parent <fparent@baylibre.com>
2018-12-15tools: mtk_image: replace strncpy(d, s, sizeof(d)) with snprintf()Andy Shevchenko1-2/+2
Starting from version 8 the GCC, i.e. C compiler, starts complaining about possible '\0' terminator loss or, as in this case, garbage copy. In function ‘mtk_image_set_gen_header’, inlined from ‘mtk_image_set_header’ at tools/mtk_image.c:733:3: tools/mtk_image.c:659:2: warning: ‘strncpy’ specified bound 12 equals destination size [-Wstringop-truncation] strncpy(hdr->boot.name, bootname, sizeof(hdr->boot.name)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function ‘mtk_brom_parse_imagename’, inlined from ‘mtk_image_check_params’ at tools/mtk_image.c:388:9: tools/mtk_image.c:325:5: warning: ‘strncpy’ specified bound 32 equals destination size [-Wstringop-truncation] strncpy(lk_name, val, sizeof(lk_name)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Replace it with snprintf() to tell compiler how much room we have in the destination buffer for source string. Fixes: 3b975a147c3c ("tools: MediaTek: add MTK boot header generation to mkimage") Cc: Ryder Lee <ryder.lee@mediatek.com> Cc: Weijie Gao <weijie.gao@mediatek.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
2018-11-29tools: MediaTek: add MTK boot header generation to mkimageRyder Lee1-0/+749
This patch adds support for MTK boot image generation. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Reviewed-by: Simon Glass <sjg@chromium.org>