summaryrefslogtreecommitdiffhomepage
path: root/src/arm64/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/arm64/makefile')
-rw-r--r--src/arm64/makefile23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/arm64/makefile b/src/arm64/makefile
index 19f88f5..7aa0ae4 100644
--- a/src/arm64/makefile
+++ b/src/arm64/makefile
@@ -8,10 +8,12 @@
# ========================================================
#
-CC=arm-none-eabi-gcc
-AS=arm-none-eabi-as
+CC=aarch64-elf-gcc
+AS=aarch64-elf-as
+COREBOOT=core-boot.elf
FIRMWARE=boot.rom
+STAGE2=bootstg2.rom
FLAGS=-c -D__COMPILE_ARM64__ -I../../ -Wall -c -nostdlib -ffreestanding -fno-builtin \
-D__BSTRICT__ -D__BDEBUG__
@@ -20,13 +22,13 @@ C_SRC=$(wildcard *.c) $(wildcard ../*.c) -c
AS_FLAGS= -c -I../../
-LD=arm-none-eabi-ld
+LD=aarch64-elf-ld
OBJ=*.o
FLAGS_LD= --script=script.lds -o core-boot.elf -nostdlib
+OBJCOPY=aarch64-elf-objcopy
-EMU=qemu-system-arm
-EMU_FLAGS=-M virt -cpu cortex-a15 -kernel $(FIRMWARE) -s \
- -drive file=bootstg2.rom,format=raw
+EMU=qemu-system-aarch64
+EMU_FLAGS=-M virt -cpu cortex-a57 -bios $(FIRMWARE) -m 256M -d int -smp 2
WAIT=sleep 1
@@ -41,16 +43,15 @@ firmware-link: firmware-compile
.PHONY: rom
rom:
qemu-img create -f qcow2 epm.img 256M
- qemu-img create -f raw boot.rom 512K
qemu-img create -f raw bootstg2.rom 64M
- dd if=core-boot.elf of=boot.rom bs=1 seek=0 conv=notrunc
+ $(OBJCOPY) --strip-all -O binary $(COREBOOT) $(FIRMWARE)
# compile firmware
.PHONY: firmware-compile
firmware-compile:
$(CC) $(FLAGS) $(C_SRC)
- $(AS) -march=armv7-a -mcpu=cortex-a15 arm64-start-context.S -o arm64-start-context.o
- $(AS) -march=armv7-a -mcpu=cortex-a15 arm64-boot.S -o arm64-boot.o
+ $(AS) arm64-start-context.S -o arm64-start-context.o
+ $(AS) arm64-boot.S -o arm64-boot.o
# launch qemu rule
@@ -61,7 +62,7 @@ run:
# launch qemu with attached debugger
.PHONY: run-dbg
run-dbg:
- $(EMU) $(EMU_FLAGS)
+ $(EMU) -s -S $(EMU_FLAGS)
# remove object files
.PHONY: clean