Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v6 3/4] firmware-imx: add support for iMX8M firmware
Date: Mon, 9 Apr 2018 22:38:46 +0200	[thread overview]
Message-ID: <20180409223846.2d245c56@windsurf> (raw)
In-Reply-To: <1520682702-10035-4-git-send-email-karl.erik.larsson@gmail.com>

Hello,

On Sat, 10 Mar 2018 12:51:41 +0100, Erik Larsson wrote:

> +ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M),y)
> +FIRMWARE_IMX_INSTALL_IMAGES = YES
> +define FIRMWARE_IMX_INSTALL_IMAGES_CMDS
> +	# Create padded versions of lpddr4_pmu_*, needed for generating imx-boot-imx8mqevk-sd.bin
> +	# which is done in post-image script.
> +	$(TARGET_OBJCOPY) -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 $(@D)/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem.bin ${BINARIES_DIR}/lpddr4_pmu_train_1d_imem_pad.bin
> +	$(TARGET_OBJCOPY) -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 $(@D)/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem.bin ${BINARIES_DIR}/lpddr4_pmu_train_1d_dmem_pad.bin
> +	$(TARGET_OBJCOPY) -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 $(@D)/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem.bin ${BINARIES_DIR}/lpddr4_pmu_train_2d_imem_pad.bin

I'm a bit unhappy with the division of work between this .mk file and
the post-image script. Why are you doing the padding here, and then the
concatenation in the post-image script?

I think it should be done in just one place. Perhaps this package is
the most logical location. Also, use $(...) instead of ${...} in shell
to refer to variables.

So, perhaps:

define FIRMWARE_IMX_PREPARE_LPDDR4_FW
	(cd $(@D)/firmware/ddr/synopsys/ && \
		$(TARGET_OBJCOPY) -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 \
			lpddr4_pmu_train_$(1)_imem.bin \
			lpddr4_pmu_train_$(1)_imem_pad.bin
		$(TARGET_OBJCOPY) -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 \
			lpddr4_pmu_train_$(1)_dmem.bin \
			lpddr4_pmu_train_$(1)_dmem_pad.bin
		cat lpddr4_pmu_train_$(1)_imem_pad.bin lpddr4_pmu_train_$(1)_dmem_pad.bin > \
			lpddr4_pmu_train_$(1)_fw.bin
	)
endef

define FIRMWARE_IMX_INSTALL_IMAGES_CMDS
	$(call FIRMWARE_IMX_PREPARE_LPDDR4_FW,1d)
	$(call FIRMWARE_IMX_PREPARE_LPDDR4_FW,2d)
	cat $(@D)/firmware/ddr/synopsys/lpddr4_pmu_train_1d_fw.bin \
		$(@D)/firmware/ddr/synopsys/lpddr4_pmu_train_2d_fw.bin > \
		$(BINARIES_DIR)/lpddr4_pmu_train_fw.bin
	...
endef

And then the post-image script can use
$(BINARIES_DIR)/lpddr4_pmu_train_fw.bin.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2018-04-09 20:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-10 11:51 [Buildroot] [PATCH v6 0/4] Initial support for NXP iMX8 (imx8mq-evk) Erik Larsson
2018-03-10 11:51 ` [Buildroot] [PATCH v6 1/4] imx-mkimage: new package Erik Larsson
2018-04-09 20:07   ` Thomas Petazzoni
2018-04-10  5:27     ` Erik Larsson
2018-04-10  6:56       ` Thomas Petazzoni
2018-03-10 11:51 ` [Buildroot] [PATCH v6 2/4] freescale-imx: add config option for i.MX8M Erik Larsson
2018-04-09 20:08   ` Thomas Petazzoni
2018-03-10 11:51 ` [Buildroot] [PATCH v6 3/4] firmware-imx: add support for iMX8M firmware Erik Larsson
2018-04-09 20:38   ` Thomas Petazzoni [this message]
2018-03-10 11:51 ` [Buildroot] [PATCH v6 4/4] configs/freescale_imx8mqevk: new defconfig Erik Larsson
2018-04-09 20:42   ` Thomas Petazzoni
2018-04-09 20:46     ` Fabio Estevam
2018-04-10  5:37     ` Erik Larsson
2018-04-10 17:31     ` Erik Larsson
2018-04-10 21:26       ` Thomas Petazzoni
2018-04-11  5:23         ` Erik Larsson
2018-03-28  9:23 ` [Buildroot] [PATCH v6 0/4] Initial support for NXP iMX8 (imx8mq-evk) Erik Larsson

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=20180409223846.2d245c56@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox