Hi Carson,
I copied codes from the uboot source code when I made changes on uboot. Then built the uboot and put it in the DOS partition of my SD card. When I got the C4 beagleboard, I did not want to do that anymore. Instead, I did the GPIO setup in kernel driver code since I have already a small customization in the mmc driver. You do not need to get uboot source code. You can do the init function in the user space code. I have done that before to show the setting of the PINMUXes. The demo image of Angstrom should have gcc. If not, go to
http://www.angstrom-distribution.org/repo/ to get what you want. You need to use opkg to do the installation.
Here is the source code to dump the configuration of the PINMUXes. In user space code, we do not use ioremap. See the source code below:
#include <stdio.h>
#include <sys/errno.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#define MMAP_START 0x48002000
#define MMAP_SIZE 1024
#define PADCONFS_START 0x48002030
#define PADCONFS_SIZE 564
int main(int argc, char *argv[])
{
int i = 0;
int rc = 0;
int fd;
unsigned long padconfig;
unsigned long *padconfig_start;
char *mmap_addr;
fd = open("/dev/mem", O_RDWR);
if (fd == -1) {
printf("open() failed!\n");
rc = -1;
}
mmap_addr = mmap(NULL, MMAP_SIZE, PROT_READ, MAP_PRIVATE, fd, MMAP_START);
if (mmap_addr == MAP_FAILED) {
printf("mmap() failed!\n");
rc = -ENOMEM;
goto exit;
}
padconfig_start = (unsigned long *)(mmap_addr + (PADCONFS_START - MMAP_START));
for (i = 0; i < PADCONFS_SIZE >> 2; i++) {
padconfig = padconfig_start[i];
printf("0x%08x\t0x%08x\n", PADCONFS_START+(i<<2), padconfig);
}
exit:
return rc;