Skip to content

Commit fcc10a3

Browse files
committed
Makefile: Add libfastboot.a for fast boot mode
Added LIB_PATH and LIB_NAME for defining library paths and library names in fastboot mode Add link fastboot static libraries to 'LD' command if CONFIG_FAST_BOOT is enabled. Signed-off-by: Li Bin <[email protected]>
1 parent c7739ed commit fcc10a3

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,17 @@ CARD_SUFFIX := $(strip $(subst ",,$(CONFIG_CARD_SUFFIX)))
170170
LINUX_KERNEL_ARG_STRING := $(strip $(subst ",,$(CONFIG_LINUX_KERNEL_ARG_STRING)))
171171
LINUX_KERNEL_ARG_STRING_FILE := $(strip $(subst ",,$(CONFIG_LINUX_KERNEL_ARG_STRING_FILE)))
172172

173+
ifeq ($(CONFIG_FAST_BOOT), y)
174+
LIB_PATH =fast-boot
175+
ifeq ($(CONFIG_SDCARD), y)
176+
LIB_NAME =fastboot_sd
177+
else ifeq ($(CONFIG_QSPI), y)
178+
LIB_NAME =fastboot_qspi
179+
else ifeq ($(CONFIG_NANDFLASH), y)
180+
LIB_NAME =fastboot_nand
181+
endif
182+
endif
183+
173184
# Device definitions
174185
DEVICENAME:=$(strip $(subst ",,$(CONFIG_DEVICENAME)))
175186

@@ -257,7 +268,7 @@ NOSTDINC_FLAGS := -nostdinc -isystem "$(shell "$(CC)" $(EXTRA_CC_ARGS) -print-fi
257268
CPPFLAGS=$(EXTRA_CC_ARGS) $(NOSTDINC_FLAGS) -ffunction-sections -g -Os -Wall \
258269
-mno-unaligned-access \
259270
-fno-stack-protector -fno-common -fno-builtin -fno-jump-tables -fno-pie \
260-
-I$(INCL) -Iinclude -Ifs/include \
271+
-I$(INCL) -Iinclude -Ifs/include -Ifast-boot\
261272
-I$(CONFIG)/at91bootstrap-config \
262273
-include $(CONFIG)/at91bootstrap-config/autoconf.h \
263274
-DAT91BOOTSTRAP_VERSION=\"$(VERSION)$(REV)$(SCMINFO)\" -DCOMPILE_TIME="\"$(BUILD_DATE)\""
@@ -350,7 +361,11 @@ PrintFlags:
350361
$(AT91BOOTSTRAP): $(OBJS) | $(BINDIR)
351362
$(Q)$(MKDIR) -p $(dir $@)
352363
@echo " LD "$(BOOT_NAME).elf
364+
ifeq ($(CONFIG_FAST_BOOT), y)
365+
$(Q)"$(LD)" $(LDFLAGS) -n -o $(BINDIR)/$(BOOT_NAME).elf $(OBJS) -L$(LIB_PATH) -l$(LIB_NAME)
366+
else
353367
$(Q)"$(LD)" $(LDFLAGS) -n -o $(BINDIR)/$(BOOT_NAME).elf $(OBJS)
368+
endif
354369
$(Q)"$(OBJCOPY)" --strip-all $(REMOVE_SECTIONS) $(BINDIR)/$(BOOT_NAME).elf -O binary $@
355370
ifdef NIX_SHELL
356371
@ln -sf $(BOOT_NAME).elf ${BINDIR}/${SYMLINK_ELF}

0 commit comments

Comments
 (0)