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

felboot: Move closer to u-boot build structure, reducing source size even further

parent 7c056093
...@@ -20,11 +20,14 @@ all: fel-boot-$(BOARD).bin ...@@ -20,11 +20,14 @@ all: fel-boot-$(BOARD).bin
UBOOT_OBJS= \ UBOOT_OBJS= \
spl/arch/arm/cpu/armv7/sunxi/libsunxi.o \ spl/arch/arm/cpu/armv7/sunxi/libsunxi.o \
spl/arch/arm/cpu/armv7/syslib.o \ spl/arch/arm/cpu/armv7/libarmv7.o \
spl/arch/arm/lib/libarm.o \
spl/arch/arm/lib/eabi_compat.o \ spl/arch/arm/lib/eabi_compat.o \
spl/drivers/power/libpower.o \ spl/drivers/power/libpower.o \
spl/drivers/i2c/libi2c.o \ spl/drivers/i2c/libi2c.o \
spl/common/memsize.o \ spl/common/libcommon.o \
spl/common/spl/libspl.o \
spl/lib/libgeneric.o \
spl/board/sunxi/libsunxi.o spl/board/sunxi/libsunxi.o
.c.o: .c.o:
...@@ -35,11 +38,11 @@ OBJS += main.o ...@@ -35,11 +38,11 @@ OBJS += main.o
ifeq ($(NO_PRINTF),1) ifeq ($(NO_PRINTF),1)
CFLAGS += -DNO_PRINTF CFLAGS += -DNO_PRINTF
else else
OBJS += printf-stdarg.o early_print.o OBJS += early_print.o
endif endif
fel-boot-$(BOARD).elf: $(OBJS) $(addprefix $(UBOOTOBJ),$(UBOOT_OBJS)) fel-boot-$(BOARD).elf: $(OBJS) $(addprefix $(UBOOTOBJ),$(UBOOT_OBJS))
$(CROSS_COMPILE)$(CC) -Tfel-boot.ld -static -nostartfiles $(CFLAGS) -Wl,-Map=$@.map -o $@ $(OBJS) -Wl,--start-group $(addprefix $(UBOOTOBJ),$(UBOOT_OBJS)) -Wl,--end-group $(CROSS_COMPILE)$(CC) -Tfel-boot.ld -static -Wl,--gc-sections -nostartfiles -nostdlib $(CFLAGS) -Wl,-Map=$@.map -o $@ $(OBJS) -Wl,--start-group $(addprefix $(UBOOTOBJ),$(UBOOT_OBJS)) -lgcc -Wl,--end-group
fel-boot-$(BOARD).bin: fel-boot-$(BOARD).elf fel-boot-$(BOARD).bin: fel-boot-$(BOARD).elf
$(CROSS_COMPILE)objcopy -O binary $< $@ $(CROSS_COMPILE)objcopy -O binary $< $@
......
...@@ -25,34 +25,6 @@ __attribute__ ((section (".text.start"))) void _start(void) ...@@ -25,34 +25,6 @@ __attribute__ ((section (".text.start"))) void _start(void)
s_init(); s_init();
} }
gd_t gdata __attribute__ ((section(".data")));
void dcache_enable(void)
{
}
void sunxi_wemac_initialize(void)
{
}
void preloader_console_init(void)
{
uart_init();
puts("\nU-Boot FEL " PLAIN_VERSION " (" U_BOOT_DATE " - " \
U_BOOT_TIME ")\n");
}
void hang(void)
{
printf("Please reset the board!");
while(1);
}
void udelay(unsigned long usec)
{
__udelay(usec);
}
int sunxi_mmc_init(void) int sunxi_mmc_init(void)
{ {
return -1; return -1;
...@@ -63,7 +35,12 @@ void status_led_set(int led, int state) ...@@ -63,7 +35,12 @@ void status_led_set(int led, int state)
return; return;
} }
#ifndef NO_PRINTF int serial_init(void)
{
uart_init();
return 0;
}
void putchar(int ch) void putchar(int ch)
{ {
if (ch == '\n') if (ch == '\n')
...@@ -71,28 +48,9 @@ void putchar(int ch) ...@@ -71,28 +48,9 @@ void putchar(int ch)
uart_putc(ch); uart_putc(ch);
} }
void puts(const char *str) void serial_puts(const char *str)
{ {
while(*str) while(*str)
putchar(*str++); putchar(*str++);
} }
#else
void putchar(int ch)
{
}
void puts(const char *str)
{
}
int printf(const char *fmt, ...)
{
return -1;
}
void uart_init(void)
{
}
#endif
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