blob: 2f625119cb13b29b56c087d4016aabc9fb4cb8cb [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001# MIPS Architecture definition
2# 12 defined ABIs, all combinations of:
3# *) Big/Little Endian
4# *) Hardware/Software Floating Point
5# *) o32, n32, n64 ABI
6
7DEFAULTTUNE ?= "mips"
8
9# Endianess
10TUNEVALID[bigendian] = "Enable big-endian mode"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050011TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', ' -meb', ' -mel', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050012
13# ABI flags
14TUNEVALID[o32] = "MIPS o32 ABI"
15TUNECONFLICTS[o32] = "n32 n64"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050016TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'o32', ' -mabi=32', '', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017
18TUNEVALID[n32] = "MIPS64 n32 ABI"
19TUNECONFLICTS[n32] = "o32 n64"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050020ABIEXTENSION .= "${@bb.utils.filter('TUNE_FEATURES', 'n32' ,d)}"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050021TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'n32', ' -mabi=n32', '', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050022
Patrick Williamsc0f7c042017-02-23 20:41:17 -060023# user mode qemu doesn't support mips64 n32: "Invalid ELF image for this architecture"
24MACHINE_FEATURES_BACKFILL_CONSIDERED_append = " ${@bb.utils.contains('TUNE_FEATURES', 'n32', 'qemu-usermode', '', d)}"
25
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026TUNEVALID[n64] = "MIPS64 n64 ABI"
27TUNECONFLICTS[n64] = "o32 n32"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050028TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'n64', ' -mabi=64', '', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050029
30# Floating point
31TUNEVALID[fpu-hard] = "Use hardware FPU"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050032TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard', ' -mhard-float', ' -msoft-float', d)}"
33TARGET_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard', '', 'soft', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034
Patrick Williamsc0f7c042017-02-23 20:41:17 -060035# MIPS r6 ABI
36TUNEVALID[r6] = "Use r6"
37TUNEVALID[mipsisa64r6] = "Use 64r6"
38TUNEVALID[mipsisa32r6] = "Use 32r6"
39
Patrick Williamsc124f4f2015-09-15 14:41:29 -050040# Package naming
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050041MIPSPKGSFX_ENDIAN = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', '', 'el', d)}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050042MIPSPKGSFX_ENDIAN2 = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', 'eb', 'el', d)}"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050043MIPSPKGSFX_BYTE = "${@bb.utils.contains('TUNE_FEATURES', 'n64' , '64', '', d)}"
44MIPSPKGSFX_BYTE .= "${@bb.utils.contains('TUNE_FEATURES', 'n32' , '64', '', d)}"
45MIPSPKGSFX_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard' , '', '-nf', d)}"
46MIPSPKGSFX_ABI = "${@bb.utils.contains('TUNE_FEATURES', 'n32', '-n32', '', d)}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050047MIPSPKGSFX_R6 = "${@bb.utils.filter('TUNE_FEATURES', 'r6', d)}"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060048MIPSPKGSFX_64R6 = "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa64r6', 'isa', '', d)}"
49MIPSPKGSFX_32R6 = "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa32r6', 'isa32', '', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050050
Patrick Williamsc0f7c042017-02-23 20:41:17 -060051TUNE_ARCH = "mips${MIPSPKGSFX_32R6}${MIPSPKGSFX_64R6}${MIPSPKGSFX_BYTE}${MIPSPKGSFX_R6}${MIPSPKGSFX_ENDIAN}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050052TUNE_PKGARCH = "${MIPSPKGSFX_VARIANT_tune-${DEFAULTTUNE}}${MIPSPKGSFX_FPU}${MIPSPKGSFX_ABI}"
53
Brad Bishop6e60e8b2018-02-01 10:27:11 -050054# Various Global Machine Overrides
55MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n64', 'mipsarchn64${MIPSPKGSFX_ENDIAN2}:', '' ,d)}"
56MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'o32', 'mipsarcho32${MIPSPKGSFX_ENDIAN2}:', '' ,d)}"
57MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n32', 'mipsarchn32${MIPSPKGSFX_ENDIAN2}:', '' ,d)}"
58MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n64', 'mipsarchn64:', '' ,d)}"
59MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'o32', 'mipsarcho32:', '' ,d)}"
60MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n32', 'mipsarchn32:', '' ,d)}"
61MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'r6', 'mipsarchr6:', '' ,d)}"
62MACHINEOVERRIDES =. "mipsarch${MIPSPKGSFX_ENDIAN2}:"
63MACHINEOVERRIDES =. "mipsarch:"
64
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065# Base tunes
66AVAILTUNES += "mips mips64-n32 mips64 mipsel mips64el-n32 mips64el mips-nf mips64-nf-n32 mips64-nf mipsel-nf mips64el-nf-n32 mips64el-nf"
67TUNE_FEATURES_tune-mips = "o32 bigendian fpu-hard"
68BASE_LIB_tune-mips = "lib"
69MIPSPKGSFX_VARIANT_tune-mips = "${TUNE_ARCH}"
70PACKAGE_EXTRA_ARCHS_tune-mips = "mips"
71
72TUNE_FEATURES_tune-mips64-n32 = "n32 bigendian fpu-hard"
73BASE_LIB_tune-mips64-n32 = "lib32"
74MIPSPKGSFX_VARIANT_tune-mips64-n32 = "${TUNE_ARCH}"
75PACKAGE_EXTRA_ARCHS_tune-mips64-n32 = "mips64-n32"
76
77TUNE_FEATURES_tune-mips64 = "n64 bigendian fpu-hard"
78BASE_LIB_tune-mips64 = "lib64"
79MIPSPKGSFX_VARIANT_tune-mips64 = "${TUNE_ARCH}"
80PACKAGE_EXTRA_ARCHS_tune-mips64 = "mips64"
81
82TUNE_FEATURES_tune-mipsel = "o32 fpu-hard"
83BASE_LIB_tune-mipsel = "lib"
84MIPSPKGSFX_VARIANT_tune-mipsel = "${TUNE_ARCH}"
85PACKAGE_EXTRA_ARCHS_tune-mipsel = "mipsel"
86
87TUNE_FEATURES_tune-mips64el-n32 = "n32 fpu-hard"
88BASE_LIB_tune-mips64el-n32 = "lib32"
89MIPSPKGSFX_VARIANT_tune-mips64el-n32 = "${TUNE_ARCH}"
90PACKAGE_EXTRA_ARCHS_tune-mips64el-n32 = "mips64el-n32"
91
92TUNE_FEATURES_tune-mips64el = "n64 fpu-hard"
93BASE_LIB_tune-mips64el = "lib64"
94MIPSPKGSFX_VARIANT_tune-mips64el = "${TUNE_ARCH}"
95PACKAGE_EXTRA_ARCHS_tune-mips64el = "mips64el"
96
97TUNE_FEATURES_tune-mips-nf = "o32 bigendian"
98BASE_LIB_tune-mips-nf = "lib"
99MIPSPKGSFX_VARIANT_tune-mips-nf = "${TUNE_ARCH}"
100PACKAGE_EXTRA_ARCHS_tune-mips-nf = "mips-nf"
101
102TUNE_FEATURES_tune-mips64-nf-n32 = "n32 bigendian"
103BASE_LIB_tune-mips64-nf-n32 = "lib32"
104MIPSPKGSFX_VARIANT_tune-mips64-nf-n32 = "${TUNE_ARCH}"
105PACKAGE_EXTRA_ARCHS_tune-mips64-nf-n32 = "mips64-nf-n32"
106
107TUNE_FEATURES_tune-mips64-nf = "n64 bigendian"
108BASE_LIB_tune-mips64-nf = "lib64"
109MIPSPKGSFX_VARIANT_tune-mips64-nf = "${TUNE_ARCH}"
110PACKAGE_EXTRA_ARCHS_tune-mips64-nf = "mips64-nf"
111
112TUNE_FEATURES_tune-mipsel-nf = "o32"
113BASE_LIB_tune-mipsel-nf = "lib"
114MIPSPKGSFX_VARIANT_tune-mipsel-nf = "${TUNE_ARCH}"
115PACKAGE_EXTRA_ARCHS_tune-mipsel-nf = "mipsel-nf"
116
117TUNE_FEATURES_tune-mips64el-nf-n32 = "n32"
118BASE_LIB_tune-mips64el-nf-n32 = "lib32"
119MIPSPKGSFX_VARIANT_tune-mips64el-nf-n32 = "${TUNE_ARCH}"
120PACKAGE_EXTRA_ARCHS_tune-mips64el-nf-n32 = "mips64el-nf-n32"
121
122TUNE_FEATURES_tune-mips64el-nf = "n64"
123BASE_LIB_tune-mips64el-nf = "lib64"
124MIPSPKGSFX_VARIANT_tune-mips64el-nf = "${TUNE_ARCH}"
125PACKAGE_EXTRA_ARCHS_tune-mips64el-nf = "mips64el-nf"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600126
127# MIPS 64 + o32
128AVAILTUNES += "mips64-o32 mips64el-o32"
129
130TUNE_FEATURES_tune-mips64-o32 = "o32 bigendian fpu-hard"
131BASE_LIB_tune-mips64-o32 = "lib"
132MIPSPKGSFX_VARIANT_tune-mips64-o32 = "${TUNE_ARCH}"
133PACKAGE_EXTRA_ARCHS_tune-mips64-o32 = "mips mips64-o32"
134
135TUNE_FEATURES_tune-mips64el-o32 = "o32 fpu-hard"
136BASE_LIB_tune-mips64el-o32 = "lib"
137MIPSPKGSFX_VARIANT_tune-mips64el-o32 = "${TUNE_ARCH}"
138PACKAGE_EXTRA_ARCHS_tune-mips64el-o32 = "mipsel mips64el-o32 mips64el-o32"
139
140# MIPS 64 o32 and Soft Float
141AVAILTUNES += "mips64-nf-o32 mips64el-nf-o32"
142
143TUNE_FEATURES_tune-mips64-nf-o32 = "o32 bigendian"
144BASE_LIB_tune-mips64-nf-o32 = "lib"
145MIPSPKGSFX_VARIANT_tune-mips64-nf-o32 = "${TUNE_ARCH}"
146PACKAGE_EXTRA_ARCHS_tune-mips64-nf-o32 = "mips-nf mips64-nf-o32"
147
148TUNE_FEATURES_tune-mips64el-nf-o32 = "o32"
149BASE_LIB_tune-mips64el-nf-o32 = "lib"
150MIPSPKGSFX_VARIANT_tune-mips64el-nf-o32 = "${TUNE_ARCH}"
151PACKAGE_EXTRA_ARCHS_tune-mips64el-nf-o32 = "mipsel-nf mips64el-nf-o32"