Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp476803ybz; Fri, 24 Apr 2020 03:52:45 -0700 (PDT) X-Google-Smtp-Source: APiQypJpu7rnPRQyu1I47Tuvt/95KzWSyMe1zXO4pO4NSAwazeX0/ZLgy0OTfx0PDcBHBi1KkmH/ X-Received: by 2002:a50:e80a:: with SMTP id e10mr6652674edn.204.1587725564865; Fri, 24 Apr 2020 03:52:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587725564; cv=none; d=google.com; s=arc-20160816; b=Evi7ePhUSPNoYsVYMcc45OX5QpcRkQ//j40/U3re6qsst5ZzM0zD8WcW/+DblVGaF0 2fwyR7fcWbt+QdJj8JE5Le3MEOMDLmwrUEulh0o/XfXoKlqZA/mfLUeawEA7yjgkUdlo aNFX2mGK0nR0Z8DD9ddCCs21B7+Q9YJuNCjwSCcrYkquYLehGH6k5jtbd81xoN/n0gjD gyqnWNU1zZk8DBFnxHo7JS44QiLgE+vdkP3AJBEn+RjQUpTJrtC5Uv5jZ2E0dD9EdvOD 1hpgF66FtsTOoPE1Jxg8YfB/nufNydqloC3l3mul563Jf7SXR/Qz47kT1yI2Kszqb5H0 fqcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=yf9tP3sNXUsAB/rOddBDtkpZustuUZCD7ZROOWh0ox4=; b=YAbpnJa0HBtTQCGg5K3sIZNqCtJYyZ7mRH3Ab0z8przlLMPezdECNeRHPKsIvAacl7 gJalycd86Wmtf08X1xaaNlwZ4AkCaYEDovSub/aeKoN7JSfTp5kLkGkz81RCaQhoSqeV k2x8OMoYlrwb0J4cQZnKmCnI0fUPwhnPjus4BYQGe+0ZGhTdIU/2WtTIe/qojZrha9s0 150U8ZUMXoxQBjE/wY7zDkfVLYcz7RrA+JXGy5aCd6xC5N2XzL1aJL3TLsDcikJjJeR2 5X/fapTgRK2k0UA/o4AwAWxCVAi9VN7PV6X/x/azzr8PT1Dt2c2GbGk4Y78VpNuHwsiJ /nKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VmBbirVE; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h15si2614140edv.341.2020.04.24.03.52.21; Fri, 24 Apr 2020 03:52:44 -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=@linaro.org header.s=google header.b=VmBbirVE; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726753AbgDXKu6 (ORCPT + 99 others); Fri, 24 Apr 2020 06:50:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726289AbgDXKu5 (ORCPT ); Fri, 24 Apr 2020 06:50:57 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40866C09B045 for ; Fri, 24 Apr 2020 03:50:57 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id x4so9949808wmj.1 for ; Fri, 24 Apr 2020 03:50:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=yf9tP3sNXUsAB/rOddBDtkpZustuUZCD7ZROOWh0ox4=; b=VmBbirVEjOgVcz1iLrCDuO5VLXN1951W8re/zO0nzgFYuwEMxoMSE1+bJi8VD1ugrt k100zGpG94719MgmRICqnQneLX0yv58hh5Eu4UMybV0Ju088At0DHXnNLHBrNZ3wd4ir ZD7sb8FxKGceNRllh8lWxRQJM921TSzHLF/sh9jCuOzooAWoNv9Y8c0eNgG9iXPQJcHo UI6hKLFOmog5ICyxUJVBFWjTf1rn4Ep1qEVB2jzkZbhzpnSyDGeM4ygUy/LNdLZriX7H 9r9BKf31beIDyCBTLhxqlxcPdXdY26KNmj2nRe+DueEx2j8TvXDVpgjU/HC402cddZWP tV6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=yf9tP3sNXUsAB/rOddBDtkpZustuUZCD7ZROOWh0ox4=; b=sJjTh3ANRUEtmtYLDWd0Ht8Ga8U7RZ3Qr9AURvK7hUTKSxcY1ApThk9JDML5h3pk0E Z+kcGaMBv52F5rBz+9Y1z3YrXIC1LbSGfiQ7jOVh9NJc55CA2dQuqK8IL4iSECRlVZX2 MJJtXXoExPwEbGgpSg4KuwqRNj+d7ohGpT/JuCbN6SBwZuq9PGd+yvrkaQaxVJwNrtT5 xFB9N5T3YV8bMrpUB5g154qflMAU96H69aW4eeTIuPmpzTT92U8l02lnwnc8iaui15wy JNa3N6H7qBoLKX3NTvgzqHi084KBZGVCcG1qyMn3huQiNFDst/eLGj1Fb9BGQHBBT2El lV5Q== X-Gm-Message-State: AGi0PuZ+5PNv+PsUZjH8mdNufEDdtyAo6EtzdHWLkjthV9AKZzaF6rJ/ 80nxkrkqzxeiVlIEvDwsbaahtg== X-Received: by 2002:a1c:7d90:: with SMTP id y138mr10044348wmc.121.1587725455891; Fri, 24 Apr 2020 03:50:55 -0700 (PDT) Received: from dell ([2.31.163.63]) by smtp.gmail.com with ESMTPSA id o18sm7595925wrp.23.2020.04.24.03.50.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2020 03:50:55 -0700 (PDT) Date: Fri, 24 Apr 2020 11:50:53 +0100 From: Lee Jones To: Marek Vasut Cc: Christophe Kerello , miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, mark.rutland@arm.com, tony@atomide.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, devicetree@vger.kernel.org, Geert Uytterhoeven Subject: Re: [PATCH v2 02/12] mfd: stm32-fmc2: add STM32 FMC2 controller driver Message-ID: <20200424105053.GC8414@dell> References: <1586966256-29548-1-git-send-email-christophe.kerello@st.com> <1586966256-29548-3-git-send-email-christophe.kerello@st.com> <20200424074517.GN3612@dell> <8b625f1c-9ded-c07a-a20e-8cd44c1ca46d@denx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8b625f1c-9ded-c07a-a20e-8cd44c1ca46d@denx.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 24 Apr 2020, Marek Vasut wrote: > On 4/24/20 9:45 AM, Lee Jones wrote: > > On Wed, 15 Apr 2020, Christophe Kerello wrote: > > > >> The driver adds the support for the STMicroelectronics FMC2 controller > >> found on STM32MP SOCs. > >> > >> The FMC2 functional block makes the interface with: synchronous and > >> asynchronous static memories (such as PSNOR, PSRAM or other > >> memory-mapped peripherals) and NAND flash memories. > >> > >> Signed-off-by: Christophe Kerello > >> --- > >> Changes in v2: > >> - remove ops from stm32_fmc2 structure > >> - add 2 APIs to manage FMC2 enable/disable > >> - add 2 APIs to manage FMC2 NWAIT shared signal > >> > >> drivers/mfd/Kconfig | 12 +++ > >> drivers/mfd/Makefile | 1 + > >> drivers/mfd/stm32-fmc2.c | 136 +++++++++++++++++++++++++ > >> include/linux/mfd/stm32-fmc2.h | 225 +++++++++++++++++++++++++++++++++++++++++ > >> 4 files changed, 374 insertions(+) > >> create mode 100644 drivers/mfd/stm32-fmc2.c > >> create mode 100644 include/linux/mfd/stm32-fmc2.h > >> > >> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig > >> index 2b20329..5260582 100644 > >> --- a/drivers/mfd/Kconfig > >> +++ b/drivers/mfd/Kconfig > >> @@ -1922,6 +1922,18 @@ config MFD_ROHM_BD71828 > >> Also included is a Coulomb counter, a real-time clock (RTC), and > >> a 32.768 kHz clock gate. > >> > >> +config MFD_STM32_FMC2 > >> + tristate "Support for FMC2 controllers on STM32MP SoCs" > >> + depends on MACH_STM32MP157 || COMPILE_TEST > >> + select MFD_CORE > >> + select REGMAP > >> + select REGMAP_MMIO > >> + help > >> + Select this option to enable STM32 FMC2 driver used for FMC2 External > >> + Bus Interface controller and FMC2 NAND flash controller. This driver > >> + provides core support for the STM32 FMC2 controllers, in order to use > >> + the actual functionality of the device other drivers must be enabled. > > > > Not sure how many times I have to say this before people stop > > attempting to pass these kinds of relationships off as MFDs: > > > > A memory device and its bus is not an MFD. In a similar vain to the > > thousands of USB, I2C, SPI, PCI and the like devices that aren't MFDs > > either. > > > > Please find another way to associate your device with its bus. > > This FMC2 is however an IP which can either operate external devices > (like ethernet chip on this parallel bus) or external flashes (like NOR > and NAND chips). I'm sure that it *can*. Although that's not its main purpose. The clue is in the nomenclature ("Flexible *Memory* Controller"). Nor is it how the device is being used in this submission: "The FMC2 functional block makes the interface with: synchronous and asynchronous static memories (such as PSNOR, PSRAM or other memory-mapped peripherals) and NAND flash memories." As I mentioned, this is just another memory device and its bus. > Can you provide a suggestion how this should be handled, if not as MFD? > It seems to me, that this is a Multi-Function Device . Simply move it into the MTD or Memory subsystems and set up the dependencies via Kconfig. > If this discussion is a recurring topic, is there some documentation > which explains how such devices should be handled ? Not that I'm aware of. -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog