]> Git Repo - J-u-boot.git/blame - tools/imx8m_image.sh
mx6sxsabresd: Keep only one target
[J-u-boot.git] / tools / imx8m_image.sh
CommitLineData
94df9885
PF
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0+
3#
4# script to check whether the file exists in imximage.cfg for i.MX8M
5#
6
7file=$1
8
9post_process=$2
10
11blobs=`awk '/^SIGNED_HDMI/ {print $2} /^LOADER/ {print $2} /^SECOND_LOADER/ {print $2} /^DDR_FW/ {print $2}' $file`
12for f in $blobs; do
8a0746db 13 if [ $f = "spl/u-boot-spl-ddr.bin" ] || [ $f = "u-boot.itb" ]; then
94df9885
PF
14 continue
15 fi
16
17 if [ -f $f ]; then
18 continue
162c72c8 19 else
94df9885
PF
20 echo "WARNING '$tmp' not found, resulting binary is not-functional" >&2
21 exit 1
22 fi
94df9885
PF
23done
24
8a0746db 25if [ $post_process = 1 ]; then
162c72c8
FS
26 if [ -f lpddr4_pmu_train_1d_imem.bin ]; then
27 objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 lpddr4_pmu_train_1d_imem.bin lpddr4_pmu_train_1d_imem_pad.bin
28 objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 lpddr4_pmu_train_1d_dmem.bin lpddr4_pmu_train_1d_dmem_pad.bin
29 objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 lpddr4_pmu_train_2d_imem.bin lpddr4_pmu_train_2d_imem_pad.bin
94df9885 30 cat lpddr4_pmu_train_1d_imem_pad.bin lpddr4_pmu_train_1d_dmem_pad.bin > lpddr4_pmu_train_1d_fw.bin
162c72c8 31 cat lpddr4_pmu_train_2d_imem_pad.bin lpddr4_pmu_train_2d_dmem.bin > lpddr4_pmu_train_2d_fw.bin
4b78bb50
PF
32 dd if=spl/u-boot-spl.bin of=spl/u-boot-spl-pad.bin bs=4 conv=sync
33 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
34 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
94df9885 35 fi
162c72c8
FS
36 if [ -f ddr4_imem_1d.bin ]; then
37 objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 ddr4_imem_1d.bin ddr4_imem_1d_pad.bin
38 objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 ddr4_dmem_1d.bin ddr4_dmem_1d_pad.bin
39 objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 ddr4_imem_2d.bin ddr4_imem_2d_pad.bin
d3c7d84b 40 cat ddr4_imem_1d_pad.bin ddr4_dmem_1d_pad.bin > ddr4_1d_fw.bin
162c72c8 41 cat ddr4_imem_2d_pad.bin ddr4_dmem_2d.bin > ddr4_2d_fw.bin
d3c7d84b
PF
42 dd if=spl/u-boot-spl.bin of=spl/u-boot-spl-pad.bin bs=4 conv=sync
43 cat spl/u-boot-spl-pad.bin ddr4_1d_fw.bin ddr4_2d_fw.bin > spl/u-boot-spl-ddr.bin
44 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
45 fi
94df9885
PF
46fi
47
48exit 0
This page took 0.067245 seconds and 4 git commands to generate.