[PATCH 0/3] Support u-boot on wandboard and mx6cuboxi

  • Done
  • quality assurance status badge
Details
3 participants
  • Danny Milosavljevic
  • Ludovic Courtès
  • Vagrant Cascadian
Owner
unassigned
Submitted by
Vagrant Cascadian
Severity
normal
V
V
Vagrant Cascadian wrote on 29 Apr 2018 09:28
(address . guix-patches@gnu.org)
87k1sqo4it.fsf@aikidev.net
The following patches enable u-boot builds for wandboard and mx6cuboxi.

Both u-boot builds require the inclusion of the "SPL" file.

Tested on Wandboard Solo and Hummingboard-i1.

live well,
vagrant

Vagrant Cascadian (3):
gnu: make-u-boot-package: Install 'SPL' files also.
gnu: Add u-boot-wandboard.
gnu: Add u-boot-mx6cuboxi.

gnu/packages/bootloaders.scm | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
From 1e1705ae3167c1e3eb149a7e30837b6fdca2aed1 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@debian.org>
Date: Sun, 29 Apr 2018 04:33:00 +0000
Subject: [PATCH 1/3] gnu: make-u-boot-package: Install 'SPL' files also.

* gnu/packages/bootloaders.scm (make-u-boot-package)[arguments]: Add 'SPL'
files to the files installed during custom 'install phase.
---
gnu/packages/bootloaders.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 4350ff3a5..fc4570c2e 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -408,7 +408,7 @@ also initializes the boards (RAM etc).")
(libexec (string-append out "/libexec"))
(uboot-files (append
(find-files "." ".*\\.(bin|efi|img|spl|itb|dtb)$")
- (find-files "." "^MLO$"))))
+ (find-files "." "^(MLO|SPL)$"))))
(mkdir-p libexec)
(install-file ".config" libexec)
(for-each
--
2.17.0
From 30a21d289cf6a49f2a80ff66fb969b3bac511a08 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@debian.org>
Date: Sun, 29 Apr 2018 04:38:05 +0000
Subject: [PATCH 2/3] gnu: Add u-boot-wandboard.

* gnu/packages/bootloaders.scm (u-boot-wandboard): New variable.
---
gnu/packages/bootloaders.scm | 3 +++
1 file changed, 3 insertions(+)

Toggle diff (16 lines)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index fc4570c2e..6a9fa36f2 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -463,6 +463,9 @@ also initializes the boards (RAM etc).")
(define-public u-boot-nintendo-nes-classic-edition
(make-u-boot-package "Nintendo_NES_Classic_Edition" "arm-linux-gnueabihf"))
+(define-public u-boot-wandboard
+ (make-u-boot-package "wandboard" "arm-linux-gnueabihf"))
+
(define-public vboot-utils
(package
(name "vboot-utils")
--
2.17.0
From d86d0b14a4885328f09b4454d078a2b0df6c041a Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@debian.org>
Date: Sun, 29 Apr 2018 06:39:10 +0000
Subject: [PATCH 3/3] gnu: Add u-boot-mx6cuboxi.

* gnu/packages/bootloaders.scm (u-boot-mx6cuboxi): New variable.
---
gnu/packages/bootloaders.scm | 3 +++
1 file changed, 3 insertions(+)

Toggle diff (16 lines)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 6a9fa36f2..0db6ad3f6 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -466,6 +466,9 @@ also initializes the boards (RAM etc).")
(define-public u-boot-wandboard
(make-u-boot-package "wandboard" "arm-linux-gnueabihf"))
+(define-public u-boot-mx6cuboxi
+ (make-u-boot-package "mx6cuboxi" "arm-linux-gnueabihf"))
+
(define-public vboot-utils
(package
(name "vboot-utils")
--
2.17.0
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEcDardHbDotegGFCHt4uC1IFLkbYFAlrldBoACgkQt4uC1IFL
kbYLOBAAhzux3ovS/6JvxljibOJGVdANVXiTODDahd4+TNxMtmh/7sQ1Y4H9aur+
wGvXSeZ4dJaMAqVuK8kXFJV4Hxrau3KT6H+gf/BnBOCTfXMSdPQWoOuKuz1XdkQL
d0qXjCTNcyOnQdkrQHuzi8snO3yDOGfdEjfEYiRYq9EJe/QZi0RXdKBG7rlJTrxs
WIM1jWC7V5zsoAiQBuyuEdYUstNH6u2xMZUzaZzzmzVO0mtuDE69XVXmLI9dMV+f
ejpLj8V3uG6b3pT0Wlfj4rulfwWB18m4X7XbFS3G4xiRl3X3mhm96sSnoIHkEvVv
JYFSd/aLkDMVMiHGb7KEDprpJa3ZqLTOu3Hpx+dMTUfw1z3tUJS/euzauFkFdhns
q2+iz7tejXDtHT1abzkZWUKJTT3T+tpiCFcAijrWcQzTUEp0PUH04cF5ckpHEKdj
LeKa8Q9DsSHgOa/lNgjeuF46+H1XrIM8AsZPt1+WfgiCdQ8v6owBtf4fEHkGRTB+
mGD3DK9sv4Ycr9PQi+WBahlOTY9tZ9gc6aA1jL0A3dOcgaZA+GV3839CJg0E48pk
LATLmTzBbHa9XdKXFvaxj+6gPhlm0/hHRHZqmLTh2IFzwJrAYf3wyW4vboc5wIcF
wlzoFvPF/6whnEQj5OHiMGCjETnkiv6C6e4PxeTr6RC+z5OxS9A=
=CV5G
-----END PGP SIGNATURE-----

D
D
Danny Milosavljevic wrote on 29 Apr 2018 17:26
(name . Vagrant Cascadian)(address . vagrant@debian.org)(address . 31308-done@debbugs.gnu.org)
20180429172616.43b04a46@scratchpost.org
Hi,

thanks!

I've applied these patches to master.

Just a heads-up, there are now files "SPL" and "spl" (with different contents) being installed. That's fine as long as we are using a case-sensitive filesystem, which we probably are.

Let's just keep an eye on it.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlrl5BgACgkQ5xo1VCww
uqW28gf/VFu1OBjCAOp99xUv/4v9rseMHE6fW8aGPufqd4A3YVy/QwLWyIpL2zMt
zme+FClmoRmTAa3SWMBvYVu1clpqcT+/AfxiXL1iBzr0SS+ixc/INj1lMbEjNsaY
kM7XTUUIjyR2X02RtZdmbvs7f6D0QfZlU4dVeMUkqrtNA2B8t/KHMNbtU+8DtaWi
VTMoamuwNsvpPtySHs9iMsJ8por5H/V1yfv7ghaSStxJtiHy+5+gK3ieYrCsRjyb
WsFha/M/3PuBlcAwx1DvEfhf+4Xad+aGut/PcJ8vIQsK6SIcEpq7OLDw7DPYC2La
QR5TyJPMtwpagksWTpZVNsh9r5u0wQ==
=zPF+
-----END PGP SIGNATURE-----


Closed
V
V
Vagrant Cascadian wrote on 30 Apr 2018 07:41
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 31308@debbugs.gnu.org)
87h8ntntdw.fsf@aikidev.net
On 2018-04-29, Danny Milosavljevic wrote:
Toggle quote (2 lines)
> I've applied these patches to master.

Thanks for being the one to apply my first contribution to guix! :)


Toggle quote (4 lines)
> Just a heads-up, there are now files "SPL" and "spl" (with different
> contents) being installed. That's fine as long as we are using a
> case-sensitive filesystem, which we probably are.

I think the two matches are against files the ending in .spl and files
that are exactly "SPL", so this shouldn't be much of an issue, even with
a case-insensitive filesystem. I imagine many other things would break
with a case-insensitive filesystem, too...


live well,
vagrant
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEcDardHbDotegGFCHt4uC1IFLkbYFAlrmrHsACgkQt4uC1IFL
kbbVIw//SfvIaEeDMEB3/1HgkpSIf9Qn9RzqvcUH1wfGoTwBH1vvw0JOrBBnjJte
0R0ZqSNK1NCK/PDkM1HaqYG4Jkx0A5CyL5WDzXiV6vxADYr8a7H0ZSPzJR/fpn/h
DhzU5aNRW1aBpt9EE4ARicVd588uPYnrmr6X3CUZ8Kg+LFB5wg0LayPy1jcXtrm2
kMFh4loxLm6U9Ii5gxQRFHS9kFIraQrowm3KpaOpoOMJ6h2JShGUXZUJFC08z09i
Tkz+vgJc4Ce54C+K0GLMjL6PpxnxONH2A6h19NGHCparyFyswmjRmtp56z0oTQmo
IwP46/fcM3Wk4gJDAAcskWoXKMtQBnMiICsMgs/QLtOjPEg706NjHcIvYJh7UikW
MNMr3hUsHznomSbwuTEVHQ2NGLVFhwdoG4erRLxRB+L16gonb4t7I17ivU/EJMEF
LcbkpxcPZsQ8OkfnJgy3HQ/RTg1MqvcJYYFg3GRrxWtpx9P/UIFDNLq4GAWY0tOV
2TRDcnPvcTPuOTpkVoRhmLCok7X4aCe3za/SfQdVHXCb9aDu4Qe0BZ3KkrKJW6fQ
p+Tj14Xza2VZfxb/weA/KMrBubLc+bJCgCcThGwvz1IyaccEUHTgJ3UkSzftl1SM
FMyPCM8KN7yCtLGuKUgtRp9ATs0PnYtDZRP2pxPYJgsc27NlJLQ=
=KaId
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 30 Apr 2018 23:01
(name . Vagrant Cascadian)(address . vagrant@debian.org)(address . 31308@debbugs.gnu.org)
876048v27m.fsf@gnu.org
Hi Vagrant,

Vagrant Cascadian <vagrant@debian.org> skribis:

Toggle quote (6 lines)
> The following patches enable u-boot builds for wandboard and mx6cuboxi.
>
> Both u-boot builds require the inclusion of the "SPL" file.
>
> Tested on Wandboard Solo and Hummingboard-i1.

Did you install these U-Boot packages on these boards, or did you go as
far as running GuixSD on them?

Thank you for these first patches! :-)

Ludo’.
V
V
Vagrant Cascadian wrote on 30 Apr 2018 23:18
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 31308@debbugs.gnu.org)
87efiwo0ks.fsf@aikidev.net
On 2018-04-30, Ludovic Courtès wrote:
Toggle quote (10 lines)
> Vagrant Cascadian <vagrant@debian.org> skribis:
>> The following patches enable u-boot builds for wandboard and mx6cuboxi.
>>
>> Both u-boot builds require the inclusion of the "SPL" file.
>>
>> Tested on Wandboard Solo and Hummingboard-i1.
>
> Did you install these U-Boot packages on these boards, or did you go as
> far as running GuixSD on them?

I only went as far as using guix to build the bootloaders and manually
install them, and tested that they successfully booted... Debian. :)

The boards I tested on were only single-core with 512MB of ram, so would
be a bit difficult to run GuixSD on.

However, this u-boot build should also work on the Wandboard Quad or
CuBox-i4, which have quad-core CPUs and 2-4GB of ram, which might
actually be useable with GuixSD. There's also been recent good progress
on free graphics drivers for this family of SoC.


Toggle quote (2 lines)
> Thank you for these first patches! :-)

Thanks for having such a nice project to contribute patches to!

I've got some work-in-progress on a few more boards, but haven't had a
chance to boot test them, and some with non-trivial changes (at least
with my rank beginner guile skills)... will submit eventually. :)


live well,
vagrant
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEcDardHbDotegGFCHt4uC1IFLkbYFAlrniBMACgkQt4uC1IFL
kbZz0w/+It3aUC1uLxhCEdmtb0ayCUkcccwD1GzNfKft2O6Ms2xux7bcim6oO9dh
Ux/cCqQqVoTCxnsJZvTLmsG9z+beNvthlDEtEVqBrsVDL7L6n/bpGqj07Uc7iwsk
JT5l1J/rLTBdlJn/DSblM4DI7t9KScAm+EQ5AQb2jygkQHPieC8bMSD/s34GAF7i
zakNvy1009NPX4nXp+khyazbGA2vItQYVDoefnlPc5nAdaimCgAAb6XIPvqM/jFk
d/EyBZ4T0282V800SHeJDv3VLQYEXzoYeBkTLkyx3V2njOoXOCVJWzzttEqD1nYi
HzLQXv/h+5ZEThV942Fo8y0238HwXTL0dFWEpM0gYJCpZ1aIIfSuo9M7TUx0H+28
CHnErzQd6t/eBbBnCcQXBaZj3HV54SQRKJ9xzmdltx1iYO+V/3eDCIwFFVsZZ51Z
f7MPoZ3AaMeE3FhqKt4Avzub6oQ6qIrwOBJbLPJytWZQ6O0Dfvy7InAjLZWujZC2
rgwMG/ljefgRfoTQBd4xe0uJnsRFiZLQT6b54qOouPq94wFxeDx7WsonEzevAfs4
5n7bHJT/9dSQ1QLKsLE9A0WI0njki4tD0yGXQvCuV/fNqw6/VY064jWsZLs7DRa2
fTjl8d8SZZlpcDzai2vnyW8ToS0kgMH77wyIgkklPDk8gyVNoNk=
=w1fF
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 1 May 2018 21:55
(name . Vagrant Cascadian)(address . vagrant@debian.org)(address . 31308@debbugs.gnu.org)
87muxjqhgf.fsf@gnu.org
Hello,

Vagrant Cascadian <vagrant@debian.org> skribis:

Toggle quote (14 lines)
> On 2018-04-30, Ludovic Courtès wrote:
>> Vagrant Cascadian <vagrant@debian.org> skribis:
>>> The following patches enable u-boot builds for wandboard and mx6cuboxi.
>>>
>>> Both u-boot builds require the inclusion of the "SPL" file.
>>>
>>> Tested on Wandboard Solo and Hummingboard-i1.
>>
>> Did you install these U-Boot packages on these boards, or did you go as
>> far as running GuixSD on them?
>
> I only went as far as using guix to build the bootloaders and manually
> install them, and tested that they successfully booted... Debian. :)

Heh, not too bad! ;-)

Toggle quote (3 lines)
> The boards I tested on were only single-core with 512MB of ram, so would
> be a bit difficult to run GuixSD on.

Yeah. I hope we’ll do better in the future in that regard.

Toggle quote (5 lines)
> However, this u-boot build should also work on the Wandboard Quad or
> CuBox-i4, which have quad-core CPUs and 2-4GB of ram, which might
> actually be useable with GuixSD. There's also been recent good progress
> on free graphics drivers for this family of SoC.

[...]

Toggle quote (4 lines)
> I've got some work-in-progress on a few more boards, but haven't had a
> chance to boot test them, and some with non-trivial changes (at least
> with my rank beginner guile skills)... will submit eventually. :)

Heh, sounds exciting. :-)

Thank you,
Ludo’.
D
D
Danny Milosavljevic wrote on 1 May 2018 22:42
(name . Vagrant Cascadian)(address . vagrant@debian.org)
20180501224229.1520d136@scratchpost.org
For an eventual u-boot-installer, how do you install u-boot on wandboard?

And how do we detect that we have to use this kind of installation method based on u-boot's .config ?

For comparison, for sunxi, it's:

.config contains CONFIG_SYS_SOC="sunxi" => install via "dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8".
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlro0TUACgkQ5xo1VCww
uqV76wf+Lcwr3FpL7GreH8VMC8/YGaXCWOzeZoCYSqaiV/EShmj66WVIMn3lO3YI
sQ+qcPYPDHholRN/5tPbeixjSp2QUD0ZCu6171bI5IUgGmRAgNwp3I42R8tj4pzu
J3NefNE+ovNQ6V4RgryFxdV3KKMxEX0TJERx8eqIRRvGueA4JVZd0IxzJqbqqOPy
+qI7DhzbNgYJn7vRvczPU4vo2KFOeKW2TUOWHTIt/lrjgZNQRYBwqu3DFZXOgvOX
uU4r7YsLnlv5zIGjLOw5F3cgIgqGmds7kJGl6jUpaY9iU0Lhiu7/t8IOZsFWYCJv
mgp50IsK+8MLY9+hQ3fmCL3vew255w==
=ssMX
-----END PGP SIGNATURE-----


V
V
Vagrant Cascadian wrote on 1 May 2018 23:41
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
87tvrruk8d.fsf@aikidev.net
On 2018-05-01, Danny Milosavljevic <dannym@scratchpost.org> wrote:
Toggle quote (4 lines)
> For an eventual u-boot-installer, how do you install u-boot on wandboard?
>
> And how do we detect that we have to use this kind of installation method based on u-boot's .config ?

An interesting idea... I had thought about making an SD image either as
a separate target, or integrating it into u-boot-BOARD for targets that
support booting from SD.


Toggle quote (4 lines)
> For comparison, for sunxi, it's:
>
> .config contains CONFIG_SYS_SOC="sunxi" => install via "dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8".

I've been using:


Which pretty much comes down to:

dd conv=fsync,notrunc if=SPL of=DEVICE|IMAGEFILE bs=1k seek=1
dd conv=fsync,notrunc if=u-boot.img of=DEVICE|IMAGEFILE bs=1k seek=69

That works on wandboard and mx6cuboxi, as well as several other imx6
targets.

The novena target requires u-boot.img to be copied to the first
partition with a fat or ext filesystem, and only the SPL is written to
the raw device.

With usbarmory (imx5), only the u-boot.img portion is installed directly
to the raw device at the offset above; there is no SPL.

CONFIG_SPL=y seems to be the best indicator that it needs SPL, and as
far as I know with CONFIG_MX[5,6]=y SPL is always installed to the same
offset.

It's less obvious to me comparing other configuration options what
determines which method is needed for u-boot.img. Maybe with recent
u-boot versions, it's possible to use either an offset or read it from a
filesystem with a single image; I didn't have much luck with that in the
past.

I'll experiment a little more and see what I can figure out.


live well,
vagrant
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEcDardHbDotegGFCHt4uC1IFLkbYFAlro3xIACgkQt4uC1IFL
kbaDExAAgEbf71BdSanAaVVaKNtVcJl+KoIbeOy5osvjJDb/6sbWUu6oVGiVAPKR
8l3z1COf98d2krJhOl345iIsKeNxm9WfKIbM222tl2EeMLuZFuvoFdC/LNZGGb3j
cEoyPUuQWWxNqAtaa1hJD472Tm9AOLLFzYOSj2iu/fmF4dFgyhf76llzS+rHAdTy
u8aTMjHQOIOW89PlQi7X6pMzLrSH/ZD8dmcFiI+nEzr9HS021M0rYLNk/+Bv3W9u
A5atmbWRE8QpgUBzzHJ5FYI3rbLG89eRoZ8ticuiZ8qTwDoRLZ5K3uPo6utrm1tk
9lznqaYThEgv9khBGnki00xYnvl6IwRSPfU74doVDstIqf7fygSGE0VCTXRVy6lN
UhKhi9Y+XjFLBEvBumQ7opZ4Yx5KURV+3m8Gl5e/PF1nUn4Vus7JUeFttZA/4he8
LPD2GhGEBP32GaoGktEuOMygQ7C11FZffFvdxJdjgIhOrTnooza6rkNNjX1nnlS3
W2QF8t9qQMYkfxzllQtthx1UHy9vZWDnUlNrF0806aKfuhM4FV6ZEdEqUOIB81Wz
vnhGmKn0DrztUQrtqyFwJ3Yf0/8mc4W2jVB0lRN7OM0neOxKpj6GDbExUi1JZyXk
75tf++qacQPw0Dg1gKOEZNgT6dAUvu3BLGz+RyaraDniaVkVSEU=
=NU7a
-----END PGP SIGNATURE-----

?