[U-Boot] Sources for MLO on BeagleBone Black?

Abraham V. abraham.varricatt at vvdntech.com
Thu Dec 5 06:08:50 CET 2013


Hello Satz,

A bit of history - until a few years ago, the u-boot project only
produced a single binary output (u-boot.bin or u-boot.img) that you
loaded for your board. The resulting binary usually comes to about 200
- 250kB (approx). Then Texas Instruments began manufacturing the OMAP
line of SOC's that had some static-RAM built into the chip. The idea
was that we could have some initialization code to setup the bare
environment before doing other things. A limitation was that the SRAM
had a capacity of just a few kB (think less than 50kB, I don't
remember what the exact number is).

So, (I presume) someone from TI make a fork of the u-boot code base to
produce a "minimal" boot-loader called X-loader. The resulting binary
came to about 25kB or so. The boot sequence thus went like this;

ROM code (we can't edit this) -> X-loader (in SRAM) -> u-boot (in DDR
RAM) -> Linux system.

(for details see here: http://omappedia.org/wiki/Bootloader_Project)

Normal DDR ram doesn't "just work". You need something to initialize
the clocks (and possibly power?), before the processor can make use of
it. This is was X-loader did.

Eventually, other manufacturers (Samsung? nVidia? not sure if
Freescale uses it....) picked up on the idea of having SRAM in their
SOC's for initialization purposes and instead of maintaining two
separate code-bases, an idea cropped up to merge X-loader back into
the u-boot source. This was eventually done and that's where we are
today.

Now, to "edit the bootloader", Satz, you'll want to understand the
build process. The MLO file does not "magically" appear. It is
actually built on your computer right after u-boot gets built. In a
nutshell, when you run,

> make omap3_beaglebone_config     (I forgot what the actual config is)

A few configuration files get created. This is in preparation for the
next step, which is;

> make

The above is an instruction to the uboot build system to scan the
configuration files and build whatever system was specified. In the
case of beagleboneblack (and omap processors) this happens in 2
different stages. First, the entire source tree is scanned/compiled to
create the "u-boot.bin" (or u-boot.img) file. Then the build system
re-starts the scan to compile the MLO file. If you browse the source,
you'll see code like "#if SPL_CONFIG" (or similar). These are the
sections that instruct the build system to create the MLO file.

Hope it answers your question? :)

Drinking coffee,
Abraham


On Thu, Dec 5, 2013 at 2:04 AM, Satz Klauer <satzklauer at googlemail.com> wrote:
> Hi Tom,
>
> point is, I want to change some functionality of bootloader - thus I
> want to know where it is built from. It is nice when MLO file appears
> automagically but in my special case I like to know where it comes
> from exaclty.
>
> Thanks :-)
>
>
> On Wed, Dec 4, 2013 at 3:58 PM, Tom Rini <trini at ti.com> wrote:
>> On Wed, Dec 04, 2013 at 03:08:43PM +0100, Satz Klauer wrote:
>>
>>> Hi,
>>>
>>> I'm looking for the sources of the MLO bootloader that is used on
>>> BeagleBone Black by default. A posting within TIs webboard pointed me
>>> to this location but ... where are the sources? While checking the GIT
>>> repositiory I could not find anything that looked like "MLO" or
>>> "BeagleBone Black".
>>
>> When you build for am335x_evm you get both u-boot.img and MLO files that
>> work on a number of boards from TI that use the am335x chip, including
>> Beaglebone Black.
>>
>> --
>> Tom
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot


More information about the U-Boot mailing list