diff --git a/Makefile b/Makefile index c410552..e6f85ad 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ all: $(TOOLS) misc: $(MISC_TOOLS) clean: - @rm -vf $(TOOLS) $(MISC_TOOLS) + @rm -vf $(TOOLS) $(MISC_TOOLS) *.o *.elf $(TOOLS): Makefile common.h @@ -27,8 +27,6 @@ fexc: fexc.h script.h script.c \ script_bin.h script_bin.c \ script_fex.h script_fex.c -bootinfo: bootinfo.c - LIBUSB = libusb-1.0 LIBUSB_CFLAGS = `pkg-config --cflags $(LIBUSB)` LIBUSB_LIBS = `pkg-config --libs $(LIBUSB)` @@ -39,6 +37,19 @@ fel: fel.c %: %.c $(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 @for x in $(TOOLS) '*.o' '*.swp'; do \ echo "$$x"; \ diff --git a/fel-pio.c b/fel-pio.c index 2bea032..d40e861 100644 --- a/fel-pio.c +++ b/fel-pio.c @@ -21,15 +21,28 @@ 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) +{ + _pio_to_sram(); +} + +void sram_to_pio(void) +{ + _sram_to_pio(); +} + +void _pio_to_sram(void) { unsigned long *a = (void *)0x1c20800; unsigned long *b = (void *)0x3000; @@ -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 *b = (void *)0x3000; diff --git a/fel-pio.lds b/fel-pio.lds new file mode 100644 index 0000000..790ff1f --- /dev/null +++ b/fel-pio.lds @@ -0,0 +1,7 @@ + SECTIONS + { + . = 0x2000; + .text : { *(.text) } + } + +