[U-Boot-Users] LED-D2,D3 on LN2410SBC
Shakthi Kannan
shakthimaan at yahoo.com
Tue Jan 10 17:33:32 CET 2006
Greetings!
I am trying to get the leds, D2 and D3 to glow on the
LN2410SBC board from littlechips.com. I am using
u-boot-1.1.1 My code:
/*
* led.c
*/
#include <common.h>
#include <exports.h>
int main (int argc, char *argv[])
{
int *r_gpbcon = 0x56000010;
int *r_gpbdat = 0x56000014;
app_startup(argv);
printf ("r_gpbcon = %x\n", *(r_gpbcon));
*(r_gpbcon) = ((*(r_gpbcon))&~(0xf<<10))|(0x5<<10);
printf ("r_gpbcon = %x\n", *(r_gpbcon));
printf ("r_gpbdat = %x\n", *(r_gpbdat));
*(r_gpbdat) |= (3<<5);
printf ("r_gpbdat = %x\n", *(r_gpbdat));
return 0;
}
The Makefile I use to build it:
# Makefile
# Tools
CROSS = /usr/local/arm/2.95.3/bin/arm-linux-
CC = $(CROSS)gcc
AS = $(CROSS)as
LD = $(CROSS)ld
OBJCOPY = $(CROSS)objcopy
TARGET = led
BASE = 0x30100000
CFLAGS = -g -Os -fno-strict-aliasing -fno-common
-ffixed-r8 -msoft-float -D__KERNEL__ -fno-builtin
-ffreestanding -nostdinc -isystem
/usr/local/arm/2.95.3/bin/../lib/gcc-lib/arm-linux/2.95.3/include
-pipe -DCONFIG_ARM -D__ARM__ -march=armv4 -Wall
-Wstrict-prototypes
INCLUDE =
-I/home/shaks/code/ln2410sbc/uboot-1.1.1/include
-I/usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/include
LIBSTUBS =
/home/shaks/code/ln2410sbc/uboot-1.1.1/examples/libstubs.a
LGCC =
-L/usr/local/arm/2.95.3/bin/../lib/gcc-lib/arm-linux/2.95.3
-lgcc
-L/home/shaks/code/ln2410sbc/uboot-1.1.1/examples
-lstubs
LIBSTUB_INCLUDE =
/usr/local/arm/2.95.3/bin/../lib/gcc-lib/arm-linux/2.95.3/include
LDFLAGS = -g -Ttext $(BASE) -e main
all:
$(CC) $(CFLAGS) $(INCLUDE) -c $(TARGET).c -o
$(TARGET).o
$(LD) $(LDFLAGS) $(TARGET).o -o $(TARGET) $(LIBSTUBS)
$(LGCC)
$(OBJCOPY) -O binary $(TARGET) $(TARGET).bin
2>/dev/null
clean:
rm -f *~ *.o *.bin $(TARGET) semantic.cache*
I copy the led.bin file to /tftpboot in my host
system, and I copy it to the board using "tftp
0x30100000 led.bin". It runs, but, leds d2 and d3
won't glow.
Can anyone tell me what I am doing wrong and how I can
get this up and running?
Thanking you,
SK
--
Shakthi Kannan, MS
Software Engineer, Hexaware Technologies
[E]: shakthimaan at yahoo.com [M]: (91) 98407-87007
[W]: http://www.shakthimaan.com [L]: Chennai, India
__________________________________________
Yahoo! DSL Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com
More information about the U-Boot
mailing list