Add core option for Cortex-M33 with DSP enabled

Signed-off-by: Deepika Bhavnani <Deepika.Bhavnani@arm.com>
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
pull/8995/head
deepikabhavnani 2018-12-06 11:33:10 -06:00 committed by Mahesh Mahadevan
parent 54f53e09d8
commit f05e7b77d0
3 changed files with 34 additions and 9 deletions

View File

@ -51,7 +51,9 @@ CORE_LABELS = {
"Cortex-M33": ["M33", "CORTEX_M", "LIKE_CORTEX_M33", "CORTEX"],
"Cortex-M33-NS": ["M33", "M33_NS", "CORTEX_M", "LIKE_CORTEX_M33", "CORTEX"],
"Cortex-M33F": ["M33", "CORTEX_M", "LIKE_CORTEX_M33", "CORTEX"],
"Cortex-M33F-NS": ["M33", "M33_NS", "CORTEX_M", "LIKE_CORTEX_M33", "CORTEX"]
"Cortex-M33F-NS": ["M33", "M33_NS", "CORTEX_M", "LIKE_CORTEX_M33", "CORTEX"],
"Cortex-M33FD": ["M33", "CORTEX_M", "LIKE_CORTEX_M33", "CORTEX"],
"Cortex-M33FD-NS": ["M33", "M33_NS", "CORTEX_M", "LIKE_CORTEX_M33", "CORTEX"]
}
CORE_ARCH = {
@ -71,6 +73,8 @@ CORE_ARCH = {
"Cortex-M33F": 8,
"Cortex-M33-NS": 8,
"Cortex-M33F-NS": 8,
"Cortex-M33FD": 8,
"Cortex-M33FD-NS": 8,
}
################################################################################

View File

@ -166,7 +166,7 @@ class ARM(mbedToolchain):
msg = None
else:
msg['text'] += line+"\n"
if msg is not None:
self.notify.cc_info(msg)
@ -304,7 +304,7 @@ class ARM(mbedToolchain):
@hook_tool
def binary(self, resources, elf, bin):
_, fmt = splitext(bin)
# On .hex format, combine multiple .hex files (for multiple load regions) into one
# On .hex format, combine multiple .hex files (for multiple load regions) into one
bin_arg = {".bin": "--bin", ".hex": "--i32combined"}[fmt]
cmd = [self.elf2bin, bin_arg, '-o', bin, elf]
cmd = self.hook.get_cmdline_binary(cmd)
@ -364,7 +364,8 @@ class ARMC6(ARM_STD):
SUPPORTED_CORES = ["Cortex-M0", "Cortex-M0+", "Cortex-M3", "Cortex-M4",
"Cortex-M4F", "Cortex-M7", "Cortex-M7F", "Cortex-M7FD",
"Cortex-M23", "Cortex-M23-NS", "Cortex-M33", "Cortex-M33F",
"Cortex-M33-NS", "Cortex-M33F-NS", "Cortex-A9"]
"Cortex-M33-NS", "Cortex-M33F-NS", "Cortex-M33FD-NS", "Cortex-M33FD",
"Cortex-A9"]
ARMCC_RANGE = (LooseVersion("6.10"), LooseVersion("7.0"))
@staticmethod
@ -392,6 +393,10 @@ class ARMC6(ARM_STD):
self.flags['common'].append("-mcpu=%s" % target.core.lower()[:-2])
self.flags['ld'].append("--cpu=%s" % target.core.lower()[:-2])
self.SHEBANG += " -mcpu=%s" % target.core.lower()[:-2]
elif target.core.lower().endswith("fd-ns"):
self.flags['common'].append("-mcpu=%s" % target.core.lower()[:-5])
self.flags['ld'].append("--cpu=%s" % target.core.lower()[:-5])
self.SHEBANG += " -mcpu=%s" % target.core.lower()[:-5]
elif target.core.lower().endswith("f"):
self.flags['common'].append("-mcpu=%s" % target.core.lower()[:-1])
self.flags['ld'].append("--cpu=%s" % target.core.lower()[:-1])
@ -420,18 +425,25 @@ class ARMC6(ARM_STD):
self.flags['common'].append("-mfpu=fpv5-sp-d16")
self.flags['common'].append("-mfloat-abi=softfp")
if target.core == "Cortex-M23" or target.core == "Cortex-M33":
if ((target.core.startswith("Cortex-M23") or
target.core.startswith("Cortex-M33")) and
not target.core.endswith("-NS")):
self.flags['cxx'].append("-mcmse")
self.flags['c'].append("-mcmse")
# Create Secure library
if ((target.core == "Cortex-M23" or self.target.core == "Cortex-M33") and
if ((target.core.startswith("Cortex-M23") or
target.core.startswith("Cortex-M33")) and
not target.core.endswith("-NS") and
kwargs.get('build_dir', False)):
build_dir = kwargs['build_dir']
secure_file = join(build_dir, "cmse_lib.o")
self.flags["ld"] += ["--import_cmse_lib_out=%s" % secure_file]
# Add linking time preprocessor macro DOMAIN_NS
if target.core == "Cortex-M23-NS" or self.target.core == "Cortex-M33-NS":
if ((target.core.startswith("Cortex-M23") or
target.core.startswith("Cortex-M33")) and
target.core.endswith("-NS")):
define_string = self.make_ld_define("DOMAIN_NS", "0x1")
self.flags["ld"].append(define_string)

View File

@ -60,6 +60,8 @@ class GCC(mbedToolchain):
self.cpu = ["-mcpu=cortex-m7"]
elif target.core.startswith("Cortex-M23"):
self.cpu = ["-mcpu=cortex-m23"]
elif target.core.startswith("Cortex-M33FD"):
self.cpu = ["-mcpu=cortex-m33"]
elif target.core.startswith("Cortex-M33F"):
self.cpu = ["-mcpu=cortex-m33+nodsp"]
elif target.core.startswith("Cortex-M33"):
@ -80,6 +82,9 @@ class GCC(mbedToolchain):
elif target.core == "Cortex-M7FD":
self.cpu.append("-mfpu=fpv5-d16")
self.cpu.append("-mfloat-abi=softfp")
elif target.core.startswith("Cortex-M33F"):
self.cpu.append("-mfpu=fpv5-sp-d16")
self.cpu.append("-mfloat-abi=softfp")
if target.core == "Cortex-A9":
self.cpu.append("-mthumb-interwork")
@ -97,8 +102,12 @@ class GCC(mbedToolchain):
"-Wl,--cmse-implib",
"-Wl,--out-implib=%s" % join(build_dir, "cmse_lib.o")
])
elif target.core == "Cortex-M23-NS" or target.core == "Cortex-M33-NS" or target.core == "Cortex-M33F-NS":
self.flags["ld"].append("-DDOMAIN_NS=1")
# Add linking time preprocessor macro DOMAIN_NS
if ((target.core.startswith("Cortex-M23") or
target.core.startswith("Cortex-M33")) and
target.core.endswith("-NS")):
self.flags["ld"].append("-DDOMAIN_NS=1")
self.flags["common"] += self.cpu