ar71xx: image: allow to use board specific code in the lzma-loader
authorGabor Juhos <juhosg@openwrt.org>
Thu, 2 Aug 2012 09:54:33 +0000 (09:54 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Thu, 2 Aug 2012 09:54:33 +0000 (09:54 +0000)
SVN-Revision: 32945

target/linux/ar71xx/image/Makefile
target/linux/ar71xx/image/lzma-loader/Makefile
target/linux/ar71xx/image/lzma-loader/src/Makefile

index 3897dd49bf20742a6d3e9ac003892444a148f777..26ac0ab102700b0f03efb7d9998855d151f7dc26 100644 (file)
@@ -113,7 +113,7 @@ 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
 
@@ -121,7 +121,7 @@ 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
 
index 8d36691cb5a4cf0e1e0b907918613af111319700..2e0b9111f2894185a18cd506fbbe4049a02b65e1 100644 (file)
@@ -15,6 +15,7 @@ LOADER_DATA   :=
 TARGET_DIR     :=
 FLASH_OFFS     :=
 FLASH_MAX      :=
+BOARD          :=
 
 ifeq ($(TARGET_DIR),)
 TARGET_DIR     := $(KDIR)
@@ -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
index c5965c9bde06f502716abd96f97a2ca98e1aad2d..3e6839c7c3899d0283a3879af6e998abe99970d0 100644 (file)
@@ -18,7 +18,7 @@
 LOADADDR       :=
 LZMA_TEXT_START        := 0x80a00000
 LOADER_DATA    :=
-CONFIG_BOARD   :=
+BOARD          :=
 FLASH_OFFS     :=
 FLASH_MAX      :=
 
@@ -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