From patchwork Mon Jun 14 20:16:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rix X-Patchwork-Id: 12319785 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 E4997C48BE6 for ; Mon, 14 Jun 2021 20:17:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D082B6134F for ; Mon, 14 Jun 2021 20:17:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235541AbhFNUTj (ORCPT ); Mon, 14 Jun 2021 16:19:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:46285 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234586AbhFNUTg (ORCPT ); Mon, 14 Jun 2021 16:19:36 -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-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-469-_E-pBCO6OkWVQi2fj7-uEQ-1; Mon, 14 Jun 2021 16:17:31 -0400 X-MC-Unique: _E-pBCO6OkWVQi2fj7-uEQ-1 Received: by mail-oo1-f72.google.com with SMTP id y13-20020a4acb8d0000b029024aa257b077so4930407ooq.5 for ; Mon, 14 Jun 2021 13:17:31 -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=rU10y8m7dc5XsjlzGUiEykxgE/mpHyd0oXaijvOCG6qpXqCQqt27vj05/UNqll4nji T0ZtnoZUTcBxgFNMBjnsfX3ocZJSgZaN8CNqhYso0TRTZLl9JzhmMYttAhDCS5ZZJoSu 8V9m1Y2zdYmdPbkKCmstZOPwW72yaoSbGL15bs4kNKG3rqN3hzsHuthCBrb7gfMoDkIZ Pf1FPJVoiGNmAGwoBsO4t8O8zG3Az2dSh0VwSdNRIS7N4GwBztrczPJsN4LBJkp/Qy/T cHHS2w7d8CiOCTVTKkafe3zCev73leqDtEJ3eccthgSenyCUPIY2ZSf3PhdTVpmlGAFk cyUw== X-Gm-Message-State: AOAM5308oiqtDfDFwWe33Tp+aZhGVvcy6/xlu14KU6mvekjFer/ILIBL pSLd26qcBsDCdHA3bPX75xYUhaZQ4UmMCGkfcwkHOSoOLCJIqYucWsXqkVogctnP8SqWa+9g0yg 90HifJkZw55pftMjsIz6ZoQ== X-Received: by 2002:a05:6830:2476:: with SMTP id x54mr14958016otr.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 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..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