KERNEL_LOADADDR = 0x80060000
DEVICE_VARS += LOADER_FLASH_OFFS LOADER_TYPE
+DEVICE_VARS += LOADER_FLASH_MAX LOADER_KERNEL_MAGIC
DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
DEVICE_VARS += RAS_BOARD RAS_ROOTFS_SIZE RAS_VERSION
endef
define Build/loader-okli-compile
- $(call Build/loader-common,FLASH_OFFS=$(LOADER_FLASH_OFFS) FLASH_MAX=0)
+ $(call Build/loader-common, \
+ FLASH_OFFS=$(LOADER_FLASH_OFFS) \
+ FLASH_MAX=$(LOADER_FLASH_MAX) \
+ KERNEL_MAGIC=$(LOADER_KERNEL_MAGIC) )
endef
# Arguments: <output name> <kernel offset>
LOADER := loader.bin
LOADER_NAME := $(basename $(notdir $(LOADER)))
LOADER_DATA :=
+KERNEL_MAGIC :=
TARGET_DIR :=
FLASH_OFFS :=
FLASH_MAX :=
LZMA_TEXT_START=$(LZMA_TEXT_START) \
LOADADDR=$(LOADADDR) \
LOADER_DATA=$(LOADER_DATA) \
+ KERNEL_MAGIC=$(KERNEL_MAGIC) \
FLASH_OFFS=$(FLASH_OFFS) \
FLASH_MAX=$(FLASH_MAX) \
BOARD="$(BOARD)" \
LOADADDR :=
LZMA_TEXT_START := 0x80a00000
LOADER_DATA :=
+KERNEL_MAGIC :=
BOARD :=
FLASH_OFFS :=
FLASH_MAX :=
CFLAGS += -DLZMA_WRAPPER=1 -DLOADADDR=$(LOADADDR)
endif
+ifneq ($(strip $(KERNEL_MAGIC)),)
+CFLAGS += -DCONFIG_KERNEL_MAGIC=$(KERNEL_MAGIC)
+endif
+
ifneq ($(strip $(KERNEL_CMDLINE)),)
CFLAGS += -DCONFIG_KERNEL_CMDLINE='"$(KERNEL_CMDLINE)"'
endif
p = flash_base + flash_ofs;
magic = get_be32(p);
+#ifdef CONFIG_KERNEL_MAGIC
+ if (magic == CONFIG_KERNEL_MAGIC) {
+#else
if (magic == IH_MAGIC_OKLI) {
+#endif
hdr = (struct image_header *) p;
break;
}