Enabled+I2C+2+bus

This tutorial explains how to enable the I2C 2 bus on the BeagleBoard =Requirements= First step is installing open embedded and bitbake.

Create working directory
1. Choose a working directory, for example: $ export OEBASE=/oe 2. Create the directory structure: $ mkdir -p $OEBASE/build/conf
 * You must choose a location with no symlinks above it

Obtaining Bitbake
$ cd $OEBASE $ wget http://download.berlios.de/bitbake/bitbake-1.8.18.tar.gz $ tar -xvzf bitbake-1.8.18.tar.gz $ mv bitbake-1.8.18 bitbake
 * Bitbake can be run without being installed, so all you have to do is:
 * The $OEBASE directory will now contain a bitbake directory.

Obtaining Open Embedded
1. Install Git if not yet installed: $ sudo apt-get install git-core 2. Download Open Embedded using Git: $ cd $OEBASE $ git clone git://git.openembedded.org/openembedded =Configuring Open Embedded=

Environment Variables
This process is needed each time you open a new shell as the range of these environment variables is limited to the shell you're currently working in. OR you can edit /etc/profile or ~/.profile to automate this process. $ export OEBASE=/oe $ export PATH=$OEBASE/bitbake/bin:$PATH $ export BBPATH=$OEBASE/build:$OEBASE/openembedded $ export BB_ENV_EXTRAWHITE="OEBASE"
 * This has actually been done in the first step of this tutorial

Local Configuration
Now a configuration file has to be created containing settings about the desired build for the bitbake process. vi $OEBASE/build/conf/local.conf A sample local.conf file can be found in $OEBASE/openembedded/conf/local.conf.sample. This file contains more settings than needed; we only need: BBFILES = "/oe/openembedded/recipes/*/*.bb" DISTRO = "angstrom-2008.1" MACHINE = "beagleboard" =Building Software=

Building U-boot
First step is building a new u-boot.bin file. This will be done using bitbake. When running bitbake in Ubuntu, it will complain: "Using dash as /bin/sh causes various subtle build problems, please use bash instead". Therefore we have to change the /bin/sh to bash: $ sudo dpkg-reconfigure dash Choose  when prompted

Now run: $ cd $OEBASE $ bitbake u-boot This command downloads the u-boot source and builds it. When completed we have to change the pin mux configuration. Open /oe/tmp/work/beagleboard-angstrom-linux-gnueabi/{gitubootdir}/git/board/ti/beagle/beagle.h and look for these lines: MUX_VAL(CP(I2C2_SCL), (IEN | PTU | EN | M4)) /*GPIO_168*/\ MUX_VAL(CP(I2C2_SDA), (IEN | PTU | EN | M4)) /*GPIO_183*/\ Replace them by: MUX_VAL(CP(I2C2_SCL), (IEN | PTU | DIS | M0)) /*I2C2_SCL*/\ MUX_VAL(CP(I2C2_SDA), (IEN | PTU | DIS | M0)) /*I2C2_SDA3*/\
 * If bitbake complains about missing packages, install them and run the above command again.

So now rebuild u-boot and deploy it to get the image. $ cd $OEBASE $ bitbake -f -c compile u-boot $ bitbake -f -c deploy u-boot Your new u-boot file can be found at $OEBASE/tmp/deploy/glibc/images/beagleboard/u-boot-beagleboard.bin

Building Kernel
Now we modify the kernel. Developers have disabled the I2C 2 bus because it threw a lot of errors when no hardware was connected to the bus.

Run: $ cd $OEBASE $ bitbake virtual/kernel

...

=References=
 * Open Embedded Manual
 * Kernel tweaks to enable I2C bus 2
 * Set bash as /bin/sh
 * Building Angstrom