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 4/4] configs/freescale_imx8mqevk: new defconfig
Date: Mon, 9 Apr 2018 22:42:24 +0200	[thread overview]
Message-ID: <20180409224224.7ba2379a@windsurf> (raw)
In-Reply-To: <1520682702-10035-5-git-send-email-karl.erik.larsson@gmail.com>

Hello Erik,

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

> diff --git a/board/freescale/common/imx/post-image.sh b/board/freescale/common/imx/post-image.sh
> index b239743..4c77ae2 100755
> --- a/board/freescale/common/imx/post-image.sh
> +++ b/board/freescale/common/imx/post-image.sh
> @@ -7,10 +7,10 @@
>  #
>  dtb_list()
>  {
> -	local DTB_LIST="$(sed -n 's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0-9 \-]*\)"$/\1/p' ${BR2_CONFIG})"
> +	local DTB_LIST="$(sed -n 's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([\/a-z0-9 \-]*\)"$/\1/p' ${BR2_CONFIG})"
>  
>  	for dt in $DTB_LIST; do
> -		echo -n "\"$dt.dtb\", "
> +		echo -n "\"`basename $dt`.dtb\", "
>  	done
>  }
>  
> @@ -23,6 +23,8 @@ linux_image()
>  {
>  	if grep -Eq "^BR2_LINUX_KERNEL_UIMAGE=y$" ${BR2_CONFIG}; then
>  		echo "\"uImage\""
> +	elif grep -Eq "^BR2_LINUX_KERNEL_IMAGE=y$" ${BR2_CONFIG}; then
> +		echo "\"Image\""
>  	else
>  		echo "\"zImage\""
>  	fi

Those two changes could be in a patch reworking post-image.sh to be
compatible with arm64.

> @@ -30,19 +32,39 @@ linux_image()
>  
>  genimage_type()
>  {
> -	if grep -Eq "^BR2_TARGET_UBOOT_SPL=y$" ${BR2_CONFIG}; then
> +	if grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M=y$" ${BR2_CONFIG}; then
> +		echo "genimage.cfg.template_imx8"
> +	elif grep -Eq "^BR2_TARGET_UBOOT_SPL=y$" ${BR2_CONFIG}; then
>  		echo "genimage.cfg.template_spl"
>  	else
>  		echo "genimage.cfg.template"
>  	fi
>  }
>  
> +gen_imx8_boot()
> +{
> +	cat ${BINARIES_DIR}/lpddr4_pmu_train_1d_imem_pad.bin ${BINARIES_DIR}/lpddr4_pmu_train_1d_dmem_pad.bin > ${BINARIES_DIR}/lpddr4_pmu_train_1d_fw.bin
> +	cat ${BINARIES_DIR}/lpddr4_pmu_train_2d_imem_pad.bin ${BINARIES_DIR}/lpddr4_pmu_train_2d_dmem.bin > ${BINARIES_DIR}/lpddr4_pmu_train_2d_fw.bin
> +	cat ${BINARIES_DIR}/u-boot-spl.bin ${BINARIES_DIR}/lpddr4_pmu_train_1d_fw.bin ${BINARIES_DIR}/lpddr4_pmu_train_2d_fw.bin > ${BINARIES_DIR}/u-boot-spl-ddr.bin
> +	rm -f ${BINARIES_DIR}/lpddr4_pmu_train_1d_fw.bin ${BINARIES_DIR}/lpddr4_pmu_train_2d_fw.bin
> +
> +	BL31=${BINARIES_DIR}/bl31.bin BL33=${BINARIES_DIR}/u-boot.bin ${HOST_DIR}/bin/mkimage_fit_atf.sh ${BINARIES_DIR}/fsl-imx8mq-evk.dtb > ${BINARIES_DIR}/u-boot.its
> +	${HOST_DIR}/bin/mkimage -E -p 0x3000 -f ${BINARIES_DIR}/u-boot.its ${BINARIES_DIR}/u-boot.itb
> +	rm -f ${BINARIES_DIR}/u-boot.its
> +
> +	${HOST_DIR}/bin/mkimage_imx8 -fit -signed_hdmi ${BINARIES_DIR}/signed_hdmi_imx8m.bin -loader ${BINARIES_DIR}/u-boot-spl-ddr.bin 0x7E1000 -second_loader ${BINARIES_DIR}/u-boot.itb 0x40200000 0x60000 -out ${BINARIES_DIR}/imx-boot-imx8mqevk-sd.bin
> +}

Shouldn't this logic be moved to a specialized post-image script ? And
then you do:

BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/imx8-bootloader-prepare.sh board/freescale/common/imx/post-image.sh"

or something like that ? Fabio, what do you think ?

Also, could you split the i.MX8 stuff from the support of the i.MX8 EVK board itself ?

I.e adding the genimage.cfg file, and adding imx8-bootloader.prepare.sh
should be one patch, and then adding the i.MX8 EVK defconfig and
readme.txt should be another patch.

Could you rework the last two patches according to those comments ?

Thanks a lot!

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

  reply	other threads:[~2018-04-09 20:42 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
2018-03-10 11:51 ` [Buildroot] [PATCH v6 4/4] configs/freescale_imx8mqevk: new defconfig Erik Larsson
2018-04-09 20:42   ` Thomas Petazzoni [this message]
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=20180409224224.7ba2379a@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