[msm8655]: Add feature flag to build Trustzone with LK

Add ENABLE_TRUSTZONE compile time flag to allow Trustzone
initializations with LK. The linker scripts move LK up in
memory, making room for TZ sysini to be placed at reset
vector and take control of Scorpion from power up itself.

This is a partial solution to enable TZ as part of LK.The
TZ/code/image itself is currently not part of LK tree and
is managed separately.As a result, this feature will be
turned off by default.

Change-Id: I1b4e4b380c415428fe22f34563a97440082befee
diff --git a/make/build.mk b/make/build.mk
index 028dc2c..ffbcdc4 100644
--- a/make/build.mk
+++ b/make/build.mk
@@ -6,9 +6,16 @@
 	$(NOECHO)$(SIZE) $<
 	$(NOCOPY)$(OBJCOPY) -O binary $< $@
 
+ifeq ($(ENABLE_TRUSTZONE), 1)
+$(OUTELF): $(ALLOBJS) $(LINKER_SCRIPT) $(OUTPUT_TZ_BIN)
+	@echo linking $@
+	$(NOECHO)$(LD) $(LDFLAGS) -T $(LINKER_SCRIPT) $(OUTPUT_TZ_BIN) $(ALLOBJS) $(LIBGCC) -o $@
+else
 $(OUTELF): $(ALLOBJS) $(LINKER_SCRIPT)
 	@echo linking $@
 	$(NOECHO)$(LD) $(LDFLAGS) -T $(LINKER_SCRIPT) $(ALLOBJS) $(LIBGCC) -o $@
+endif
+
 
 $(OUTELF).sym: $(OUTELF)
 	@echo generating symbols: $@
@@ -26,5 +33,11 @@
 	@echo generating size map: $@
 	$(NOECHO)$(NM) -S --size-sort $< > $@
 
+ifeq ($(ENABLE_TRUSTZONE), 1)
+$(OUTPUT_TZ_BIN): $(INPUT_TZ_BIN)
+	@echo generating TZ output from TZ input
+	$(NOECHO)$(OBJCOPY) -I binary -B arm -O elf32-littlearm $(INPUT_TZ_BIN) $(OUTPUT_TZ_BIN)
+endif
+
 include arch/$(ARCH)/compile.mk