MX23 Olinuxino support in U-boot

Started by Fabio Estevam, January 23, 2013, 07:17:45 pm

Previous topic - Next topic

Fabio Estevam

Hi,

Just to inform that Marek sent an initial support for mx23olinuxino into U-boot mainline:
http://git.denx.de/?p=u-boot/u-boot-imx.git;a=commitdiff;h=64a9386080b3c3fdf85ec5cfad093df23a9e2189

Feel free to contribute to the project :-)

Regards,

Fabio Estevam

jlumme

This is great!
I will start hacking on this. Looks like MMC support is now enabled, so no need to load it via USB (and thus can avoid soldering at least for now)

Fabio Estevam

Not all patches reached u-boot-imx branch yet. In the meantime, you can use Otavio's tree:
https://github.com/otavio/u-boot/commits/mx23

Happy hacking ;-)

lucio

I'm interested in getting Plan 9 <plan9.bell-labs.com> to run on the LinuXino-Maxi, but I lack the most basic details on how to get (a) u-boot installed on the MAXI and (b) how to configure a Plan 9 kernel to be bootable by u-boot.  Here, I am very familiar with Plan 9, my needs are to determine what u-boot demands.

I'm told that the Plan 9 kernel for the Sheevaplug is a good starting point for my efforts and I have a suspicion, somewhat difficult to verify, that the Sheevaplug comes with u-boot.  Again, my lack of knowledge is a problem here.  Could the u-boot developers for the Maxi point me to helpful documentation I can use to make my efforts more likely to succeed?

Lucio.

PS: bypassing u-boot is certainly an option, but at this point it seems even more complicated.

Fabio Estevam

Hi Lucio,

Documentation is not available yet and we will work on it.

In the meantime you can try U-boot in your olinuxino by following the instructions below:

1. Get the U-boot source form Otavio's repository located at https://github.com/otavio/u-boot/commits/mx23

2. Build U-boot:

- Export your toolchain
- make mx23_olinuxino_config
- make -j4 u-boot.sb

3. Flash the u-boot binary into the SD card:

dd if=u-boot.sb of=/dev/<sd>1 bs=512 seek=4


4. Place the SD card into olinuxino and power on the board.

If you face any issues in this process, please ask in the U-boot mailing list.

U-boot can boot uImage and zImage kernels (uImage is used by default) and it also allows you to boot old kernel (uImage only) and new device tree kernel (uImage + imx23-olinuxino.dtb) method, such as the latest and greatest kernel from kernel.org.

Regards,

Fabio Estevam

lucio

I'd be happy to contribute to the documentation if that is possible.  You may have to provide guidelines.

Thanks for the instructions, I'll be using them shortly.

Lucio.

lucio

> U-boot can boot uImage and zImage kernels (uImage is
> used by default) and it also allows you to boot old
> kernel (uImage only) and new device tree kernel (uImage
> + imx23-olinuxino.dtb) method, such as the latest and
> greatest kernel from kernel.org.

"All the world's a Linux".  Sadly, I have heard the terms
iImage and zImage, but I would not (yet) know how to generate
such beasts for my favourite operating system.  I did however
check and u-boot is used by Marvell in their Sheevaplug, so
there's code in the Plan 9 distribution to generate something
u-boot can handle.  I just need to identify the most helpful
persons for when I get stuck :-)

Lucio.

PS: Mind you, I use PXE and the Plan 9 loader to boot the
Sheevaplug, that is the most practical route to take at
this point for the MAXI.  I can navigate my way around
u-boot's menus, from earlier experience.

lucio

Just a note before I forget: I needed to compile elftosb because it unsurprisingly is not part of the Ubuntu release, nor is it available as a package (maybe it ought to be).  I'm not sure how many OlinuXino users are likely to have to do the same, but in one of the modules there is a reference:

   #include "/usr/include/sys/types.h"

that fails in recent versions of Ubuntu (I have no idea about other platforms) because /usr/include/sys (blessed Ubuntu's soul) has been dropped as a feature.  The replacement, more conventional

   #include <sys/types.h>

works.  I'm not sure who is most likely to be able to pass this on upstream to Freescale.

Lucio.

PS: I think "elftosb" is insane!  I have only a vague idea of what it does, but consensus seems to be that it is a weird idea.  That it takes:

-rw-rw-r--  1 lucio lucio 7329031 Jan 24 18:47 elftosb-10.12.01.tar.gz

(note this is zipped) to do it, that it is written in C++ and that it takes just under 20000 lines of C++ to do it, strikes me as excessive.  Call me ungrateful!

jlumme

You can also find a pre-compiled version from Koliqi's repository:
https://github.com/koliqi/imx23-olinuxino/tree/master/boot/elftosb-0.3

This is what I have been using, and it has worked for me.

lucio

I'm from the old school, when I have the resources to compile these utilities myself I prefer to do so.  Thank you for the link, however, with some luck Google will pick it up and save someone else some effort in future.

Maybe I ought to download the binary just in case: right now I have a dysfunctional version of u-boot, also home-built and I don't know whether it was compiled with the wrong toolchain or without specifying the correct architecture (I left out ARCH=arm), whether a home-built version of elftosb produced an invalid image or, last possibility in my mind, whether it was placed at the wrong offset in the kernel partition on SD (4 sectors from the beginning, according to the instructions).  Eliminating elftosb would be a step forward.

Lucio.