diff mbox series

[1/5] board/freescale/common/imx: make imx8-bootloader-prepare more generic

Message ID 20180719073253.22433-2-gary.bisson@boundarydevices.com
State Superseded
Headers show
Series Add Boundary Devices Nitrogen8M support | expand

Commit Message

Gary Bisson July 19, 2018, 7:32 a.m. UTC
Allow user to override the hardcoded dtb name by using
BR2_ROOTFS_POST_SCRIPT_ARGS.

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
---
 .../freescale/common/imx/imx8-bootloader-prepare.sh  | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Thomas Petazzoni July 19, 2018, 7:45 a.m. UTC | #1
Hello,

On Thu, 19 Jul 2018 09:32:49 +0200, Gary Bisson wrote:
> Allow user to override the hardcoded dtb name by using
> BR2_ROOTFS_POST_SCRIPT_ARGS.
> 
> Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
> ---
>  .../freescale/common/imx/imx8-bootloader-prepare.sh  | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/board/freescale/common/imx/imx8-bootloader-prepare.sh b/board/freescale/common/imx/imx8-bootloader-prepare.sh
> index 2648147ab0..ce2c3405a0 100755
> --- a/board/freescale/common/imx/imx8-bootloader-prepare.sh
> +++ b/board/freescale/common/imx/imx8-bootloader-prepare.sh
> @@ -2,9 +2,17 @@
>  
>  main ()
>  {
> -	# Currently we support imx8mqevk.
> +	if [ $# -le 1 ]; then
> +		UBOOT_DTB=${BINARIES_DIR}/fsl-imx8mq-evk.dtb

I don't think it's worth keeping some kind of "backward compatibility"
here. Just change configs/freescale_imx8mqevk_defconfig to pass the DTB
name as argument.

Thanks!

Thomas
Gary Bisson July 19, 2018, 8 a.m. UTC | #2
Hi Thomas,

On Thu, Jul 19, 2018 at 09:45:27AM +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Thu, 19 Jul 2018 09:32:49 +0200, Gary Bisson wrote:
> > Allow user to override the hardcoded dtb name by using
> > BR2_ROOTFS_POST_SCRIPT_ARGS.
> > 
> > Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
> > ---
> >  .../freescale/common/imx/imx8-bootloader-prepare.sh  | 12 ++++++++++--
> >  1 file changed, 10 insertions(+), 2 deletions(-)
> > 
> > diff --git a/board/freescale/common/imx/imx8-bootloader-prepare.sh b/board/freescale/common/imx/imx8-bootloader-prepare.sh
> > index 2648147ab0..ce2c3405a0 100755
> > --- a/board/freescale/common/imx/imx8-bootloader-prepare.sh
> > +++ b/board/freescale/common/imx/imx8-bootloader-prepare.sh
> > @@ -2,9 +2,17 @@
> >  
> >  main ()
> >  {
> > -	# Currently we support imx8mqevk.
> > +	if [ $# -le 1 ]; then
> > +		UBOOT_DTB=${BINARIES_DIR}/fsl-imx8mq-evk.dtb
> 
> I don't think it's worth keeping some kind of "backward compatibility"
> here. Just change configs/freescale_imx8mqevk_defconfig to pass the DTB
> name as argument.

Fair enough, I'm fine with that. However, should I keep the check on the
arguments number to throw an error if no argument is provided?

Or is the check on UBOOT_DTB existence sufficient?

I'll wait for a day before respinning the series to see if there are
other comments.

Also, not related to the patch, the series doesn't appear "properly" in
the mailing list archive, patches aren't answers to the cover letter.
Other strange thing in Patchwork, patch 4/5 is part of "Untitled series
#56383" instead of the real series, is it normal?
I just want to make sure I'm not missing some settings in my
git-send-email config although it just seems that the server
received/treated the emails in the wrong order.

Regards,
Gary
Thomas Petazzoni July 19, 2018, 8:07 a.m. UTC | #3
Hello,

On Thu, 19 Jul 2018 10:00:54 +0200, Gary Bisson wrote:

> > I don't think it's worth keeping some kind of "backward compatibility"
> > here. Just change configs/freescale_imx8mqevk_defconfig to pass the DTB
> > name as argument.  
> 
> Fair enough, I'm fine with that. However, should I keep the check on the
> arguments number to throw an error if no argument is provided?
> 
> Or is the check on UBOOT_DTB existence sufficient?

I think the latter is sufficient.

Or, alternatively, change the script radically to use getopt to avoid
using positional arguments. But I don't think it's worth the effort for
now, just keep things simple.

> I'll wait for a day before respinning the series to see if there are
> other comments.
> 
> Also, not related to the patch, the series doesn't appear "properly" in
> the mailing list archive, patches aren't answers to the cover letter.
> Other strange thing in Patchwork, patch 4/5 is part of "Untitled series
> #56383" instead of the real series, is it normal?
> I just want to make sure I'm not missing some settings in my
> git-send-email config although it just seems that the server
> received/treated the emails in the wrong order.

This is a known patchwork limitation. Your e-mails arrived out of order
(I was initially missing patch 3/5 here and the cover letter, and they
arrived a few minutes later). When e-mails arrive out of order,
patchwork gets confused and is not able to assign patches to the proper
series. IOW, there's no problem on your side, it's patchwork that
doesn't behave properly.

Best regards,

Thomas
diff mbox series

Patch

diff --git a/board/freescale/common/imx/imx8-bootloader-prepare.sh b/board/freescale/common/imx/imx8-bootloader-prepare.sh
index 2648147ab0..ce2c3405a0 100755
--- a/board/freescale/common/imx/imx8-bootloader-prepare.sh
+++ b/board/freescale/common/imx/imx8-bootloader-prepare.sh
@@ -2,9 +2,17 @@ 
 
 main ()
 {
-	# Currently we support imx8mqevk.
+	if [ $# -le 1 ]; then
+		UBOOT_DTB=${BINARIES_DIR}/fsl-imx8mq-evk.dtb
+	else
+		UBOOT_DTB=$2
+	fi
+	if [ ! -e $UBOOT_DTB ]; then
+		echo "ERROR: couldn't find $UBOOT_DTB"
+		exit 1
+	fi
 	cat ${BINARIES_DIR}/u-boot-spl.bin ${BINARIES_DIR}/lpddr4_pmu_train_fw.bin > ${BINARIES_DIR}/u-boot-spl-ddr.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
+	BL31=${BINARIES_DIR}/bl31.bin BL33=${BINARIES_DIR}/u-boot.bin ${HOST_DIR}/bin/mkimage_fit_atf.sh ${UBOOT_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