From eb790d6dd40a1b6778907c794f61a2cf2707f2fe Mon Sep 17 00:00:00 2001
From: "Haoran.Wang" <elven.wang@nxp.com>
Date: Thu, 4 Jan 2018 20:27:04 +0800
Subject: [PATCH] MA-10983 Pad HDMI firmware after iMX8QM bootloader

As iMX8QM need to load HDMI firmware in bootloader
to make HDMI interface available for both u-boot's splash
and Linux. So pad it after u-boot.bin will be the best solution
to make u-boot fetch the firmware data.

This patch modify soc.mak and judge when there is HDMI firmware
and pad it after u-boot.bin. This will enlarge u-boot by 128KB.

Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
---
 iMX8QM/soc.mak | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/iMX8QM/soc.mak b/iMX8QM/soc.mak
index ec7938f..3e43e1b 100755
--- a/iMX8QM/soc.mak
+++ b/iMX8QM/soc.mak
@@ -34,6 +34,12 @@ u-boot-atf.bin: u-boot.bin bl31.bin
 	./$(MKIMG) -commit > head.hash
 	@cat u-boot.bin head.hash > u-boot-hash.bin
 	@dd if=u-boot-hash.bin of=u-boot-atf.bin bs=1K seek=128
+	@if [ ! -d "hdmitxfw.bin" ]; then \
+	cp u-boot-atf.bin u-boot-atf-b.bin; \
+	objcopy -I binary -O binary --pad-to 0x20000 --gap-fill=0x0 hdmitxfw.bin hdmitxfw-pad.bin; \
+	cat u-boot-atf.bin hdmitxfw-pad.bin > u-boot-atf-hdmi.bin; \
+	cp u-boot-atf-hdmi.bin u-boot-atf.bin; \
+	fi
 
 .PHONY: clean
 clean:
-- 
GitLab