blob: 169e5d7fae8c569f4b50ae835c0ce44f9496e75f [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001# SPDX-License-Identifier: GPL-2.0+
Alexey Brodkin2f16ac92014-02-04 12:56:14 +04002#
3# Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
Alexey Brodkin2f16ac92014-02-04 12:56:14 +04004
Alexey Brodkin1f9ad442015-02-03 13:58:14 +03005ifndef CONFIG_CPU_BIG_ENDIAN
Alexey Brodkin2f16ac92014-02-04 12:56:14 +04006CONFIG_SYS_LITTLE_ENDIAN = 1
Alexey Brodkin1f9ad442015-02-03 13:58:14 +03007else
8CONFIG_SYS_BIG_ENDIAN = 1
Alexey Brodkin2f16ac92014-02-04 12:56:14 +04009endif
10
11ifdef CONFIG_SYS_LITTLE_ENDIAN
Masahiro Yamada574bbf42015-05-13 18:49:31 +090012ARC_CROSS_COMPILE := arc-linux-
Alexey Brodkina67ef282015-02-03 13:58:20 +030013PLATFORM_LDFLAGS += -EL
14PLATFORM_CPPFLAGS += -mlittle-endian
Alexey Brodkin2f16ac92014-02-04 12:56:14 +040015endif
16
17ifdef CONFIG_SYS_BIG_ENDIAN
Masahiro Yamada574bbf42015-05-13 18:49:31 +090018ARC_CROSS_COMPILE := arceb-linux-
Alexey Brodkin2f16ac92014-02-04 12:56:14 +040019PLATFORM_LDFLAGS += -EB
Alexey Brodkina67ef282015-02-03 13:58:20 +030020PLATFORM_CPPFLAGS += -mbig-endian
Alexey Brodkin2f16ac92014-02-04 12:56:14 +040021endif
22
Masahiro Yamada9b6e2c32014-02-28 14:33:30 +090023ifeq ($(CROSS_COMPILE),)
24CROSS_COMPILE := $(ARC_CROSS_COMPILE)
25endif
26
Alexey Brodkindcb431e2014-12-24 17:00:29 +030027ifdef CONFIG_ARC_MMU_VER
28CONFIG_MMU = 1
29endif
30
Alexey Brodkin51f49992015-02-03 13:58:19 +030031ifdef CONFIG_CPU_ARC750D
Alexey Brodkin7c8d8162016-09-16 12:12:26 +030032PLATFORM_CPPFLAGS += -mcpu=arc700
Alexey Brodkin51f49992015-02-03 13:58:19 +030033endif
34
Alexey Brodkin812980b2015-02-03 13:58:11 +030035ifdef CONFIG_CPU_ARC770D
Alexey Brodkin7c8d8162016-09-16 12:12:26 +030036PLATFORM_CPPFLAGS += -mcpu=arc700 -mlock -mswape
Alexey Brodkin812980b2015-02-03 13:58:11 +030037endif
38
Alexey Brodkinf13606b2015-01-13 18:35:46 +030039ifdef CONFIG_CPU_ARCEM6
Alexey Brodkin7c8d8162016-09-16 12:12:26 +030040PLATFORM_CPPFLAGS += -mcpu=arcem
Alexey Brodkinf13606b2015-01-13 18:35:46 +030041endif
42
43ifdef CONFIG_CPU_ARCHS34
Alexey Brodkin7a54f512016-06-16 10:55:00 +020044PLATFORM_CPPFLAGS += -mcpu=archs
Alexey Brodkinf13606b2015-01-13 18:35:46 +030045endif
46
47ifdef CONFIG_CPU_ARCHS38
Alexey Brodkin7a54f512016-06-16 10:55:00 +020048PLATFORM_CPPFLAGS += -mcpu=archs
Alexey Brodkinf13606b2015-01-13 18:35:46 +030049endif
50
Alexey Brodkind53b1282018-02-15 15:34:58 +030051PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -gdwarf-2 -mno-sdata
Alexey Brodkinfac47902018-01-25 00:25:12 +030052PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
Alexey Brodkin2f16ac92014-02-04 12:56:14 +040053
Alexey Brodkin2f16ac92014-02-04 12:56:14 +040054# Needed for relocation
Alexey Brodkinfac47902018-01-25 00:25:12 +030055LDFLAGS_FINAL += -pie --gc-sections
Alexey Brodkin2f16ac92014-02-04 12:56:14 +040056
57# Load address for standalone apps
58CONFIG_STANDALONE_LOAD_ADDR ?= 0x82000000