Commit be2a89d9 authored by Henrik Nordstrom's avatar Henrik Nordstrom
Browse files

fel-pio.bin: Add a jump table in the beginning to ease usage

parent a072e4f7
...@@ -15,7 +15,7 @@ all: $(TOOLS) ...@@ -15,7 +15,7 @@ all: $(TOOLS)
misc: $(MISC_TOOLS) misc: $(MISC_TOOLS)
clean: clean:
@rm -vf $(TOOLS) $(MISC_TOOLS) @rm -vf $(TOOLS) $(MISC_TOOLS) *.o *.elf
$(TOOLS): Makefile common.h $(TOOLS): Makefile common.h
...@@ -27,8 +27,6 @@ fexc: fexc.h script.h script.c \ ...@@ -27,8 +27,6 @@ fexc: fexc.h script.h script.c \
script_bin.h script_bin.c \ script_bin.h script_bin.c \
script_fex.h script_fex.c script_fex.h script_fex.c
bootinfo: bootinfo.c
LIBUSB = libusb-1.0 LIBUSB = libusb-1.0
LIBUSB_CFLAGS = `pkg-config --cflags $(LIBUSB)` LIBUSB_CFLAGS = `pkg-config --cflags $(LIBUSB)`
LIBUSB_LIBS = `pkg-config --libs $(LIBUSB)` LIBUSB_LIBS = `pkg-config --libs $(LIBUSB)`
...@@ -39,6 +37,19 @@ fel: fel.c ...@@ -39,6 +37,19 @@ fel: fel.c
%: %.c %: %.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(filter %.c,$^) $(LIBS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
.dummy: fel-pio.bin
fel-pio.bin: fel-pio.elf fel-pio.nm
arm-none-eabi-objcopy -O binary fel-pio.elf fel-pio.bin
fel-pio.elf: fel-pio.c
arm-none-eabi-gcc -g -Os -fno-common -fno-builtin -ffreestanding -nostdinc -mno-thumb-interwork -Wall -Wstrict-prototypes -fno-stack-protector -Wno-format-nonliteral -Wno-format-security -fno-toplevel-reorder fel-pio.c -nostdlib -o fel-pio.elf -T fel-pio.lds
fel-pio.nm: fel-pio.elf
arm-none-eabi-nm fel-pio.elf | grep -v " _" >fel-pio.nm
bootinfo: bootinfo.c
.gitignore: Makefile .gitignore: Makefile
@for x in $(TOOLS) '*.o' '*.swp'; do \ @for x in $(TOOLS) '*.o' '*.swp'; do \
echo "$$x"; \ echo "$$x"; \
......
...@@ -21,15 +21,28 @@ ...@@ -21,15 +21,28 @@
Build instructions: Build instructions:
arm-none-linux-gnueabi-gcc -g -Os -fno-common -ffixed-r8 -msoft-float -fno-builtin -ffreestanding -nostdinc -mno-thumb-interwork -Wall -Wstrict-prototypes -fno-stack-protector -Wno-format-nonliteral -Wno-format-security -fno-toplevel-reorder fel-pio.c -c arm-none-eabi-gcc -g -Os -fno-common -fno-builtin -ffreestanding -nostdinc -mno-thumb-interwork -Wall -Wstrict-prototypes -fno-stack-protector -Wno-format-nonliteral -Wno-format-security -fno-toplevel-reorder fel-pio.c -nostdlib -o fel-pio.elf
arm-none-linux-gnueabi-objcopy -O binary fel-pio.o fel-pio.bin arm-none-eabi-objcopy -O binary fel-pio.elf fel-pio.bin
arm-none-linux-gnueabi-nm fel-pio.o arm-none-eabi-nm fel-pio.o
*/ */
void _pio_to_sram(void);
void _sram_to_pio(void);
void pio_to_sram(void) void pio_to_sram(void)
{
_pio_to_sram();
}
void sram_to_pio(void)
{
_sram_to_pio();
}
void _pio_to_sram(void)
{ {
unsigned long *a = (void *)0x1c20800; unsigned long *a = (void *)0x1c20800;
unsigned long *b = (void *)0x3000; unsigned long *b = (void *)0x3000;
...@@ -39,7 +52,7 @@ void pio_to_sram(void) ...@@ -39,7 +52,7 @@ void pio_to_sram(void)
} }
} }
void sram_to_pio(void) void _sram_to_pio(void)
{ {
unsigned long *a = (void *)0x1c20800; unsigned long *a = (void *)0x1c20800;
unsigned long *b = (void *)0x3000; unsigned long *b = (void *)0x3000;
......
SECTIONS
{
. = 0x2000;
.text : { *(.text) }
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment