diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/.gitignore | 1 | ||||
-rw-r--r-- | tools/buildman/control.py | 10 | ||||
-rw-r--r-- | tools/buildman/test.py | 8 | ||||
-rw-r--r-- | tools/fit_image.c | 3 | ||||
-rw-r--r-- | tools/ifwitool.c | 2 | ||||
-rw-r--r-- | tools/mtk_image.h | 86 | ||||
-rw-r--r-- | tools/patman/func_test.py | 4 | ||||
-rwxr-xr-x | tools/patman/patman.py | 2 | ||||
-rw-r--r-- | tools/patman/series.py | 4 | ||||
l--------- | tools/version.h | 1 | ||||
-rw-r--r-- | tools/zynqmpbif.c | 2 |
11 files changed, 60 insertions, 63 deletions
diff --git a/tools/.gitignore b/tools/.gitignore index bd03d32f684..d0176a7283f 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -31,4 +31,5 @@ /spl_size_limit /sunxi-spl-image-builder /ubsha1 +/version.h /xway-swap-bytes diff --git a/tools/buildman/control.py b/tools/buildman/control.py index fcf531c5f14..9787b867476 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -201,14 +201,14 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None, # Work out what subset of the boards we are building if not boards: - board_file = os.path.join(options.git, 'boards.cfg') - status = subprocess.call([os.path.join(options.git, - 'tools/genboardscfg.py')]) + board_file = os.path.join(options.output_dir, 'boards.cfg') + genboardscfg = os.path.join(options.git, 'tools/genboardscfg.py') + status = subprocess.call([genboardscfg, '-o', board_file]) if status != 0: - sys.exit("Failed to generate boards.cfg") + sys.exit("Failed to generate boards.cfg") boards = board.Boards() - boards.ReadBoards(os.path.join(options.git, 'boards.cfg')) + boards.ReadBoards(board_file) exclude = [] if options.exclude: diff --git a/tools/buildman/test.py b/tools/buildman/test.py index de02f61be65..ed99b9375c4 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -156,14 +156,6 @@ class TestBuild(unittest.TestCase): result.return_code = commit.return_code result.stderr = (''.join(commit.error_list) % {'basedir' : base_dir + '/.bm-work/00/'}) - if stage == 'build': - target_dir = None - for arg in args: - if arg.startswith('O='): - target_dir = arg[2:] - - if not os.path.isdir(target_dir): - os.mkdir(target_dir) result.combined = result.stdout + result.stderr return result diff --git a/tools/fit_image.c b/tools/fit_image.c index 5aca634b5e9..0201cc44d8f 100644 --- a/tools/fit_image.c +++ b/tools/fit_image.c @@ -229,6 +229,7 @@ static int fit_write_images(struct image_tool_params *params, char *fdt) for (cont = params->content_head; cont; cont = cont->next) { if (cont->type != IH_TYPE_FLATDT) continue; + typename = genimg_get_type_short_name(cont->type); snprintf(str, sizeof(str), "%s-%d", FIT_FDT_PROP, ++upto); fdt_begin_node(fdt, str); @@ -253,6 +254,8 @@ static int fit_write_images(struct image_tool_params *params, char *fdt) fdt_property_string(fdt, FIT_TYPE_PROP, FIT_RAMDISK_PROP); fdt_property_string(fdt, FIT_OS_PROP, genimg_get_os_short_name(params->os)); + fdt_property_string(fdt, FIT_ARCH_PROP, + genimg_get_arch_short_name(params->arch)); ret = fdt_property_file(params, fdt, FIT_DATA_PROP, params->fit_ramdisk); diff --git a/tools/ifwitool.c b/tools/ifwitool.c index 2e020a82824..543e9d4e702 100644 --- a/tools/ifwitool.c +++ b/tools/ifwitool.c @@ -10,7 +10,9 @@ #include <getopt.h> #include "os_support.h" +#ifndef __packed #define __packed __attribute__((packed)) +#endif #define KiB 1024 #define ALIGN(x, a) __ALIGN_MASK((x), (typeof(x))(a) - 1) #define __ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask)) diff --git a/tools/mtk_image.h b/tools/mtk_image.h index 0a9eab372b9..4e78b3d0ff0 100644 --- a/tools/mtk_image.h +++ b/tools/mtk_image.h @@ -9,14 +9,14 @@ #ifndef _MTK_IMAGE_H #define _MTK_IMAGE_H -/* Device header definitions */ +/* Device header definitions, all fields are little-endian */ /* Header for NOR/SD/eMMC */ union gen_boot_header { struct { char name[12]; - __le32 version; - __le32 size; + uint32_t version; + uint32_t size; }; uint8_t pad[0x200]; @@ -32,14 +32,14 @@ union nand_boot_header { char name[12]; char version[4]; char id[8]; - __le16 ioif; - __le16 pagesize; - __le16 addrcycles; - __le16 oobsize; - __le16 pages_of_block; - __le16 numblocks; - __le16 writesize_shift; - __le16 erasesize_shift; + uint16_t ioif; + uint16_t pagesize; + uint16_t addrcycles; + uint16_t oobsize; + uint16_t pages_of_block; + uint16_t numblocks; + uint16_t writesize_shift; + uint16_t erasesize_shift; uint8_t dummy[60]; uint8_t ecc_parity[28]; }; @@ -54,14 +54,14 @@ union nand_boot_header { /* BootROM layout header */ struct brom_layout_header { char name[8]; - __le32 version; - __le32 header_size; - __le32 total_size; - __le32 magic; - __le32 type; - __le32 header_size_2; - __le32 total_size_2; - __le32 unused; + uint32_t version; + uint32_t header_size; + uint32_t total_size; + uint32_t magic; + uint32_t type; + uint32_t header_size_2; + uint32_t total_size_2; + uint32_t unused; }; #define BRLYT_NAME "BRLYT" @@ -90,8 +90,8 @@ struct gen_device_header { struct gfh_common_header { uint8_t magic[3]; uint8_t version; - __le16 size; - __le16 type; + uint16_t size; + uint16_t type; }; #define GFH_HEADER_MAGIC "MMM" @@ -106,17 +106,17 @@ struct gfh_common_header { struct gfh_file_info { struct gfh_common_header gfh; char name[12]; - __le32 unused; - __le16 file_type; + uint32_t unused; + uint16_t file_type; uint8_t flash_type; uint8_t sig_type; - __le32 load_addr; - __le32 total_size; - __le32 max_size; - __le32 hdr_size; - __le32 sig_size; - __le32 jump_offset; - __le32 processed; + uint32_t load_addr; + uint32_t total_size; + uint32_t max_size; + uint32_t hdr_size; + uint32_t sig_size; + uint32_t jump_offset; + uint32_t processed; }; #define GFH_FILE_INFO_NAME "FILE_INFO" @@ -129,16 +129,16 @@ struct gfh_file_info { struct gfh_bl_info { struct gfh_common_header gfh; - __le32 attr; + uint32_t attr; }; struct gfh_brom_cfg { struct gfh_common_header gfh; - __le32 cfg_bits; - __le32 usbdl_by_auto_detect_timeout_ms; + uint32_t cfg_bits; + uint32_t usbdl_by_auto_detect_timeout_ms; uint8_t unused[0x48]; - __le32 usbdl_by_kcol0_timeout_ms; - __le32 usbdl_by_flag_timeout_ms; + uint32_t usbdl_by_kcol0_timeout_ms; + uint32_t usbdl_by_flag_timeout_ms; uint32_t pad; }; @@ -157,15 +157,15 @@ struct gfh_anti_clone { uint8_t ac_b2k; uint8_t ac_b2c; uint16_t pad; - __le32 ac_offset; - __le32 ac_len; + uint32_t ac_offset; + uint32_t ac_len; }; struct gfh_brom_sec_cfg { struct gfh_common_header gfh; - __le32 cfg_bits; + uint32_t cfg_bits; char customer_name[0x20]; - __le32 pad; + uint32_t pad; }; #define BROM_SEC_CFG_JTAG_EN 1 @@ -184,11 +184,11 @@ struct gfh_header { union lk_hdr { struct { - __le32 magic; - __le32 size; + uint32_t magic; + uint32_t size; char name[32]; - __le32 loadaddr; - __le32 mode; + uint32_t loadaddr; + uint32_t mode; }; uint8_t data[512]; diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py index 50a2741439e..2321f9e028b 100644 --- a/tools/patman/func_test.py +++ b/tools/patman/func_test.py @@ -198,9 +198,9 @@ class TestFunctional(unittest.TestCase): line += 4 self.assertEqual(expected, tools.ToUnicode(lines[line])) - self.assertEqual(('%s %s, %s' % (args[0], rick, stefan)), + self.assertEqual(('%s %s\0%s' % (args[0], rick, stefan)), tools.ToUnicode(cc_lines[0])) - self.assertEqual(('%s %s, %s, %s, %s' % (args[1], fred, ed, rick, + self.assertEqual(('%s %s\0%s\0%s\0%s' % (args[1], fred, ed, rick, stefan)), tools.ToUnicode(cc_lines[1])) expected = ''' diff --git a/tools/patman/patman.py b/tools/patman/patman.py index 9605a36eff2..0187ebe1d4b 100755 --- a/tools/patman/patman.py +++ b/tools/patman/patman.py @@ -112,7 +112,7 @@ elif options.cc_cmd: for line in fd.readlines(): match = re_line.match(line) if match and match.group(1) == args[0]: - for cc in match.group(2).split(', '): + for cc in match.group(2).split('\0'): cc = cc.strip() if cc: print(cc) diff --git a/tools/patman/series.py b/tools/patman/series.py index 67103f03e69..d667d9b6d61 100644 --- a/tools/patman/series.py +++ b/tools/patman/series.py @@ -243,13 +243,13 @@ class Series(dict): if limit is not None: cc = cc[:limit] all_ccs += cc - print(commit.patch, ', '.join(sorted(set(cc))), file=fd) + print(commit.patch, '\0'.join(sorted(set(cc))), file=fd) self._generated_cc[commit.patch] = cc if cover_fname: cover_cc = gitutil.BuildEmailList(self.get('cover_cc', '')) cover_cc = [tools.FromUnicode(m) for m in cover_cc] - cc_list = ', '.join([tools.ToUnicode(x) + cc_list = '\0'.join([tools.ToUnicode(x) for x in sorted(set(cover_cc + all_ccs))]) print(cover_fname, cc_list.encode('utf-8'), file=fd) diff --git a/tools/version.h b/tools/version.h deleted file mode 120000 index bb576071e84..00000000000 --- a/tools/version.h +++ /dev/null @@ -1 +0,0 @@ -../include/version.h
\ No newline at end of file diff --git a/tools/zynqmpbif.c b/tools/zynqmpbif.c index 8c47107c7b9..82ce0ac1a52 100644 --- a/tools/zynqmpbif.c +++ b/tools/zynqmpbif.c @@ -517,7 +517,7 @@ static int bif_add_bit(struct bif_entry *bf) debug("Bitstream Length: 0x%x\n", bitlen); for (i = 0; i < bitlen; i += sizeof(uint32_t)) { uint32_t *bitbin32 = (uint32_t *)&bitbin[i]; - *bitbin32 = __swab32(*bitbin32); + *bitbin32 = __builtin_bswap32(*bitbin32); } if (!bf->dest_dev) |