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=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 D439AC48BE6 for ; Mon, 14 Jun 2021 20:17:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C22776128A for ; Mon, 14 Jun 2021 20:17:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234988AbhFNUTq (ORCPT ); Mon, 14 Jun 2021 16:19:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60419 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234444AbhFNUTf (ORCPT ); Mon, 14 Jun 2021 16:19:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623701852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=48bjdR1NLAI+LnEF7dKeko2J72GoFENKIfUW9/6F9Ro=; b=UIXXD45ZBGOz2HpkRCaaFk6A8EP3DAjTzpVY5RxQ2o0HAosZ/DLh02I00ygNIQW0MAQATJ zsg7Xy98ZSdoGYB2dD1OMsqexzV+LpE237dqINkYOX1n6wU65ZF13iEaFvzrxsFKPyBn/5 xB8tel0rjAZ5Aeg0rH8qgdmglZf1b6E= Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-449-5EU3T3wRNuW9fI3RUAX7jA-1; Mon, 14 Jun 2021 16:17:30 -0400 X-MC-Unique: 5EU3T3wRNuW9fI3RUAX7jA-1 Received: by mail-oo1-f71.google.com with SMTP id c25-20020a4a28590000b029024a664285fdso7593069oof.23 for ; Mon, 14 Jun 2021 13:17:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=48bjdR1NLAI+LnEF7dKeko2J72GoFENKIfUW9/6F9Ro=; b=W3iQ/0BW5y84oDdrdTPL8Kaa+amqQPUdu3WVWAVike+/9ZqJomiIQzxAyTKXL8VKrI jlsAI7o4n4GkfBRho1hyjBK1Iur48yuiRS/Bz6MI9aDTEZLEvRvXqGw77dcHR5kmToac HZJ5ViQNrfcuVgbYhOaui2TMwku4qKh+R5NIFk8b9Tey4UmluQ6WOQCdpnQgJAOBQqMw HroHaSsje3zh4BeeTX9Qi71EX2XpnXBDuSGM1FvakiOdUwQQSYatjYG3b88F1GRyDb8w 9YwULyR+bTGn4HJKwVk8ooahQtNOom0g0OrU433a7kMf87F62g3c0P1IOBw8GTVwzmf3 bNYg== X-Gm-Message-State: AOAM532jCTs1Wo7YMf8Qf5Hq+rShR5ijtyNcGyOBGapQpqWdW7t76azp Xd69Q8lAdXcfqQbql5Hz2p48vAAadZhMnKTSIXDcu27TfqPamgRIomjX7fmIsR6B8SW2xO0IzkL P1o39Tnh7lAguhuReEqth/JEQ X-Received: by 2002:a05:6830:2476:: with SMTP id x54mr14958022otr.293.1623701849597; Mon, 14 Jun 2021 13:17:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0XFjy3LT1wiB4YYU/Lhzpn8Z5S2BIhQmLh52HqgpzLeC6Pr2Erm4I2ORjMhxDIxuNaaqUXQ== X-Received: by 2002:a05:6830:2476:: with SMTP id x54mr14958004otr.293.1623701849345; Mon, 14 Jun 2021 13:17:29 -0700 (PDT) Received: from localhost.localdomain.com (075-142-250-213.res.spectrum.com. [75.142.250.213]) by smtp.gmail.com with ESMTPSA id b198sm408535oii.19.2021.06.14.13.17.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 13:17:29 -0700 (PDT) From: trix@redhat.com To: hao.wu@intel.com, mdf@kernel.org, corbet@lwn.net, michal.simek@xilinx.com, gregkh@linuxfoundation.org, krzysztof.kozlowski@canonical.com, nava.manne@xilinx.com, yilun.xu@intel.com, davidgow@google.com, fpacheco@redhat.com, richard.gong@intel.com, luca@lucaceresoli.net Cc: linux-fpga@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tom Rix Subject: [PATCH v4 4/4] fpga: lattice: reorganize to subdir layout Date: Mon, 14 Jun 2021 13:16:48 -0700 Message-Id: <20210614201648.3358206-6-trix@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210614201648.3358206-1-trix@redhat.com> References: <20210614201648.3358206-1-trix@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tom Rix Follow drivers/net/ethernet/ which has control configs NET_VENDOR_BLA that map to drivers/net/ethernet/bla Since fpgas do not have many vendors, drop the 'VENDOR' and use FPGA_BLA. There are several new subdirs altera/ dfl/ lattice/ xilinx/ Each subdir has a Kconfig that has a new/reused if FPGA_BLA ... existing configs ... endif FPGA_BLA Which is sourced into the main fpga/Kconfig Each subdir has a Makefile whose transversal is controlled in the fpga/Makefile by obj-$(CONFIG_FPGA_BLA) += bla/ This is the lattice/ subdir part. Create a lattice/ subdir Move ice40* and machxo2* files to it. Add a Kconfig and Makefile Signed-off-by: Tom Rix --- drivers/fpga/Kconfig | 14 +----------- drivers/fpga/Makefile | 13 ++++------- drivers/fpga/lattice/Kconfig | 29 ++++++++++++++++++++++++ drivers/fpga/lattice/Makefile | 4 ++++ drivers/fpga/{ => lattice}/ice40-spi.c | 0 drivers/fpga/{ => lattice}/machxo2-spi.c | 0 6 files changed, 39 insertions(+), 21 deletions(-) create mode 100644 drivers/fpga/lattice/Kconfig create mode 100644 drivers/fpga/lattice/Makefile rename drivers/fpga/{ => lattice}/ice40-spi.c (100%) rename drivers/fpga/{ => lattice}/machxo2-spi.c (100%) diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig index 2c829b1105925..955b155da3575 100644 --- a/drivers/fpga/Kconfig +++ b/drivers/fpga/Kconfig @@ -12,19 +12,6 @@ menuconfig FPGA if FPGA -config FPGA_MGR_ICE40_SPI - tristate "Lattice iCE40 SPI" - depends on OF && SPI - help - FPGA manager driver support for Lattice iCE40 FPGAs over SPI. - -config FPGA_MGR_MACHXO2_SPI - tristate "Lattice MachXO2 SPI" - depends on SPI - help - FPGA manager driver support for Lattice MachXO2 configuration - over slave SPI interface. - config FPGA_BRIDGE tristate "FPGA Bridge Framework" help @@ -48,6 +35,7 @@ config OF_FPGA_REGION source "drivers/fpga/altera/Kconfig" source "drivers/fpga/dfl/Kconfig" +source "drivers/fpga/lattice/Kconfig" source "drivers/fpga/xilinx/Kconfig" endif # FPGA diff --git a/drivers/fpga/Makefile b/drivers/fpga/Makefile index db83aeb997f24..9197698201e3a 100644 --- a/drivers/fpga/Makefile +++ b/drivers/fpga/Makefile @@ -4,19 +4,16 @@ # # Core FPGA Manager Framework -obj-$(CONFIG_FPGA) += fpga-mgr.o - -# FPGA Manager Drivers -obj-$(CONFIG_FPGA_MGR_ICE40_SPI) += ice40-spi.o -obj-$(CONFIG_FPGA_MGR_MACHXO2_SPI) += machxo2-spi.o +obj-$(CONFIG_FPGA) += fpga-mgr.o # FPGA Bridge Drivers -obj-$(CONFIG_FPGA_BRIDGE) += fpga-bridge.o +obj-$(CONFIG_FPGA_BRIDGE) += fpga-bridge.o # High Level Interfaces -obj-$(CONFIG_FPGA_REGION) += fpga-region.o -obj-$(CONFIG_OF_FPGA_REGION) += of-fpga-region.o +obj-$(CONFIG_FPGA_REGION) += fpga-region.o +obj-$(CONFIG_OF_FPGA_REGION) += of-fpga-region.o obj-$(CONFIG_FPGA_ALTERA) += altera/ obj-$(CONFIG_FPGA_DFL) += dfl/ +obj-$(CONFIG_FPGA_LATTICE) += lattice/ obj-$(CONFIG_FPGA_XILINX) += xilinx/ diff --git a/drivers/fpga/lattice/Kconfig b/drivers/fpga/lattice/Kconfig new file mode 100644 index 0000000000000..6c2f1ae17e4f6 --- /dev/null +++ b/drivers/fpga/lattice/Kconfig @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: GPL-2.0-only + +config FPGA_LATTICE + bool "Lattice FPGAs" + default y + help + If you have a lattice fpga, say Y. + + Note that the answer to this question doesn't directly affect the + kernel: saying N will just cause the configurator to skip all + the questions about lattice fpgas. If you say Y, you will be asked + for your specific device in the following questions. + +if FPGA_LATTICE + +config FPGA_MGR_ICE40_SPI + tristate "Lattice iCE40 SPI" + depends on OF && SPI + help + FPGA manager driver support for Lattice iCE40 FPGAs over SPI. + +config FPGA_MGR_MACHXO2_SPI + tristate "Lattice MachXO2 SPI" + depends on SPI + help + FPGA manager driver support for Lattice MachXO2 configuration + over slave SPI interface. + +endif #FPGA_LATTICE diff --git a/drivers/fpga/lattice/Makefile b/drivers/fpga/lattice/Makefile new file mode 100644 index 0000000000000..f542c96a73d40 --- /dev/null +++ b/drivers/fpga/lattice/Makefile @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-only + +obj-$(CONFIG_FPGA_MGR_ICE40_SPI) += ice40-spi.o +obj-$(CONFIG_FPGA_MGR_MACHXO2_SPI) += machxo2-spi.o diff --git a/drivers/fpga/ice40-spi.c b/drivers/fpga/lattice/ice40-spi.c similarity index 100% rename from drivers/fpga/ice40-spi.c rename to drivers/fpga/lattice/ice40-spi.c diff --git a/drivers/fpga/machxo2-spi.c b/drivers/fpga/lattice/machxo2-spi.c similarity index 100% rename from drivers/fpga/machxo2-spi.c rename to drivers/fpga/lattice/machxo2-spi.c -- 2.26.3