diff options
author | Dan Tejada <dan.tejada@cantada.com> | 2020-04-23 03:25:04 (GMT) |
---|---|---|
committer | Dan Tejada <dan.tejada@cantada.com> | 2020-05-21 01:16:14 (GMT) |
commit | d532f025420de029914fb43734dec6be9b7128f6 (patch) | |
tree | 87ca7378e9d1197dbf0d052d723158452c40161b /scripts | |
parent | 75d7525aa1698a8bd8dd0c6b78819846fe2ec869 (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')
-rw-r--r-- | scripts/build/arch/c6x.sh | 81 | ||||
-rw-r--r-- | scripts/build/kernel/linux.sh | 2 |
2 files changed, 82 insertions, 1 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 +} diff --git a/scripts/build/kernel/linux.sh b/scripts/build/kernel/linux.sh index bfeadf0..4c96257 100644 --- a/scripts/build/kernel/linux.sh +++ b/scripts/build/kernel/linux.sh @@ -10,7 +10,7 @@ CT_DoKernelTupleValues() # should be added here when someone starts to care about them. case "${CT_ARCH}" in arm*) CT_TARGET_KERNEL="linux" ;; - m68k|xtensa*) CT_TARGET_KERNEL="uclinux" ;; + c6x|m68k|xtensa*) CT_TARGET_KERNEL="uclinux" ;; *) CT_Abort "Unsupported no-mmu arch '${CT_ARCH}'" esac fi |