]>
Commit | Line | Data |
---|---|---|
e6f3ed43 LL |
1 | #\r |
2 | # Makefile - build a UEFI boot image for booting from different exception levels.\r | |
3 | #\r | |
4 | # Copyright (C) 2011-2013 ARM Limited.\r | |
5 | # All rights reserved.\r | |
6 | #\r | |
7 | # Redistribution and use in source and binary forms, with or without\r | |
8 | # modification, are permitted provided that the following conditions are\r | |
9 | # met:\r | |
10 | #\r | |
11 | # * Redistributions of source code must retain the above copyright\r | |
12 | # notice, this list of conditions and the following disclaimer.\r | |
13 | # * Redistributions in binary form must reproduce the above copyright\r | |
14 | # notice, this list of conditions and the following disclaimer in\r | |
15 | # the documentation and/or other materials provided with the\r | |
16 | # distribution.\r | |
17 | # * Neither the name of ARM nor the names of its contributors may be\r | |
18 | # used to endorse or promote products derived from this software\r | |
19 | # without specific prior written permission.\r | |
20 | #\r | |
21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS\r | |
22 | # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\r | |
23 | # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\r | |
24 | # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r | |
25 | # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r | |
26 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\r | |
27 | # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\r | |
28 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\r | |
29 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r | |
30 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r | |
31 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r | |
32 | #\r | |
33 | # This license can also be found in the LICENSE.TXT file.\r | |
34 | \r | |
35 | \r | |
36 | # VE\r | |
37 | PHYS_OFFSET := 0x80000000\r | |
38 | UART_BASE := 0x1c090000\r | |
39 | GIC_DIST_BASE := 0x2c001000\r | |
40 | GIC_CPU_BASE := 0x2c002000\r | |
41 | CNTFRQ := 0x01800000 # 24Mhz\r | |
42 | \r | |
43 | BOOTLOADER := boot.S\r | |
44 | LD_SCRIPT := model.lds.S\r | |
45 | IMAGE_1 := uefi-bootstrap-el1.axf\r | |
46 | IMAGE_2 := uefi-bootstrap-el2.axf\r | |
47 | IMAGE_3 := uefi-bootstrap-el3.axf\r | |
48 | IMAGE_3F := uefi-bootstrap-el3-foundation.axf\r | |
49 | \r | |
50 | \r | |
51 | CROSS_COMPILE ?= aarch64-none-elf-\r | |
52 | CC := $(CROSS_COMPILE)gcc\r | |
53 | LD := $(CROSS_COMPILE)ld\r | |
54 | \r | |
55 | all: $(IMAGE_1) $(IMAGE_2) $(IMAGE_3) $(IMAGE_3F)\r | |
56 | \r | |
57 | clean:\r | |
58 | rm -f *.axf *.o *.lds\r | |
59 | \r | |
60 | $(IMAGE_1): boot1.o model1.lds\r | |
61 | $(LD) -o $@ --script=model1.lds\r | |
62 | \r | |
63 | $(IMAGE_2): boot2.o model2.lds\r | |
64 | $(LD) -o $@ --script=model2.lds\r | |
65 | \r | |
66 | $(IMAGE_3): boot3.o model3.lds\r | |
67 | $(LD) -o $@ --script=model3.lds\r | |
68 | \r | |
69 | $(IMAGE_3F): boot3f.o model3f.lds\r | |
70 | $(LD) -o $@ --script=model3f.lds\r | |
71 | \r | |
72 | boot1.o: $(BOOTLOADER) Makefile\r | |
73 | $(CC) $(CPPFLAGS) -DUART_BASE=$(UART_BASE) -DCNTFRQ=$(CNTFRQ) -DGIC_DIST_BASE=$(GIC_DIST_BASE) -DGIC_CPU_BASE=$(GIC_CPU_BASE) -DSTART_EL2=1 -DSTART_EL1=1 -c -o $@ $(BOOTLOADER)\r | |
74 | \r | |
75 | boot2.o: $(BOOTLOADER) Makefile\r | |
76 | $(CC) $(CPPFLAGS) -DUART_BASE=$(UART_BASE) -DCNTFRQ=$(CNTFRQ) -DGIC_DIST_BASE=$(GIC_DIST_BASE) -DGIC_CPU_BASE=$(GIC_CPU_BASE) -DSTART_EL2=1 -c -o $@ $(BOOTLOADER)\r | |
77 | \r | |
78 | boot3.o: $(BOOTLOADER) Makefile\r | |
79 | $(CC) $(CPPFLAGS) -DUART_BASE=$(UART_BASE) -DCNTFRQ=$(CNTFRQ) -DGIC_DIST_BASE=$(GIC_DIST_BASE) -DGIC_CPU_BASE=$(GIC_CPU_BASE) -c -o $@ $(BOOTLOADER)\r | |
80 | \r | |
81 | boot3f.o: $(BOOTLOADER) Makefile\r | |
82 | $(CC) $(CPPFLAGS) -DUART_BASE=$(UART_BASE) -DCNTFRQ=$(CNTFRQ) -DGIC_DIST_BASE=$(GIC_DIST_BASE) -DGIC_CPU_BASE=$(GIC_CPU_BASE) -DFOUNDATION_MODEL=1 -c -o $@ $(BOOTLOADER)\r | |
83 | \r | |
84 | model1.lds: $(LD_SCRIPT) Makefile boot1.o\r | |
85 | $(CC) $(CPPFLAGS) -DPHYS_OFFSET=$(PHYS_OFFSET) -DBOOT1 -E -P -C -o $@ $<\r | |
86 | \r | |
87 | model2.lds: $(LD_SCRIPT) Makefile boot2.o\r | |
88 | $(CC) $(CPPFLAGS) -DPHYS_OFFSET=$(PHYS_OFFSET) -DBOOT2 -E -P -C -o $@ $<\r | |
89 | \r | |
90 | model3.lds: $(LD_SCRIPT) Makefile boot3.o\r | |
91 | $(CC) $(CPPFLAGS) -DPHYS_OFFSET=$(PHYS_OFFSET) -DBOOT3 -E -P -C -o $@ $<\r | |
92 | \r | |
93 | model3f.lds: $(LD_SCRIPT) Makefile boot3f.o\r | |
94 | $(CC) $(CPPFLAGS) -DPHYS_OFFSET=$(PHYS_OFFSET) -DBOOT3F -E -P -C -o $@ $<\r | |
95 | \r | |
96 | .PHONY: all clean\r |