From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9F8EC433DF for ; Fri, 29 May 2020 11:55:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B9A9620776 for ; Fri, 29 May 2020 11:55:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="MEFuw0nb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726860AbgE2Lz4 (ORCPT ); Fri, 29 May 2020 07:55:56 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.87.133]:33922 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725865AbgE2Lzz (ORCPT ); Fri, 29 May 2020 07:55:55 -0400 Received: from mailhost.synopsys.com (mdc-mailhost2.synopsys.com [10.225.0.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 92F7BC041D; Fri, 29 May 2020 11:55:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1590753354; bh=HAPFFec+/Hlkj9FbESiTvhmKn3vHH0RVoyQrcedk9fo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MEFuw0nbGW0bAmc5/Hos7ILiqxxnJEY+vhe1axOXnlgQyGDazgaR84W08G0lVFCIr Sl4hSMx0j1f6q7aCg4CQghjkAcQ7krLFPl45yC8U7rtcWIJCxpCDXG5DX3G62CbE1b xcr2giTwD52KF8gW7sP1T7zTOCphe1y4uBgcgKSLHp9KDseHXGrxonnLwdqfpVPUQR 4WrmNMXi6/HE7q+9sBzlcV0D8C2A0ALZ1FHweAooQIrmaeylEdGO3eBj46WUbovDGc IqLA4mGIT3RTp4O3FQpX0BUk8LMZM4Gipytkq1pVoI+0UahJve3XgQ1HJZ2NVI+JWg rXItvqPrOoRRA== Received: from paltsev-e7480.internal.synopsys.com (ru20-e7250.internal.synopsys.com [10.225.50.16]) by mailhost.synopsys.com (Postfix) with ESMTP id 13778A0067; Fri, 29 May 2020 11:55:53 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Eugeniy Paltsev To: linux-snps-arc@lists.infradead.org, Vineet Gupta Cc: linux-kernel@vger.kernel.org, Alexey Brodkin , Eugeniy Paltsev Subject: [PATCH private 1/3] ARC: allow to overwrite default mcpu compiler flag Date: Fri, 29 May 2020 14:55:32 +0300 Message-Id: <20200529115534.22883-3-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200529115534.22883-1-Eugeniy.Paltsev@synopsys.com> References: <20200529115534.22883-1-Eugeniy.Paltsev@synopsys.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org By default we set -mcpu=xxx compiler flag depending on the CPU ISA version. It's good starting point, however that may be not enough as for some platforms we may want to use some specific 'mcpu' options for better optimization or to workaround HW issues. We are going to use this option for HSDK-4xD board support. In addition it also allows to awoid patching 'mcpu' in ARC Makefile when we building Linux for some non-standard simulation or FPGA-based platforms. Signed-off-by: Eugeniy Paltsev --- arch/arc/Kconfig | 7 +++++++ arch/arc/Makefile | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index ff306246d0f8..e7805db10f7a 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig @@ -377,6 +377,13 @@ config ARC_HAS_SWAPE bool "Insn: SWAPE (endian-swap)" default y +config ARC_MCPU_OVERWRITE + string "Overwrite default -mcpu compiler flag" + default "" + help + Overwrite default -mcpu=xxx compiler flag (which is set depending on + the ISA version) with the specified value. + if ISA_ARCV2 config ARC_USE_UNALIGNED_MEM_ACCESS diff --git a/arch/arc/Makefile b/arch/arc/Makefile index 20e9ab6cc521..1b37e44d9b57 100644 --- a/arch/arc/Makefile +++ b/arch/arc/Makefile @@ -10,8 +10,12 @@ CROSS_COMPILE := $(call cc-cross-prefix, arc-linux- arceb-linux-) endif cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__ +ifeq ($(CONFIG_ARC_MCPU_OVERWRITE),"") cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7 cflags-$(CONFIG_ISA_ARCV2) += -mcpu=hs38 +else +cflags-y += $(shell echo $(CONFIG_ARC_MCPU_OVERWRITE)) +endif ifdef CONFIG_ARC_CURR_IN_REG # For a global register defintion, make sure it gets passed to every file -- 2.21.3