diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/Makefile | 27 | ||||
-rwxr-xr-x | tools/checkpatch.pl | 1 | ||||
-rw-r--r-- | tools/imximage.c | 17 | ||||
-rw-r--r-- | tools/imximage.h | 9 | ||||
-rw-r--r-- | tools/logos/wandboard.bmp | bin | 0 -> 22390 bytes | |||
-rw-r--r-- | tools/mkimage.h | 12 | ||||
-rw-r--r-- | tools/mxsboot.c | 8 |
7 files changed, 48 insertions, 26 deletions
diff --git a/tools/Makefile b/tools/Makefile index 26eb50082f..4630f03dc5 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -130,28 +130,21 @@ LOGO-$(CONFIG_LCD_LOGO) += $(LOGO_DATA_H) LOGO-$(CONFIG_VIDEO_LOGO) += $(LOGO_H) LOGO-$(CONFIG_VIDEO_LOGO) += $(LOGO_DATA_H) +# Generic logo ifeq ($(LOGO_BMP),) LOGO_BMP= logos/denx.bmp + +# Use board logo and fallback to vendor +ifneq ($(wildcard logos/$(BOARD).bmp),) +LOGO_BMP= logos/$(BOARD).bmp +else +ifneq ($(wildcard logos/$(VENDOR).bmp),) +LOGO_BMP= logos/$(VENDOR).bmp endif -ifeq ($(VENDOR),atmel) -LOGO_BMP= logos/atmel.bmp -endif -ifeq ($(VENDOR),esd) -LOGO_BMP= logos/esd.bmp -endif -ifeq ($(VENDOR),freescale) -LOGO_BMP= logos/freescale.bmp -endif -ifeq ($(VENDOR),ronetix) -LOGO_BMP= logos/ronetix.bmp -endif -ifeq ($(VENDOR),syteco) -LOGO_BMP= logos/syteco.bmp -endif -ifeq ($(VENDOR),intercontrol) -LOGO_BMP= logos/intercontrol.bmp endif +endif # !LOGO_BMP + # now $(obj) is defined HOSTSRCS += $(addprefix $(SRCTREE)/,$(EXT_OBJ_FILES-y:.o=.c)) HOSTSRCS += $(addprefix $(SRCTREE)/tools/,$(OBJ_FILES-y:.o=.c)) diff --git a/tools/checkpatch.pl b/tools/checkpatch.pl index 9f23901872..896e2bc985 100755 --- a/tools/checkpatch.pl +++ b/tools/checkpatch.pl @@ -273,6 +273,7 @@ our $logFunctions = qr{(?x: WARN(?:_RATELIMIT|_ONCE|)| panic| debug| + printf| MODULE_[A-Z_]+ )}; diff --git a/tools/imximage.c b/tools/imximage.c index fa308c94b0..5e8e4701d3 100644 --- a/tools/imximage.c +++ b/tools/imximage.c @@ -37,6 +37,7 @@ */ static table_entry_t imximage_cmds[] = { {CMD_BOOT_FROM, "BOOT_FROM", "boot command", }, + {CMD_BOOT_OFFSET, "BOOT_OFFSET", "Boot offset", }, {CMD_DATA, "DATA", "Reg Write Data", }, {CMD_IMAGE_VERSION, "IMAGE_VERSION", "image version", }, {-1, "", "", }, @@ -352,6 +353,11 @@ static void parse_cfg_cmd(struct imx_header *imxhdr, int32_t cmd, char *token, if (unlikely(cmd_ver_first != 1)) cmd_ver_first = 0; break; + case CMD_BOOT_OFFSET: + imxhdr->flash_offset = get_cfg_value(token, name, lineno); + if (unlikely(cmd_ver_first != 1)) + cmd_ver_first = 0; + break; case CMD_DATA: value = get_cfg_value(token, name, lineno); (*set_dcd_val)(imxhdr, name, lineno, fld, value, dcd_len); @@ -518,11 +524,14 @@ static void imximage_set_header(void *ptr, struct stat *sbuf, int ifd, /* * ROM bug alert - * mx53 only loads 512 byte multiples. - * The remaining fraction of a block bytes would - * not be loaded. + * + * MX53 only loads 512 byte multiples in case of SD boot. + * MX53 only loads NAND page multiples in case of NAND boot and + * supports up to 4096 byte large pages, thus align to 4096. + * + * The remaining fraction of a block bytes would not be loaded! */ - *header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 512); + *header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 4096); } int imximage_check_params(struct mkimage_params *params) diff --git a/tools/imximage.h b/tools/imximage.h index 42b60906fd..5c929e4987 100644 --- a/tools/imximage.h +++ b/tools/imximage.h @@ -31,6 +31,11 @@ #define HEADER_OFFSET 0x400 +/* + * NOTE: This file must be kept in sync with arch/arm/include/asm/\ + * imx-common/imximage.cfg because tools/imximage.c can not + * cross-include headers from arch/arm/ and vice-versa. + */ #define CMD_DATA_STR "DATA" #define FLASH_OFFSET_UNDEFINED 0xFFFFFFFF #define FLASH_OFFSET_STANDARD 0x400 @@ -52,6 +57,7 @@ enum imximage_cmd { CMD_INVALID, CMD_IMAGE_VERSION, CMD_BOOT_FROM, + CMD_BOOT_OFFSET, CMD_DATA }; @@ -151,13 +157,14 @@ typedef struct { dcd_v2_t dcd_table; } imx_header_v2_t; +/* The header must be aligned to 4k on MX53 for NAND boot */ struct imx_header { union { imx_header_v1_t hdr_v1; imx_header_v2_t hdr_v2; } header; uint32_t flash_offset; -}; +} __attribute__((aligned(4096))); typedef void (*set_dcd_val_t)(struct imx_header *imxhdr, char *name, int lineno, diff --git a/tools/logos/wandboard.bmp b/tools/logos/wandboard.bmp Binary files differnew file mode 100644 index 0000000000..7f288a8e8e --- /dev/null +++ b/tools/logos/wandboard.bmp diff --git a/tools/mkimage.h b/tools/mkimage.h index e07a6157eb..03c6c8f523 100644 --- a/tools/mkimage.h +++ b/tools/mkimage.h @@ -44,12 +44,24 @@ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +static inline void *map_sysmem(ulong paddr, unsigned long len) +{ + return (void *)(uintptr_t)paddr; +} + +static inline ulong map_to_sysmem(void *ptr) +{ + return (ulong)(uintptr_t)ptr; +} + #define MKIMAGE_TMPFILE_SUFFIX ".tmp" #define MKIMAGE_MAX_TMPFILE_LEN 256 #define MKIMAGE_DEFAULT_DTC_OPTIONS "-I dts -O dtb -p 500" #define MKIMAGE_MAX_DTC_CMDLINE_LEN 512 #define MKIMAGE_DTC "dtc" /* assume dtc is in $PATH */ +#define IH_ARCH_DEFAULT IH_ARCH_INVALID + /* * This structure defines all such variables those are initialized by * mkimage main core and need to be referred by image type specific diff --git a/tools/mxsboot.c b/tools/mxsboot.c index 6c05aa479d..d92c39fec6 100644 --- a/tools/mxsboot.c +++ b/tools/mxsboot.c @@ -551,7 +551,7 @@ static int mx28_create_sd_image(int infd, int outfd) fsize = lseek(infd, 0, SEEK_END); lseek(infd, 0, SEEK_SET); - size = fsize + 512; + size = fsize + 4 * 512; buf = malloc(size); if (!buf) { @@ -559,7 +559,7 @@ static int mx28_create_sd_image(int infd, int outfd) goto err0; } - ret = read(infd, (uint8_t *)buf + 512, fsize); + ret = read(infd, (uint8_t *)buf + 4 * 512, fsize); if (ret != fsize) { ret = -1; goto err1; @@ -574,8 +574,8 @@ static int mx28_create_sd_image(int infd, int outfd) cb->drv_info[0].chip_num = 0x0; cb->drv_info[0].drive_type = 0x0; cb->drv_info[0].tag = 0x1; - cb->drv_info[0].first_sector_number = sd_sector + 1; - cb->drv_info[0].sector_count = (size - 1) / 512; + cb->drv_info[0].first_sector_number = sd_sector + 4; + cb->drv_info[0].sector_count = (size - 4) / 512; wr_size = write(outfd, buf, size); if (wr_size != size) { |