aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/at91bootstrap/at91bootstrap.mk
diff options
context:
space:
mode:
authorSandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun@microchip.com>2017-09-13 11:51:23 -0700
committerJohn Crispin <john@phrozen.org>2017-09-20 09:01:46 +0200
commit670448a002ddbc79cc370647b8d30b3b8e9025d6 (patch)
treea782eb80a683533a775a8a809efbea38425ead3f /package/boot/at91bootstrap/at91bootstrap.mk
parent5b9cff921ebe54cecba38c17b3c60babb73f1f1a (diff)
downloadupstream-670448a002ddbc79cc370647b8d30b3b8e9025d6.tar.gz
upstream-670448a002ddbc79cc370647b8d30b3b8e9025d6.tar.bz2
upstream-670448a002ddbc79cc370647b8d30b3b8e9025d6.zip
at91bootstrap: New package at91bootstrap
at91bootstrap is a second-level bootloader for Microchip(Atmel AT91) SoCs. It provides a set of algorithms to manage the hardware initialization and to download the main application or a third-level bootloader(i.e. uboot) from specified boot media to main memory and execute it. Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun@microchip.com>
Diffstat (limited to 'package/boot/at91bootstrap/at91bootstrap.mk')
-rw-r--r--package/boot/at91bootstrap/at91bootstrap.mk80
1 files changed, 80 insertions, 0 deletions
diff --git a/package/boot/at91bootstrap/at91bootstrap.mk b/package/boot/at91bootstrap/at91bootstrap.mk
new file mode 100644
index 0000000000..732d643aa6
--- /dev/null
+++ b/package/boot/at91bootstrap/at91bootstrap.mk
@@ -0,0 +1,80 @@
+
+export GCC_HONOUR_COPTS=s
+
+define AT91Bootstrap/Init
+ BUILD_TARGET:=
+ BUILD_SUBTARGET:=
+ BUILD_DEVICES:=
+ NAME:=
+ DEPENDS:=
+ HIDDEN:=
+ DEFAULT:=
+ VARIANT:=$(1)
+ AT91BOOTSTRAP_CONFIG:=$(1)
+endef
+
+TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))
+
+AT91BOOTSTRAP_MAKE_FLAGS = \
+ HOSTCC="$(HOSTCC)" \
+ HOSTCFLAGS='$(HOST_CFLAGS) $$$$(HOSTCPPFLAGS)' \
+ HOSTLDFLAGS=""
+
+define Build/AT91Bootstrap/Target
+ $(eval $(call AT91Bootstrap/Init,$(1)))
+ $(eval $(call AT91Bootstrap/Default,$(1)))
+ $(eval $(call AT91Bootstrap/$(1),$(1)))
+
+ define Package/at91bootstrap-$(1)
+ SECTION:=boot
+ CATEGORY:=Boot Loaders
+ TITLE:= .$(NAME)
+ VARIANT:=$(VARIANT)
+ DEPENDS:=@!IN_SDK $(DEPENDS)
+ HIDDEN:=$(HIDDEN)
+ ifneq ($(BUILD_TARGET),)
+ DEPENDS += @$(TARGET_DEP)
+ ifneq ($(BUILD_DEVICES),)
+ DEFAULT := y if ($(TARGET_DEP)_Default \
+ $(patsubst %,|| $(TARGET_DEP)_DEVICE_%,$(BUILD_DEVICES)) \
+ $(patsubst %,|| $(patsubst TARGET_%,TARGET_DEVICE_%, \
+ $(TARGET_DEP))_DEVICE_%,$(BUILD_DEVICES)))
+ endif
+ endif
+ $(if $(DEFAULT),DEFAULT:=$(DEFAULT))
+ URL:=https://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap
+ endef
+
+ define Package/at91bootstrap-$(1)/install
+ $(CP) $(PKG_BUILD_DIR)/binaries/*uboot*.bin \
+ $(BIN_DIR)/at91bootstrap-$(1).bin
+ endef
+endef
+
+define Build/Configure/AT91Bootstrap
+ +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+ $(AT91BOOTSTRAP_CONFIG)_defconfig
+endef
+
+
+define Build/Compile/AT91Bootstrap
+ +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+ CROSS_COMPILE=$(TARGET_CROSS) \
+ $(AT91BOOTSTRAP_MAKE_FLAGS)
+endef
+
+define BuildPackage/AT91Bootstrap/Defaults
+ Build/Configure/Default = $$$$(Build/Configure/AT91Bootstrap)
+ Build/Compile/Default = $$$$(Build/Compile/AT91Bootstrap)
+endef
+
+define BuildPackage/AT91Bootstrap
+ $(eval $(call BuildPackage/AT91Bootstrap/Defaults))
+ $(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \
+ $(eval $(call Build/AT91Bootstrap/Target,$(type)))
+ )
+ $(eval $(call Build/DefaultTargets))
+ $(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \
+ $(call BuildPackage,at91bootstrap-$(type))
+ )
+endef