Skip to contentSkip to conversation

Use barebox instead of u-boot

PATCH Applied Jeff Horn 4 participants 11 messages Jan 9, 2013 – Jan 10, 2013 Arm i.MX and Layerscape

lore
Share & tools
lore

Jeff Horn

author
#0 lore raw

Hi,

I've been tasked to test yocto to build our BSP. We have a custom board based on the i.MX53. I was able to follow the instructions and did manage to generate an image for the i.MX53 QSB. That was nice! Now I'm lost in layer land trying to figure out how yocto determines what packages are built when I type bitbake fsl-image-gui.

We are currently using barebox so I would like to use barebox instead of u-boot for the bootloader. I tried adding my own layer and then added a machine configuration but I am lost at what to do next.

How can I change the imx53qsb build to use barebox? Maybe that will help.
Also, am I on the right track to add my own layer so I can add additional
patches to barebox and the kernel.

I only need to patch barebox and the kernel to boot my board. I could just hack the imx53qsb build but I want to learn how to do this the yocto way.

Thanks in advance for any information.

Jeff

#1 lore raw

Hi Jeff,

Quoted 4 lines · Jeff Horn

How can I change the imx53qsb build to use barebox? Maybe that will help.
Also, am I on the right track to add my own layer so I can add additional
patches to barebox and the kernel.

bitbake barebox -> will build barebox

set IMAGE_BOOTLOADER = "barebox" in your local.conf and you will get barebox in the SDCard image when you build it.

Quoted 2 lines

I only need to patch barebox and the kernel to boot my board. I could just hack the imx53qsb build but I want to learn how to do this the yocto way.

If you create your overlay to support your board, you can simply add a barebox_2012.02.0.bbappend and add your patch & defconfig from there

BTW : I plan to update barebox support in meta-fsl-arm in the coming weeks.

Best regards
Eric

#2 lore raw
In reply to Jeff Horn
Quoted 5 lines · Jeff Horn

I've been tasked to test yocto to build our BSP. We have a custom board based on the i.MX53. I was able to follow the instructions and did manage to generate an image for the i.MX53 QSB. That was nice! Now I'm lost in layer land trying to figure out how yocto determines what packages are built when I type bitbake fsl-image-gui.

I advice you to read the Yocto documentation; it is a rich documentation and it will avoid a lot of common mistakes from your side.

Please go to https://www.yoctoproject.org/documentation/current and check the available docs.

Quoted 7 lines

We are currently using barebox so I would like to use barebox instead of u-boot for the bootloader. I tried adding my own layer and then added a machine configuration but I am lost at what to do next.

How can I change the imx53qsb build to use barebox? Maybe that will help. Also, am I on the right track to add my own layer so I can add additional patches to barebox and the kernel.

To change the bootloader, in the machine you need to set the IMAGE_BOOTLOADER variable so the sdcard will use barebox instead of u-boot:

Your machine.conf ought to have:

IMAGE_BOOTLOADER = "barebox"

Quoted 2 lines

I only need to patch barebox and the kernel to boot my board. I could just hack the imx53qsb build but I want to learn how to do this the yocto way.

Yes; the right way to do it is to use a custom layer. If this is a public board you can add it to meta-fsl-arm-extra and send the patches for us to integrate them otherwise use an internal layer for your custom boards.

Regards,

--
Otavio Salvador O.S. Systems
E-mail: [email protected] http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br

#3 lore raw
In reply to Jeff Horn
Quoted 7 lines · Jeff Horn

Hi,

I've been tasked to test yocto to build our BSP. We have a custom board based on the i.MX53. I was able to follow the instructions and did manage to generate an image for the i.MX53 QSB. That was nice! Now I'm lost in layer land trying to figure out how yocto determines what packages are built when I type bitbake fsl-image-gui.

Go to sources/ and look for a fsl-image-gui file:

$ cd sources
$ find -name fsl-image-gui*

Open it and you will see what is built when you bitbake fsl-image-gui

Daiane

author
#4 lore raw

Thanks for all the help. I was able to add a custom layer and append our barebox and kernel patches. I still trying to figure out how to handle the default configs. The sdcard image generated did not boot correctly but I manually wrote barebox and the kernel to an sd card and my board booted.
Very nice.

I'll continue to read through the source and docs and see where I can help.

Thanks,
Jeff

Quoted 19 lines · Daiane Angolini
Quoted 4 lines · Jeff Horn

Hi,

I've been tasked to test yocto to build our BSP. We have a custom board based on the i.MX53. I was able to follow the instructions and did

manage

Quoted 2 lines

to generate an image for the i.MX53 QSB. That was nice! Now I'm lost in layer land trying to figure out how yocto determines what packages are

built

Quoted 1 line

when I type bitbake fsl-image-gui.

Go to sources/ and look for a fsl-image-gui file:

$ cd sources
$ find -name fsl-image-gui*

Open it and you will see what is built when you bitbake fsl-image-gui

Daiane

#5 lore raw
Quoted 7 lines · Jeff Horn

Thanks for all the help. I was able to add a custom layer and append our barebox and kernel patches. I still trying to figure out how to handle the default configs. The sdcard image generated did not boot correctly but I manually wrote barebox and the kernel to an sd card and my board booted. Very nice.

I'll continue to read through the source and docs and see where I can help.

Please check the sdcard class file, in classes directory, for the commands done when generating for barebox; it might need some adjustments.

Eric, can you give it a try too?

--
Otavio Salvador O.S. Systems
E-mail: [email protected] http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br

#6 lore raw

PATCH 1/2 barebox: fix sdcard partition scheme

- SDCard's partition scheme was changed in image_type_fsl.bbclass so update barebox's configuration to match the new one.
- tested on MCIMX53-START-R board 1.0 rev B

---
 .../imx53qsb/0001-imx53qsb-default-config-for-OE-s-sdcard-image.patch | 2 +-
 recipes-bsp/barebox/barebox-2012.02.0/imx53qsb/config                 | 4 ++--
 recipes-bsp/barebox/barebox_2012.02.0.bb                              | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
recipes-bsp/barebox/barebox-2012.02.0/imx53qsb/0001-imx53qsb-default-config-for-OE-s-sdcard-image.patch +1 -1
index 6a3c000..399e95a 100644
@@ -22,7 +22,7 @@ index 0000000..3a5ae42
 +#!/bin/sh
 +
 +mkdir /mnt
-+mount /dev/disk0.1 fat /mnt
++mount /dev/disk0.0 fat /mnt
 diff --git a/defaultenv/bin/boot b/defaultenv/bin/boot
 index 1120757..e46705d 100644
 --- a/defaultenv/bin/boot
recipes-bsp/barebox/barebox-2012.02.0/imx53qsb/config +2 -2
index b60bf3c..c65e6ad 100644
@@ -21,7 +21,7 @@ rootfs_loc=disk
 
 # boot parameters for SDCard boot
 kernel_name=uImage
-rootfs_part_linux_dev=mmcblk0p3
+rootfs_part_linux_dev=mmcblk0p2
 rootfs_type=ext3
 
 # can be either 'jffs2' or 'ubifs'
@@ -45,7 +45,7 @@ autoboot_timeout=3
 
 bootargs="console=ttymxc0,115200"
 
-disk_parts="512k(barebox)ro,512k(bareboxenv),4M(kernel),-(root)"
+disk_parts="512k(barebox)ro,512k(bareboxenv),8M(kernel),-(root)"
 
 # set a fancy prompt (if support is compiled in)
 PS1="\e[1;32mbarebox@\e[1;31m\h:\w\e[0m "
recipes-bsp/barebox/barebox_2012.02.0.bb +1 -1
index 20d7d40..1eed4d3 100644
@@ -1,6 +1,6 @@
 require barebox.inc
 
-PR = "r2"
+PR = "r3"
 
 SRC_URI = "http://barebox.org/download/${PN}-${PV}.tar.bz2 \
 	file://defconfig \
Signature · 1 line
1.7.11.7
#7 lore raw

PATCH 2/2 barebox: default to no kernel ipconfig

- this change asks barebox to not pass the ip=dhcp parameter to the kernel so that we get a decent boot speed when the ethernet cable is not plugged during boot instead of waiting for kernel ipconfig.
- tested on MCIMX53-START-R board 1.0 rev B

---
 recipes-bsp/barebox/barebox-2012.02.0/imx53qsb/config | 2 +-
 recipes-bsp/barebox/barebox_2012.02.0.bb              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
recipes-bsp/barebox/barebox-2012.02.0/imx53qsb/config +1 -1
index c65e6ad..a0a2b74 100644
@@ -6,7 +6,7 @@ user=
 
 # use 'dhcp' to do dhcp in barebox and in kernel
 # use 'none' if you want to skip kernel ip autoconfiguration
-ip=dhcp
+ip=none
 
 # or set your networking parameters here
 #eth0.ipaddr=a.b.c.d
recipes-bsp/barebox/barebox_2012.02.0.bb +1 -1
index 1eed4d3..5489f7c 100644
@@ -1,6 +1,6 @@
 require barebox.inc
 
-PR = "r3"
+PR = "r4"
 
 SRC_URI = "http://barebox.org/download/${PN}-${PV}.tar.bz2 \
 	file://defconfig \
Signature · 1 line
1.7.11.7
#8 lore raw

Re: [PATCH 2/2] barebox: default to no kernel ipconfig

Quoted 7 lines · Eric Bénard

- this change asks barebox to not pass the ip=dhcp parameter to the kernel so that we get a decent boot speed when the ethernet cable is not plugged during boot instead of waiting for kernel ipconfig.
- tested on MCIMX53-START-R board 1.0 rev B

Applied to master and danny.

--
Otavio Salvador O.S. Systems
E-mail: [email protected] http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br

#9 lore raw

Re: [PATCH 1/2] barebox: fix sdcard partition scheme

In reply to Eric Bénard
Quoted 5 lines · Eric Bénard

- SDCard's partition scheme was changed in image_type_fsl.bbclass so update barebox's configuration to match the new one.
- tested on MCIMX53-START-R board 1.0 rev B

Applied to master and danny.

--
Otavio Salvador O.S. Systems
E-mail: [email protected] http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br

#10 lore raw
In reply to Jeff Horn
Quoted 5 lines · Jeff Horn

Thanks for all the help. I was able to add a custom layer and append our barebox and kernel patches. I still trying to figure out how to handle the default configs. The sdcard image generated did not boot correctly but I manually wrote barebox and the kernel to an sd card and my board booted. Very nice.

If it was the case, please file a bug

https://bugzilla.yoctoproject.org/buglist.cgi?quicksearch=meta-fsl-arm

I have never worked with barebox, but I can try to help you to fix any mismatch/mistake in the sdcard class file.

Let's work to get the sdcard image fixed.

Daiane