From patchwork Tue Jun 22 20:05:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rix X-Patchwork-Id: 12338441 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=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 C4E33C49EA4 for ; Tue, 22 Jun 2021 20:06:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B29B361361 for ; Tue, 22 Jun 2021 20:06:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232992AbhFVUI0 (ORCPT ); Tue, 22 Jun 2021 16:08:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53767 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232953AbhFVUIQ (ORCPT ); Tue, 22 Jun 2021 16:08:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624392359; 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=Vueqp5/9s7lfGwIMwpU/0PSymm50fedJWz69+qj6nak=; b=BLPxsROVbyKrb5Xx3j2AtDCuFrN2iSqNCLG7LiGLjE7pYhniFGe1ZtEr96C7+l9f+CarTP qLGrQ13TEoj24aiOjMaMKBDvoK8+7ignsCBoNsPwdXJ3Al1BcpS87dePqUTXLkFPYL3CFf YH/lIjvEYtjJU9h/2BxNEDyOE01zfu8= Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-379-mR0pSSQ2NmS3NOBsOdOneg-1; Tue, 22 Jun 2021 16:05:57 -0400 X-MC-Unique: mR0pSSQ2NmS3NOBsOdOneg-1 Received: by mail-ot1-f72.google.com with SMTP id a60-20020a9d26420000b0290448d2be15e6so11317739otb.23 for ; Tue, 22 Jun 2021 13:05:57 -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=Vueqp5/9s7lfGwIMwpU/0PSymm50fedJWz69+qj6nak=; b=MsV+CNnn0/eLTrz154JD94qX6TM/i9+67DWu1fRAa7FvCpwKJIi6A/LUAtFwVku0jj lcClyxtDY4/yY54/D0IqP09X9a+ROuykRZIHXRdQg7VnfVD36gD3D2axZsw5lSckTSxX WGROun73L9bAFFoqe1HvULH84ix0RfAcM+FZcFob1ees4MoE5j+/ecQUfRBe4lczzlRh rSYnphboC3zbRk30Qsxauc/HYKmbHXWHS5qAc1AGsrQTdwtpsiViXMRa9SOORcxLxk+B f1eViM/SkP1LN9QUxnXDkzIIOu9Bi0kaD7QcEdA+CYCIVYyzjJemH4/FmaXZRIxddDCz cjpA== X-Gm-Message-State: AOAM5312QkQW0BLHEEP9b3jJ1EvbBZWZzcPduOxlnT/TwFBjsHsYOTp8 oZ6OjZ9UwvU4WISZUr7VIWCKRyPTSYpGbbe9E3hoUY4gNmpNCSMNwf3G6CyvmoXqUYcHq/4+n8I 2Yf9Lot88lCCZ4OblvK6+ww== X-Received: by 2002:aca:654c:: with SMTP id j12mr362065oiw.163.1624392357104; Tue, 22 Jun 2021 13:05:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWaG2CSBroZAks+yu+lTlx8m5PPcazaPB9K4jSe5JQDrXqq3OZ9wFCEQTuzH3IG8mQj1y77A== X-Received: by 2002:aca:654c:: with SMTP id j12mr362053oiw.163.1624392356944; Tue, 22 Jun 2021 13:05:56 -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 5sm727184oot.29.2021.06.22.13.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Jun 2021 13:05:56 -0700 (PDT) From: trix@redhat.com To: hao.wu@intel.com, mdf@kernel.org, corbet@lwn.net, michal.simek@xilinx.com, gregkh@linuxfoundation.org, nava.manne@xilinx.com, dinguyen@kernel.org, krzysztof.kozlowski@canonical.com, yilun.xu@intel.com, davidgow@google.com, fpacheco@redhat.com, russell.h.weight@intel.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 v5 4/4] fpga: lattice: reorganize to subdir layout Date: Tue, 22 Jun 2021 13:05:11 -0700 Message-Id: <20210622200511.3739914-6-trix@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210622200511.3739914-1-trix@redhat.com> References: <20210622200511.3739914-1-trix@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fpga@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..47f5a0c62aa4e --- /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