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 <marc.jones@se-eng.com> Change-Id: Iacd95d336559c45458784d1da67bde62a0956620 Reviewed-on: http://review.coreboot.org/8236 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
c4dbdaf50a
commit
17b9c198e0
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -21,13 +21,14 @@
|
|||
#include <arch/stages.h>
|
||||
#include <cbmem.h>
|
||||
#include <console/console.h>
|
||||
#include <payload_loader.h>
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -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_)
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue