Skip to content

Commit

Permalink
ar71xx: image: allow to use board specific code in the lzma-loader
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32945 3c298f89-4303-0410-b956-a3cf2f4a3e73
  • Loading branch information
juhosg committed Aug 2, 2012
1 parent 58aa6ee commit 70b3c12
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions target/linux/ar71xx/image/Makefile
Expand Up @@ -113,15 +113,15 @@ define Image/BuildLoader
-rm -rf $(KDIR)/lzma-loader
$(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)"\
LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
LOADER_DATA="$(KDIR)/vmlinux.bin.lzma" \
LOADER_DATA="$(KDIR)/vmlinux.bin.lzma" BOARD="$(1)" \
compile loader.$(2)
endef

define Image/BuildLoaderAlone
-rm -rf $(KDIR)/lzma-loader
$(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)" \
LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
FLASH_OFFS=$(4) FLASH_MAX=$(5) \
BOARD="$(1)" FLASH_OFFS=$(4) FLASH_MAX=$(5) \
compile loader.$(2)
endef

Expand Down
2 changes: 2 additions & 0 deletions target/linux/ar71xx/image/lzma-loader/Makefile
Expand Up @@ -15,6 +15,7 @@ LOADER_DATA :=
TARGET_DIR :=
FLASH_OFFS :=
FLASH_MAX :=
BOARD :=

ifeq ($(TARGET_DIR),)
TARGET_DIR := $(KDIR)
Expand All @@ -40,6 +41,7 @@ loader-compile: $(PKG_BUILD_DIR)/.prepared
LOADER_DATA=$(LOADER_DATA) \
FLASH_OFFS=$(FLASH_OFFS) \
FLASH_MAX=$(FLASH_MAX) \
BOARD="$(BOARD)" \
clean all

loader.gz: $(PKG_BUILD_DIR)/loader.bin
Expand Down
7 changes: 6 additions & 1 deletion target/linux/ar71xx/image/lzma-loader/src/Makefile
Expand Up @@ -18,7 +18,7 @@
LOADADDR :=
LZMA_TEXT_START := 0x80a00000
LOADER_DATA :=
CONFIG_BOARD :=
BOARD :=
FLASH_OFFS :=
FLASH_MAX :=

Expand Down Expand Up @@ -63,6 +63,11 @@ ifneq ($(strip $(FLASH_MAX)),)
CFLAGS += -DCONFIG_FLASH_MAX=$(FLASH_MAX)
endif

BOARD_DEF := $(shell echo $(strip $(BOARD)) | tr a-z A-Z | tr - _)
ifneq ($(BOARD_DEF),)
CFLAGS += -DCONFIG_BOARD_$(BOARD_DEF)
endif

all: loader.bin

# Don't build dependencies, this may die if $(CC) isn't gcc
Expand Down

0 comments on commit 70b3c12

Please sign in to comment.