summaryrefslogtreecommitdiff
path: root/scripts/build/arch
diff options
context:
space:
mode:
authorDan Tejada <dan.tejada@cantada.com>2020-04-23 03:25:04 (GMT)
committerDan Tejada <dan.tejada@cantada.com>2020-05-21 01:16:14 (GMT)
commitd532f025420de029914fb43734dec6be9b7128f6 (patch)
tree87ca7378e9d1197dbf0d052d723158452c40161b /scripts/build/arch
parent75d7525aa1698a8bd8dd0c6b78819846fe2ec869 (diff)
Experimental: Add support for the Texas Instruments C6X (TMS320C6000 series) DSPs
-- c6x: Add support for c6x product families to pass on to uClibC-ng -- c6x: Fix multilib support -- c6x: Add patch fix internal instruction error (GCC 57295) Signed-off-by: Dan Tejada <dan.tejada@cantada.com>
Diffstat (limited to 'scripts/build/arch')
-rw-r--r--scripts/build/arch/c6x.sh81
1 files changed, 81 insertions, 0 deletions
diff --git a/scripts/build/arch/c6x.sh b/scripts/build/arch/c6x.sh
new file mode 100644
index 0000000..2713389
--- /dev/null
+++ b/scripts/build/arch/c6x.sh
@@ -0,0 +1,81 @@
+# 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
+ ;;
+ -mlittle-endian)
+ ;;
+ -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
+}