diff options
author | Chris Packham <judge.packham@gmail.com> | 2020-11-10 07:29:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-10 07:29:25 (GMT) |
commit | a4231a555a3f897ecb32aad2069de4305ce0a969 (patch) | |
tree | d7e2127ff0c795a7641d617b54fa0d26c898f20d /scripts | |
parent | 66b3c25be73ff9bd1894492fef32b786f921d53c (diff) | |
parent | 3a3e645245d4cc84957209ec4313bfd6635acdec (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')
-rw-r--r-- | scripts/build/arch/c6x.sh | 79 | ||||
-rw-r--r-- | scripts/build/kernel/linux.sh | 2 |
2 files changed, 80 insertions, 1 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 +} 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 |