fel-pio.bin: Add a jump table in the beginning to ease usage
This commit is contained in:
parent
a072e4f706
commit
be2a89d975
17
Makefile
17
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"; \
|
||||
|
||||
21
fel-pio.c
21
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;
|
||||
|
||||
7
fel-pio.lds
Normal file
7
fel-pio.lds
Normal file
@ -0,0 +1,7 @@
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x2000;
|
||||
.text : { *(.text) }
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user