diff options
author | Ionela Voinescu <ionela.voinescu@imgtec.com> | 2014-09-24 17:05:33 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-03-21 11:07:50 +0100 |
commit | ce22c023878d2b2e5963f379857ccec4815aeede (patch) | |
tree | b047099359cc3695ac939803cd643c2f2de8afd3 /payloads/libpayload/util | |
parent | 51421633d534752c2d677a5255f9583ecdcd4a60 (diff) |
libpayload: arch/mips: Add basic MIPS architecture support
Add the basic build infrastructure and architectural support
required to build for targets using the MIPS architecture.
This will require the addition of cache maintenance.
BUG=chrome-os-partner:31438
TEST=tested on Pistachio FPGA with Depthcharge as payload;
successfully executed payload.
BRANCH=none
Change-Id: I75cfd0536860b6d84b53a567940fe6668d9b2cbb
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 758c8cb9a6846e6ca32be409ec5f7a888ac9c888
Original-Signed-off-by: Ionela Voinescu <ionela.voinescu@imgtec.com>
Original-Change-Id: I0b9af983bf5032335a519ce2510a0b3aca082edf
Original-Reviewed-on: https://chromium-review.googlesource.com/219740
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/8741
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'payloads/libpayload/util')
-rw-r--r-- | payloads/libpayload/util/xcompile/xcompile | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/payloads/libpayload/util/xcompile/xcompile b/payloads/libpayload/util/xcompile/xcompile index 9cc2d6923e..214e9afe21 100644 --- a/payloads/libpayload/util/xcompile/xcompile +++ b/payloads/libpayload/util/xcompile/xcompile @@ -110,11 +110,13 @@ detect_special_flags() { # testcc "$CC" "$CFLAGS -mcpu=cortex-a9" && # CFLAGS="$CFLAGS -mcpu=cortex-a9" ;; - esac - case "$architecture" in arm64-generic ) ;; + mips ) + testcc "$CC" "CFLAGS -mxgot" && + CFLAGS="$CFLAGS -mxgot" + ;; esac } @@ -140,7 +142,7 @@ touch "$TMPFILE" trap clean_up EXIT # Architecture definition -SUPPORTED_ARCHITECTURE="x86 arm arm64" +SUPPORTED_ARCHITECTURE="arm arm64 mipsel x86" # ARM Architecture TARCH_arm="arm" @@ -154,18 +156,25 @@ TBFDARCH_arm64="littleaarch64" TCLIST_arm64="aarch64" TWIDTH_arm64="64" +# MIPS Architecture (Little Endian) +TARCH_mipsel="mipsel" +TBFDARCH_mipsel="tradlittlemips littlemips" +TCLIST_mipsel="mipsel" +TWIDTH_mipsel="32" + # X86 Architecture TARCH_x86="i386" TBFDARCH_x86="i386" TCLIST_x86="i386 x86_64" TWIDTH_x86="32" + XGCCPATH=${1:-"`pwd`/../../util/crossgcc/xgcc/bin/"} # This loops over all supported architectures. for architecture in $SUPPORTED_ARCHITECTURE; do GCCPREFIX="invalid" TARCH="$(eval echo \$TARCH_$architecture)" - TBFDARCH="$(eval echo \$TBFDARCH_$architecture)" + TBFDARCHS="$(eval echo \$TBFDARCH_$architecture)" TCLIST="$(eval echo \$TCLIST_$architecture)" TWIDTH="$(eval echo \$TWIDTH_$architecture)" [ -z "$TARCH" -o -z "$TCLIST" -o -z "$TWIDTH" ] && @@ -186,10 +195,13 @@ for architecture in $SUPPORTED_ARCHITECTURE; do echo "# $architecture TARCH_SEARCH=$search" # Search toolchain by checking assembler capability. - for gccprefixes in $search ""; do - program_exists "${gccprefixes}as" || continue - testas "$gccprefixes" "$TWIDTH" "$TBFDARCH" "" && break - testas "$gccprefixes" "$TWIDTH" "$TBFDARCH" "TRUE" && break + for TBFDARCH in $TBFDARCHS; do + for gccprefixes in $search ""; do + program_exists "${gccprefixes}as" || continue + testas "$gccprefixes" "$TWIDTH" "$TBFDARCH" "" && break + testas "$gccprefixes" "$TWIDTH" "$TBFDARCH" "TRUE" && break + done + [ "$GCCPREFIX" = "invalid" ] || break done if [ "$GCCPREFIX" = "invalid" ]; then |