Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
ab5089a1
Commit
ab5089a1
authored
May 17, 2013
by
Henrik Nordstrom
Browse files
felboot: NO_PRINTF=1 make option to disable printf for smaller code size
parent
de093ee7
Changes
3
Hide whitespace changes
Inline
Side-by-side
felboot/Makefile
View file @
ab5089a1
...
...
@@ -30,7 +30,15 @@ UBOOT_OBJS= \
.c.o
:
$(CROSS_COMPILE)$(CC)
-c
$(CFLAGS)
$<
-o
$@
fel-boot-$(BOARD).elf
:
main.o printf-stdarg.o early_print.o $(addprefix $(UBOOTOBJ)
,
$(UBOOT_OBJS))
OBJS
+=
main.o
ifeq
($(NO_PRINTF),1)
CFLAGS
+=
-DNO_PRINTF
else
OBJS
+=
printf-stdarg.o early_print.o
endif
fel-boot-$(BOARD).elf
:
$(OBJS) $(addprefix $(UBOOTOBJ)
,
$(UBOOT_OBJS))
$(CROSS_COMPILE)$(CC)
-Tfel-boot
.ld
-static
-nostartfiles
$(CFLAGS)
-Wl
,-Map
=
$@
.map
$^
-o
$@
fel-boot-$(BOARD).bin
:
fel-boot-$(BOARD).elf
...
...
felboot/README.txt
View file @
ab5089a1
...
...
@@ -28,6 +28,9 @@ Build instructions:
make BOARD=cubieboard CROSS_COMPILE=arm-linux-gnueabihf- UBOOT=~/SRC/u-boot/ UBOOTOBJ=~/SRC/u-boot/build/'$(BOARD)'/
Other options
NO_PRINTF=1 Disable printf, reducing the code size a bit
Defaults:
# Target board name. This should match the dram_<boardname>.c in
...
...
felboot/main.c
View file @
ab5089a1
...
...
@@ -38,9 +38,6 @@ void sunxi_wemac_initialize(void)
{
}
void
*
gd
;
int
gdata
;
void
preloader_console_init
(
void
)
{
}
...
...
@@ -55,6 +52,18 @@ void udelay(unsigned long usec)
__udelay
(
usec
);
}
int
sunxi_mmc_init
(
void
)
{
return
-
1
;
}
int
status_led_set
(
void
)
{
return
-
1
;
}
#ifndef NO_PRINTF
int
putchar
(
int
ch
)
{
return
uart_putc
(
ch
);
...
...
@@ -65,12 +74,24 @@ int puts(const char *str)
return
uart_puts
(
str
);
}
int
sunxi_mmc_init
(
void
)
#else
int
putchar
(
int
ch
)
{
return
-
1
;
}
int
status_led_set
(
void
)
int
puts
(
const
char
*
str
)
{
return
-
1
;
}
int
printf
(
const
char
*
fmt
,
...)
{
return
-
1
;
}
void
uart_init
(
void
)
{
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment