CFLAGS = -march=armv8-a
CPPFLAGS = -DPHYS_OFFSET=0x80000000 -DCNTFRQ=0x01800000 \
-DUART_BASE=0x1c090000 -DSYSREGS_BASE=0x1c010000 \
- -DGIC_DIST_BASE=0x2c001000 -Dkernel=0x80080000 \
+ -Dkernel=0x80080000 \
-Dmbox=0x8000fff8 -Ddtb=0x80000100
LDFLAGS = -N -Ttext 0x00000010 -non_shared -static
$(BUILDDIR)/boot_v2.arm64
#v1 has a GIC V2
-$(BUILDDIR)/boot_emm.o: CPPFLAGS += -UGICV3 -DGIC_CPU_BASE=0x2c002000
-$(BUILDDIR)/boot.o: CPPFLAGS += -UGICV3 -DGIC_CPU_BASE=0x2c002000
+$(BUILDDIR)/boot_emm.o: CPPFLAGS += -UGICV3 -DGIC_CPU_BASE=0x2c002000 \
+ -DGIC_DIST_BASE=0x2c001000
+$(BUILDDIR)/boot.o: CPPFLAGS += -UGICV3 -DGIC_CPU_BASE=0x2c002000 \
+ -DGIC_DIST_BASE=0x2c001000
#V2 has a GIC V3
-$(BUILDDIR)/boot_v2.o: CPPFLAGS += -DGICV3 -DGIC_REDIST_BASE=0x2c010000
+$(BUILDDIR)/boot_v2.o: CPPFLAGS += -DGICV3 -DGIC_REDIST_BASE=0x2c010000 \
+ -DGIC_DIST_BASE=0x2c000000
$(BUILDDIR)/%.arm64: $(BUILDDIR)/%.o
$(LD) -o $@ $< $(LDFLAGS)