All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baruch Siach <baruch@tkos.co.il>
To: u-boot@lists.denx.de
Subject: [PATCH] tools: imx8m_image: Change source path for DDR firmware to build dir
Date: Wed, 11 Dec 2019 17:25:19 +0200	[thread overview]
Message-ID: <87immmubog.fsf@tarshish> (raw)
In-Reply-To: <f2d26080-bf20-27ba-b372-5548a646f886@kontron.de>

Hi Frieder,

On Wed, Dec 11 2019, Schrempf Frieder wrote:
> On 11.12.19 11:49, Baruch Siach wrote:
>> Hi Frieder Schrempf,
>>
>> On Wed, Dec 11 2019, Schrempf Frieder wrote:
>>
>>> From: Frieder Schrempf <frieder.schrempf@kontron.de>
>>>
>>> The DDR firmware binaries are not part of the U-Boot source code, so
>>> we should look for them in the build directory, where they need to be
>>> copied to before building U-Boot.
>>>
>>> The ATF binary is already fetched from the build directory, but the
>>> README files for the i.MX8M EVKs claim that it needs to be copied to
>>> the source directory (which is still true for in-tree builds, but not
>>> in general). Therefore we also fix the READMEs to use the build
>>> directory as the correct location for all additional binary files.
>>>
>>> Sined-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
>>> ---
>>>   board/freescale/imx8mm_evk/README |  6 +++---
>>>   board/freescale/imx8mq_evk/README |  8 ++++----
>>>   tools/imx8m_image.sh              | 28 +++++++++++-----------------
>>>   3 files changed, 18 insertions(+), 24 deletions(-)
>>>
>>> diff --git a/board/freescale/imx8mm_evk/README b/board/freescale/imx8mm_evk/README
>>> index a885bc5c97..c908c0adc4 100644
>>> --- a/board/freescale/imx8mm_evk/README
>>> +++ b/board/freescale/imx8mm_evk/README
>>> @@ -9,18 +9,18 @@ Quick Start
>>>
>>>   Get and Build the ARM Trusted firmware
>>>   ======================================
>>> -Note: srctree is U-Boot source directory
>>> +Note: builddir is U-Boot build directory (source directory for in-tree builds)
>>>   Get ATF from: https://source.codeaurora.org/external/imx/imx-atf
>>>   branch: imx_4.19.35_1.0.0
>>>   $ make PLAT=imx8mm bl31
>>> -$ cp build/imx8mm/release/bl31.bin $(srctree)
>>> +$ cp build/imx8mm/release/bl31.bin $(builddir)
>>>
>>>   Get the ddr and hdmi firmware
>>>   =============================
>>>   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.0.bin
>>>   $ chmod +x firmware-imx-8.0.bin
>>>   $ ./firmware-imx-8.0
>>> -$ cp firmware-imx-7.9/firmware/ddr/synopsys/lpddr4*.bin $(srctree)
>>> +$ cp firmware-imx-7.9/firmware/ddr/synopsys/lpddr4*.bin $(builddir)
>>
>> You might want to take the opportunity to fix the firmware directory
>> name as well.
>
> I will leave this to someone who knows more about this and once someone
> has decided which version of the firmware should actually be used.
> Personally I have used 7.8 (from Yocto Warrior release) and 8.1 (from
> Yocto Zeus release) with my custom i.MX8MM board so far.
>
> The discussion about this is currently also going on here:
> https://lists.denx.de/pipermail/u-boot/2019-December/393638.html

I'm not talking about the selection of firmware package version. It is
just that the firmware-imx-8.0.bin archive (another typo), extract into
firmware-imx-8.0/, not firmware-imx-7.9/ as the current text shows.

>>>   Build U-Boot
>>>   ============
>>> diff --git a/board/freescale/imx8mq_evk/README b/board/freescale/imx8mq_evk/README
>>> index c1d400bcf9..bbf69c60d8 100644
>>> --- a/board/freescale/imx8mq_evk/README
>>> +++ b/board/freescale/imx8mq_evk/README
>>> @@ -9,19 +9,19 @@ Quick Start
>>>
>>>   Get and Build the ARM Trusted firmware
>>>   ======================================
>>> -Note: srctree is U-Boot source directory
>>> +Note: builddir is U-Boot build directory (source directory for in-tree builds)
>>>   Get ATF from: https://source.codeaurora.org/external/imx/imx-atf
>>>   branch: imx_4.14.62_1.0.0_beta
>>>   $ make PLAT=imx8mq bl31
>>> -$ cp build/imx8mq/release/bl31.bin $(srctree)
>>> +$ cp build/imx8mq/release/bl31.bin $(builddir)
>>>
>>>   Get the ddr and hdmi firmware
>>>   =============================
>>>   $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-7.9.bin
>>>   $ chmod +x firmware-imx-7.9.bin
>>>   $ ./firmware-imx-7.9.bin
>>> -$ cp firmware-imx-7.9/firmware/hdmi/cadence/signed_hdmi_imx8m.bin $(srctree)
>>> -$ cp firmware-imx-7.9/firmware/ddr/synopsys/lpddr4*.bin $(srctree)
>>> +$ cp firmware-imx-7.9/firmware/hdmi/cadence/signed_hdmi_imx8m.bin $(builddir)
>>> +$ cp firmware-imx-7.9/firmware/ddr/synopsys/lpddr4*.bin $(builddir)
>>
>> Same here.

The text here is correct, by the way.

baruch

>>>   Build U-Boot
>>>   ============
>>> diff --git a/tools/imx8m_image.sh b/tools/imx8m_image.sh
>>> index 603ba6e8f4..4959f9c835 100755
>>> --- a/tools/imx8m_image.sh
>>> +++ b/tools/imx8m_image.sh
>>> @@ -10,41 +10,35 @@ post_process=$2
>>>
>>>   blobs=`awk '/^SIGNED_HDMI/ {print $2} /^LOADER/ {print $2} /^SECOND_LOADER/ {print $2} /^DDR_FW/ {print $2}' $file`
>>>   for f in $blobs; do
>>> -	tmp=$srctree/$f
>>> -
>>>   	if [ $f = "spl/u-boot-spl-ddr.bin" ] || [ $f = "u-boot.itb" ]; then
>>>   		continue
>>>   	fi
>>>
>>>   	if [ -f $f ]; then
>>>   		continue
>>> -	fi
>>> -
>>> -	if [ ! -f $tmp ]; then
>>> +	else
>>>   		echo "WARNING '$tmp' not found, resulting binary is not-functional" >&2
>>>   		exit 1
>>>   	fi
>>> -
>>> -	sed -in "s;$f;$tmp;" $file
>>>   done
>>>
>>>   if [ $post_process = 1 ]; then
>>> -	if [ -f $srctree/lpddr4_pmu_train_1d_imem.bin ]; then
>>> -		objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 $srctree/lpddr4_pmu_train_1d_imem.bin lpddr4_pmu_train_1d_imem_pad.bin
>>> -		objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 $srctree/lpddr4_pmu_train_1d_dmem.bin lpddr4_pmu_train_1d_dmem_pad.bin
>>> -		objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 $srctree/lpddr4_pmu_train_2d_imem.bin lpddr4_pmu_train_2d_imem_pad.bin
>>> +	if [ -f lpddr4_pmu_train_1d_imem.bin ]; then
>>> +		objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 lpddr4_pmu_train_1d_imem.bin lpddr4_pmu_train_1d_imem_pad.bin
>>> +		objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 lpddr4_pmu_train_1d_dmem.bin lpddr4_pmu_train_1d_dmem_pad.bin
>>> +		objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 lpddr4_pmu_train_2d_imem.bin lpddr4_pmu_train_2d_imem_pad.bin
>>>   		cat lpddr4_pmu_train_1d_imem_pad.bin lpddr4_pmu_train_1d_dmem_pad.bin > lpddr4_pmu_train_1d_fw.bin
>>> -		cat lpddr4_pmu_train_2d_imem_pad.bin $srctree/lpddr4_pmu_train_2d_dmem.bin > lpddr4_pmu_train_2d_fw.bin
>>> +		cat lpddr4_pmu_train_2d_imem_pad.bin lpddr4_pmu_train_2d_dmem.bin > lpddr4_pmu_train_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 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
>>> +	if [ -f ddr4_imem_1d.bin ]; then
>>> +		objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 ddr4_imem_1d.bin ddr4_imem_1d_pad.bin
>>> +		objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 ddr4_dmem_1d.bin ddr4_dmem_1d_pad.bin
>>> +		objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 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
>>> +		cat ddr4_imem_2d_pad.bin 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

--
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

  reply	other threads:[~2019-12-11 15:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11 10:06 [PATCH] tools: imx8m_image: Change source path for DDR firmware to build dir Schrempf Frieder
2019-12-11 10:49 ` Baruch Siach
2019-12-11 13:37   ` Schrempf Frieder
2019-12-11 15:25     ` Baruch Siach [this message]
2019-12-11 16:21       ` Fabio Estevam
2019-12-30 12:32         ` Stefano Babic
  -- strict thread matches above, loose matches on Subject: below --
2020-01-04 11:03 sbabic at denx.de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87immmubog.fsf@tarshish \
    --to=baruch@tkos.co.il \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.