blob: e39cdcab5ddcf363180dde5b43dd5313f23d9d7b [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"
Andrew Geisslerc3d88e42020-10-02 09:45:00 -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"
Patrick Williams213cb262021-08-07 19:21:33 -050024MACHINE_FEATURES_BACKFILL_CONSIDERED:append = " ${@bb.utils.contains('TUNE_FEATURES', 'n32', 'qemu-usermode', '', d)}"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060025
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)}"
Andrew Geissler5082cc72023-09-11 08:41:39 -040029LD64ARG = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', '-m elf64btsmip', '-m elf64ltsmip', d)}"
30TUNE_LDARGS += "${@bb.utils.contains('TUNE_FEATURES', 'n64', '${LD64ARG}', '', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031
32# Floating point
33TUNEVALID[fpu-hard] = "Use hardware FPU"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050034TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard', ' -mhard-float', ' -msoft-float', d)}"
35TARGET_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard', '', 'soft', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050036
Patrick Williamsc0f7c042017-02-23 20:41:17 -060037# MIPS r6 ABI
38TUNEVALID[r6] = "Use r6"
39TUNEVALID[mipsisa64r6] = "Use 64r6"
40TUNEVALID[mipsisa32r6] = "Use 32r6"
41
Patrick Williamsc124f4f2015-09-15 14:41:29 -050042# Package naming
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050043MIPSPKGSFX_ENDIAN = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', '', 'el', d)}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050044MIPSPKGSFX_ENDIAN2 = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', 'eb', 'el', d)}"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050045MIPSPKGSFX_BYTE = "${@bb.utils.contains('TUNE_FEATURES', 'n64' , '64', '', d)}"
46MIPSPKGSFX_BYTE .= "${@bb.utils.contains('TUNE_FEATURES', 'n32' , '64', '', d)}"
47MIPSPKGSFX_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard' , '', '-nf', d)}"
48MIPSPKGSFX_ABI = "${@bb.utils.contains('TUNE_FEATURES', 'n32', '-n32', '', d)}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050049MIPSPKGSFX_R6 = "${@bb.utils.filter('TUNE_FEATURES', 'r6', d)}"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060050MIPSPKGSFX_64R6 = "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa64r6', 'isa', '', d)}"
51MIPSPKGSFX_32R6 = "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa32r6', 'isa32', '', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050052
Patrick Williamsc0f7c042017-02-23 20:41:17 -060053TUNE_ARCH = "mips${MIPSPKGSFX_32R6}${MIPSPKGSFX_64R6}${MIPSPKGSFX_BYTE}${MIPSPKGSFX_R6}${MIPSPKGSFX_ENDIAN}"
Patrick Williams213cb262021-08-07 19:21:33 -050054TUNE_PKGARCH = "${MIPSPKGSFX_VARIANT:tune-${DEFAULTTUNE}}${MIPSPKGSFX_FPU}${MIPSPKGSFX_ABI}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050055
Brad Bishop6e60e8b2018-02-01 10:27:11 -050056# Various Global Machine Overrides
Andrew Geisslerc3d88e42020-10-02 09:45:00 -050057MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n64', 'mipsarchn64${MIPSPKGSFX_ENDIAN2}:', '', d)}"
58MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'o32', 'mipsarcho32${MIPSPKGSFX_ENDIAN2}:', '', d)}"
59MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n32', 'mipsarchn32${MIPSPKGSFX_ENDIAN2}:', '', d)}"
60MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n64', 'mipsarchn64:', '', d)}"
61MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'o32', 'mipsarcho32:', '', d)}"
62MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n32', 'mipsarchn32:', '', d)}"
63MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'r6', 'mipsarchr6:', '', d)}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050064MACHINEOVERRIDES =. "mipsarch${MIPSPKGSFX_ENDIAN2}:"
65MACHINEOVERRIDES =. "mipsarch:"
66
Patrick Williamsc124f4f2015-09-15 14:41:29 -050067# Base tunes
68AVAILTUNES += "mips mips64-n32 mips64 mipsel mips64el-n32 mips64el mips-nf mips64-nf-n32 mips64-nf mipsel-nf mips64el-nf-n32 mips64el-nf"
Patrick Williams213cb262021-08-07 19:21:33 -050069TUNE_FEATURES:tune-mips = "o32 bigendian fpu-hard"
70BASE_LIB:tune-mips = "lib"
71MIPSPKGSFX_VARIANT:tune-mips = "${TUNE_ARCH}"
72PACKAGE_EXTRA_ARCHS:tune-mips = "mips"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050073
Patrick Williams213cb262021-08-07 19:21:33 -050074TUNE_FEATURES:tune-mips64-n32 = "n32 bigendian fpu-hard"
75BASE_LIB:tune-mips64-n32 = "lib32"
76MIPSPKGSFX_VARIANT:tune-mips64-n32 = "${TUNE_ARCH}"
77PACKAGE_EXTRA_ARCHS:tune-mips64-n32 = "mips64-n32"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050078
Patrick Williams213cb262021-08-07 19:21:33 -050079TUNE_FEATURES:tune-mips64 = "n64 bigendian fpu-hard"
80BASE_LIB:tune-mips64 = "lib64"
81MIPSPKGSFX_VARIANT:tune-mips64 = "${TUNE_ARCH}"
82PACKAGE_EXTRA_ARCHS:tune-mips64 = "mips64"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050083
Patrick Williams213cb262021-08-07 19:21:33 -050084TUNE_FEATURES:tune-mipsel = "o32 fpu-hard"
85BASE_LIB:tune-mipsel = "lib"
86MIPSPKGSFX_VARIANT:tune-mipsel = "${TUNE_ARCH}"
87PACKAGE_EXTRA_ARCHS:tune-mipsel = "mipsel"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050088
Patrick Williams213cb262021-08-07 19:21:33 -050089TUNE_FEATURES:tune-mips64el-n32 = "n32 fpu-hard"
90BASE_LIB:tune-mips64el-n32 = "lib32"
91MIPSPKGSFX_VARIANT:tune-mips64el-n32 = "${TUNE_ARCH}"
92PACKAGE_EXTRA_ARCHS:tune-mips64el-n32 = "mips64el-n32"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050093
Patrick Williams213cb262021-08-07 19:21:33 -050094TUNE_FEATURES:tune-mips64el = "n64 fpu-hard"
95BASE_LIB:tune-mips64el = "lib64"
96MIPSPKGSFX_VARIANT:tune-mips64el = "${TUNE_ARCH}"
97PACKAGE_EXTRA_ARCHS:tune-mips64el = "mips64el"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050098
Patrick Williams213cb262021-08-07 19:21:33 -050099TUNE_FEATURES:tune-mips-nf = "o32 bigendian"
100BASE_LIB:tune-mips-nf = "lib"
101MIPSPKGSFX_VARIANT:tune-mips-nf = "${TUNE_ARCH}"
102PACKAGE_EXTRA_ARCHS:tune-mips-nf = "mips-nf"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500103
Patrick Williams213cb262021-08-07 19:21:33 -0500104TUNE_FEATURES:tune-mips64-nf-n32 = "n32 bigendian"
105BASE_LIB:tune-mips64-nf-n32 = "lib32"
106MIPSPKGSFX_VARIANT:tune-mips64-nf-n32 = "${TUNE_ARCH}"
107PACKAGE_EXTRA_ARCHS:tune-mips64-nf-n32 = "mips64-nf-n32"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500108
Patrick Williams213cb262021-08-07 19:21:33 -0500109TUNE_FEATURES:tune-mips64-nf = "n64 bigendian"
110BASE_LIB:tune-mips64-nf = "lib64"
111MIPSPKGSFX_VARIANT:tune-mips64-nf = "${TUNE_ARCH}"
112PACKAGE_EXTRA_ARCHS:tune-mips64-nf = "mips64-nf"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500113
Patrick Williams213cb262021-08-07 19:21:33 -0500114TUNE_FEATURES:tune-mipsel-nf = "o32"
115BASE_LIB:tune-mipsel-nf = "lib"
116MIPSPKGSFX_VARIANT:tune-mipsel-nf = "${TUNE_ARCH}"
117PACKAGE_EXTRA_ARCHS:tune-mipsel-nf = "mipsel-nf"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500118
Patrick Williams213cb262021-08-07 19:21:33 -0500119TUNE_FEATURES:tune-mips64el-nf-n32 = "n32"
120BASE_LIB:tune-mips64el-nf-n32 = "lib32"
121MIPSPKGSFX_VARIANT:tune-mips64el-nf-n32 = "${TUNE_ARCH}"
122PACKAGE_EXTRA_ARCHS:tune-mips64el-nf-n32 = "mips64el-nf-n32"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500123
Patrick Williams213cb262021-08-07 19:21:33 -0500124TUNE_FEATURES:tune-mips64el-nf = "n64"
125BASE_LIB:tune-mips64el-nf = "lib64"
126MIPSPKGSFX_VARIANT:tune-mips64el-nf = "${TUNE_ARCH}"
127PACKAGE_EXTRA_ARCHS:tune-mips64el-nf = "mips64el-nf"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600128
129# MIPS 64 + o32
130AVAILTUNES += "mips64-o32 mips64el-o32"
131
Patrick Williams213cb262021-08-07 19:21:33 -0500132TUNE_FEATURES:tune-mips64-o32 = "o32 bigendian fpu-hard"
133BASE_LIB:tune-mips64-o32 = "lib"
134MIPSPKGSFX_VARIANT:tune-mips64-o32 = "${TUNE_ARCH}"
135PACKAGE_EXTRA_ARCHS:tune-mips64-o32 = "mips mips64-o32"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600136
Patrick Williams213cb262021-08-07 19:21:33 -0500137TUNE_FEATURES:tune-mips64el-o32 = "o32 fpu-hard"
138BASE_LIB:tune-mips64el-o32 = "lib"
139MIPSPKGSFX_VARIANT:tune-mips64el-o32 = "${TUNE_ARCH}"
140PACKAGE_EXTRA_ARCHS:tune-mips64el-o32 = "mipsel mips64el-o32"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600141
142# MIPS 64 o32 and Soft Float
143AVAILTUNES += "mips64-nf-o32 mips64el-nf-o32"
144
Patrick Williams213cb262021-08-07 19:21:33 -0500145TUNE_FEATURES:tune-mips64-nf-o32 = "o32 bigendian"
146BASE_LIB:tune-mips64-nf-o32 = "lib"
147MIPSPKGSFX_VARIANT:tune-mips64-nf-o32 = "${TUNE_ARCH}"
148PACKAGE_EXTRA_ARCHS:tune-mips64-nf-o32 = "mips-nf mips64-nf-o32"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600149
Patrick Williams213cb262021-08-07 19:21:33 -0500150TUNE_FEATURES:tune-mips64el-nf-o32 = "o32"
151BASE_LIB:tune-mips64el-nf-o32 = "lib"
152MIPSPKGSFX_VARIANT:tune-mips64el-nf-o32 = "${TUNE_ARCH}"
153PACKAGE_EXTRA_ARCHS:tune-mips64el-nf-o32 = "mipsel-nf mips64el-nf-o32"