[coreboot-gerrit] New patch to review for coreboot: 61370e4 arm64: Prepare ARM64/AARCH64 for building
Marc Jones (marc.jones@se-eng.com)
gerrit at coreboot.org
Fri Jan 2 22:26:41 CET 2015
Marc Jones (marc.jones at se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8039
-gerrit
commit 61370e48846a48d64f5ad901256337aa2e52775e
Author: Marc Jones <marc.jones at se-eng.com>
Date: Fri Jan 2 14:20:39 2015 -0700
arm64: Prepare ARM64/AARCH64 for building
There were a number of issues with the ARM64 build files:
- mapping aarch64 toolchain to arm64 directory structure and
automagic make file toolchain setup fixes.
- 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 at se-eng.com>
---
src/arch/arm64/Kconfig | 6 +--
src/arch/arm64/Makefile.inc | 55 +++++++++++++--------------
src/arch/arm64/armv8/Kconfig | 14 ++++---
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 | 34 ++++++++---------
toolchain.inc | 4 +-
8 files changed, 65 insertions(+), 68 deletions(-)
diff --git a/src/arch/arm64/Kconfig b/src/arch/arm64/Kconfig
index dc0e332..e3741b1 100644
--- a/src/arch/arm64/Kconfig
+++ b/src/arch/arm64/Kconfig
@@ -1,13 +1,13 @@
-config ARCH_BOOTBLOCK_ARM64
+config ARCH_BOOTBLOCK_AARCH64
bool
default n
select ARCH_ARM64
-config ARCH_ROMSTAGE_ARM64
+config ARCH_ROMSTAGE_AARCH64
bool
default n
-config ARCH_RAMSTAGE_ARM64
+config ARCH_RAMSTAGE_AARCH64
bool
default n
diff --git a/src/arch/arm64/Makefile.inc b/src/arch/arm64/Makefile.inc
index 5bf72b2..8fb8acf 100644
--- a/src/arch/arm64/Makefile.inc
+++ b/src/arch/arm64/Makefile.inc
@@ -33,25 +33,32 @@ subdirs-y += armv8/
# ARM specific options
################################################################################
-ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM64),y)
+ifeq ($(CONFIG_ARCH_ROMSTAGE_AARCH64),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_AARCH64),y)
+stages_c = $(src)/arch/arm/stages.c
+stages_o = $(obj)/arch/arm/stages.o
+
+$(stages_o): $(stages_c) $(obj)/config.h
+ @printf " CC $(subst $(obj)/,,$(@))\n"
+ $(CC_arm) -I. $(CPPFLAGS_arm) -c -o $@ $< -marm
+
+endif
+
################################################################################
# bootblock
################################################################################
-ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARM64),y)
+ifeq ($(CONFIG_ARCH_BOOTBLOCK_AARCH64),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,38 +67,38 @@ 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
+endif # CONFIG_ARCH_BOOTBLOCK_AARCH64
################################################################################
# romstage
################################################################################
-ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM64),y)
+ifeq ($(CONFIG_ARCH_ROMSTAGE_AARCH64),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
romstage-y += memmove.S
-romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
+romstage-y += stages.c
+romstage-y += tables.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"
$(LD_romstage) -nostdlib --gc-sections -static -o $@ -L$(obj) --start-group $(romstage-objs) --end-group -T $(src)/arch/arm64/romstage.ld
-endif # CONFIG_ARCH_ROMSTAGE_ARM64
+endif # CONFIG_ARCH_ROMSTAGE_AARCH64
################################################################################
# ramstage
################################################################################
-ifeq ($(CONFIG_ARCH_RAMSTAGE_ARM64),y)
+ifeq ($(CONFIG_ARCH_RAMSTAGE_AARCH64),y)
ramstage-y += stages.c
ramstage-y += div0.c
@@ -102,24 +109,16 @@ 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
+endif # CONFIG_ARCH_RAMSTAGE_AARCH64
diff --git a/src/arch/arm64/armv8/Kconfig b/src/arch/arm64/armv8/Kconfig
index fc2e668..f8c8425 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
def_bool n
- select ARCH_BOOTBLOCK_ARM64
-config ARCH_ROMSTAGE_ARM_V8_64
+ select ARCH_BOOTBLOCK_AARCH64
+
+config ARCH_ROMSTAGE_ARMV8
def_bool n
- select ARCH_ROMSTAGE_ARM64
-config ARCH_RAMSTAGE_ARM_V8_64
+ select ARCH_ROMSTAGE_AARCH64
+
+config ARCH_RAMSTAGE_ARMV8
def_bool n
- select ARCH_RAMSTAGE_ARM64
+ select ARCH_RAMSTAGE_AARCH64
diff --git a/src/arch/arm64/armv8/Makefile.inc b/src/arch/arm64/armv8/Makefile.inc
index 973b391..b352ea5 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),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),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),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 6fb0e65..85b2cce 100644
--- a/src/arch/arm64/boot.c
+++ b/src/arch/arm64/boot.c
@@ -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);
}
diff --git a/src/arch/arm64/include/arch/early_variables.h b/src/arch/arm64/include/arch/early_variables.h
index 3d9fa26..5b58baa 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 49fab9f..8e93ebf 100644
--- a/src/arch/arm64/tables.c
+++ b/src/arch/arm64/tables.c
@@ -29,30 +29,27 @@
#define MAX_COREBOOT_TABLE_SIZE (8 * 1024)
-#if ! CONFIG_DYNAMIC_CBMEM
-/*
- * TODO: "High" tables are a convention used on x86. Maybe we can
- * clean up that naming at some point.
- */
-uint64_t high_tables_base = 0;
-uint64_t high_tables_size;
+#if !CONFIG_DYNAMIC_CBMEM
+void __attribute__((weak)) get_cbmem_table(uint64_t *base, uint64_t *size)
+{
+ printk(BIOS_WARNING, "WARNING: you need to define get_cbmem_table for your board\n");
+ *base = 0;
+ *size = 0;
+}
#endif
+#ifndef __PRE_RAM__
void cbmem_arch_init(void)
{
}
-struct lb_memory *write_tables(void)
+void cbmem_fail_resume(void)
{
- unsigned long table_pointer, new_table_pointer;
-
-#if ! CONFIG_DYNAMIC_CBMEM
- if (!high_tables_base) {
- printk(BIOS_ERR, "ERROR: high_tables_base is not set.\n");
- }
+}
- printk(BIOS_DEBUG, "high_tables_base: %llx.\n", high_tables_base);
-#endif
+void write_tables(void)
+{
+ unsigned long table_pointer, new_table_pointer;
post_code(0x9d);
@@ -60,7 +57,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,
@@ -78,6 +75,5 @@ struct lb_memory *write_tables(void)
/* Print CBMEM sections */
cbmem_list();
-
- return get_lb_mem();
}
+#endif /*__PRE_RAM__ */
diff --git a/toolchain.inc b/toolchain.inc
index e6f530a..b51fdd7 100644
--- a/toolchain.inc
+++ b/toolchain.inc
@@ -56,12 +56,12 @@ COREBOOT_STANDARD_STAGES := bootblock romstage ramstage
ARCHDIR-i386 := x86
ARCHDIR-x86_32 := x86
ARCHDIR-arm := arm
-ARCHDIR-arm64 := arm64
+ARCHDIR-aarch64 := arm64
ARCHDIR-riscv := riscv
CFLAGS_arm := -mno-unaligned-access -ffunction-sections -fdata-sections
-CFLAGS_arm64 := -ffunction-sections -fdata-sections
+CFLAGS_aarch64 := -ffunction-sections -fdata-sections
toolchain_to_dir = \
$(foreach arch,$(ARCH_SUPPORTED),\
More information about the coreboot-gerrit
mailing list