bootloader and uImage sources [gitorious vs angstrom recipes]

Hi,
I'm trying to compile my own version of u-boot, x-loader and uImage.
I'm using as cross-compiler arm-cortex_a8-linux-gnueabi obtained with crosstool-ng.
Sources and patches have been taken from angstrom sources (actually I use .bb files to extract the git repository, the version to checkout and the patches to apply).

Here my first question:

* The validation images found on http://gitorious.org/beagleboard-validation/ are the same of those ones obtained using the angstrom recipes?

To do some experimenting, I tried to compile the 2.6.32 kernel (+ patches) taken from the angstrom recipe with my cross-compiler using the .config file of the validation uImage. What I get is an unusable kernel image (my beagleboard stuck after the kernel decompression without any message).
So:

* Why? Can be a problem with cross-compiler?

Thank you,

I'm trying to compile my own version of u-boot, x-loader and uImage.
I'm using as cross-compiler arm-cortex_a8-linux-gnueabi obtained with
crosstool-ng.

Ah. Someone else tromping down the path I've just come from! :slight_smile:

Sources and patches have been taken from angstrom sources (actually I
use .bb files to extract the git repository, the version to checkout and
the patches to apply).

I've done this too, with BeagleBox.

Here my first question:

* The validation images found on
http://gitorious.org/beagleboard-validation/ are the same of those ones
obtained using the angstrom recipes?

No. The validation stuff comes from gitorious.org. The BB stuff comes
from the OMAP branch of the kernel.org git repository.

To do some experimenting, I tried to compile the 2.6.32 kernel (+
patches) taken from the angstrom recipe with my cross-compiler using the
.config file of the validation uImage. What I get is an unusable kernel
image (my beagleboard stuck after the kernel decompression without any
message).

If you compile the exact kernel from BB with only the patches listed in
the .bb configuration for BeagleBoard then you get a kernel that boots.
Also, if you build from the gitorious.org/beagleboard-validation
repository without patches you get a kernel that will boot. "Working"
is subjective. The latter is a 2.6.28 kernel that appears to support
S-Video using DSS1. The former (angstrom) is a 2.6.32 kernel that uses
DSS2 but S-Video doesn't appear to work. At least I haven't gotten it
working yet.

Finding an appropriate repository and associated patches (if any) can be
a problem. I just checked in changes last night to BeagleBox to make it
easier (well, to me) to experiment with different repository/patch
combinations.

So:
* Why? Can be a problem with cross-compiler?

In some cases, yes, though once you get the cross compiler setup you
still have to pick a meaningful u-boot/kernel repository setup.

The Crosstool-NG 1.8.x cross compiler had some problems when built under
Fedora 13. I had to add a small patch to the cross compiler build
(related to cloog) to make it work. Also, make sure you're using
binutils 2.20, not 2.19. You can check out the BeagleBox [1] build and
take a look at the Crosstool-NG config file under src/xcc as a
comparison.

Oh, and I also had to provide an external uClibc configuration in order
to enable UCLIBC_HAS_GETPT. You can't change uClibc's config from
Crosstool-NG directly, so you have to create it manually and then
reference it from the Crosstool-NG configuration.

Hope that helps.

[1] http://www.graphics-muse.org/wiki/pmwiki.php?n=BeagleBox.BeagleBox
or get the source from cvs:
http://sourceforge.net/projects/beaglebox/develop/

One other thing I forgot to mention regarding cross compiling on Fedora.
The latest release, Fedora 14, provides make 3.82. This version seems
to break some older kernel builds as well as Buildroot and others. The
proper fix is to fix the broken Makefiles but to get around the problem
on F14 you can downgrade make.

See my blog entry on this:
http://www.graphics-muse.org/wp/?p=796

I'm trying to compile my own version of u-boot, x-loader and uImage.
I'm using as cross-compiler arm-cortex_a8-linux-gnueabi obtained with
crosstool-ng.

Ah. Someone else tromping down the path I've just come from! :slight_smile:

Glad to see I'm not the only crazy guy :wink:

Sources and patches have been taken from angstrom sources (actually I
use .bb files to extract the git repository, the version to checkout and
the patches to apply).

I've done this too, with BeagleBox.

I'll take a look to the proj...

Here my first question:

* The validation images found on
http://gitorious.org/beagleboard-validation/ are the same of those ones
obtained using the angstrom recipes?

No. The validation stuff comes from gitorious.org. The BB stuff comes
from the OMAP branch of the kernel.org git repository.

Ok, then I prefer to go with BB

To do some experimenting, I tried to compile the 2.6.32 kernel (+
patches) taken from the angstrom recipe with my cross-compiler using the
.config file of the validation uImage. What I get is an unusable kernel
image (my beagleboard stuck after the kernel decompression without any
message).

If you compile the exact kernel from BB with only the patches listed in
the .bb configuration for BeagleBoard then you get a kernel that boots.

The recipe I used is linux-omap_2.6.32.bb with related patches.
But ok, surely there is something wrong with my config file.

Also, if you build from the gitorious.org/beagleboard-validation
repository without patches you get a kernel that will boot. "Working"
is subjective.

Right!
This is my "not working" :slight_smile:

reading uImage

3047704 bytes read
Booting from mmc ...
## Booting kernel from Legacy Image at 80200000 ...
  Image Name: Linux-2.6.32
  Image Type: ARM Linux Kernel Image (uncompressed)
  Data Size: 3047640 Bytes = 2.9 MB
  Load Address: 80008000
  Entry Point: 80008000
  Verifying Checksum ... OK
  Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux................................................................................................................................................................................................... done, bo.

The latter is a 2.6.28 kernel that appears to support
S-Video using DSS1. The former (angstrom) is a 2.6.32 kernel that uses
DSS2 but S-Video doesn't appear to work. At least I haven't gotten it
working yet.

Actually, also for beagle-validation there is a 2.6.32 kernel.

Finding an appropriate repository and associated patches (if any) can be
a problem. I just checked in changes last night to BeagleBox to make it
easier (well, to me) to experiment with different repository/patch
combinations.

I see. I'm a bit puzzled with this mess about sources

So:
* Why? Can be a problem with cross-compiler?

In some cases, yes, though once you get the cross compiler setup you
still have to pick a meaningful u-boot/kernel repository setup.

The Crosstool-NG 1.8.x cross compiler had some problems when built under
Fedora 13. I had to add a small patch to the cross compiler build
(related to cloog) to make it work. Also, make sure you're using
binutils 2.20, not 2.19. You can check out the BeagleBox [1] build and
take a look at the Crosstool-NG config file under src/xcc as a
comparison.

Oh, and I also had to provide an external uClibc configuration in order
to enable UCLIBC_HAS_GETPT. You can't change uClibc's config from
Crosstool-NG directly, so you have to create it manually and then
reference it from the Crosstool-NG configuration.

Actually under Slackware 13.1 I had no problem in compiling the crosscompiler.
But I'll try to use CodeSourcery.

Hope that helps.

Thank you :slight_smile:

[cut]

No. The validation stuff comes from gitorious.org. The BB stuff comes
from the OMAP branch of the kernel.org git repository.

[cut]

The validation image
(http://code.google.com/p/beagleboard/wiki/BeagleBoardDiagnosticsNext)
seems to use the
angstrom kernel:

$ file /media/BEAGLE/uImage
/media/BEAGLE/uImage: u-boot legacy uImage,
Angstrom/2.6.32/beagleboard, Linux/ARM, OS Kernel Image (Not
compressed), 3190504 bytes, Wed Aug 18 17:53:27 2010, Load Address:
0x80008000, Entry Point: 0x80008000, Header CRC: 0x912440A4, Data CRC:
0x6F575C05

FYI...

> Ah. Someone else tromping down the path I've just come from! :slight_smile:
Glad to see I'm not the only crazy guy :wink:

No, but we may be the only two going about it this way. At least we're
in the minority. :slight_smile:

> I've done this too, with BeagleBox.
I'll take a look to the proj...

Just added some minor stuff to make it a little easier to get started.
In summary, start with "make help".

> No. The validation stuff comes from gitorious.org. The BB stuff comes
> from the OMAP branch of the kernel.org git repository.
Ok, then I prefer to go with BB

If you pull the validation image source together (u-boot and kernel)
then you're okay. See
http://code.google.com/p/beagleboard/wiki/BeagleboardRevC3Validation

But that version of the kernel is older and uses the outdated support
for the OMAP2/3 display subsystem. It uses DSS1. The current version
of this support is called DSS2. See
http://gitorious.org/linux-omap-dss2/linux/blobs/master/Documentation/arm/OMAP/DSS

The recipe I used is linux-omap_2.6.32.bb with related patches.
But ok, surely there is something wrong with my config file.

This kernel version uses the omap3_beagle_defconfig target to create the
configuration file for the kernel. BeagleBox uses that initially, then
you can edit (make kernel-menuconfig) and save a copy (make
kernel-saveconfig) locally to use in future builds. Earlier versions of
the Linux kernel with OMAP support may have different config targets.
Newer versions definitely do - the 2.6.34 and later use
omap2plus_defconfig.

If you want to start with the omap3_beagle_defconfig (or whichever
config target is appropriate) you have to move or delete
src/kernel/linux-omap-2.6.32.cfg (or other appropriate kernel config)
first. But this isn't required as this config is good enough to get
started.

This is my "not working" :slight_smile:
Starting kernel ...
Uncompressing Linux................................................................................................................................................................................................... done, bo.

Yeah, the BeagleBox kernels should get further than that. At least with
a C4 board. I don't have an xM board so can't say what happens on
those. And chances are good you have either a bad kernel config or an
inappropriate cross compiler setup.

Actually, also for beagle-validation there is a 2.6.32 kernel.

Yes, there is a branch for it in gitorious' repository. However, this
branch does not match up with the u-boot source specified in the
validation images - again, see
http://code.google.com/p/beagleboard/wiki/BeagleboardRevC3Validation
That u-boot with the 2.6.32 kernel won't work because of the display
differences. Well, at least they haven't worked for me yet.

Note, however, that this combination of u-boot and kernel should at
least boot to the root fs and a login and/or shell prompt on the serial
console. You just may not have much else working at that point.

> Finding an appropriate repository and associated patches (if any) can be
> a problem.
I see. I'm a bit puzzled with this mess about sources

It's the way sw development works in the bazaar model. Lots of places
to get similar code, but with different people working in different
places. The gitorious.org code appears to be the BeagleBoard
development home, while git.kernel.org/.../tmlind/ is the OMAP branch of
the kernel mainline before it gets pushed into Linus' tree. The
gitorious.org stuff works its way toward the tmlind branch. At least
that's my take on it at the moment. I'm still trying to clarify it in
my own mind.

Actually under Slackware 13.1 I had no problem in compiling the crosscompiler.
But I'll try to use CodeSourcery.

Compiling it isn't too difficult. You just may need to tweak it every
now and then to make sure it supports certain features. I've not used
the CodeSourcery release since I wanted to make sure I understood the
whole software stack, starting with the toolchain.

The way BeagleBox works is you build the cross compiler first (target:
xcc) and then build u-boot, kernel and rootfs with that. You never
clobber (make clobber) the xcc build unless you need to rebuild it with
a new configuration. Once you've stabilized the xcc, you almost never
go back to rebuild it. Then you slowly spend more time on each
component as you move up the software stack: bootloader, kernel, rootfs,
applications.

At work I have the xcc packaged into an RPM for projects there. I
haven't do that with the BeagleBox stuff yet but should.

Thank you :slight_smile:

No problem. Keep in touch. I'd like to hear from someone else slogging
through this particular part of the briar patch.

Good news (for me at least): I finally found a working kernel with DSS2
support for TV-out (re: S-Video). It's Tomi's tree (see
http://elinux.org/BeagleBoard#Linux_kernel). So now it's the default
kernel (based on 2.6.37), and the denx.de mainline is the u-boot
default.

Still have to get S-Video output cleaned up (force interlace mode,
reduce flicker and adjust overlay size), but at least its displaying
now.

Let me know if you try the build. I tried to clean it up so it should
just work with "make" now and build everything.

Great... I'll try it (this evening after work)... (also using u-boot mainline with no patches)

Yesterday I tried to compile the vanilla omap kernel (without patches from Angstrom).
I have been able to boot angstrom but without any output on the ttyS2 (serial) port (not even of TV-out). The boot parameters were correct (bootargs=console=ttyS2). Anyway I'm on it.

if it's a new york 2.6.37-rc vanilla kernel, you'll need "ttyO2" (O in
Omap) vs "ttyS2" if your not seeing serial output..

Regards,

As Robert noted the newer kernels (2.6.37 and later, I believe) changed
the serial port devices from ttySx to ttyOx. Check which kernel you
have to see if you need to change that.

When you try BeagleBox, the build will automatically generate a working
boot.scr for you from src/uboot/boot-sd.txt. You can view the .txt file
to see how the boot args are put together. It's heavily commented.

Don't forget to run "make pkg" after the build and then "cd ../pkg" to
grab the build files to stuff on the SD card - see the Build page on the
wiki for a bash function to make building easier:
http://www.graphics-muse.org/wiki/pmwiki.php?n=BeagleBox.Build

I wonder why they'd want to change that? It's been like that, well,
forever. What makes an OMAP serial port different than any other serial
port? Just curious.

Anyway, FYI - BeagleBox is not using the SGX patches you provided at the
moment because it's now using (by default) a different kernel than the
TI SDK and I'm not sure yet if SGX is supported in that kernel. Do you
know if the 2.6.37 series has the TI SDK patches applied yet? If so, I
can try to forward-port your patches. If you don't know I'll have to do
some diff'ing to find out.

BeagleBox can still build the TI SDK/SGX based kernel for anyone who
wants to try it. It just isn't using it by default since it doesn't
support TV-out.

if it's a new york 2.6.37-rc vanilla kernel, you'll need "ttyO2" (O in
Omap) vs "ttyS2" if your not seeing serial output..

I wonder why they'd want to change that? It's been like that, well,
forever. What makes an OMAP serial port different than any other serial
port? Just curious.

My guess, some developer thought that what ever enhancement they were
doing to the serial port for the omap no longer fit in the normal
'serial' driver, so we get the omap-serial driver now...

Anyway, FYI - BeagleBox is not using the SGX patches you provided at the
moment because it's now using (by default) a different kernel than the
TI SDK and I'm not sure yet if SGX is supported in that kernel. Do you
know if the 2.6.37 series has the TI SDK patches applied yet? If so, I
can try to forward-port your patches. If you don't know I'll have to do
some diff'ing to find out.

For 2.6.37-rc's there's just one build fix over 2.6.36 to make it
buildable: Mutex to semaphore

http://bazaar.launchpad.net/~beagleboard-kernel/%2Bjunk/2.6.37-devel/annotate/head:/patches/sgx/0001-OMAP3-SGX-TI-4.00.00.01-2.6.37-rc1-use-semaphore-ove.patch

I last tested it with v2.6.37-rc2, and the sgx blob was working fine
on my xM/C4's.. I'm currently setting up a new xfce image, so my plan
is to test the sgx with v2.6.37-rc4 today..

https://code.launchpad.net/~beagleboard-kernel/+junk/2.6.37-devel

BeagleBox can still build the TI SDK/SGX based kernel for anyone who
wants to try it. It just isn't using it by default since it doesn't
support TV-out.

Regards,