From: hackbard Date: Tue, 28 Aug 2007 17:20:01 +0000 (+0200) Subject: holidays ... X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8569c0f53d6b77d5d69d8e31a9d2c25b654265c;p=my-code%2Farm.git holidays ... --- diff --git a/betty/Makefile b/betty/Makefile index 4e07f98..8925b22 100644 --- a/betty/Makefile +++ b/betty/Makefile @@ -1,13 +1,16 @@ +# native builds CC = gcc CFLAGS = -Wall -ARMCC = /scratch/arm-elf/bin/arm-elf-gcc -ARMCFLAGS = -Wall -mcpu=arm7tdmi-s -nostartfiles -nostdlib -ARMOBJCOPY = /scratch/arm-elf/bin/arm-elf-objcopy +# cross build +ARCH = arm-elf +CROSS_CC = $(ARCH)-gcc +CROSS_OBJCOPY = $(ARCH)-objcopy +CROSS_CFLAGS = -Wall -Os -mcpu=arm7tdmi-s -nostartfiles -nostdlib -HOSTOBJECTS = lpcload fwdump - -ARMOBJECTS = fwbc.hex fwflash.hex +# build objects +HOST_TARGET = lpcload fwdump +CROSS_TARGET = fwbc.hex fwflash.hex # all projects all: $(HOSTOBJECTS) $(ARMOBJECTS) diff --git a/betty/fwflash.c b/betty/fwflash.c index 8d837e7..e2f78d9 100644 --- a/betty/fwflash.c +++ b/betty/fwflash.c @@ -9,16 +9,24 @@ * include files */ +#include + #include "lpc2xxx.h" /* * defines */ -/* band 0/2 addr */ +/* bank 0/2 addr */ #define BANK0 0x80000000 #define BANK2 0x82000000 +/* flash cmd addresses */ +#define B0F555 (*((volatile unsigned long *)(BANK0|0x555))) +#define B0F2AA (*((volatile unsigned long *)(BANK0|0x2aa))) +#define B2F555 (*((volatile unsigned long *)(BANK2|0x555))) +#define B2F2AA (*((volatile unsigned long *)(BANK2|0x2aa))) + /* commands */ #define CMD_READ 'R' #define CMD_CHIP_ERASE 'E' @@ -38,10 +46,14 @@ typedef unsigned int u32; */ #define TX_BYTE(x) while(!(UART0_LSR&(1<<5))) continue; \ - UART0_THR=x; + UART0_THR=x + +#define TX_NL TX_BYTE('\n'); TX_BYTE('\r') -#define SEND_OK TX_BYTE('o'); TX_BYTE('k'); TX_BYTE('\n'); \ - TX_BYTE('\r'); +#define TX_STRING(x,len) for(scnt=0;scnt