Skip to contentSkip to conversation

u-boot-rpi2: use the upstreamed U-Boot

PATCH In review Steve Rae 3 participants 4 messages Jan 25, 2016 – Apr 25, 2016 Broadcom BCM2711/BCM2835 Arm architecture

lore
Share & tools
lore

Steve Rae

author
#0 lore raw

PATCH 1/1 u-boot-rpi2: use the upstreamed U-Boot

For Raspberry Pi 2, use the U-Boot from "denx".

---
 conf/machine/raspberrypi2.conf        |  1 +
 recipes-bsp/u-boot/u-boot-rpi2_git.bb | 36 +++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)
 create mode 100644 recipes-bsp/u-boot/u-boot-rpi2_git.bb
conf/machine/raspberrypi2.conf +1 -0
index 30edae3..50912c9 100644
@@ -5,4 +5,5 @@
 DEFAULTTUNE ?= "cortexa7thf-neon-vfpv4"
 
 require conf/machine/include/tune-cortexa7.inc
+PREFERRED_PROVIDER_u-boot ?= "u-boot-rpi2"
 include conf/machine/include/rpi-base.inc
recipes-bsp/u-boot/u-boot-rpi2_git.bb new file +36 -0
new file mode 100644
index 0000000..ce0d1a0
@@ -0,0 +1,36 @@
+DESCRIPTION = "U-Boot for Raspberry Pi 2 Model B"
+
+require recipes-bsp/u-boot/u-boot.inc
+
+DEPENDS += "rpi-mkimage-native"
+
+PROVIDES += "u-boot"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://README;md5=587d8d939ae351bb11910921b1eafd42"
+
+SRCREV = "fa85e826c16b9ce1ad302a57e9c4b24db0d8b930"
+SRC_URI = "git://git.denx.de/u-boot.git;branch=master"
+
+S = "${WORKDIR}/git"
+
+UBOOT_MACHINE = "rpi2_b"
+UBOOT_MAKE_TARGET = "u-boot.bin"
+UBOOT_SUFFIX = "img"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+COMPATIBLE_MACHINE = "raspberrypi2"
+
+do_compile() {
+    oe_runmake mrproper
+    oe_runmake rpi_2_defconfig
+    oe_runmake CROSS_COMPILE=arm-poky-linux-gnueabi- \
+        CC="arm-poky-linux-gnueabi-gcc --sysroot=${PKG_CONFIG_SYSROOT_DIR}"
+}
+
+do_compile_append() {
+    # From 'uboot.bin', create 'kernel.img', then rename it to 'u-boot.img'
+    ${STAGING_DIR_NATIVE}/usr/lib/rpi-mkimage/imagetool-uncompressed.py u-boot.bin
+    mv kernel.img u-boot.img
+}
Signature · 1 line
1.9.1
#1 lore raw

Hi Steve

Quoted 3 lines · Steve Rae

For Raspberry Pi 2, use the U-Boot from "den".

Can this be done by using/extending OE-Core recipe please ?

Quoted 68 lines

---
conf/machine/raspberrypi2.conf | 1 +
recipes-bsp/u-boot/u-boot-rpi2_git.bb | 36 +++++++++++++++++++++++++++++++++++

2 files changed, 37 insertions(+)

create mode 100644 recipes-bsp/u-boot/u-boot-rpi2_git.bb

conf/machine/raspberrypi2.conf +0 -0
index 30edae3..50912c9 100644
@@ -5,4 +5,5 @@

DEFAULTTUNE ?= "cortexa7thf-neon-vfpv4"

require conf/machine/include/tune-cortexa7.inc
+PREFERRED_PROVIDER_u-boot ?= "u-boot-rpi2"
include conf/machine/include/rpi-base.inc

recipes-bsp/u-boot/u-boot-rpi2_git.bb new file +36 -1
new file mode 100644
index 0000000..ce0d1a0
@@ -0,0 +1,36 @@
+DESCRIPTION = "U-Boot for Raspberry Pi 2 Model B"
+
+require recipes-bsp/u-boot/u-boot.inc
+
+DEPENDS += "rpi-mkimage-native"
+
+PROVIDES += "u-boot"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://README;md5=587d8d939ae351bb11910921b1eafd42"
+
+SRCREV = "fa85e826c16b9ce1ad302a57e9c4b24db0d8b930"
+SRC_URI = "git://git.denx.de/u-boot.git;branch=master"
+
+S = "${WORKDIR}/git"
+
+UBOOT_MACHINE = "rpi2_b"
+UBOOT_MAKE_TARGET = "u-boot.bin"
+UBOOT_SUFFIX = "img"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+COMPATIBLE_MACHINE = "raspberrypi2"
+
+do_compile() {
+    oe_runmake mrproper
+    oe_runmake rpi_2_defconfig
+    oe_runmake CROSS_COMPILE=arm-poky-linux-gnueabi- \
+        CC="arm-poky-linux-gnueabi-gcc --sysroot=${PKG_CONFIG_SYSROOT_DIR}"
+}
+
+do_compile_append() {
+    # From 'uboot.bin', create 'kernel.img', then rename it to 'u-boot.img'
+    ${STAGING_DIR_NATIVE}/usr/lib/rpi-mkimage/imagetool-uncompressed.py u-boot.bin
+    mv kernel.img u-boot.img
+}
--

1.9.1

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

author
#2 lore raw
Quoted 10 lines · Khem Raj

Hi Steve

Quoted 3 lines · Steve Rae

For Raspberry Pi 2, use the U-Boot from "den".

Can this be done by using/extending OE-Core recipe please ?

I modelled it after the existing RPi recipe:
diff recipes-bsp/u-boot/u-boot-rpi_git.bb
recipes-bsp/u-boot/u-boot-rpi2_git.bb
sorry -- I don't know enough about this to answer your question... Which recipe should I "extend"? Could you please provide more details? Thanks in advance, Steve

Quoted 69 lines
Quoted 68 lines

---
conf/machine/raspberrypi2.conf | 1 +
recipes-bsp/u-boot/u-boot-rpi2_git.bb | 36 +++++++++++++++++++++++++++++++++++

2 files changed, 37 insertions(+)

create mode 100644 recipes-bsp/u-boot/u-boot-rpi2_git.bb

conf/machine/raspberrypi2.conf +0 -0
index 30edae3..50912c9 100644
@@ -5,4 +5,5 @@

DEFAULTTUNE ?= "cortexa7thf-neon-vfpv4"

require conf/machine/include/tune-cortexa7.inc
+PREFERRED_PROVIDER_u-boot ?= "u-boot-rpi2"
include conf/machine/include/rpi-base.inc

recipes-bsp/u-boot/u-boot-rpi2_git.bb new file +36 -1
new file mode 100644
index 0000000..ce0d1a0
@@ -0,0 +1,36 @@
+DESCRIPTION = "U-Boot for Raspberry Pi 2 Model B"
+
+require recipes-bsp/u-boot/u-boot.inc
+
+DEPENDS += "rpi-mkimage-native"
+
+PROVIDES += "u-boot"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://README;md5=587d8d939ae351bb11910921b1eafd42"
+
+SRCREV = "fa85e826c16b9ce1ad302a57e9c4b24db0d8b930"
+SRC_URI = "git://git.denx.de/u-boot.git;branch=master"
+
+S = "${WORKDIR}/git"
+
+UBOOT_MACHINE = "rpi2_b"
+UBOOT_MAKE_TARGET = "u-boot.bin"
+UBOOT_SUFFIX = "img"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+COMPATIBLE_MACHINE = "raspberrypi2"
+
+do_compile() {
+    oe_runmake mrproper
+    oe_runmake rpi_2_defconfig
+    oe_runmake CROSS_COMPILE=arm-poky-linux-gnueabi- \
+        CC="arm-poky-linux-gnueabi-gcc --sysroot=${PKG_CONFIG_SYSROOT_DIR}"
+}
+
+do_compile_append() {
+    # From 'uboot.bin', create 'kernel.img', then rename it to 'u-boot.img'
+    ${STAGING_DIR_NATIVE}/usr/lib/rpi-mkimage/imagetool-uncompressed.py u-boot.bin
+    mv kernel.img u-boot.img
+}
--

1.9.1

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#3 lore raw

Hi Steve,

Quoted 14 lines · Steve Rae
Quoted 10 lines · Khem Raj

Hi Steve

Quoted 3 lines · Steve Rae

For Raspberry Pi 2, use the U-Boot from "den".

Can this be done by using/extending OE-Core recipe please ?

Quoted 6 lines

I modelled it after the existing RPi recipe:
diff recipes-bsp/u-boot/u-boot-rpi_git.bb
recipes-bsp/u-boot/u-boot-rpi2_git.bb
sorry -- I don't know enough about this to answer your question... Which recipe should I "extend"? Could you please provide more details? Thanks in advance, Steve

Khem Raj is proposing to use a uboot recipe from oe-core
https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-bsp/u-boot
and extend it with a bbappend to include rpi support. Is that possible?

P.S.: Sorry for this late reply. I'm trying to catch up with some old threads.

--
Andrei Gherzan