fetch-imx-firmware 551 Bytes
Newer Older
1 2 3 4 5
#!/bin/bash

set -e

URL_BASE=https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/
Guido Gunther's avatar
Guido Gunther committed
6
FIRMWARE=firmware-imx-8.10.bin
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

function cleanup()
{
  [ -z "${DLDIR}" ] || rm -rf "${DLDIR}"
}

trap cleanup EXIT

if [ -z "$1" ]; then
    echo "No output dir given" 1>&2
    exit 1
fi

OUT=$1
DLDIR=$(mktemp -d)
cd "${DLDIR}"
wget "${URL_BASE}/${FIRMWARE}"
chmod +x "${FIRMWARE}"
./"${FIRMWARE}" --auto-accept
cd -

for f in ddr/synopsys/lpddr4_pmu_train_?d_?mem.bin hdmi/cadence/signed_*_imx8m.bin; do
	cp -v ${DLDIR}/$(basename "${FIRMWARE}" .bin)/firmware/$f "${OUT}"
done