diff options
author | Tom Rini <trini@konsulko.com> | 2019-11-12 07:18:23 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-11-12 07:18:23 -0500 |
commit | 5f7ff6d63eeb81ad2c071ff5f5adae5bcc94f7a4 (patch) | |
tree | eb3707f7e5b4ae1d0f3094cc8814ef8bc389aa8c /tools | |
parent | a965a8b904093c9e6790d0460d18a144cefa5e42 (diff) | |
parent | bdcf3a88cc582ce8bb9ea024fa917d9a52e05479 (diff) | |
download | u-boot-5f7ff6d63eeb81ad2c071ff5f5adae5bcc94f7a4.zip u-boot-5f7ff6d63eeb81ad2c071ff5f5adae5bcc94f7a4.tar.gz u-boot-5f7ff6d63eeb81ad2c071ff5f5adae5bcc94f7a4.tar.bz2 |
Merge tag 'u-boot-imx-20191105' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
u-boot-imx-20191105
-------------------
i.MX8MN SoC support
ROM API image download support
i.MX8MM enet enabling
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/imx8m_image.sh | 10 | ||||
-rw-r--r-- | tools/imx8mimage.c | 24 |
2 files changed, 32 insertions, 2 deletions
diff --git a/tools/imx8m_image.sh b/tools/imx8m_image.sh index 08a6a48..603ba6e 100755 --- a/tools/imx8m_image.sh +++ b/tools/imx8m_image.sh @@ -39,6 +39,16 @@ if [ $post_process = 1 ]; then cat spl/u-boot-spl-pad.bin lpddr4_pmu_train_1d_fw.bin lpddr4_pmu_train_2d_fw.bin > spl/u-boot-spl-ddr.bin rm -f lpddr4_pmu_train_1d_fw.bin lpddr4_pmu_train_2d_fw.bin lpddr4_pmu_train_1d_imem_pad.bin lpddr4_pmu_train_1d_dmem_pad.bin lpddr4_pmu_train_2d_imem_pad.bin spl/u-boot-spl-pad.bin fi + if [ -f $srctree/ddr4_imem_1d.bin ]; then + objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 $srctree/ddr4_imem_1d.bin ddr4_imem_1d_pad.bin + objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 $srctree/ddr4_dmem_1d.bin ddr4_dmem_1d_pad.bin + objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 $srctree/ddr4_imem_2d.bin ddr4_imem_2d_pad.bin + cat ddr4_imem_1d_pad.bin ddr4_dmem_1d_pad.bin > ddr4_1d_fw.bin + cat ddr4_imem_2d_pad.bin $srctree/ddr4_dmem_2d.bin > ddr4_2d_fw.bin + dd if=spl/u-boot-spl.bin of=spl/u-boot-spl-pad.bin bs=4 conv=sync + cat spl/u-boot-spl-pad.bin ddr4_1d_fw.bin ddr4_2d_fw.bin > spl/u-boot-spl-ddr.bin + rm -f ddr4_1d_fw.bin ddr4_2d_fw.bin ddr4_imem_1d_pad.bin ddr4_dmem_1d_pad.bin ddr4_imem_2d_pad.bin spl/u-boot-spl-pad.bin + fi fi exit 0 diff --git a/tools/imx8mimage.c b/tools/imx8mimage.c index 6c02337..2b0d946 100644 --- a/tools/imx8mimage.c +++ b/tools/imx8mimage.c @@ -21,6 +21,11 @@ static uint32_t sld_header_off; static uint32_t ivt_offset; static uint32_t using_fit; +#define ROM_V1 1 +#define ROM_V2 2 + +static uint32_t rom_version = ROM_V1; + #define CSF_SIZE 0x2000 #define HDMI_IVT_ID 0 #define IMAGE_IVT_ID 1 @@ -71,6 +76,7 @@ static table_entry_t imx8mimage_cmds[] = { {CMD_LOADER, "LOADER", "loader image", }, {CMD_SECOND_LOADER, "SECOND_LOADER", "2nd loader image", }, {CMD_DDR_FW, "DDR_FW", "ddr firmware", }, + {CMD_ROM_VERSION, "ROM_VERSION", "rom version", }, {-1, "", "", }, }; @@ -90,6 +96,9 @@ static void parse_cfg_cmd(int32_t cmd, char *token, char *name, int lineno) token); if (!strncmp(token, "sd", 2)) rom_image_offset = 0x8000; + + if (rom_version == ROM_V2) + ivt_offset = 0; break; case CMD_LOADER: ap_img = token; @@ -103,6 +112,15 @@ static void parse_cfg_cmd(int32_t cmd, char *token, char *name, int lineno) case CMD_DDR_FW: /* Do nothing */ break; + case CMD_ROM_VERSION: + if (!strncmp(token, "v2", 2)) { + rom_version = ROM_V2; + ivt_offset = 0; + } else if (!strncmp(token, "v1", 2)) { + rom_version = ROM_V1; + } + break; + } } @@ -491,8 +509,10 @@ void build_image(int ofd) * Record the second bootloader relative offset in * image's IVT reserved1 */ - imx_header[IMAGE_IVT_ID].fhdr.reserved1 = - sld_header_off - header_image_off; + if (rom_version == ROM_V1) { + imx_header[IMAGE_IVT_ID].fhdr.reserved1 = + sld_header_off - header_image_off; + } sld_fd = open(sld_img, O_RDONLY | O_BINARY); if (sld_fd < 0) { fprintf(stderr, "%s: Can't open: %s\n", |