Patchwork [meta-fsl-arm-extra,2/4] imx-bootlets: add a recipe for barebox and cfa-10036 support

login
register
mail settings
Submitter Alexandre Belloni
Date Aug. 22, 2013, 2:51 p.m.
Message ID <1377183077-5270-3-git-send-email-alexandre.belloni@free-electrons.com>
Download mbox | patch
Permalink /patch/56275/
State Changes Requested
Delegated to: Otavio Salvador
Headers show

Comments

Alexandre Belloni - Aug. 22, 2013, 2:51 p.m.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 .../imx-bootlets/barebox-fix-paths.patch           | 35 ++++++++++++
 recipes-bsp/imx-bootlets/imx-bootlets_cfa.bb       | 65 ++++++++++++++++++++++
 2 files changed, 100 insertions(+)
 create mode 100644 recipes-bsp/imx-bootlets/imx-bootlets/barebox-fix-paths.patch
 create mode 100644 recipes-bsp/imx-bootlets/imx-bootlets_cfa.bb
Otavio Salvador - Aug. 22, 2013, 5:10 p.m.
On Thu, Aug 22, 2013 at 11:51 AM, Alexandre Belloni
<alexandre.belloni@free-electrons.com> wrote:
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
...
> new file mode 100644
> index 0000000..c6c90d1
> --- /dev/null
> +++ b/recipes-bsp/imx-bootlets/imx-bootlets/barebox-fix-paths.patch
> @@ -0,0 +1,35 @@
> +From 98721be1c1762adec9130f15263d98e575e290ae Mon Sep 17 00:00:00 2001
> +From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> +Date: Thu, 8 Aug 2013 20:14:51 +0200
> +Subject: [PATCH] imx-bootlets: Fix paths used during boot stream generation
> +
> +This will be run during image generation thus this won't use a
> +complete path to allow for relocation.
> +
> +Upstream-Status: Inappropriate [configuration]
> +
> +Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> +---
> + barebox_ivt.bd | 6 +++---
> + 1 file changed, 3 insertions(+), 3 deletions(-)
> +
> +diff --git a/barebox_ivt.bd b/barebox_ivt.bd
> +index 0c67e9c..c603f9e 100644
> +--- a/barebox_ivt.bd
> ++++ b/barebox_ivt.bd
> +@@ -1,9 +1,9 @@
> + // STMP378x ROM command script to load and run U-Boot
> +
> + sources {
> +-      power_prep="./power_prep/power_prep";
> +-      sdram_prep="./boot_prep/boot_prep";
> +-      barebox="./barebox";
> ++      power_prep="imx-bootlets-power_prep-@MACHINE@";
> ++      sdram_prep="imx-bootlets-boot_prep-@MACHINE@";
> ++      barebox="barebox-@MACHINE@.bin";
> + }
> +
> + section (0) {
> +--
> +1.8.1.2


This patch is generic, move it to fsl-arm :)

> diff --git a/recipes-bsp/imx-bootlets/imx-bootlets_cfa.bb b/recipes-bsp/imx-bootlets/imx-bootlets_cfa.bb
> new file mode 100644
> index 0000000..580adef
> --- /dev/null
> +++ b/recipes-bsp/imx-bootlets/imx-bootlets_cfa.bb
> @@ -0,0 +1,65 @@
> +DESCRIPTION = "i.MXS boot streams"
> +LICENSE = "GPL-2.0"
> +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
> +
> +PR = "r1"
> +
> +SRC_URI = "git://github.com/crystalfontz/bootlets.git \
> +                  file://barebox-fix-paths.patch \
> +                 "
...

Use a bbappend :)
Alexandre Belloni - Aug. 22, 2013, 5:20 p.m.
On 22/08/2013 19:10, Otavio Salvador wrote:
> On Thu, Aug 22, 2013 at 11:51 AM, Alexandre Belloni
> <alexandre.belloni@free-electrons.com> wrote:
>> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ...
>> new file mode 100644
>> index 0000000..c6c90d1
>> --- /dev/null
>> +++ b/recipes-bsp/imx-bootlets/imx-bootlets/barebox-fix-paths.patch
>> @@ -0,0 +1,35 @@
>> +From 98721be1c1762adec9130f15263d98e575e290ae Mon Sep 17 00:00:00 2001
>> +From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
>> +Date: Thu, 8 Aug 2013 20:14:51 +0200
>> +Subject: [PATCH] imx-bootlets: Fix paths used during boot stream generation
>> +
>> +This will be run during image generation thus this won't use a
>> +complete path to allow for relocation.
>> +
>> +Upstream-Status: Inappropriate [configuration]
>> +
>> +Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
>> +---
>> + barebox_ivt.bd | 6 +++---
>> + 1 file changed, 3 insertions(+), 3 deletions(-)
>> +
>> +diff --git a/barebox_ivt.bd b/barebox_ivt.bd
>> +index 0c67e9c..c603f9e 100644
>> +--- a/barebox_ivt.bd
>> ++++ b/barebox_ivt.bd
>> +@@ -1,9 +1,9 @@
>> + // STMP378x ROM command script to load and run U-Boot
>> +
>> + sources {
>> +-      power_prep="./power_prep/power_prep";
>> +-      sdram_prep="./boot_prep/boot_prep";
>> +-      barebox="./barebox";
>> ++      power_prep="imx-bootlets-power_prep-@MACHINE@";
>> ++      sdram_prep="imx-bootlets-boot_prep-@MACHINE@";
>> ++      barebox="barebox-@MACHINE@.bin";
>> + }
>> +
>> + section (0) {
>> +--
>> +1.8.1.2
>
> This patch is generic, move it to fsl-arm :)
>

Probably not generic enough, barebox_ivt.bd is only present in the
crystalfontz's github repository. I think that is the main difference
but I didn't check.

>> diff --git a/recipes-bsp/imx-bootlets/imx-bootlets_cfa.bb b/recipes-bsp/imx-bootlets/imx-bootlets_cfa.bb
>> new file mode 100644
>> index 0000000..580adef
>> --- /dev/null
>> +++ b/recipes-bsp/imx-bootlets/imx-bootlets_cfa.bb
>> @@ -0,0 +1,65 @@
>> +DESCRIPTION = "i.MXS boot streams"
>> +LICENSE = "GPL-2.0"
>> +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
>> +
>> +PR = "r1"
>> +
>> +SRC_URI = "git://github.com/crystalfontz/bootlets.git \
>> +                  file://barebox-fix-paths.patch \
>> +                 "
> ...
>
> Use a bbappend :)
>
Otavio Salvador - Aug. 22, 2013, 5:59 p.m.
On Thu, Aug 22, 2013 at 2:20 PM, Alexandre Belloni
<alexandre.belloni@free-electrons.com> wrote:
> On 22/08/2013 19:10, Otavio Salvador wrote:
>> On Thu, Aug 22, 2013 at 11:51 AM, Alexandre Belloni
>> <alexandre.belloni@free-electrons.com> wrote:
>>> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
>> ...
>>> new file mode 100644
>>> index 0000000..c6c90d1
>>> --- /dev/null
>>> +++ b/recipes-bsp/imx-bootlets/imx-bootlets/barebox-fix-paths.patch
>>> @@ -0,0 +1,35 @@
>>> +From 98721be1c1762adec9130f15263d98e575e290ae Mon Sep 17 00:00:00 2001
>>> +From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
>>> +Date: Thu, 8 Aug 2013 20:14:51 +0200
>>> +Subject: [PATCH] imx-bootlets: Fix paths used during boot stream generation
>>> +
>>> +This will be run during image generation thus this won't use a
>>> +complete path to allow for relocation.
>>> +
>>> +Upstream-Status: Inappropriate [configuration]
>>> +
>>> +Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
>>> +---
>>> + barebox_ivt.bd | 6 +++---
>>> + 1 file changed, 3 insertions(+), 3 deletions(-)
>>> +
>>> +diff --git a/barebox_ivt.bd b/barebox_ivt.bd
>>> +index 0c67e9c..c603f9e 100644
>>> +--- a/barebox_ivt.bd
>>> ++++ b/barebox_ivt.bd
>>> +@@ -1,9 +1,9 @@
>>> + // STMP378x ROM command script to load and run U-Boot
>>> +
>>> + sources {
>>> +-      power_prep="./power_prep/power_prep";
>>> +-      sdram_prep="./boot_prep/boot_prep";
>>> +-      barebox="./barebox";
>>> ++      power_prep="imx-bootlets-power_prep-@MACHINE@";
>>> ++      sdram_prep="imx-bootlets-boot_prep-@MACHINE@";
>>> ++      barebox="barebox-@MACHINE@.bin";
>>> + }
>>> +
>>> + section (0) {
>>> +--
>>> +1.8.1.2
>>
>> This patch is generic, move it to fsl-arm :)
>>
>
> Probably not generic enough, barebox_ivt.bd is only present in the
> crystalfontz's github repository. I think that is the main difference
> but I didn't check.

I'd prefer to check the changes need and keep them in imx-bootlets to
avoid other boards intending to use barebox to redo it. The patch for
the board can be done using the bbappend.

Patch

diff --git a/recipes-bsp/imx-bootlets/imx-bootlets/barebox-fix-paths.patch b/recipes-bsp/imx-bootlets/imx-bootlets/barebox-fix-paths.patch
new file mode 100644
index 0000000..c6c90d1
--- /dev/null
+++ b/recipes-bsp/imx-bootlets/imx-bootlets/barebox-fix-paths.patch
@@ -0,0 +1,35 @@ 
+From 98721be1c1762adec9130f15263d98e575e290ae Mon Sep 17 00:00:00 2001
+From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
+Date: Thu, 8 Aug 2013 20:14:51 +0200
+Subject: [PATCH] imx-bootlets: Fix paths used during boot stream generation
+
+This will be run during image generation thus this won't use a
+complete path to allow for relocation.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
+---
+ barebox_ivt.bd | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/barebox_ivt.bd b/barebox_ivt.bd
+index 0c67e9c..c603f9e 100644
+--- a/barebox_ivt.bd
++++ b/barebox_ivt.bd
+@@ -1,9 +1,9 @@
+ // STMP378x ROM command script to load and run U-Boot
+ 
+ sources {
+-	power_prep="./power_prep/power_prep";
+-	sdram_prep="./boot_prep/boot_prep";
+-	barebox="./barebox";
++	power_prep="imx-bootlets-power_prep-@MACHINE@";
++	sdram_prep="imx-bootlets-boot_prep-@MACHINE@";
++	barebox="barebox-@MACHINE@.bin";
+ }
+ 
+ section (0) {
+-- 
+1.8.1.2
+
diff --git a/recipes-bsp/imx-bootlets/imx-bootlets_cfa.bb b/recipes-bsp/imx-bootlets/imx-bootlets_cfa.bb
new file mode 100644
index 0000000..580adef
--- /dev/null
+++ b/recipes-bsp/imx-bootlets/imx-bootlets_cfa.bb
@@ -0,0 +1,65 @@ 
+DESCRIPTION = "i.MXS boot streams"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+PR = "r1"
+
+SRC_URI = "git://github.com/crystalfontz/bootlets.git \
+		   file://barebox-fix-paths.patch \
+		  "
+SRCREV = "03bfdef0fa7efc6b64392e3eebfaf688018751cc"
+
+S = "${WORKDIR}/git"
+
+# Disable parallel building or it may fail to build.
+PARALLEL_MAKE = ""
+
+EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX}"
+
+# Ensure machine defines the IMXBOOTLETS_MACHINE
+python () {
+	if not d.getVar("IMXBOOTLETS_MACHINE", True):
+		PN = d.getVar("PN", True)
+		FILE = os.path.basename(d.getVar("FILE", True))
+		bb.debug(1, "To build %s, see %s for instructions on \
+			     setting up your machine config" % (PN, FILE))
+		raise bb.parse.SkipPackage("because IMXBOOTLETS_MACHINE is not set")
+}
+
+do_configure () {
+    sed -i 's,@MACHINE@,${MACHINE},g' barebox_ivt.bd
+}
+
+do_compile () {
+    oe_runmake BOARD=${IMXBOOTLETS_MACHINE} linux_prep \
+                                            boot_prep \
+                                            power_prep
+}
+
+do_install () {
+    install -d ${D}/boot/
+    install -m 644 boot_prep/boot_prep power_prep/power_prep \
+                   barebox_ivt.bd \
+                   ${D}/boot
+}
+
+FILES_${PN} = "/boot"
+
+do_deploy () {
+    install -d ${DEPLOY_DIR_IMAGE}
+
+	for f in boot_prep/boot_prep \
+             power_prep/power_prep \
+             barebox_ivt.bd; do
+        full_name="imx-bootlets-`basename $f`-${MACHINE}-${PV}-${PR}"
+        symlink_name="imx-bootlets-`basename $f`-${MACHINE}"
+
+        install -m 644 ${S}/$f ${DEPLOY_DIR_IMAGE}/$full_name
+        (cd ${DEPLOY_DIR_IMAGE} ; rm -f $symlink_nake ; ln -sf $full_name $symlink_name)
+    done
+}
+
+addtask deploy before do_build after do_compile
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+COMPATIBLE_MACHINE = "(mxs)"