arm64: Provide secmon trampoline for restart
[coreboot.git] / src / arch / arm64 / armv8 / secmon / Makefile.inc
blob03b93edaf251663583c77f2d9b5d594fbc0990b3
1 ################################################################################
2 ##
3 ## This file is part of the coreboot project.
4 ##
5 ## Copyright (C) 2014 Google Inc.
6 ##
7 ## This program is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation; version 2 of the License.
11 ## This program is distributed in the hope that it will be useful,
12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 ## GNU General Public License for more details.
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program; if not, write to the Free Software
18 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 ################################################################################
22 $(eval $(call create_class_compiler,secmon,arm64))
24 SECMON_DIR=$(obj)/arch/arm64/armv8/secmon
25 SECMON_SRC=$(SECMON_DIR)/secmon
26 SECMON_OBJ=$(SECMON_DIR)/secmon.o
27 SECMON_ELF=$(SECMON_DIR)/secmon.elf
28 SECMON_RMOD=$(SECMON_DIR)/secmon.elf.rmod
29 SECMON_RAMSTAGE=$(SECMON_DIR)/secmon.ramstage.o
31 secmon-c-ccopts += -I$(src)/arch/arm64/include/armv8/ -include $(src)/include/kconfig.h -D__SECMON__
32 secmon-S-ccopts += -I$(src)/arch/arm64/include/armv8/ -include $(src)/include/kconfig.h -D__SECMON__
34 secmon-y += secmon_init.c
35 secmon-y += smc.c
36 secmon-y += trampoline.S
37 secmon-y += ../exception.c
38 secmon-y += ../../cpu.c
39 secmon-y += ../../transition_asm.S ../../transition.c
41 ramstage-srcs += $(SECMON_SRC)
43 $(SECMON_OBJ):  $$(secmon-objs)
44                 $(CC_secmon) $(LDFLAGS) -nostdlib -r -o $@ $^
46 $(eval $(call rmodule_link,$(SECMON_ELF), $(SECMON_OBJ), 0,arm64))
48 $(SECMON_SRC): $(SECMON_RMOD)
49                $(OBJCOPY_secmon) -O binary $< $@
51 $(SECMON_RAMSTAGE): $(SECMON_SRC)
52                     @printf "    OBJCOPY $(subst $(obj)/,,$(@))\n"
53                     cd $(dir $@); $(OBJCOPY_secmon) -I binary $(notdir $<) -O elf64-littleaarch64 -B aarch64 $(notdir $@)