summaryrefslogtreecommitdiff
path: root/scripts/build/arch
diff options
context:
space:
mode:
authorChris Packham <judge.packham@gmail.com>2020-11-10 07:29:25 (GMT)
committerGitHub <noreply@github.com>2020-11-10 07:29:25 (GMT)
commita4231a555a3f897ecb32aad2069de4305ce0a969 (patch)
treed7e2127ff0c795a7641d617b54fa0d26c898f20d /scripts/build/arch
parent66b3c25be73ff9bd1894492fef32b786f921d53c (diff)
parent3a3e645245d4cc84957209ec4313bfd6635acdec (diff)
Merge pull request #1342 from DspHack/feature/add_support_for_ti_c6x
Experimental: Add support for the Texas Instruments C6X (TMS320C6000 …
Diffstat (limited to 'scripts/build/arch')
-rw-r--r--scripts/build/arch/c6x.sh79
1 files changed, 79 insertions, 0 deletions
diff --git a/scripts/build/arch/c6x.sh b/scripts/build/arch/c6x.sh
new file mode 100644
index 0000000..3eb40e4
--- /dev/null
+++ b/scripts/build/arch/c6x.sh
@@ -0,0 +1,79 @@
+# Compute c6x-specific values
+
+CT_DoArchUClibcConfig() {
+ local cfg="${1}"
+
+ CT_DoArchUClibcSelectArch "${cfg}" "c6x"
+}
+
+CT_DoArchTupleValues() {
+ CT_TARGET_ARCH="tic6x"
+ #binutils does not like uclibc in the tuple
+ if [ "${CT_TARGET_SYS}" = "uclibc" ]; then
+ CT_TARGET_SYS=
+ fi
+}
+
+CT_DoArchUClibcHeaderDir() {
+ local dir_var="${1}"
+ local cflags="${2}"
+
+ # If it is non-default multilib, add a suffix with architecture (reported by gcc)
+ # to the headers installation path.
+ if [ -n "${cflags}" ]; then
+ eval "${dir_var}="$( ${CT_TARGET}-${CT_CC} -print-multiarch ${cflags} )
+ fi
+}
+
+CT_DoArchUClibcCflags() {
+ local cfg="${1}"
+ local cflags="${2}"
+ local f
+
+ # Set default little endian options
+ CT_KconfigDisableOption "ARCH_BIG_ENDIAN" "${cfg}"
+ CT_KconfigDisableOption "ARCH_WANTS_BIG_ENDIAN" "${cfg}"
+ CT_KconfigEnableOption "ARCH_LITTLE_ENDIAN" "${cfg}"
+ CT_KconfigEnableOption "ARCH_WANTS_LITTLE_ENDIAN" "${cfg}"
+
+ # Set arch options based on march switch
+ CT_KconfigDisableOption "CONFIG_TMS320C674X" "${cfg}"
+ CT_KconfigDisableOption "CONFIG_TMS320C64XPLUS" "${cfg}"
+ CT_KconfigDisableOption "CONFIG_TMS320C64X" "${cfg}"
+ CT_KconfigDisableOption "UCLIBC_HAS_FPU" "${cfg}"
+ CT_KconfigEnableOption "CONFIG_GENERIC_C6X" "${cfg}"
+
+ for f in ${cflags}; do
+ case "${f}" in
+ -march=*)
+ case "${f#-march=}" in
+ c674x)
+ CT_KconfigEnableOption "CONFIG_TMS320C674X" "${cfg}"
+ CT_KconfigEnableOption "UCLIBC_HAS_FPU" "${cfg}"
+ CT_KconfigDisableOption "CONFIG_GENERIC_C6X" "${cfg}"
+ ;;
+ c64x+)
+ CT_KconfigEnableOption "CONFIG_TMS320C64XPLUS" "${cfg}"
+ CT_KconfigDisableOption "CONFIG_GENERIC_C6X" "${cfg}"
+ ;;
+ c64x)
+ CT_KconfigEnableOption "CONFIG_TMS320C64X" "${cfg}"
+ CT_KconfigDisableOption "CONFIG_GENERIC_C6X" "${cfg}"
+ ;;
+ c67x)
+ CT_KconfigEnableOption "UCLIBC_HAS_FPU" "${cfg}"
+ ;;
+ c62x)
+ ;;
+ *) CT_Abort "Unsupported architecture: ${f#-march=}";;
+ esac
+ ;;
+ -mbig-endian)
+ CT_KconfigEnableOption "ARCH_BIG_ENDIAN" "${cfg}"
+ CT_KconfigEnableOption "ARCH_WANTS_BIG_ENDIAN" "${cfg}"
+ CT_KconfigDisableOption "ARCH_LITTLE_ENDIAN" "${cfg}"
+ CT_KconfigDisableOption "ARCH_WANTS_LITTLE_ENDIAN" "${cfg}"
+ ;;
+ esac
+ done
+}