Received: by 10.223.185.116 with SMTP id b49csp2629769wrg; Mon, 5 Mar 2018 06:17:11 -0800 (PST) X-Google-Smtp-Source: AG47ELsb5vYc/kihFYsmDG0IFeg8bCfwb7n1Ka2wWWz9HsR7GsO5Ro3G/1TOyG8ShPG6zCXlTnxK X-Received: by 10.98.166.85 with SMTP id t82mr15392721pfe.237.1520259431660; Mon, 05 Mar 2018 06:17:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520259431; cv=none; d=google.com; s=arc-20160816; b=HaEHu0g/llzPSHqYwFRvzF/zBviEWTOOVFYc38gJV/h1Z9HctNvfzO+vJ8PtDSkrF7 esxpv8KBIeJQY4T6jqC2JcFDVHRhEc14ibuZaa/M9sWU2lO+F/5h3n/Bf+PeFWAgFlk0 evZBK5UHblC0+I14IHr8HiFFiG/icq+575UYllg6+52qI0pFTFIL5COyA0/ztobDAcNm 0n98DyIGUHiUTbg4P49AkkCdqZMC1otACcYi7nuEvc2tB3pdr/h1EozfWZDJSHiODAdq XQvFJu31aH/OVVFyUO1lyOr8Cc+Ke+9wg6JGeS8zvV0TFyMLQ9qrPB4Xdeutq/0RUJ/h FUyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=NAHCA8ckiRhGNR4T+iRjFLQu6hpsC7jVj8nBp7DbRzM=; b=lsU+L4flPlrFfZW77LDzQnh2m0LgWLMy6sxvxByHB2VuBI7WrhxzNeofmy5+mYmtSK X5f3lo+DgJfvNrYX2XsJk08mYZiYTEuEjwzmrpfWUhLcxhjIZHJWtfZUqXwljYe7dTDZ JQhk1wUN5kPkqIqa4TfCdZZe85+OpgR3UpnUtrYULahpFOzM84NhBvXPvpGDT+fmhRdK hSrDHJjO3N87g9voStejvK2RKqjp2IchyhuNUcKO2spdsE7jLN3Oroa1vXHQGgVTFHrL 9mQ9zHwwiJnt+wtuGxtmEgM/AmineoVeQGSVsFMXPYKHxGbUlOT68JEqcGHQ4EFcoT3s CkIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HRttuUFN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id v4-v6si3427415plp.672.2018.03.05.06.16.57; Mon, 05 Mar 2018 06:17:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HRttuUFN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S964784AbeCEMxg (ORCPT + 99 others); Mon, 5 Mar 2018 07:53:36 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:43485 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934982AbeCEMx1 (ORCPT ); Mon, 5 Mar 2018 07:53:27 -0500 Received: by mail-io0-f196.google.com with SMTP id l12so17821085ioc.10 for ; Mon, 05 Mar 2018 04:53:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NAHCA8ckiRhGNR4T+iRjFLQu6hpsC7jVj8nBp7DbRzM=; b=HRttuUFNoHU4Th08EFvgzBTMlOuqPxm1OA8kuo3Lc08KmtLv70fVtDTxsqWNUra+Vw vTkJEZlhwyNbpcvb9JzicFE7brLXC7TBV8Svbe/bVgyWW8EB4Eh/YzNbe1Fclnyox7HH bk57ZUZsnyvVxGxeORhZnWgyMQJyN31HLrINg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NAHCA8ckiRhGNR4T+iRjFLQu6hpsC7jVj8nBp7DbRzM=; b=kCBXVbTaYUDITEpCrcV8nk/BrW37hf2732J+JIfZIHe4NgheTYxFmxyTSqNIUoSdno q7qq/wmZxPCdu7N97c0Z0nQzx8wqhwQz3umq3Uc+vbL/9t7rFVGUndp6fEOcI6fC7oSC 085wTexfd2GJtRNNRAmcIK+W59iRytvQCay7vyGRSICLh9HzlnnvHGKJpRPQYPI6KT2Z FbsKuh+AnyR0N0hJd5AM7hu9+x/TaogOSetter/VSw3CWyO4PH1YfWtYeVgQgGbgKexk 0UI+mHjH+kkKaPNEZNXb/0AZVqpF9dV5skrFgKSD+ZHdL0rCfVdbF+mlq3hdEAib1d+U EU4w== X-Gm-Message-State: AElRT7EOLfrFP1T2KQpik+965phLI3UhnUinQ5dwmvDMPgIl+dKLnqt8 YvB5XPPwHvJQBVkojJbvS3mHS0pKHTVqkHicDldTFw== X-Received: by 10.107.104.1 with SMTP id d1mr16840388ioc.119.1520254406377; Mon, 05 Mar 2018 04:53:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.91.10 with HTTP; Mon, 5 Mar 2018 04:53:25 -0800 (PST) In-Reply-To: References: <1519832844-28068-1-git-send-email-ludovic.Barre@st.com> <8f328063-610f-a2e8-5f29-d3f0019384f2@st.com> From: Ulf Hansson Date: Mon, 5 Mar 2018 13:53:25 +0100 Message-ID: Subject: Re: [PATCH V2 0/5] mmc: add stm32 sdmmc controller To: Ludovic BARRE Cc: Rob Herring , Maxime Coquelin , Alexandre Torgue , Gerald Baeza , Linux ARM , Linux Kernel Mailing List , devicetree@vger.kernel.org, "linux-mmc@vger.kernel.org" , Benjamin Gaignard Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2 March 2018 at 09:51, Ludovic BARRE wrote: > > > On 03/01/2018 11:44 AM, Ulf Hansson wrote: >> >> On 1 March 2018 at 10:57, Ludovic BARRE wrote: >>> >>> Hi Ulf >>> >>> On 03/01/2018 10:06 AM, Ulf Hansson wrote: >>>> >>>> >>>> Hi Ludovic, >>>> >>>> On 28 February 2018 at 16:47, Ludovic Barre >>>> wrote: >>>>> >>>>> >>>>> From: Ludovic Barre >>>>> >>>>> This patch serie adds support of stm32 SDMMC controller. >>>>> stm32h7 is the first SoC to use stm32 SDMMC controller >>>>> (previous SoC had pl180 controller). >>>> >>>> >>>> >>>> I am a not convinced this isn't a new improved variant of the pl180. >>>> According to register layout and the code you submitted in patch2, >>>> there are great similarities to pl180 and the mmci driver. >>> >>> >>> >>> In fact, ST designers which created stm32-sdmmc hardware block from >>> scratch >>> are the same which have done the modifications on pl180 variant (stm32 >>> legacy f4, f7). >>> So some registers or bits name seem identical (or strongly inspirited) >>> but >>> the engine and features are different. >> >> >> Well, in that case, I assume the driver would also need work >> differently, but when looking at the code in patch2 this doesn't seem >> to be the case. >> > > I understand why you push to avoid drivers multiplication. But I'm > scared to squash 2 different hardware block which are their own roadmap > in the same drivers. I fear that it complicates the features management and > maintenance of this driver. It may require more work for you to upstream the code you need. You may even have to re-factor existing code in mmci before you can add your specific parts on top. However, whether it gets complicated or not, I think much depends on the quality of the code changes we make. Both sdhci and dw_mmc gives an idea of how we can deal with variant differences, in particular when variant changes are a bit bigger. In the mmci case, so far the controller that differs the most, is the qcom variant, which also has the built-in DMA support, similar to your new ST variant. Perhaps there is some code we can re-use around that. > > there are some difference: > -the stm32-sdmmc use an internal dma (stm32-sdmmc is master on the bus), > -idma alignment constraint. > -idma transfer mode single buffer, double buffer... (future evolution) > -need a command to stop transmission for data state machine > -same bit naming could have offset, mask width or set in different register. > => I will try to synthesis register difference in a document > -voltage switch sequence > -delay block: calibration, tunning (sdr104) > -reset line required > -the same feature have not the same impact, example ddr mode > stm32:no bypass clk, activated in clk register > pl180: clkreg_neg_edge_enable, activated in datactrl register, Doesn't sound like this couldn't be done, yes there are differences but not that much. Sure we may need re-work the core driver mmci code, maybe convert it to set of library function instead and invent a couple mmci specific callbacks. As I said, sdhci and dw_mmc already does it, so I am sure it can be done. > ... > > stm32-sdmmc is just at begining of its life cycle. Each revision of this > block increases the difference with pl180. Today, I've just push the minimal That's fine, this happens all the time to sdhci and dw_mmc variants. Again, if it works for them, it should work for mmci. > driver to start a request, but I've not yet send all features of this > revision like sdio, sdr104 support. After this revision there already are 2 > other revisions in the pipe (at short term). > > I am Out of Office with limited access to my e-mail till 2018 march 12th > I'll try to think about it on ski slope. euh, in fact no just ski and enjoy > ;-) Enjoy you skiing and let's talk more when you get back! [...] Kind regards Uffe