u-boot sources

I've spent many hours yesterday and today trying to figure out how
u-boot gets built in the Angstrom distribution. I found

Angstrom_sources/setup-scripts/sources/downloads/u-boot-2011.06.tar.bz2

but it does appear to have been unpacked anywhere.

I got the source package from here:

http://www.angstrom-distribution.org/building-angstrom

I'm still working on getting the second chip select pin working on
spi2.1. In the above tar, there is a beagle.h file and in it, all the
pins are enumerated properly. I just can't figure out how to get from
there to a u-boot that enables the second pin.

Help! please.

John

If you built an image (eg. bitbake console-image) the unpacked source code is removed in one of the tasks and all you will get in the ‘work’ dir are the log files.
If you do just bitbake -c config console-image, all the source codes will be in the work dir.
That’s what i noticed.

Comment out line INHERIT += “rm_work” found in local.conf in the “conf” folder.
Then build an image - bitbake console-image or any other image.

u-boot source code should be in “setup-scripts/build/tmp-angstrom_v2012_05-eglibc/work/beagleboard-angstrom-linux-gnueabi/u-boot-2011.12-r8/git”
You may have to replace the folder names with your version number.

Thanks so much to both you and Fernando.

One other small question if you don't mind. Where are the compacted
sources stored?

I'll take time later to learn "the linux way" of managing kernel sources
but right now I just gotta get something working so I certainly
appreciate the advice.

John

A follow-up. This almost worked. Just commenting out INHERIT didn't do
a lot because I had already built the kernel and didn't know how to
rebuild from scratch.

So last night I got the scripts, commented out INHERIT and started a
virgin build. This morning it was finished. The SPI code on my machine
is in

~/BeagleBone_Dev/Angstrom_srcs/setup-scripts/build/tmp-angstrom_v2012_05-eglibc/work/beaglebone-angstrom-linux-gnueabi/u-boot-2011.09+git-r30/git/board/ti/beagl

Just for grins I counted the files under the setup-scripts tree. An
astounding 1,110,613 file totaling 19.5 gig! Of course, little of this
belongs to the beaglebone distribution. Still, over 1 million files. Wow.

Now that I've found the files, time to go to work.

John

Comment out line INHERIT += "rm_work" found in local.conf in the "conf"
folder.
Then build an image - bitbake console-image or any other image.

u-boot source code should be in
"setup-scripts/build/tmp-angstrom_v2012_05-eglibc/work/beagleboard-angstrom-linux-gnueabi/u-boot-2011.12-r8/git"
You may have to replace the folder names with your version number.

A follow-up. This almost worked. Just commenting out INHERIT didn't do
a lot because I had already built the kernel and didn't know how to
rebuild from scratch.

So last night I got the scripts, commented out INHERIT and started a
virgin build. This morning it was finished. The SPI code on my machine
is in

~/BeagleBone_Dev/Angstrom_srcs/setup-scripts/build/tmp-angstrom_v2012_05-eglibc/work/beaglebone-angstrom-linux-gnueabi/u-boot-2011.09+git-r30/git/board/ti/beagl

Just for grins I counted the files under the setup-scripts tree. An
astounding 1,110,613 file totaling 19.5 gig! Of course, little of this
belongs to the beaglebone distribution. Still, over 1 million files. Wow.

20GB is an over kill for just u-boot sources - that is the part i hate
about this build system from what little i understand it right now.

Is there a specific way to _JUST_ get the u-boot sources instead of
all this 20GB data?

Comment out line INHERIT += "rm_work" found in local.conf in the "conf"
folder.
Then build an image - bitbake console-image or any other image.

u-boot source code should be in
"setup-scripts/build/tmp-angstrom_v2012_05-eglibc/work/beagleboard-angstrom-linux-gnueabi/u-boot-2011.12-r8/git"
You may have to replace the folder names with your version number.

A follow-up. This almost worked. Just commenting out INHERIT didn't do
a lot because I had already built the kernel and didn't know how to
rebuild from scratch.

So last night I got the scripts, commented out INHERIT and started a
virgin build. This morning it was finished. The SPI code on my machine
is in

~/BeagleBone_Dev/Angstrom_srcs/setup-scripts/build/tmp-angstrom_v2012_05-eglibc/work/beaglebone-angstrom-linux-gnueabi/u-boot-2011.09+git-r30/git/board/ti/beagl

I assume this is a u-boot git tree on which you can do a git log.
Any chance you could tar up this one directory that is the u-boot tree
and i could make use of it.

You sure will save me all this over night download time :slight_smile:

Thanks in advance.
randy

And the next question is, what has to change to get bitbake to make
those sources again? Modifying beagle.c and/or beagle.h doesn't do it.

John

20GB is an over kill for just u-boot sources - that is the part i hate
about this build system from what little i understand it right now.

Is there a specific way to _JUST_ get the u-boot sources instead of
all this 20GB data?

And the next question is, what has to change to get bitbake to make
those sources again? Modifying beagle.c and/or beagle.h doesn't do it.

Frankly speaking, i am lost in this bitbake system.
I almost have given up on having some working sources for u-boot for bone:

https://groups.google.com/forum/?fromgroups=#!topic/beagleboard/FylQduiKjeQ

We are planning of spinning a new board based of AM35xx processor for which
we need to modify the u-boot to some extent.

Experience to get to the sources for the Angstrom shipped with the SD
card for bone board,
is in itself the biggest pain i experience.

I wish someone is listening...

I'm still learning about this but this is what I think happens. This
package called openembedded manages things. It's like a super-make but
with "recipes" istead of Makefiles. When you git the "Angstrom
Distribution", what you get is a set of scripts. You run the scripts
and they git sources as needed and then (unless you uncomment that rm
directive) deletes them after compile.

This is an example of the work flow that I discovered in my research

http://www.slimlogic.co.uk/2011/05/openembeddedangstrom-kernel-workflow/

You can go here

http://www.openembedded.org/wiki/Documentation

And try to learn about OpenEmbedded but this stuff is out of date plus
the Angstrom stuff is so customized that I'm still working on
reconciling the two.

I put a tar in my dropbox of everything I think you'll need to make u-boot

https://dl.dropbox.com/u/81715047/u-boot-2011.09%2Bgit-r30.tar.bz2

This is not guaranteed to be complete. You'll be looking for beagle.c
and beagle.h for the SPI stuff. There is a Makefile in that directory
but it needs to be called with some command line options that I haven't
figured out yet.

My next step is to figure out what I have to touch to make bitbake
remake only the u-boot image.

John

John

I assume this is a u-boot git tree on which you can do a git log.
Any chance you could tar up this one directory that is the u-boot tree
and i could make use of it.

You sure will save me all this over night download time :slight_smile:

I'm still learning about this but this is what I think happens. This
package called openembedded manages things. It's like a super-make but
with "recipes" istead of Makefiles. When you git the "Angstrom
Distribution", what you get is a set of scripts. You run the scripts
and they git sources as needed and then (unless you uncomment that rm
directive) deletes them after compile.

This is an example of the work flow that I discovered in my research

http://www.slimlogic.co.uk/2011/05/openembeddedangstrom-kernel-workflow/

You can go here

http://www.openembedded.org/wiki/Documentation

And try to learn about OpenEmbedded but this stuff is out of date plus
the Angstrom stuff is so customized that I'm still working on
reconciling the two.

I am also reverse engineering this a bit - but dont have much
bandwidth to learn this new build system.
My role is to have this simple u-boot re-compile - change - re-compile
- and be able to run it.

On hint i can see is this folder - shows on top of denx upstream
u-boot what are the extra patches to be put:
~/setup-scripts/sources/meta-ti/recipes-bsp/u-boot/u-boot/2011.12

I put a tar in my dropbox of everything I think you'll need to make u-boot

https://dl.dropbox.com/u/81715047/u-boot-2011.09%2Bgit-r30.tar.bz2

Thanks - i am going to use this for now.
Please keep me posted what you find on u-boot. I have the exact same need.

If i know anything further, i will keep posted.

Thanks again.

That's right.

If you check out the Gumstix site and the list you will see some examples,
etc.
Obviously the examples are intended for the Gumstix boards, however they
still may be helpful.

Good luck :slight_smile:

I assume this is a u-boot git tree on which you can do a git log.
Any chance you could tar up this one directory that is the u-boot tree
and i could make use of it.

You sure will save me all this over night download time :slight_smile:

I'm still learning about this but this is what I think happens. This
package called openembedded manages things. It's like a super-make but
with "recipes" istead of Makefiles. When you git the "Angstrom
Distribution", what you get is a set of scripts. You run the scripts
and they git sources as needed and then (unless you uncomment that rm
directive) deletes them after compile.

This is an example of the work flow that I discovered in my research

http://www.slimlogic.co.uk/2011/05/openembeddedangstrom-kernel-workflow/

You can go here

http://www.openembedded.org/wiki/Documentation

And try to learn about OpenEmbedded but this stuff is out of date plus
the Angstrom stuff is so customized that I'm still working on
reconciling the two.

I put a tar in my dropbox of everything I think you'll need to make u-boot

https://dl.dropbox.com/u/81715047/u-boot-2011.09%2Bgit-r30.tar.bz2

Looks a git log of u-boot directory is dependent on some ref objects
in root dir:
~/u-boot-2011.09+git-r30/git$ git log

error: object directory
/home/jgd/BeagleBone_Dev/Angstrom_srcs/setup-scripts/sources/downloads/git2/arago-project.org.git.projects.u-boot-am33x.git/objects
does not exist; check .git/objects/info/alternates.
fatal: bad object HEAD

Sources are there in the directory for sure - so that is good.

Again, I'm still learning but I think that things are supposed to go
like this.

You git a release. You find something that needs changing. As soon as
it's working, you do a diff against the original source and put that in
a patch tree. Optionally if its of general interest you send it back to
the linux.gods and they incorporate the patch in the new release.

The reason you do it this way is because if you do a git pull, your work
that is not in patch form will be over-written.

I just dropped a copy of the scripts that a git of Angstrom produces in
my dropbox.

https://dl.dropbox.com/u/81715047/setup-scripts_as_received.tar.bz2

The README is an important read plus you can see the virgin git before
OpenEmbedded is unleashed against your machine :slight_smile:

You might want to look at the Robert Nelson kernel. He maintains
hundreds of patch files that constitute the difference between the
mainline release and his work. Unfortunately, to my knowledge he
doesn't do u-boot.

One other thing you'll need.

During the setup process, a file called environment-angstromv2012.05 is
set up in ~/.oe. You have to run that manually on each terminal screen
you open.

$ . ~/.oe/environment-angstromv2012.05

I put a copy of mine in my dropbox also

/home/jgd/Desktop/Dropbox/Public/environment-angstromv2012.05

This is customized to the particular machine it is running on so you'll
need to edit it.

Something else I've just learned.

If I touch beagle.c and run the command

$ MACHINE=beaglebone bitbake -f u-boot

it will re-make u-boot. The "-f" is the "force" option.

I have not yet figured out where it puts the binary, however.

The stuff that gets used when you build an SD card is in

/build/tmp-angstrom_v2012_05-eglibc/deploy/images/beaglebone/

u-boot.img is actually a symbolic link to
u-boot-beaglebone-2011.09+git-r30.img

I've just executed a "find" on the whole build tree and come up with
three locations for u-boot-beaglebone-2011.09+git-r30.img other than deploy

./build/tmp-angstrom_v2012_05-eglibc/work/beaglebone-angstrom-linux-gnueabi/u-boot-2011.09+git-r30/image/boot/u-boot-beaglebone-2011.09+git-r30.img
./build/tmp-angstrom_v2012_05-eglibc/work/beaglebone-angstrom-linux-gnueabi/u-boot-2011.09+git-r30/package/boot/u-boot-beaglebone-2011.09+git-r30.img
./build/tmp-angstrom_v2012_05-eglibc/work/beaglebone-angstrom-linux-gnueabi/u-boot-2011.09+git-r30/packages-split/u-boot/boot/u-boot-beaglebone-2011.09+git-r30.img

I'll check these to see which one was updated by my touch/bitbake.

John

I am following your clone and build steps from scratch with this as
the only change:

diff --git a/conf/local.conf b/conf/local.conf
index 2477a90..9670beb 100644
--- a/conf/local.conf
+++ b/conf/local.conf
@@ -2,7 +2,7 @@
# CONF_VERSION is increased each time build/conf/ changes incompatibly
CONF_VERSION = "1"

-INHERIT += "rm_work"
+#INHERIT += "rm_work"

# Which files do we want to parse:
BBMASK = ""

Which directory are you referring to?

John

Hopefully i will be on the same state and will have the u-boot sources.
In u-boot directory you can issue command to cross compile:
make CROSS_COMPILE=arm-angstrom-linux-gnueabi- am335x_evm_config
make CROSS_COMPILE=arm-angstrom-linux-gnueabi- -j3

Which directory are you referring to?

My build is still on-going so i cannot exactly pin point the directory
location right now.
Will let u know as and when its ready.

I would guess it will be same as what Gopal pointed:
"setup-scripts/build/tmp-angstrom_v2012_05-eglibc/work/beagleboard-angstrom-linux-gnueabi/u-boot-2011.12-r8/git"
It should be the u-boot sources. Will confirm in couple of hours.

Real close. The directory is

setup-scripts/build/tmp-angstrom_v2012_05-eglibc/work/beaglebone-angstrom-linux-gnueabi/u-boot-2011.09+git-r30/git

notice "beaglebone-" instead of beagleboard-

These worked for me

make CROSS_COMPILE=arm-linux-gnueabi- am335x_evm_config
make CROSS_COMPILE=arm-linux-gnueabi- -j3

These produced binaries in the git directory but did not copy them over
to the

setup-scripts/build/tmp-angstrom_v2012_05-eglibc/deploy/images/beaglebone

Something else does that. "make install" does NOT work. I'll look at
that later. Right now I'm going to copy the image over to my BB and see
if it'll boot. The image is about the right size.

Note that there are a bunch of patches listed in

/home/jgd/BeagleBone_Dev/Angstrom_srcs/setup-scripts/sources/meta-ti/recipes-bsp/u-boot/u-boot_2011.10rc.bb

(this is the recipe that gets executed with "bitbake -v -f u-boot" Add
the verbose command to see lots of stuff going on.)

and it appears they got applied. My screen scrolled too rapidly.

Fingers crossed that it works.

John

I would guess it will be same as what Gopal pointed:
"setup-scripts/build/tmp-angstrom_v2012_05-eglibc/work/beagleboard-angstrom-linux-gnueabi/u-boot-2011.12-r8/git"
It should be the u-boot sources. Will confirm in couple of hours.

Real close. The directory is

setup-scripts/build/tmp-angstrom_v2012_05-eglibc/work/beaglebone-angstrom-linux-gnueabi/u-boot-2011.09+git-r30/git

notice "beaglebone-" instead of beagleboard-

These worked for me

make CROSS_COMPILE=arm-linux-gnueabi- am335x_evm_config
make CROSS_COMPILE=arm-linux-gnueabi- -j3

These produced binaries in the git directory but did not copy them over
to the

setup-scripts/build/tmp-angstrom_v2012_05-eglibc/deploy/images/beaglebone

Something else does that. "make install" does NOT work. I'll look at
that later. Right now I'm going to copy the image over to my BB and see
if it'll boot. The image is about the right size.

Note that there are a bunch of patches listed in

/home/jgd/BeagleBone_Dev/Angstrom_srcs/setup-scripts/sources/meta-ti/recipes-bsp/u-boot/u-boot_2011.10rc.bb

I think i have a good idea what is going on and will share.

Base U-boot sources for v2011.12 TAG is in git tree here:
~/setup-scripts/build/tmp-angstrom_v2012_05-eglibc/work/beagleboard-angstrom-linux-gnueabi/u-boot-2011.12-r8/git

Next if you check:
~/setup-scripts/sources/meta-ti/recipes-bsp/u-boot/u-boot_2011.12.bb

This file says: the final u-boot is: v2011.12 + 14 patches mentioned
in this .bb file.

So to get to the right source, we will have to manually apply these
patches (git am *.patch)
I am going to try that now and see if this yields the final result
good MLO and u-boot.bin.

(this is the recipe that gets executed with "bitbake -v -f u-boot" Add
the verbose command to see lots of stuff going on.)

This command fails for me with:
bitbake -v -f u-boot
Traceback (most recent call last):
  File "/usr/bin/bitbake", line 234, in <module>
    ret = main()
  File "/usr/bin/bitbake", line 197, in main
    server = ProcessServer(server_channel, event_queue, configuration)
  File "/usr/lib/pymodules/python2.7/bb/server/process.py", line 78, in __init__
    self.cooker = BBCooker(configuration, self.register_idle_function)
  File "/usr/lib/pymodules/python2.7/bb/cooker.py", line 76, in __init__
    self.parseConfigurationFiles(self.configuration.file)
  File "/usr/lib/pymodules/python2.7/bb/cooker.py", line 510, in
parseConfigurationFiles
    data = _parse(os.path.join("conf", "bitbake.conf"), data)
TypeError: getVar() takes exactly 3 arguments (2 given)
ERROR: Error evaluating
'${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:forcevariable${@bb.utils.contains("TUNE_FEATURES",
"thumb", ":thumb", "", d)}${@bb.utils.contains("TUNE_FEATURES",
"no-thumb-interwork", ":thumb-interwork", "", d)}'
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/bb/data_smart.py", line 116, in
expandWithRefs
    s = __expand_var_regexp__.sub(varparse.var_sub, s)
  File "/usr/lib/pymodules/python2.7/bb/data_smart.py", line 60, in var_sub
    var = self.d.getVar(key, 1)
  File "/usr/lib/pymodules/python2.7/bb/data_smart.py", line 260, in getVar
    return self.expand(value, var)
  File "/usr/lib/pymodules/python2.7/bb/data_smart.py", line 132, in expand
    return self.expandWithRefs(s, varname).value
  File "/usr/lib/pymodules/python2.7/bb/data_smart.py", line 117, in
expandWithRefs
    s = __expand_python_regexp__.sub(varparse.python_sub, s)
TypeError: getVar() takes exactly 3 arguments (2 given)

ERROR: Error evaluating
'${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE'),d)[0] or
'defaultpkgname'}'
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/bb/data_smart.py", line 117, in
expandWithRefs
    s = __expand_python_regexp__.sub(varparse.python_sub, s)
  File "/usr/lib/pymodules/python2.7/bb/data_smart.py", line 76, in python_sub
    value = utils.better_eval(codeobj, DataContext(self.d))
  File "/usr/lib/pymodules/python2.7/bb/utils.py", line 387, in better_eval
    return eval(source, _context, locals)
  File "PN", line 1, in <module>
TypeError: getVar() takes exactly 3 arguments (2 given)

I would guess it will be same as what Gopal pointed:
"setup-scripts/build/tmp-angstrom_v2012_05-eglibc/work/beagleboard-angstrom-linux-gnueabi/u-boot-2011.12-r8/git"
It should be the u-boot sources. Will confirm in couple of hours.

Real close. The directory is

setup-scripts/build/tmp-angstrom_v2012_05-eglibc/work/beaglebone-angstrom-linux-gnueabi/u-boot-2011.09+git-r30/git

notice "beaglebone-" instead of beagleboard-

These worked for me

make CROSS_COMPILE=arm-linux-gnueabi- am335x_evm_config
make CROSS_COMPILE=arm-linux-gnueabi- -j3

These produced binaries in the git directory but did not copy them over
to the

setup-scripts/build/tmp-angstrom_v2012_05-eglibc/deploy/images/beaglebone

Something else does that. "make install" does NOT work. I'll look at
that later. Right now I'm going to copy the image over to my BB and see
if it'll boot. The image is about the right size.

Note that there are a bunch of patches listed in

/home/jgd/BeagleBone_Dev/Angstrom_srcs/setup-scripts/sources/meta-ti/recipes-bsp/u-boot/u-boot_2011.10rc.bb

I think i have a good idea what is going on and will share.

Base U-boot sources for v2011.12 TAG is in git tree here:
~/setup-scripts/build/tmp-angstrom_v2012_05-eglibc/work/beagleboard-angstrom-linux-gnueabi/u-boot-2011.12-r8/git

Next if you check:
~/setup-scripts/sources/meta-ti/recipes-bsp/u-boot/u-boot_2011.12.bb

This file says: the final u-boot is: v2011.12 + 14 patches mentioned
in this .bb file.

So to get to the right source, we will have to manually apply these
patches (git am *.patch)
I am going to try that now and see if this yields the final result
good MLO and u-boot.bin.

(this is the recipe that gets executed with "bitbake -v -f u-boot" Add
the verbose command to see lots of stuff going on.)

This command fails for me with:
bitbake -v -f u-boot

Now it worked as environ setup was missing: . ~/.oe/environment-angstromv2012.05

But i don't see u-boot compiling logs. So it means its not compiling the uboot.