#
# KERNEL_IMG_IN: The filename of an LZMA compressed kernel. If given the loader
# and the kernel will be concatenated (piggy back loading).
-# FLASH_ADDR: The kernel address in the ROM. If given, the loeader will be
+# FLASH_ADDR: The kernel address in the ROM. If given, the loader will be
# created standalone and search a LZMA compressed uImage on the
# target device starting from this address.
+# KERNEL_ADDR: The to-be-used kernel load address to which rt-loader will load
+# the kernel and execute it. If not given, rt-loader will use its
+# initial run address for this (which is the uImage load address
+# when using U-boot images) For non-uImage, this uses an arbitrary
+# load address which is independent of rt-loader's initial run
+# address.
# KERNEL_IMG_OUT: The filename of the kernel image with the rt-loader prepended.
# If not given it will be created as image.bin into the BUILD_DIR.
# BUILD_DIR: The temporary build dir. If not given it will be set to "build".
# mv "$@.new" "$@"
# endef
#
+# define Build/rt-loader-non-uImage
+# $(MAKE) all clean -C rt-loader CROSS_COMPILE="$(TARGET_CROSS)" \
+# KERNEL_ADDR="$(KERNEL_LOADADDR)" KERNEL_IMG_IN="$@" \
+# KERNEL_IMG_OUT="$@.new" BUILD_DIR="$@.build"
+# mv "$@.new" "$@"
+#
# define Build/rt-loader-standalone
# $(MAKE) all clean -C rt-loader CROSS_COMPILE="$(TARGET_CROSS)" \
# FLASH_ADDR=$(FLASH_ADDR) KERNEL_IMG_OUT="$@.new" BUILD_DIR="$@.build"
# KERNEL/rt-loader := rt-loader-standalone
# KERNEL := kernel-bin | append-dtb | rt-compress | uImage lzma
# endef
+#
FLASH_ADDR_NONE := 0x0
FLASH_ADDR ?= $(FLASH_ADDR_NONE)
+KERNEL_ADDR_NONE := 0x0
+KERNEL_ADDR ?= $(KERNEL_ADDR_NONE)
+
CC := $(CROSS_COMPILE)gcc
LD := $(CROSS_COMPILE)ld
OBJCOPY := $(CROSS_COMPILE)objcopy
CFLAGS = -fpic -mabicalls -O2 -fno-builtin-printf -Iinclude
CFLAGS += -DFLASH_ADDR=$(FLASH_ADDR)
+CFLAGS += -DKERNEL_ADDR=$(KERNEL_ADDR)
ASFLAGS = -fpic -msoft-float -Iinclude