forked from YuchengWang/bl1-artik710
-
Notifications
You must be signed in to change notification settings - Fork 11
/
config.mak
202 lines (168 loc) · 4.69 KB
/
config.mak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# Copyright (C) 2016 Nexell Co., Ltd.
# Author: Sangjong, Han <hans@nexell.co.kr>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
#
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
###########################################################################
# Build Version info
###########################################################################
VERINFO = V110
###########################################################################
# Build Environment
###########################################################################
DEBUG = n
OPMODE = aarch64
#OPMODE = aarch32
MEMTYPE = DDR3
#MEMTYPE = LPDDR3
MEMTEST = n
INITPMIC = YES
#INITPMIC = NO
CRC_CHECK = n
CHIPNAME = S5P6818
CFLAGS :=
SUPPORT_USB_BOOT = y
SUPPORT_SDMMC_BOOT = y
#BOARD = SVT
#BOARD = ASB
#BOARD = DRONE
#BOARD = AVN
#BOARD = BF700
#BOARD ?= RAPTOR
BOARD = NANOPI
# System Log Message
SYSLOG ?= n
# Secure Boot
SECURE_ON ?= 0
# cross-tool pre-header
ifeq ($(OPMODE), aarch32)
ifeq ($(OS),Windows_NT)
CROSS_TOOL_TOP =
CROSS_TOOL = $(CROSS_TOOL_TOP)arm-none-eabi-
else
CROSS_TOOL_TOP =
CROSS_TOOL = $(CROSS_TOOL_TOP)arm-linux-
endif
endif
ifeq ($(OPMODE), aarch64)
ifeq ($(OS),Windows_NT)
CROSS_TOOL_TOP =
CROSS_TOOL = $(CROSS_TOOL_TOP)aarch64-none-elf-
else
CROSS_TOOL_TOP =
CROSS_TOOL = $(CROSS_TOOL_TOP)aarch64-linux-gnu-
#CROSS_TOOL = $(CROSS_TOOL_TOP)aarch64-elf-
endif
endif
###########################################################################
# Top Names
###########################################################################
PROJECT_NAME = $(CHIPNAME)_2ndboot_$(OPMODE)_$(MEMTYPE)_$(VERINFO)
TARGET_NAME = bl1-$(shell echo $(BOARD) | tr A-Z a-z)
LDS_NAME = peridot_2ndboot_$(OPMODE)
###########################################################################
# Directories
###########################################################################
DIR_PROJECT_TOP =
DIR_OBJOUTPUT = obj
DIR_TARGETOUTPUT = out
CODE_MAIN_INCLUDE =
###########################################################################
# Build Environment
###########################################################################
ifeq ($(OPMODE) , aarch32)
ARCH = armv7-a
CPU = cortex-a15
endif
ifeq ($(OPMODE) , aarch64)
ARCH = armv8-a
CPU = cortex-a53+crc
endif
CC = $(CROSS_TOOL)gcc
LD = $(CROSS_TOOL)ld
AS = $(CROSS_TOOL)as
AR = $(CROSS_TOOL)ar
MAKEBIN = $(CROSS_TOOL)objcopy
OBJCOPY = $(CROSS_TOOL)objcopy
RANLIB = $(CROSS_TOOL)ranlib
GCC_LIB = $(shell $(CC) -print-libgcc-file-name)
ifeq ($(DEBUG), y)
CFLAGS += -DNX_DEBUG -Os
Q =
else
CFLAGS += -DNX_RELEASE -Os
Q = @
endif
###########################################################################
# MISC tools for MS-DOS
###########################################################################
ifeq ($(OS),Windows_NT)
MKDIR = mkdir
RM = del /q /F
MV = move
CD = cd
CP = copy
ECHO = echo
RMDIR = rmdir /S /Q
else
MKDIR = mkdir
RM = rm -f
MV = mv
CD = cd
CP = cp
ECHO = echo
RMDIR = rm -rf
endif
###########################################################################
# FLAGS
###########################################################################
ARFLAGS = rcs
ARFLAGS_REMOVE = -d
ARLIBFLAGS = -v -s
ASFLAG = -D__ASSEMBLY__ -D$(OPMODE)
CFLAGS += -g -Wall \
-Wextra -ffreestanding -fno-builtin \
-mlittle-endian \
-mcpu=$(CPU) \
$(CODE_MAIN_INCLUDE) \
-D__arm \
-DMEMTYPE_$(MEMTYPE) \
-DINITPMIC_$(INITPMIC) \
-D$(OPMODE) -D$(BOARD)
ifeq ($(SYSLOG), y)
CFLAGS += -DSYSLOG_ON
endif
ifeq ($(SECURE_ON), 1)
CFLAGS += -DSECURE_ON
endif
ifeq ($(OPMODE) , aarch32)
CFLAGS += -msoft-float \
-mstructure-size-boundary=32
endif
ifeq ($(OPMODE) , aarch64)
ASFLAG += -march=$(ARCH) -mcpu=$(CPU)
CFLAGS += -mcmodel=small \
-march=$(ARCH) -mstrict-align
endif
ifeq ($(INITPMIC), YES)
CFLAGS += -D$(BOARD)_PMIC_INIT
endif
ifeq ($(MEMTEST), y)
MEMTEST_TYPE += SIMPLE
CFLAGS += -D$(MEMTEST_TYPE)_MEMTEST
endif
ifeq ($(CRC_CHECK), y)
CHECKSUM += CRC_CHECK
CFLAGS += -D$(CHECKSUM)_ON
endif