summaryrefslogtreecommitdiffstats
path: root/meta/conf/machine/include/mips/arch-mips.inc
blob: e48ddd2d6b474c32ceddf9f813008cca482a832e (plain)
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
# MIPS Architecture definition
# 12 defined ABIs, all combinations of:
# *) Big/Little Endian
# *) Hardware/Software Floating Point
# *) o32, n32, n64 ABI

DEFAULTTUNE ?= "mips"

# Endianess
TUNEVALID[bigendian] = "Enable big-endian mode"
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', ' -meb', ' -mel', d)}"

# ABI flags
TUNEVALID[o32] = "MIPS o32 ABI"
TUNECONFLICTS[o32] = "n32 n64"
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'o32', ' -mabi=32', '', d)}"

TUNEVALID[n32] = "MIPS64 n32 ABI"
TUNECONFLICTS[n32] = "o32 n64"
ABIEXTENSION .= "${@bb.utils.filter('TUNE_FEATURES', 'n32', d)}"
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'n32', ' -mabi=n32', '', d)}"

# user mode qemu doesn't support mips64 n32: "Invalid ELF image for this architecture"
MACHINE_FEATURES_BACKFILL_CONSIDERED:append = " ${@bb.utils.contains('TUNE_FEATURES', 'n32', 'qemu-usermode', '', d)}"

TUNEVALID[n64] = "MIPS64 n64 ABI"
TUNECONFLICTS[n64] = "o32 n32"
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'n64', ' -mabi=64', '', d)}"

# Floating point
TUNEVALID[fpu-hard] = "Use hardware FPU"
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard', ' -mhard-float', ' -msoft-float', d)}"
TARGET_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard', '', 'soft', d)}"

# MIPS r6 ABI
TUNEVALID[r6] = "Use r6"
TUNEVALID[mipsisa64r6] = "Use 64r6"
TUNEVALID[mipsisa32r6] = "Use 32r6"

# Package naming
MIPSPKGSFX_ENDIAN = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', '', 'el', d)}"
MIPSPKGSFX_ENDIAN2 = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', 'eb', 'el', d)}"
MIPSPKGSFX_BYTE = "${@bb.utils.contains('TUNE_FEATURES', 'n64' , '64', '', d)}"
MIPSPKGSFX_BYTE .= "${@bb.utils.contains('TUNE_FEATURES', 'n32' , '64', '', d)}"
MIPSPKGSFX_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard' , '', '-nf', d)}"
MIPSPKGSFX_ABI = "${@bb.utils.contains('TUNE_FEATURES', 'n32', '-n32', '', d)}"
MIPSPKGSFX_R6 = "${@bb.utils.filter('TUNE_FEATURES', 'r6', d)}"
MIPSPKGSFX_64R6 = "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa64r6', 'isa', '', d)}"
MIPSPKGSFX_32R6 = "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa32r6', 'isa32', '', d)}"

TUNE_ARCH = "mips${MIPSPKGSFX_32R6}${MIPSPKGSFX_64R6}${MIPSPKGSFX_BYTE}${MIPSPKGSFX_R6}${MIPSPKGSFX_ENDIAN}"
TUNE_PKGARCH = "${MIPSPKGSFX_VARIANT:tune-${DEFAULTTUNE}}${MIPSPKGSFX_FPU}${MIPSPKGSFX_ABI}"

# Various Global Machine Overrides
MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n64', 'mipsarchn64${MIPSPKGSFX_ENDIAN2}:', '', d)}"
MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'o32', 'mipsarcho32${MIPSPKGSFX_ENDIAN2}:', '', d)}"
MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n32', 'mipsarchn32${MIPSPKGSFX_ENDIAN2}:', '', d)}"
MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n64', 'mipsarchn64:', '', d)}"
MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'o32', 'mipsarcho32:', '', d)}"
MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n32', 'mipsarchn32:', '', d)}"
MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'r6', 'mipsarchr6:', '', d)}"
MACHINEOVERRIDES =. "mipsarch${MIPSPKGSFX_ENDIAN2}:"
MACHINEOVERRIDES =. "mipsarch:"

# Base tunes
AVAILTUNES += "mips mips64-n32 mips64 mipsel mips64el-n32 mips64el mips-nf mips64-nf-n32 mips64-nf mipsel-nf mips64el-nf-n32 mips64el-nf"
TUNE_FEATURES:tune-mips = "o32 bigendian fpu-hard"
BASE_LIB:tune-mips = "lib"
MIPSPKGSFX_VARIANT:tune-mips = "${TUNE_ARCH}"
PACKAGE_EXTRA_ARCHS:tune-mips = "mips"

TUNE_FEATURES:tune-mips64-n32 = "n32 bigendian fpu-hard"
BASE_LIB:tune-mips64-n32 = "lib32"
MIPSPKGSFX_VARIANT:tune-mips64-n32 = "${TUNE_ARCH}"
PACKAGE_EXTRA_ARCHS:tune-mips64-n32 = "mips64-n32"

TUNE_FEATURES:tune-mips64 = "n64 bigendian fpu-hard"
BASE_LIB:tune-mips64 = "lib64"
MIPSPKGSFX_VARIANT:tune-mips64 = "${TUNE_ARCH}"
PACKAGE_EXTRA_ARCHS:tune-mips64 = "mips64"

TUNE_FEATURES:tune-mipsel = "o32 fpu-hard"
BASE_LIB:tune-mipsel = "lib"
MIPSPKGSFX_VARIANT:tune-mipsel = "${TUNE_ARCH}"
PACKAGE_EXTRA_ARCHS:tune-mipsel = "mipsel"

TUNE_FEATURES:tune-mips64el-n32 = "n32 fpu-hard"
BASE_LIB:tune-mips64el-n32 = "lib32"
MIPSPKGSFX_VARIANT:tune-mips64el-n32 = "${TUNE_ARCH}"
PACKAGE_EXTRA_ARCHS:tune-mips64el-n32 = "mips64el-n32"

TUNE_FEATURES:tune-mips64el = "n64 fpu-hard"
BASE_LIB:tune-mips64el = "lib64"
MIPSPKGSFX_VARIANT:tune-mips64el = "${TUNE_ARCH}"
PACKAGE_EXTRA_ARCHS:tune-mips64el = "mips64el"

TUNE_FEATURES:tune-mips-nf = "o32 bigendian"
BASE_LIB:tune-mips-nf = "lib"
MIPSPKGSFX_VARIANT:tune-mips-nf = "${TUNE_ARCH}"
PACKAGE_EXTRA_ARCHS:tune-mips-nf = "mips-nf"

TUNE_FEATURES:tune-mips64-nf-n32 = "n32 bigendian"
BASE_LIB:tune-mips64-nf-n32 = "lib32"
MIPSPKGSFX_VARIANT:tune-mips64-nf-n32 = "${TUNE_ARCH}"
PACKAGE_EXTRA_ARCHS:tune-mips64-nf-n32 = "mips64-nf-n32"

TUNE_FEATURES:tune-mips64-nf = "n64 bigendian"
BASE_LIB:tune-mips64-nf = "lib64"
MIPSPKGSFX_VARIANT:tune-mips64-nf = "${TUNE_ARCH}"
PACKAGE_EXTRA_ARCHS:tune-mips64-nf = "mips64-nf"

TUNE_FEATURES:tune-mipsel-nf = "o32"
BASE_LIB:tune-mipsel-nf = "lib"
MIPSPKGSFX_VARIANT:tune-mipsel-nf = "${TUNE_ARCH}"
PACKAGE_EXTRA_ARCHS:tune-mipsel-nf = "mipsel-nf"

TUNE_FEATURES:tune-mips64el-nf-n32 = "n32"
BASE_LIB:tune-mips64el-nf-n32 = "lib32"
MIPSPKGSFX_VARIANT:tune-mips64el-nf-n32 = "${TUNE_ARCH}"
PACKAGE_EXTRA_ARCHS:tune-mips64el-nf-n32 = "mips64el-nf-n32"

TUNE_FEATURES:tune-mips64el-nf = "n64"
BASE_LIB:tune-mips64el-nf = "lib64"
MIPSPKGSFX_VARIANT:tune-mips64el-nf = "${TUNE_ARCH}"
PACKAGE_EXTRA_ARCHS:tune-mips64el-nf = "mips64el-nf"

# MIPS 64 + o32
AVAILTUNES += "mips64-o32 mips64el-o32"

TUNE_FEATURES:tune-mips64-o32 = "o32 bigendian fpu-hard"
BASE_LIB:tune-mips64-o32 = "lib"
MIPSPKGSFX_VARIANT:tune-mips64-o32 = "${TUNE_ARCH}"
PACKAGE_EXTRA_ARCHS:tune-mips64-o32 = "mips mips64-o32"

TUNE_FEATURES:tune-mips64el-o32 = "o32 fpu-hard"
BASE_LIB:tune-mips64el-o32 = "lib"
MIPSPKGSFX_VARIANT:tune-mips64el-o32 = "${TUNE_ARCH}"
PACKAGE_EXTRA_ARCHS:tune-mips64el-o32 = "mipsel mips64el-o32"

# MIPS 64 o32 and Soft Float
AVAILTUNES += "mips64-nf-o32 mips64el-nf-o32"

TUNE_FEATURES:tune-mips64-nf-o32 = "o32 bigendian"
BASE_LIB:tune-mips64-nf-o32 = "lib"
MIPSPKGSFX_VARIANT:tune-mips64-nf-o32 = "${TUNE_ARCH}"
PACKAGE_EXTRA_ARCHS:tune-mips64-nf-o32 = "mips-nf mips64-nf-o32"

TUNE_FEATURES:tune-mips64el-nf-o32 = "o32"
BASE_LIB:tune-mips64el-nf-o32 = "lib"
MIPSPKGSFX_VARIANT:tune-mips64el-nf-o32 = "${TUNE_ARCH}"
PACKAGE_EXTRA_ARCHS:tune-mips64el-nf-o32 = "mipsel-nf mips64el-nf-o32"