From patchwork Mon Jan 18 17:51:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 569639 X-Patchwork-Delegate: nbd@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D928C14030F for ; Tue, 19 Jan 2016 04:53:18 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 4F40E28C6D6; Mon, 18 Jan 2016 18:51:53 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id AF4C828C6DE for ; Mon, 18 Jan 2016 18:51:43 +0100 (CET) X-policyd-weight: using cached result; rate:hard: -8.5 Received: from smtprelay.synopsys.com (smtprelay4.synopsys.com [198.182.47.9]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 18 Jan 2016 18:51:38 +0100 (CET) Received: from us02secmta2.synopsys.com (us02secmta2.synopsys.com [10.12.235.98]) by smtprelay.synopsys.com (Postfix) with ESMTP id 8C54A24E0639; Mon, 18 Jan 2016 09:52:15 -0800 (PST) Received: from us02secmta2.internal.synopsys.com (us02secmta2.internal.synopsys.com [127.0.0.1]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id 8003155F13; Mon, 18 Jan 2016 09:52:15 -0800 (PST) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id 4DFEE55F02; Mon, 18 Jan 2016 09:52:15 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 388FA9F6; Mon, 18 Jan 2016 09:52:15 -0800 (PST) Received: from ltrimas-z400.internal.synopsys.com (ltrimas-z400.internal.synopsys.com [10.121.8.143]) by mailhost.synopsys.com (Postfix) with ESMTP id C0DDF9E3; Mon, 18 Jan 2016 09:52:13 -0800 (PST) From: Alexey Brodkin To: openwrt-devel@lists.openwrt.org Date: Mon, 18 Jan 2016 20:51:57 +0300 Message-Id: <1453139518-558-2-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1453139518-558-1-git-send-email-abrodkin@synopsys.com> References: <1453139518-558-1-git-send-email-abrodkin@synopsys.com> Cc: Alexey Brodkin , Jonas Gorski Subject: [OpenWrt-Devel] [PATCH 1/2 v2] toolchain: add support of ARCv2 architecture X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" This change adds support of ARC ISAv2 processors in OpenWRT toolchain. In general gcc for ARC may compile code for both ISA versions simultaneously but libgcc will be built only for default architecture that's why it's necessary to specify --with-cpu on gcc configuration. As for uClibc we need to use different configurations for different ARC ISAs. Signed-off-by: Alexey Brodkin Cc: Felix Fietkau Cc: Jo-Philipp Wich Cc: Jonas Gorski --- Changes v1 -> v2: * Toolchain changes were moved to a separate patch toolchain/gcc/common.mk | 1 + toolchain/uClibc/common.mk | 3 ++- toolchain/uClibc/config/archs | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 toolchain/uClibc/config/archs diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk index 648cd2d..458215f 100644 --- a/toolchain/gcc/common.mk +++ b/toolchain/gcc/common.mk @@ -133,6 +133,7 @@ GCC_CONFIGURE:= \ $(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \ $(if $(CONFIG_mips64)$(CONFIG_mips64el),--with-arch=mips64 \ --with-abi=$(call qstrip,$(CONFIG_MIPS64_ABI))) \ + $(if $(CONFIG_arc),--with-cpu=$(CONFIG_CPU_TYPE)) \ --with-gmp=$(TOPDIR)/staging_dir/host \ --with-mpfr=$(TOPDIR)/staging_dir/host \ --with-mpc=$(TOPDIR)/staging_dir/host \ diff --git a/toolchain/uClibc/common.mk b/toolchain/uClibc/common.mk index ad6ff02..2828156 100644 --- a/toolchain/uClibc/common.mk +++ b/toolchain/uClibc/common.mk @@ -41,8 +41,9 @@ GEN_CONFIG=$(SCRIPT_DIR)/kconfig.pl -n \ $(if $(CONFIG_UCLIBC_ENABLE_DEBUG),$(if $(wildcard $(CONFIG_DIR)/debug),'+' $(CONFIG_DIR)/debug)) \ $(CONFIG_DIR)/$(ARCH)$(strip \ $(if $(wildcard $(CONFIG_DIR)/$(ARCH).$(BOARD)),.$(BOARD), \ + $(if $(filter archs,$(subst ",,$(CONFIG_CPU_TYPE))),hs, \ $(if $(CONFIG_MIPS64_ABI),.$(subst ",,$(CONFIG_MIPS64_ABI)), \ - $(if $(CONFIG_HAS_SPE_FPU),$(if $(wildcard $(CONFIG_DIR)/$(ARCH).e500),.e500))))) + $(if $(CONFIG_HAS_SPE_FPU),$(if $(wildcard $(CONFIG_DIR)/$(ARCH).e500),.e500)))))) CPU_CFLAGS = \ -funsigned-char -fno-builtin -fno-asm \ diff --git a/toolchain/uClibc/config/archs b/toolchain/uClibc/config/archs new file mode 100644 index 0000000..961628e --- /dev/null +++ b/toolchain/uClibc/config/archs @@ -0,0 +1,10 @@ +ARCH_ANY_ENDIAN=y +ARCH_LITTLE_ENDIAN=y +ARCH_WANTS_LITTLE_ENDIAN=y +TARGET_ARCH="arc" +TARGET_arc=y +# CONFIG_ARC_CPU_700 is not set +CONFIG_ARC_CPU_HS=y +CONFIG_ARC_PAGE_SIZE_8K=y +# CONFIG_ARC_PAGE_SIZE_16K is not set +# CONFIG_ARC_PAGE_SIZE_4K is not set