Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | # 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 | |
| 7 | DEFAULTTUNE ?= "mips" |
| 8 | |
| 9 | # Endianess |
| 10 | TUNEVALID[bigendian] = "Enable big-endian mode" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 11 | TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', ' -meb', ' -mel', d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 12 | |
| 13 | # ABI flags |
| 14 | TUNEVALID[o32] = "MIPS o32 ABI" |
| 15 | TUNECONFLICTS[o32] = "n32 n64" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 16 | TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'o32', ' -mabi=32', '', d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 17 | |
| 18 | TUNEVALID[n32] = "MIPS64 n32 ABI" |
| 19 | TUNECONFLICTS[n32] = "o32 n64" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 20 | ABIEXTENSION .= "${@bb.utils.filter('TUNE_FEATURES', 'n32' ,d)}" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 21 | TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'n32', ' -mabi=n32', '', d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 22 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 23 | # user mode qemu doesn't support mips64 n32: "Invalid ELF image for this architecture" |
| 24 | MACHINE_FEATURES_BACKFILL_CONSIDERED_append = " ${@bb.utils.contains('TUNE_FEATURES', 'n32', 'qemu-usermode', '', d)}" |
| 25 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | TUNEVALID[n64] = "MIPS64 n64 ABI" |
| 27 | TUNECONFLICTS[n64] = "o32 n32" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 28 | TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'n64', ' -mabi=64', '', d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 29 | |
| 30 | # Floating point |
| 31 | TUNEVALID[fpu-hard] = "Use hardware FPU" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 32 | TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard', ' -mhard-float', ' -msoft-float', d)}" |
| 33 | TARGET_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard', '', 'soft', d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 34 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 35 | # MIPS r6 ABI |
| 36 | TUNEVALID[r6] = "Use r6" |
| 37 | TUNEVALID[mipsisa64r6] = "Use 64r6" |
| 38 | TUNEVALID[mipsisa32r6] = "Use 32r6" |
| 39 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 40 | # Package naming |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 41 | MIPSPKGSFX_ENDIAN = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', '', 'el', d)}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 42 | MIPSPKGSFX_ENDIAN2 = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', 'eb', 'el', d)}" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 43 | MIPSPKGSFX_BYTE = "${@bb.utils.contains('TUNE_FEATURES', 'n64' , '64', '', d)}" |
| 44 | MIPSPKGSFX_BYTE .= "${@bb.utils.contains('TUNE_FEATURES', 'n32' , '64', '', d)}" |
| 45 | MIPSPKGSFX_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard' , '', '-nf', d)}" |
| 46 | MIPSPKGSFX_ABI = "${@bb.utils.contains('TUNE_FEATURES', 'n32', '-n32', '', d)}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 47 | MIPSPKGSFX_R6 = "${@bb.utils.filter('TUNE_FEATURES', 'r6', d)}" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 48 | MIPSPKGSFX_64R6 = "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa64r6', 'isa', '', d)}" |
| 49 | MIPSPKGSFX_32R6 = "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa32r6', 'isa32', '', d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 50 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 51 | TUNE_ARCH = "mips${MIPSPKGSFX_32R6}${MIPSPKGSFX_64R6}${MIPSPKGSFX_BYTE}${MIPSPKGSFX_R6}${MIPSPKGSFX_ENDIAN}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 52 | TUNE_PKGARCH = "${MIPSPKGSFX_VARIANT_tune-${DEFAULTTUNE}}${MIPSPKGSFX_FPU}${MIPSPKGSFX_ABI}" |
| 53 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 54 | # Various Global Machine Overrides |
| 55 | MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n64', 'mipsarchn64${MIPSPKGSFX_ENDIAN2}:', '' ,d)}" |
| 56 | MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'o32', 'mipsarcho32${MIPSPKGSFX_ENDIAN2}:', '' ,d)}" |
| 57 | MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n32', 'mipsarchn32${MIPSPKGSFX_ENDIAN2}:', '' ,d)}" |
| 58 | MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n64', 'mipsarchn64:', '' ,d)}" |
| 59 | MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'o32', 'mipsarcho32:', '' ,d)}" |
| 60 | MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n32', 'mipsarchn32:', '' ,d)}" |
| 61 | MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'r6', 'mipsarchr6:', '' ,d)}" |
| 62 | MACHINEOVERRIDES =. "mipsarch${MIPSPKGSFX_ENDIAN2}:" |
| 63 | MACHINEOVERRIDES =. "mipsarch:" |
| 64 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 65 | # Base tunes |
| 66 | AVAILTUNES += "mips mips64-n32 mips64 mipsel mips64el-n32 mips64el mips-nf mips64-nf-n32 mips64-nf mipsel-nf mips64el-nf-n32 mips64el-nf" |
| 67 | TUNE_FEATURES_tune-mips = "o32 bigendian fpu-hard" |
| 68 | BASE_LIB_tune-mips = "lib" |
| 69 | MIPSPKGSFX_VARIANT_tune-mips = "${TUNE_ARCH}" |
| 70 | PACKAGE_EXTRA_ARCHS_tune-mips = "mips" |
| 71 | |
| 72 | TUNE_FEATURES_tune-mips64-n32 = "n32 bigendian fpu-hard" |
| 73 | BASE_LIB_tune-mips64-n32 = "lib32" |
| 74 | MIPSPKGSFX_VARIANT_tune-mips64-n32 = "${TUNE_ARCH}" |
| 75 | PACKAGE_EXTRA_ARCHS_tune-mips64-n32 = "mips64-n32" |
| 76 | |
| 77 | TUNE_FEATURES_tune-mips64 = "n64 bigendian fpu-hard" |
| 78 | BASE_LIB_tune-mips64 = "lib64" |
| 79 | MIPSPKGSFX_VARIANT_tune-mips64 = "${TUNE_ARCH}" |
| 80 | PACKAGE_EXTRA_ARCHS_tune-mips64 = "mips64" |
| 81 | |
| 82 | TUNE_FEATURES_tune-mipsel = "o32 fpu-hard" |
| 83 | BASE_LIB_tune-mipsel = "lib" |
| 84 | MIPSPKGSFX_VARIANT_tune-mipsel = "${TUNE_ARCH}" |
| 85 | PACKAGE_EXTRA_ARCHS_tune-mipsel = "mipsel" |
| 86 | |
| 87 | TUNE_FEATURES_tune-mips64el-n32 = "n32 fpu-hard" |
| 88 | BASE_LIB_tune-mips64el-n32 = "lib32" |
| 89 | MIPSPKGSFX_VARIANT_tune-mips64el-n32 = "${TUNE_ARCH}" |
| 90 | PACKAGE_EXTRA_ARCHS_tune-mips64el-n32 = "mips64el-n32" |
| 91 | |
| 92 | TUNE_FEATURES_tune-mips64el = "n64 fpu-hard" |
| 93 | BASE_LIB_tune-mips64el = "lib64" |
| 94 | MIPSPKGSFX_VARIANT_tune-mips64el = "${TUNE_ARCH}" |
| 95 | PACKAGE_EXTRA_ARCHS_tune-mips64el = "mips64el" |
| 96 | |
| 97 | TUNE_FEATURES_tune-mips-nf = "o32 bigendian" |
| 98 | BASE_LIB_tune-mips-nf = "lib" |
| 99 | MIPSPKGSFX_VARIANT_tune-mips-nf = "${TUNE_ARCH}" |
| 100 | PACKAGE_EXTRA_ARCHS_tune-mips-nf = "mips-nf" |
| 101 | |
| 102 | TUNE_FEATURES_tune-mips64-nf-n32 = "n32 bigendian" |
| 103 | BASE_LIB_tune-mips64-nf-n32 = "lib32" |
| 104 | MIPSPKGSFX_VARIANT_tune-mips64-nf-n32 = "${TUNE_ARCH}" |
| 105 | PACKAGE_EXTRA_ARCHS_tune-mips64-nf-n32 = "mips64-nf-n32" |
| 106 | |
| 107 | TUNE_FEATURES_tune-mips64-nf = "n64 bigendian" |
| 108 | BASE_LIB_tune-mips64-nf = "lib64" |
| 109 | MIPSPKGSFX_VARIANT_tune-mips64-nf = "${TUNE_ARCH}" |
| 110 | PACKAGE_EXTRA_ARCHS_tune-mips64-nf = "mips64-nf" |
| 111 | |
| 112 | TUNE_FEATURES_tune-mipsel-nf = "o32" |
| 113 | BASE_LIB_tune-mipsel-nf = "lib" |
| 114 | MIPSPKGSFX_VARIANT_tune-mipsel-nf = "${TUNE_ARCH}" |
| 115 | PACKAGE_EXTRA_ARCHS_tune-mipsel-nf = "mipsel-nf" |
| 116 | |
| 117 | TUNE_FEATURES_tune-mips64el-nf-n32 = "n32" |
| 118 | BASE_LIB_tune-mips64el-nf-n32 = "lib32" |
| 119 | MIPSPKGSFX_VARIANT_tune-mips64el-nf-n32 = "${TUNE_ARCH}" |
| 120 | PACKAGE_EXTRA_ARCHS_tune-mips64el-nf-n32 = "mips64el-nf-n32" |
| 121 | |
| 122 | TUNE_FEATURES_tune-mips64el-nf = "n64" |
| 123 | BASE_LIB_tune-mips64el-nf = "lib64" |
| 124 | MIPSPKGSFX_VARIANT_tune-mips64el-nf = "${TUNE_ARCH}" |
| 125 | PACKAGE_EXTRA_ARCHS_tune-mips64el-nf = "mips64el-nf" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 126 | |
| 127 | # MIPS 64 + o32 |
| 128 | AVAILTUNES += "mips64-o32 mips64el-o32" |
| 129 | |
| 130 | TUNE_FEATURES_tune-mips64-o32 = "o32 bigendian fpu-hard" |
| 131 | BASE_LIB_tune-mips64-o32 = "lib" |
| 132 | MIPSPKGSFX_VARIANT_tune-mips64-o32 = "${TUNE_ARCH}" |
| 133 | PACKAGE_EXTRA_ARCHS_tune-mips64-o32 = "mips mips64-o32" |
| 134 | |
| 135 | TUNE_FEATURES_tune-mips64el-o32 = "o32 fpu-hard" |
| 136 | BASE_LIB_tune-mips64el-o32 = "lib" |
| 137 | MIPSPKGSFX_VARIANT_tune-mips64el-o32 = "${TUNE_ARCH}" |
| 138 | PACKAGE_EXTRA_ARCHS_tune-mips64el-o32 = "mipsel mips64el-o32 mips64el-o32" |
| 139 | |
| 140 | # MIPS 64 o32 and Soft Float |
| 141 | AVAILTUNES += "mips64-nf-o32 mips64el-nf-o32" |
| 142 | |
| 143 | TUNE_FEATURES_tune-mips64-nf-o32 = "o32 bigendian" |
| 144 | BASE_LIB_tune-mips64-nf-o32 = "lib" |
| 145 | MIPSPKGSFX_VARIANT_tune-mips64-nf-o32 = "${TUNE_ARCH}" |
| 146 | PACKAGE_EXTRA_ARCHS_tune-mips64-nf-o32 = "mips-nf mips64-nf-o32" |
| 147 | |
| 148 | TUNE_FEATURES_tune-mips64el-nf-o32 = "o32" |
| 149 | BASE_LIB_tune-mips64el-nf-o32 = "lib" |
| 150 | MIPSPKGSFX_VARIANT_tune-mips64el-nf-o32 = "${TUNE_ARCH}" |
| 151 | PACKAGE_EXTRA_ARCHS_tune-mips64el-nf-o32 = "mipsel-nf mips64el-nf-o32" |