[Home] CCDC hs vs as output via u-boot

Goal

Configure the cam_hs and cam_vs as outputs.

Linux Kernel

I had tried this before and documented the experience somewhat as Export-gpio-pins-on-gumstix

Later I found that although the cam_d lines were outputting data, the values were coming out as 0s. There is a suspision that setting CONFIG_OMAP3_MUX in the kernel enables a number of other changes that may not be desired. The next step is to try via node-devreg and then u-boot.

/* Camera - HS/VS signals */
OMAP3_MUX(CAM_HS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),

gpio94 / cam_hs

u-boot

Make the changes you need:

cd ${OVEROTOP}
bitbake -c clean u-boot-omap3; bitbake -c configure u-boot-omap3
VERSION=`bitbake --show-versions | grep 'u-boot-omap3\>' | cut -d':' -f2`
UBOOTDIR=${OVEROTOP}/tmp/work/overo-angstrom-linux-gnueabi/u-boot-omap3-${VERSION}
cd ${UBOOTDIR}
cd ./git/board/overo
cp overo.h overo.h.orig
vim overo.h # find `CAM_HS` and `CAM_VS` and change IEN (input enable) to IDIS (input disable)

Make your own copy of u-boot (as not to wipe it out if you clean org.openembedded.dev):

cd ${OVEROTOP}/
mkdir -p ./user.collection/recipes/
cp -a ./org.openembedded.dev/recipes/u-boot ./user.collection/recipes/u-boot

Create a patchfile that bitbake can understand:

cd ${UBOOTDIR}
git diff --no-prefix git/board/overo/overo.h.orig git/board/overo/overo.h > pin-mux.patch
mv pin-mux.patch ${OVEROTOP}/user.collection/recipes/u-boot/u-boot-omap3-git/

Edit the bitbake file:

vim ${OVEROTOP}/user.collection/recipes/u-boot/u-boot-omap3_git.bb

So that it has pin-mux.patch;patch=yes \, something like this:

SRC_URI = "git://www.sakoman.com/git/u-boot.git;branch=omap3;protocol=git \
           file://fw_env.config \
           file://pin-mux.patch;apply==yes \
          "

And bitbake it:

cd ${OVEROTOP}
bitbake -c clean u-boot-omap3; bitbake u-boot-omap3

And copy it to your gumstix:

WARNING: Be wise. Test your u-boot on an SDHC before corrupting your NAND.

GUMSTIX=192.168.1.20 # change this to your gumstix's address
scp ${OVEROTOP}/tmp/deploy/glibc/images/overo/u-boot-overo.bin ${GUMSTIX}:/media/mmcblk0p1/u-boot.bin

node-devreg

with node-devreg you can change the registry settings in user-space

./doc/omap3530/control.js

// control registers
var padconf = {
  base_address: "0x48002030",
  description: "Pad Multiplexing Register Fields - Core Control Module Pad Configuration Register Fields - pin muxing, etc",
  pages: [764],
  registers: {
    cam_hs: {
      description: "Configuring hsync/vsync or gpio94/gpio95",
      address: "0x4800210C",
      offset: "0x000000DC",
      fields: {
        cam_hs: [15:0],
        cam_vs: [31:16]
      }
    }
  }
}
exports.padconf = padconf;

control_settings.js

var padconf = {
  "cam_hs": {
    "cam_hs": "0",
    "cam_vs": "0"
  }
}

Resources

Updated at 2010-08-12
blog comments powered by Disqus