diff --git a/qiboot/Makefile b/qiboot/Makefile index 563d932..43511ec 100644 --- a/qiboot/Makefile +++ b/qiboot/Makefile @@ -31,8 +31,14 @@ C_OBJS = $(patsubst %.c,%.o, $(C_SRCS)) SRCS = ${S_SRCS} ${C_SRCS} OBJS = ${S_OBJS} ${C_OBJS} +# GTA02 A5 and A6 U-Boot will eat these for DFU action +UDFU_VID = 0x1d50 +UDFU_PID = 0x5119 +UDFU_REV = 0x350 + TARGET = src/start_kboot_all -IMAGE = $(IMAGE_DIR)/start +IMAGE = $(IMAGE_DIR)/kboot +UDFU_IMAGE = $(IMAGE_DIR)/kboot.udfu %.o: %.S @$(CC) $(CFLAGS) -o $@ $< @@ -40,13 +46,15 @@ IMAGE = $(IMAGE_DIR)/start %.o: %.c @$(CC) $(CFLAGS) -o $@ $< -all:${TARGET} +all:${UDFU_IMAGE} ${OBJS}:${SRCS} -${TARGET}:${OBJS} +${UDFU_IMAGE}:${OBJS} $(LD) ${LDFLAGS} -T$(LDS) -g $(OBJS) -o ${TARGET} $(OBJCOPY) -O binary -S ${TARGET} ${IMAGE} + $(MKUDFU) -v ${UDFU_VID} -p ${UDFU_PID} -r ${UDFU_REV} \ + -d ${IMAGE} ${UDFU_IMAGE} $(OBJDUMP) -D ${TARGET} >${IMAGE}.dis blink_led:src/led_on.S @@ -55,4 +63,4 @@ blink_led:src/led_on.S $(OBJCOPY) -O binary -S led_on_temp.o $(IMAGE)/led_on clean: - rm -f src/*.o src/*~ include/*~ ${IMAGE}* ${TARGET} + rm -f src/*.o src/*~ include/*~ ${IMAGE}* ${TARGET} ${UDFU_IMAGE} diff --git a/qiboot/config.mk b/qiboot/config.mk index 52c0148..5d01952 100644 --- a/qiboot/config.mk +++ b/qiboot/config.mk @@ -2,7 +2,7 @@ # Include the make variables (CC, etc...) # #CROSS_COMPILE=arm-softfloat-linux-gnu- -CROSS_COMPILE=arm-angstrom-linux-gnueabi- +CROSS_COMPILE=/usr/local/openmoko/arm/bin/arm-angstrom-linux-gnueabi- AS = $(CROSS_COMPILE)as LD = $(CROSS_COMPILE)ld @@ -10,4 +10,7 @@ CC = $(CROSS_COMPILE)gcc OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump -export CROSS_COMPILE AD LD CC OBJCOPY OBJDUMP +# we need the mkudfu tool from U-Boot build +MKUDFU = ../uboot/u-boot/tools/mkudfu + +export CROSS_COMPILE AD LD CC OBJCOPY OBJDUMP MKUDFU