From 17b9c198e0ebbd79d1b581eba0810a4c7979f012 Mon Sep 17 00:00:00 2001 From: Marc Jones Date: Fri, 16 Jan 2015 13:45:23 -0700 Subject: arm64: Prepare ARM64 for building There were a number of issues with the ARM64 build files. This patch ports the following changes from ARMV4/V7 to ARMV8: - make armv8 Kconfig options consistent with armv4/v7 - fix build include issues in boot.c, tables.c, and early_variables.h by matching armv4/v7. Change-Id: I57359a96821d88c50f48dc0bb6ad226cacb0c2ec Signed-off-by: Marc Jones Change-Id: Iacd95d336559c45458784d1da67bde62a0956620 Reviewed-on: http://review.coreboot.org/8236 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/arch/arm64/Makefile.inc | 35 ++++++++++++++------------- src/arch/arm64/armv8/Kconfig | 8 +++--- src/arch/arm64/armv8/Makefile.inc | 9 ++++--- src/arch/arm64/boot.c | 7 +++--- src/arch/arm64/include/arch/early_variables.h | 4 --- src/arch/arm64/tables.c | 10 +++++--- 6 files changed, 39 insertions(+), 34 deletions(-) diff --git a/src/arch/arm64/Makefile.inc b/src/arch/arm64/Makefile.inc index 5bf72b2a88..a080e23787 100644 --- a/src/arch/arm64/Makefile.inc +++ b/src/arch/arm64/Makefile.inc @@ -37,6 +37,16 @@ ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM64),y) CBFSTOOL_PRE1_OPTS = -m arm64 -b $(CONFIG_BOOTBLOCK_ROM_OFFSET) -H $(CONFIG_CBFS_HEADER_ROM_OFFSET) -o $(CONFIG_CBFS_ROM_OFFSET) endif +ifeq ($(CONFIG_ARCH_ARM64),y) +stages_c = $(src)/arch/arm64/stages.c +stages_o = $(obj)/arch/arm64/stages.o + +$(stages_o): $(stages_c) $(obj)/config.h + @printf " CC $(subst $(obj)/,,$(@))\n" + $(CC_arm) -I. $(CPPFLAGS_arm) -c -o $@ $< -marm + +endif + ################################################################################ # bootblock ################################################################################ @@ -44,14 +54,11 @@ endif ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARM64),y) bootblock-y += div0.c -bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += early_console.c - bootblock-y += id.S $(obj)/arch/arm64/id.bootblock.o: $(obj)/build.h bootblock-y += stages.c bootblock-y += eabi_compat.c - bootblock-y += memset.S bootblock-y += memcpy.S bootblock-y += memmove.S @@ -60,7 +67,7 @@ bootblock-y += memmove.S $(objcbfs)/bootblock.debug: $(src)/arch/arm64/bootblock.ld $(obj)/ldoptions $$(bootblock-objs) $(obj)/config.h @printf " LINK $(subst $(obj)/,,$(@))\n" - $(LD_bootblock) -nostdlib --gc-sections -static -o $@ -L$(obj) --start-group $(bootblock-objs) --end-group -T $(src)/arch/arm64/bootblock.ld + $(LD_bootblock) --gc-sections -static -o $@ -L$(obj) --start-group $(bootblock-objs) --end-group -T $(src)/arch/arm64/bootblock.ld endif # CONFIG_ARCH_BOOTBLOCK_ARM64 @@ -72,7 +79,6 @@ ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM64),y) romstage-y += stages.c romstage-y += div0.c -romstage-y += early_console.c romstage-y += eabi_compat.c romstage-y += memset.S romstage-y += memcpy.S @@ -80,6 +86,7 @@ romstage-y += memmove.S romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c # Build the romstage +VBOOT_STUB_DEPS += $(obj)/arch/arm/eabi_compat.rmodules_arm64.o $(objcbfs)/romstage.debug: $$(romstage-objs) $(src)/arch/arm64/romstage.ld $(obj)/ldoptions @printf " LINK $(subst $(obj)/,,$(@))\n" @@ -102,24 +109,18 @@ ramstage-y += tables.c ramstage-y += memset.S ramstage-y += memcpy.S ramstage-y += memmove.S - -rmodules_$(ARCH-ramstage-y) += memset.S -rmodules_$(ARCH-ramstage-y) += memcpy.S -rmodules_$(ARCH-ramstage-y) += memmove.S -rmodules_$(ARCH-ramstage-y) += eabi_compat.c - -VBOOT_STUB_DEPS += $(obj)/arch/arm64/eabi_compat.rmodules.o - -$(eval $(call create_class_compiler,rmodules,arm64)) - ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c -ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/mainboard.c +ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c) # Build the ramstage $(objcbfs)/ramstage.debug: $$(ramstage-objs) $(src)/arch/arm64/ramstage.ld $(obj)/ldoptions @printf " CC $(subst $(obj)/,,$(@))\n" - $(LD_ramstage) -nostdlib --gc-sections -o $@ --start-group $(ramstage-objs) --end-group -T $(src)/arch/arm64/ramstage.ld + $(LD_ramstage) -nostdlib --gc-sections -o $@ -L$(obj) --start-group $(ramstage-objs) --end-group -T $(src)/arch/arm64/ramstage.ld + +$(objgenerated)/ramstage.o: $(stages_o) $$(ramstage-objs) + @printf " CC $(subst $(obj)/,,$(@))\n" + $(LD_ramstage) -nostdlib --gc-sections -r -o $@ --start-group $(ramstage-objs) --end-group endif # CONFIG_ARCH_RAMSTAGE_ARM64 diff --git a/src/arch/arm64/armv8/Kconfig b/src/arch/arm64/armv8/Kconfig index fc2e6680b1..1dd2576cb7 100644 --- a/src/arch/arm64/armv8/Kconfig +++ b/src/arch/arm64/armv8/Kconfig @@ -1,9 +1,11 @@ -config ARCH_BOOTBLOCK_ARM_V8_64 +config ARCH_BOOTBLOCK_ARMV8_64 def_bool n select ARCH_BOOTBLOCK_ARM64 -config ARCH_ROMSTAGE_ARM_V8_64 + +config ARCH_ROMSTAGE_ARMV8_64 def_bool n select ARCH_ROMSTAGE_ARM64 -config ARCH_RAMSTAGE_ARM_V8_64 + +config ARCH_RAMSTAGE_ARMV8_64 def_bool n select ARCH_RAMSTAGE_ARM64 diff --git a/src/arch/arm64/armv8/Makefile.inc b/src/arch/arm64/armv8/Makefile.inc index 973b391dd4..c5f7a80767 100644 --- a/src/arch/arm64/armv8/Makefile.inc +++ b/src/arch/arm64/armv8/Makefile.inc @@ -26,7 +26,7 @@ armv8_asm_flags = $(armv8_flags) ################################################################################ ## bootblock ################################################################################ -ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARM_V8_64),y) +ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARMV8_64),y) ifneq ($(CONFIG_ARM_BOOTBLOCK_CUSTOM),y) bootblock-y += bootblock.S @@ -46,7 +46,7 @@ endif ################################################################################ ## romstage ################################################################################ -ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM_V8_64),y) +ifeq ($(CONFIG_ARCH_ROMSTAGE_ARMV8_64),y) romstage-y += cache.c romstage-y += cpu.S @@ -61,7 +61,7 @@ endif ################################################################################ ## ramstage ################################################################################ -ifeq ($(CONFIG_ARCH_RAMSTAGE_ARM_V8_64),y) +ifeq ($(CONFIG_ARCH_RAMSTAGE_ARMV8_64),y) ramstage-y += cache.c ramstage-y += cpu.S @@ -71,4 +71,7 @@ ramstage-y += exception_asm.S ramstage-c-ccopts += $(armv8_flags) ramstage-S-ccopts += $(armv8_asm_flags) +rmodules_arm64-c-ccopts += $(armv8_flags) +rmodules_arm64-S-ccopts += $(armv8_asm_flags) + endif diff --git a/src/arch/arm64/boot.c b/src/arch/arm64/boot.c index 6fb0e650b5..85b2cce95f 100644 --- a/src/arch/arm64/boot.c +++ b/src/arch/arm64/boot.c @@ -21,13 +21,14 @@ #include #include #include +#include -void jmp_to_elf_entry(void *entry, unsigned long buffer, unsigned long size) +void arch_payload_run(const struct payload *payload) { - void (*doit)(void *) = entry; + void (*doit)(void *) = payload->entry; void *cb_tables = cbmem_find(CBMEM_ID_CBTABLE); - printk(BIOS_SPEW, "entry = %p\n", entry); + printk(BIOS_SPEW, "entry = %p\n", payload->entry); cache_sync_instructions(); doit(cb_tables); } diff --git a/src/arch/arm64/include/arch/early_variables.h b/src/arch/arm64/include/arch/early_variables.h index 3d9fa26397..5b58baa271 100644 --- a/src/arch/arm64/include/arch/early_variables.h +++ b/src/arch/arm64/include/arch/early_variables.h @@ -20,10 +20,6 @@ #ifndef ARCH_EARLY_VARIABLES_H #define ARCH_EARLY_VARIABLES_H -#if CONFIG_CAR_MIGRATION - #error "This is ARM, silly... we don't have CAR here." -#endif - #define CAR_GLOBAL #define CAR_MIGRATE(migrate_fn_) diff --git a/src/arch/arm64/tables.c b/src/arch/arm64/tables.c index ce7ad5ae5e..a2b7b9b179 100644 --- a/src/arch/arm64/tables.c +++ b/src/arch/arm64/tables.c @@ -33,7 +33,11 @@ void cbmem_arch_init(void) { } -struct lb_memory *write_tables(void) +void cbmem_fail_resume(void) +{ +} + +void write_tables(void) { unsigned long table_pointer, new_table_pointer; @@ -43,7 +47,7 @@ struct lb_memory *write_tables(void) MAX_COREBOOT_TABLE_SIZE); if (!table_pointer) { printk(BIOS_ERR, "Could not add CBMEM for coreboot table.\n"); - return NULL; + return; } new_table_pointer = write_coreboot_table(0UL, 0UL, @@ -61,6 +65,4 @@ struct lb_memory *write_tables(void) /* Print CBMEM sections */ cbmem_list(); - - return get_lb_mem(); } -- cgit v1.2.3