Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp484360pxb; Thu, 12 Aug 2021 22:42:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwn6hoo5NaUydQtrfJZ1FBKQ5kcf5XY0vcZCFYRoES42ohwteEJ3cfTp6LZcBdgUUhXdbCQ X-Received: by 2002:a17:906:e20f:: with SMTP id gf15mr867766ejb.0.1628833374911; Thu, 12 Aug 2021 22:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628833374; cv=none; d=google.com; s=arc-20160816; b=dwbBywS4sR+tL7bD6xOd5SodAK2XG2HM2G5fgXcT5o0rNxhf7xr1U35q4Uof+X6O+2 Enyna2LKdLxj9xiR8uS1hVLv4IXWAsUavg8GY8FSvKrO70hdmn0fOIiBiW3kqS62yP/2 zU8nc56QmyAY1TanrNHmCP0aec5Rfw9tW4h5YNMAHRumbzX/cxixFR0iqPMn7Yly+mQ0 zkow1SFOhPUlkV7pp0DpM8wOyyNuCC2MEOnGcBva9MGzn9OqO6333hpbP9+yZPHOXWst khtq05SmlHcAcsvLeSGjR1fi5uO4PJtHCW0dOmtFsO27T/bDm/TR3fKFY1FPpqKrp5g6 Bnkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=SjY0/FqpdDSUzmYDD6o6NUxD8vYkaJFdfIaMbxp4reQ=; b=T7Km6kvRzJLvv3Fo8C1cla08mCoKC6qeC6Fxgd7HN3k5MZLIwQpXGJ0m0/gUSDJdQB onhk92UJ1ZaznnZtUGHqljmPz60IAYhALb4Whv6nHy2ZqOc6g9PswB0AmWF0tHBiwEOS A96y4eIwuj9LlFQhJRl7trLCYDeU6e0IaObL4mJnps7ZcwmaAhpVIuPZV15AvKMmOFvY 2jaLffp/HTGsBnC8WMfVmi/TTJ+TKf9forG36Y8fVrKVzEz6D4h9lnN/JMsu/9q80Hjx 32mSFQmRbRdFYBrY+8Fm0L8YU8uCorSfWSJabBQbj71cPga4AJ4SWJSiLoyVHFoiu27I vS/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Pom5kFB+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si513068edu.93.2021.08.12.22.42.31; Thu, 12 Aug 2021 22:42:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Pom5kFB+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235170AbhHMFc6 (ORCPT + 99 others); Fri, 13 Aug 2021 01:32:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229654AbhHMFc4 (ORCPT ); Fri, 13 Aug 2021 01:32:56 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41466C061756 for ; Thu, 12 Aug 2021 22:32:30 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id w5so16201665ejq.2 for ; Thu, 12 Aug 2021 22:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SjY0/FqpdDSUzmYDD6o6NUxD8vYkaJFdfIaMbxp4reQ=; b=Pom5kFB+D2EtF1yj0MgO35Ntwe7FczYHcIaX7Xgf/ypWo0eEV5SmBEpNDebM3FXl/b gLznHtg0E7u58vlgLjBSExfjkqGfMl80GAVfdoWRmC+7iRQ3XFNRKvgH+zfwKlRYr0ug 5U+4t6lR4VZRtPkjPHxN16aIeXuowoF7AIyKNYAltWh91UoDQxVP5bZtu3y+I5Bb/tV2 SK9hN16AGRpOHjDuAC/r5Yp2PBCyn10zO2N+7KNC6ACm6CBCcyJfw+NjBxfkMeaNHz0z FhdYvqivjRJp3rUeJu1anTWoBajQUaH8ZXH0OWB9WYYKnv63CjXQIu3osh6c2K0+04le 5arA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SjY0/FqpdDSUzmYDD6o6NUxD8vYkaJFdfIaMbxp4reQ=; b=KInn4FQexxHye36GYkB62QjVSsHpfmTfspuY7e5dJHsv2r1JJ0qdeykrKuhZyxfnT9 YNke+q2K9rjpEmriIQgeWnUl3WqLS7uQeDYsZykT5IpNOLdPrVIEBiyve5RhzYmcppXa WClejsqAFV6UxxuKYySKI7DBIn4C3u5exK/abGpqb/cLNZgKEulhE/tXT0l65EwisVvB GL/JxFVMuggUA82+yO0OZb0mAb/BGEO9f6XZh9p0BupWGsGvg0/hxw2lwqH/YoSzVvf+ Eg0vOAO3b/px33tmAjK/aGXomTnKcSQs7qxdvFWEYqnq2PNBKPvU2OIwZfAwEeL9rKLK 8HtQ== X-Gm-Message-State: AOAM5316nGT+A6JDBvb+Gv90bVn3Udvg9WjUTO4dSWegMAvRtpInxUaZ CVGC6hW0dWw2BBbgxRO70SVssEudqyo7OwmYHVo= X-Received: by 2002:a17:906:4ad8:: with SMTP id u24mr809791ejt.186.1628832748914; Thu, 12 Aug 2021 22:32:28 -0700 (PDT) MIME-Version: 1.0 References: <20210811163731.186125-1-masahiroy@kernel.org> <20210811163731.186125-4-masahiroy@kernel.org> In-Reply-To: <20210811163731.186125-4-masahiroy@kernel.org> From: Max Filippov Date: Thu, 12 Aug 2021 22:32:17 -0700 Message-ID: Subject: Re: [PATCH 4/4] xtensa: move core-y in arch/xtensa/Makefile to arch/xtensa/Kbuild To: Masahiro Yamada Cc: Chris Zankel , "open list:TENSILICA XTENSA PORT (xtensa)" , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 11, 2021 at 9:38 AM Masahiro Yamada wrote: > > Use obj-y to clean up Makefile. > > Signed-off-by: Masahiro Yamada > --- > > arch/xtensa/Kbuild | 1 + > arch/xtensa/Makefile | 3 --- > arch/xtensa/platforms/Makefile | 4 ++++ > 3 files changed, 5 insertions(+), 3 deletions(-) > create mode 100644 arch/xtensa/platforms/Makefile > > diff --git a/arch/xtensa/Kbuild b/arch/xtensa/Kbuild > index a4e40e534e6a..fd12f61745ba 100644 > --- a/arch/xtensa/Kbuild > +++ b/arch/xtensa/Kbuild > @@ -1 +1,2 @@ > # SPDX-License-Identifier: GPL-2.0-only > +obj-y += kernel/ mm/ platforms/ boot/dts/ > diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile > index 093e87b889be..96714ef7c89e 100644 > --- a/arch/xtensa/Makefile > +++ b/arch/xtensa/Makefile > @@ -58,9 +58,6 @@ KBUILD_DEFCONFIG := iss_defconfig > LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) > > head-y := arch/xtensa/kernel/head.o > -core-y += arch/xtensa/kernel/ arch/xtensa/mm/ > -core-y += arch/xtensa/platforms/$(platform-y)/ > -core-y += arch/xtensa/boot/dts/ > > libs-y += arch/xtensa/lib/ $(LIBGCC) > > diff --git a/arch/xtensa/platforms/Makefile b/arch/xtensa/platforms/Makefile > new file mode 100644 > index 000000000000..e2e7e0726979 > --- /dev/null > +++ b/arch/xtensa/platforms/Makefile > @@ -0,0 +1,4 @@ > +# SPDX-License-Identifier: GPL-2.0-only > +obj-$(CONFIG_XTENSA_PLATFORM_XT2000) += xt2000/ > +obj-$(CONFIG_XTENSA_PLATFORM_ISS) += iss/ > +obj-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += xtfpga/ With this change platform directory names are duplicated in two makefiles. Can we move them to Kconfig with something like the following (on top of this change)? ---8<--- diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index b843902ad9fd..fe5ae5ec71c9 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig @@ -314,6 +314,12 @@ config PLATFORM_HAVE_XIP menu "Platform options" +config XTENSA_PLATFORM + string + default iss if XTENSA_PLATFORM_ISS + default xt2000 if XTENSA_PLATFORM_XT2000 + default xtfpga if XTENSA_PLATFORM_XTFPGA + choice prompt "Xtensa System Type" default XTENSA_PLATFORM_ISS diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile index 96714ef7c89e..6b104ecdd19e 100644 --- a/arch/xtensa/Makefile +++ b/arch/xtensa/Makefile @@ -26,12 +26,6 @@ ifneq ($(VARIANT),) endif endif -# Platform configuration - -platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000 -platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss -platform-$(CONFIG_XTENSA_PLATFORM_XTFPGA) := xtfpga - # temporarily until string.h is fixed KBUILD_CFLAGS += -ffreestanding -D__linux__ KBUILD_CFLAGS += -pipe -mlongcalls -mtext-section-literals @@ -47,7 +41,7 @@ endif CHECKFLAGS += -D$(if $(CONFIG_CPU_BIG_ENDIAN),__XTENSA_EB__,__XTENSA_EL__) vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y)) -plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y)) +plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(CONFIG_XTENSA_PLATFORM)) KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs)) diff --git a/arch/xtensa/platforms/Makefile b/arch/xtensa/platforms/Makefile index e2e7e0726979..08d0e9053db6 100644 --- a/arch/xtensa/platforms/Makefile +++ b/arch/xtensa/platforms/Makefile @@ -1,4 +1,2 @@ # SPDX-License-Identifier: GPL-2.0-only -obj-$(CONFIG_XTENSA_PLATFORM_XT2000) += xt2000/ -obj-$(CONFIG_XTENSA_PLATFORM_ISS) += iss/ -obj-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += xtfpga/ +obj-y += $(CONFIG_XTENSA_PLATFORM)/ ---8<--- -- Thanks. -- Max