[U-Boot] [PATCHv1] arm: stm32mp1: deploy spl in root folder

Deploy u-boot-spl.stm32 binary in u-boot root folder like the rest of the boards. This makes it more streamlined when building in Yocto, Buildroot etc..
Signed-off-by: Sean Nyekjaer sean.nyekjaer@prevas.dk --- arch/arm/mach-stm32mp/config.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-stm32mp/config.mk b/arch/arm/mach-stm32mp/config.mk index cde5850e934..124729cd839 100644 --- a/arch/arm/mach-stm32mp/config.mk +++ b/arch/arm/mach-stm32mp/config.mk @@ -3,11 +3,11 @@ # Copyright (C) 2018, STMicroelectronics - All Rights Reserved #
-ALL-$(CONFIG_SPL_BUILD) += spl/u-boot-spl.stm32 +ALL-$(CONFIG_SPL_BUILD) += u-boot-spl.stm32
MKIMAGEFLAGS_u-boot-spl.stm32 = -T stm32image -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE)
-spl/u-boot-spl.stm32: MKIMAGEOUTPUT = spl/u-boot-spl.stm32.log +u-boot-spl.stm32: MKIMAGEOUTPUT = u-boot-spl.stm32.log
-spl/u-boot-spl.stm32: spl/u-boot-spl.bin FORCE +u-boot-spl.stm32: spl/u-boot-spl.bin FORCE $(call if_changed,mkimage)

Hi Sean
+Patrick Delaunay
What about keeping spl binary in /spl directory and copying it in root directory instead ? It would avoid us to update our environment regarding your proposal.
Just a minor remark, don't forget to add maintainers in copy when sending your patch.
Either use ./scripts/get_maintainer.pl <filename> which give you the people list to send your patch to or patman which adds automatically right people in cc.
For example ./scripts/get_maintainer.pl arch/arm/mach-stm32mp/config.mk gives you :
Patrick Delaunay patrick.delaunay@st.com (maintainer:ARM STM STM32MP) Christophe Kerello christophe.kerello@st.com (maintainer:ARM STM STM32MP) Patrice Chotard patrice.chotard@st.com (maintainer:ARM STM STM32MP) Albert Aribaud albert.u.boot@aribaud.net (maintainer:ARM) uboot-stm32@st-md-mailman.stormreply.com (moderated list:ARM STM STM32MP) u-boot@lists.denx.de (open list)
Patrice
On 1/4/19 12:37 PM, Sean Nyekjær wrote:
Deploy u-boot-spl.stm32 binary in u-boot root folder like the rest of the boards. This makes it more streamlined when building in Yocto, Buildroot etc..
Signed-off-by: Sean Nyekjaer sean.nyekjaer@prevas.dk
arch/arm/mach-stm32mp/config.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-stm32mp/config.mk b/arch/arm/mach-stm32mp/config.mk index cde5850e934..124729cd839 100644 --- a/arch/arm/mach-stm32mp/config.mk +++ b/arch/arm/mach-stm32mp/config.mk @@ -3,11 +3,11 @@ # Copyright (C) 2018, STMicroelectronics - All Rights Reserved #
-ALL-$(CONFIG_SPL_BUILD) += spl/u-boot-spl.stm32 +ALL-$(CONFIG_SPL_BUILD) += u-boot-spl.stm32
MKIMAGEFLAGS_u-boot-spl.stm32 = -T stm32image -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE)
-spl/u-boot-spl.stm32: MKIMAGEOUTPUT = spl/u-boot-spl.stm32.log +u-boot-spl.stm32: MKIMAGEOUTPUT = u-boot-spl.stm32.log
-spl/u-boot-spl.stm32: spl/u-boot-spl.bin FORCE +u-boot-spl.stm32: spl/u-boot-spl.bin FORCE $(call if_changed,mkimage)

ping
On 04.01.2019 16.18, Patrice CHOTARD wrote:
Hi Sean
+Patrick Delaunay
What about keeping spl binary in /spl directory and copying it in root directory instead ? It would avoid us to update our environment regarding your proposal.
Just a minor remark, don't forget to add maintainers in copy when sending your patch.
Either use ./scripts/get_maintainer.pl <filename> which give you the people list to send your patch to or patman which adds automatically right people in cc.
For example ./scripts/get_maintainer.pl arch/arm/mach-stm32mp/config.mk gives you :
Patrick Delaunay patrick.delaunay@st.com (maintainer:ARM STM STM32MP) Christophe Kerello christophe.kerello@st.com (maintainer:ARM STM STM32MP) Patrice Chotard patrice.chotard@st.com (maintainer:ARM STM STM32MP) Albert Aribaud albert.u.boot@aribaud.net (maintainer:ARM) uboot-stm32@st-md-mailman.stormreply.com (moderated list:ARM STM STM32MP) u-boot@lists.denx.de (open list)
Patrice
On 1/4/19 12:37 PM, Sean Nyekjær wrote:
Deploy u-boot-spl.stm32 binary in u-boot root folder like the rest of the boards. This makes it more streamlined when building in Yocto, Buildroot etc..
Signed-off-by: Sean Nyekjaer sean.nyekjaer@prevas.dk
arch/arm/mach-stm32mp/config.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-stm32mp/config.mk b/arch/arm/mach-stm32mp/config.mk index cde5850e934..124729cd839 100644 --- a/arch/arm/mach-stm32mp/config.mk +++ b/arch/arm/mach-stm32mp/config.mk @@ -3,11 +3,11 @@ # Copyright (C) 2018, STMicroelectronics - All Rights Reserved #
-ALL-$(CONFIG_SPL_BUILD) += spl/u-boot-spl.stm32 +ALL-$(CONFIG_SPL_BUILD) += u-boot-spl.stm32
MKIMAGEFLAGS_u-boot-spl.stm32 = -T stm32image -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE)
-spl/u-boot-spl.stm32: MKIMAGEOUTPUT = spl/u-boot-spl.stm32.log +u-boot-spl.stm32: MKIMAGEOUTPUT = u-boot-spl.stm32.log
-spl/u-boot-spl.stm32: spl/u-boot-spl.bin FORCE +u-boot-spl.stm32: spl/u-boot-spl.bin FORCE $(call if_changed,mkimage)

Hi Sean
On 1/24/19 12:30 PM, Sean Nyekjaer wrote:
ping
On 04.01.2019 16.18, Patrice CHOTARD wrote:
Hi Sean
+Patrick Delaunay
What about keeping spl binary in /spl directory and copying it in root directory instead ? It would avoid us to update our environment regarding your proposal.
You didn't answer to the above question.
Patrice
Just a minor remark, don't forget to add maintainers in copy when sending your patch.
Either use ./scripts/get_maintainer.pl <filename> which give you the people list to send your patch to or patman which adds automatically right people in cc.
For example ./scripts/get_maintainer.pl arch/arm/mach-stm32mp/config.mk gives you :
Patrick Delaunay patrick.delaunay@st.com (maintainer:ARM STM STM32MP) Christophe Kerello christophe.kerello@st.com (maintainer:ARM STM STM32MP) Patrice Chotard patrice.chotard@st.com (maintainer:ARM STM STM32MP) Albert Aribaud albert.u.boot@aribaud.net (maintainer:ARM) uboot-stm32@st-md-mailman.stormreply.com (moderated list:ARM STM STM32MP) u-boot@lists.denx.de (open list)
Patrice
On 1/4/19 12:37 PM, Sean Nyekjær wrote:
Deploy u-boot-spl.stm32 binary in u-boot root folder like the rest of the boards. This makes it more streamlined when building in Yocto, Buildroot etc..
Signed-off-by: Sean Nyekjaer sean.nyekjaer@prevas.dk
arch/arm/mach-stm32mp/config.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-stm32mp/config.mk b/arch/arm/mach-stm32mp/config.mk index cde5850e934..124729cd839 100644 --- a/arch/arm/mach-stm32mp/config.mk +++ b/arch/arm/mach-stm32mp/config.mk @@ -3,11 +3,11 @@ # Copyright (C) 2018, STMicroelectronics - All Rights Reserved # -ALL-$(CONFIG_SPL_BUILD) += spl/u-boot-spl.stm32 +ALL-$(CONFIG_SPL_BUILD) += u-boot-spl.stm32 MKIMAGEFLAGS_u-boot-spl.stm32 = -T stm32image -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -spl/u-boot-spl.stm32: MKIMAGEOUTPUT = spl/u-boot-spl.stm32.log +u-boot-spl.stm32: MKIMAGEOUTPUT = u-boot-spl.stm32.log -spl/u-boot-spl.stm32: spl/u-boot-spl.bin FORCE +u-boot-spl.stm32: spl/u-boot-spl.bin FORCE $(call if_changed,mkimage)

Hi Patrice
What about keeping spl binary in /spl directory and copying it in root directory instead ? It would avoid us to update our environment regarding your proposal.
You didn't answer to the above question.
Patrice
Sorry. I really don't care how it's done :-) But the I think the best solution is the I one posted, it's better to align things with other boards in u-boot.
/Sean

Hi Sean,
From: Sean Nyekjaer sean@geanix.com Sent: jeudi 24 janvier 2019 13:38
Hi Patrice
What about keeping spl binary in /spl directory and copying it in root directory instead ? It would avoid us to update our environment regarding your proposal.
You didn't answer to the above question.
Patrice
Sorry. I really don't care how it's done :-) But the I think the best solution is the I one posted, it's better to align things with other boards in u-boot.
I checked with Patrice the other boards and most of the cases the modified spl binay (u-boot-spl.bin/ u-boot-spl.ais / u-boot-spl.img / u-boot-spl.pbl / u-boot-spl.gph) are generated in spl directory.
So I done the same for u-boot-spl.stm32.
The only case where it is populated in u-boot directory it is when it is concatenated with u-boot image (so the generated files depends on u-boot.bin) , but is not the case for us.
Perhaps I miss so other cases ?
Moreover I am working with YOCTO and using a sub-directory is not issue with latest version and with patch in poky/meta/recipes-bsp/u-boot/u-boot.inc ------------------------------------------------------------------------------------------ commit c6ab82882cd49be5510d1f8c967d0dc2da2490c2 Author: Nathan Rossi nathan@nathanrossi.com Fri Mar 25 10:07:12 2016 Committer: Richard Purdie richard.purdie@linuxfoundation.org Mon Mar 28 16:55:48 2016
u-boot.inc: Add sub-dir support for SPL_BINARY
Add support for the SPL_BINARY variable to handle sub directories. In some cases the SPL binary that needs to be deployed is only built to the spl/ directory in U-Boot. So that a sub directory can be specified in the SPL_BINARY variable, handle the case so that the deploy code uses the basename of the path specified in SPL_BINARY.
(From OE-Core rev: eb90d1c8fc7b82ca2593185930b3bf175f40ae13)
Signed-off-by: Nathan Rossi nathan@nathanrossi.com Signed-off-by: Richard Purdie richard.purdie@linuxfoundation.org ------------------------------------------------------------------------------------------
So, I don't understood the blocking point, and other platform do the same (the reason of the patch).
Even I agree that copy the generated u-boot-spl.stm32 in u-boot build directory could be easier (for BUILDROOT ?), I want keep the file spl/u-boot-spl.stm32 to avoid to break the current upstream effort of YOCTO BSP support for STM32MP157 board (which expect spl file in spl directory).
I you are agree with the next proposal, I will ack you patch v2
=> a modified patch to just copy with $(call if_changed,copy)
------------------------------------------------------------------------------------------------------------ From c2ee2da650c0afef8df8c467ee6e643480193c5d Mon Sep 17 00:00:00 2001 From: Patrick Delaunay patrick.delaunay@st.com Date: Thu, 24 Jan 2019 16:08:50 +0100 Subject: [PATCHv2] arm: stm32mp1: deploy spl in root folder
Deploy u-boot-spl.stm32 binary in u-boot root folder like the rest of the boards. This makes it more streamlined when building in Yocto, Buildroot etc..
Signed-off-by: Sean Nyekjaer sean.nyekjaer@prevas.dk ---
arch/arm/mach-stm32mp/config.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-stm32mp/config.mk b/arch/arm/mach-stm32mp/config.mk index cde5850..f371aac 100644 --- a/arch/arm/mach-stm32mp/config.mk +++ b/arch/arm/mach-stm32mp/config.mk @@ -3,7 +3,7 @@ # Copyright (C) 2018, STMicroelectronics - All Rights Reserved #
-ALL-$(CONFIG_SPL_BUILD) += spl/u-boot-spl.stm32 +ALL-$(CONFIG_SPL_BUILD) += u-boot-spl.stm32
MKIMAGEFLAGS_u-boot-spl.stm32 = -T stm32image -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE)
@@ -11,3 +11,6 @@ spl/u-boot-spl.stm32: MKIMAGEOUTPUT = spl/u-boot-spl.stm32.log
spl/u-boot-spl.stm32: spl/u-boot-spl.bin FORCE $(call if_changed,mkimage) + +u-boot-spl.stm32 : spl/u-boot-spl.stm32 + $(call if_changed,copy)

Hi Patrick
I checked with Patrice the other boards and most of the cases the modified spl binay (u-boot-spl.bin/ u-boot-spl.ais / u-boot-spl.img / u-boot-spl.pbl / u-boot-spl.gph) are generated in spl directory.
So I done the same for u-boot-spl.stm32.
All the NXP iMX6 variant boards deploy the SPL to the root folder :-)
The only case where it is populated in u-boot directory it is when it is concatenated with u-boot image (so the generated files depends on u-boot.bin) , but is not the case for us.
Perhaps I miss so other cases ?
Moreover I am working with YOCTO and using a sub-directory is not issue with latest version and with patch in poky/meta/recipes-bsp/u-boot/u-boot.inc
commit c6ab82882cd49be5510d1f8c967d0dc2da2490c2 Author: Nathan Rossi <nathan@nathanrossi.com> Fri Mar 25 10:07:12 2016
Committer: Richard Purdie richard.purdie@linuxfoundation.org Mon Mar 28 16:55:48 2016
u-boot.inc: Add sub-dir support for SPL_BINARY
Add support for the SPL_BINARY variable to handle sub directories. In some cases the SPL binary that needs to be deployed is only built to the spl/ directory in U-Boot. So that a sub directory can be specified in the SPL_BINARY variable, handle the case so that the deploy code uses the basename of the path specified in SPL_BINARY.
(From OE-Core rev: eb90d1c8fc7b82ca2593185930b3bf175f40ae13)
Signed-off-by: Nathan Rossi nathan@nathanrossi.com Signed-off-by: Richard Purdie richard.purdie@linuxfoundation.org
So, I don't understood the blocking point, and other platform do the same (the reason of the patch).
Even I agree that copy the generated u-boot-spl.stm32 in u-boot build directory could be easier (for BUILDROOT ?), I want keep the file spl/u-boot-spl.stm32 to avoid to break the current upstream effort of YOCTO BSP support for STM32MP157 board (which expect spl file in spl directory).
I got a new job (therefore new email address), so i don't have access to the Yocto source where I got into troubles with this. If i recall correctly we where using the SPI_BINARY variable when deploying the SPL and we should have been using the SPL_BINARYNAME.
So no need for this patch.
/Sean

Hi Sean,
From: Sean Nyekjaer sean@geanix.com Sent: vendredi 25 janvier 2019 08:11 To: Patrick DELAUNAY patrick.delaunay@st.com; ravi@prevas.dk Cc: Patrice CHOTARD patrice.chotard@st.com; u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCHv1] arm: stm32mp1: deploy spl in root folder Importance: High
Hi Patrick
I checked with Patrice the other boards and most of the cases the modified spl binay (u-boot-spl.bin/ u-boot-spl.ais / u-boot-spl.img / u-boot-spl.pbl / u-boot-spl.gph) are generated in spl directory.
So I done the same for u-boot-spl.stm32.
All the NXP iMX6 variant boards deploy the SPL to the root folder :-)
Ok, I checked and the generated files are
1 - spl/u-boot-spl.bin 2 - SPL = spl/u-boot-spl.bin + $(PLUGIN).bin + imx header 3 - u-boot.bin
SPL is no only spl but include plugin, so it is normal for for that it is not in spl sub-directory
The only case where it is populated in u-boot directory it is when it is concatenated with u-boot image (so the generated files depends on u-
boot.bin) , but is not the case for us.
Perhaps I miss so other cases ?
Moreover I am working with YOCTO and using a sub-directory is not issue with latest version and with patch in poky/meta/recipes-bsp/u-boot/u-boot.inc
commit c6ab82882cd49be5510d1f8c967d0dc2da2490c2 Author: Nathan Rossi <nathan@nathanrossi.com> Fri Mar 25 10:07:12
2016
Committer: Richard Purdie richard.purdie@linuxfoundation.org Mon Mar
28 16:55:48 2016
u-boot.inc: Add sub-dir support for SPL_BINARY
Add support for the SPL_BINARY variable to handle sub directories. In some cases the SPL binary that needs to be deployed is only built to the spl/ directory in U-Boot. So that a sub directory can be specified in the SPL_BINARY variable, handle the case so that the deploy code uses the basename of the path specified in SPL_BINARY.
(From OE-Core rev: eb90d1c8fc7b82ca2593185930b3bf175f40ae13)
Signed-off-by: Nathan Rossi nathan@nathanrossi.com Signed-off-by: Richard Purdie richard.purdie@linuxfoundation.org
So, I don't understood the blocking point, and other platform do the same (the
reason of the patch).
Even I agree that copy the generated u-boot-spl.stm32 in u-boot build directory could be easier (for BUILDROOT ?), I want keep the file spl/u-boot-spl.stm32 to avoid to break the current upstream effort of YOCTO
BSP support for STM32MP157 board (which expect spl file in spl directory).
I got a new job (therefore new email address), so i don't have access to the Yocto source where I got into troubles with this. If i recall correctly we where using the SPI_BINARY variable when deploying the SPL and we should have been using the SPL_BINARYNAME.
So no need for this patch.
Ok, I think the patch can be abandon as with latest YOCTO it is working with machine value:
SPL_BINARY = " spl/u-boot-spl.stm32"
Because path is supported in the next variables
SPL_BINARYNAME ?= "${@os.path.basename(d.getVar("SPL_BINARY"))}" SPL_IMAGE ?= "${SPL_BINARYNAME}-${MACHINE}-${PV}-${PR}" SPL_SYMLINK ?= "${SPL_BINARYNAME}-${MACHINE}"
PS: It can also work with previous version YOCTO with SPL_BINARY = " spl/u-boot-spl.stm32" SPL_BINARYNAME = "u-boot-spl.stm32"
But I will kept my proposal in mind if other requests/complaint come in the future.
Thanks for your time and good luck for your new job.
/Sean
Best regards
Patrick

On Fri, Jan 04, 2019 at 11:37:24AM +0000, Sean Nyekjær wrote:
Deploy u-boot-spl.stm32 binary in u-boot root folder like the rest of the boards. This makes it more streamlined when building in Yocto, Buildroot etc..
Signed-off-by: Sean Nyekjaer sean.nyekjaer@prevas.dk Signed-off-by: Sean Nyekjaer sean.nyekjaer@prevas.dk
Applied to u-boot/master, thanks!

Hi Tom,
-----Original Message----- From: U-Boot u-boot-bounces@lists.denx.de On Behalf Of Tom Rini Sent: dimanche 27 janvier 2019 04:51 To: Sean Nyekjær Sean.Nyekjaer@prevas.dk Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] [U-Boot, PATCHv1] arm: stm32mp1: deploy spl in root folder
On Fri, Jan 04, 2019 at 11:37:24AM +0000, Sean Nyekjær wrote:
Deploy u-boot-spl.stm32 binary in u-boot root folder like the rest of the boards. This makes it more streamlined when building in Yocto, Buildroot etc..
Signed-off-by: Sean Nyekjaer sean.nyekjaer@prevas.dk Signed-off-by: Sean Nyekjaer sean.nyekjaer@prevas.dk
Applied to u-boot/master, thanks!
For information, I want some update for this patch in my last comment. As it is already merged I sent a updated version:
http://patchwork.ozlabs.org/patch/1031838/
Regards.
-- Tom
Patrick

On Mon, Jan 28, 2019 at 10:18:37AM +0000, Patrick DELAUNAY wrote:
Hi Tom,
-----Original Message----- From: U-Boot u-boot-bounces@lists.denx.de On Behalf Of Tom Rini Sent: dimanche 27 janvier 2019 04:51 To: Sean Nyekjær Sean.Nyekjaer@prevas.dk Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] [U-Boot, PATCHv1] arm: stm32mp1: deploy spl in root folder
On Fri, Jan 04, 2019 at 11:37:24AM +0000, Sean Nyekjær wrote:
Deploy u-boot-spl.stm32 binary in u-boot root folder like the rest of the boards. This makes it more streamlined when building in Yocto, Buildroot etc..
Signed-off-by: Sean Nyekjaer sean.nyekjaer@prevas.dk Signed-off-by: Sean Nyekjaer sean.nyekjaer@prevas.dk
Applied to u-boot/master, thanks!
For information, I want some update for this patch in my last comment. As it is already merged I sent a updated version:
Sorry for missing your comments, I'll grab your newer patch shortly.
participants (5)
-
Patrice CHOTARD
-
Patrick DELAUNAY
-
Sean Nyekjaer
-
Sean Nyekjær
-
Tom Rini