Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2782374rwi; Fri, 21 Oct 2022 07:53:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ZFp5lHds2ML7wOPTcbxWqsv9GR5cx6wNWtPWjxdweTzHFc/IiDjF+hy62wbcRceYsgraE X-Received: by 2002:a17:907:2bef:b0:78d:8b6c:a20b with SMTP id gv47-20020a1709072bef00b0078d8b6ca20bmr16178548ejc.674.1666364012333; Fri, 21 Oct 2022 07:53:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666364012; cv=none; d=google.com; s=arc-20160816; b=0mjNTx61GeJL+MGA+1PGuqBaTT5VksRlIDCGgfs3KzsbYAFluSNd37oqlBMc3o9f11 77a4nBZ7QYz447Sgj1uYOAsh8JGRBa0ml4TtS1oTRbYYywSsQD4f9Fe48ZjVrl4TrxvR yotZBI5zd+luUCBPP0UHqDc9FaaFPfz7aHb+m6Mczrj13TyklNV/GTertHyB02HT9uI4 A+RX81y1wlp4I06Rdkyg+TEx5RKZRjZr9L/HL52gkr9PgMt/6kpcatld+pj95P9bsKIe 8ApP7WS0Xsc023T8YQTOoqfb9v46V1sqpdaa2SAyn9y6GkwopudIM71Q45xmgcJXDjwM wEQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=5+e3tfZKD8wPLq+xcmy+Hq7e5zoVdL8VVcXpDbD3Ib4=; b=NWhYe1vkDS7IdoLP4nAu5jjCxtohHeldgXn/se30MJPJls4Anm/f1sB2jtzlr2ump/ IQRpnDM4Be3VbEsZqnhKqMCWMJTSsnLj3NcLUZUO8uGky41GyWmWfywGM7igQl9IXgZd 6tkIuRTtEbSfeheNbV2yYAKPOVnkhAy47ILGPBRxMhVcD5mW0tS2enIopp2Ghq+b9T7g r9PIOB4ahQSKPXYmqtrh/qwV5PCX4IpS4vcUzqXzPHjxIRqUl8zGUFiIwT4mcGnRKkTm iArIyt4RnlhfMn8JWPa3iOBAFH8roCPs3fqL36dRAzdzrPEpwxdc8xha/rhDv8O4u+TA xKuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yx8xloWD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cr21-20020a170906d55500b00780837381d8si21213698ejc.591.2022.10.21.07.53.06; Fri, 21 Oct 2022 07:53:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yx8xloWD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231174AbiJUNcw (ORCPT + 99 others); Fri, 21 Oct 2022 09:32:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231178AbiJUNca (ORCPT ); Fri, 21 Oct 2022 09:32:30 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A111C272119 for ; Fri, 21 Oct 2022 06:32:22 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id a5so1984015qkl.6 for ; Fri, 21 Oct 2022 06:32:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=5+e3tfZKD8wPLq+xcmy+Hq7e5zoVdL8VVcXpDbD3Ib4=; b=Yx8xloWDhbEQ67y0pJkRiQj2ByUZYLHTkUmjgXvkWGU/moYFskJONIRkSscwkXJuKl 7RSpTwuxzRQhww/X3kFwMir6d0xDIAwHLFDpaPpShmyrrrh3dvf+wLup6XNfeG+hgrYY MMdOUkLsv/m9pSrImhvsnUUeWLn/3lyk78qiq4fhkZn7sso9wygWmffE/9B2E9U4zaqu 2KI6roiiVu+XhxlVNWv7WQ4Vql2wJ+91YP3jejvsL9cxAhBtU8iiIFdxBvAbv9uFnLCd NV6qtkS//cq2mEUw7E1JJWEsebbN2i+T+DLSeeSCHl40e9ODk871N2jg+j5D+ASwq9EA /K/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5+e3tfZKD8wPLq+xcmy+Hq7e5zoVdL8VVcXpDbD3Ib4=; b=iVzyJHGX7mQUVGFWVJkxegojGFqXjzlicSBxVWHSGcV5rjxRsJbVWQGaT6ORxXZY/d MSZZhn7IHre7vqdwlAOtm68AFxLNsyt8fnw5qXURXQ6G8EBd1JaNXH+cZEQ8IcmmHK+7 12BN2umwNgCvTuk3aSLkNcwfBs2Hnc914bwZE8tC4QkCTD/LSluhMVXnc/jRQdqSWSar b38D1o2RuqvAuY9+vYpnFZSZPHJwAFjs0CsQ1n+JB6RgOYWmVoO2JGAcyM76nlPZ/q2K D/o6i4gr8WNx0ReWnACUKnEmBt+DCxWCfwKtyJwHc3v83Tarp6qjBrqD6bHcQalntHKF +O2g== X-Gm-Message-State: ACrzQf22fjYVACaqdtCr/JeSVXF3YCaN+xWtW7pEaM5M6jZaYdJqqzIb 6I27C+0Jg9X3alrZCj6PWtMBVg== X-Received: by 2002:ae9:ef4e:0:b0:6ee:80b6:2ee4 with SMTP id d75-20020ae9ef4e000000b006ee80b62ee4mr13415282qkg.126.1666359140868; Fri, 21 Oct 2022 06:32:20 -0700 (PDT) Received: from [192.168.10.124] (pool-72-83-177-149.washdc.east.verizon.net. [72.83.177.149]) by smtp.gmail.com with ESMTPSA id l3-20020a37f903000000b006ee2953fac4sm9387945qkj.136.2022.10.21.06.32.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Oct 2022 06:32:20 -0700 (PDT) Message-ID: Date: Fri, 21 Oct 2022 09:32:19 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCHv5 4/6] mmc: dw_mmc-pltfm: socfpga: add method to configure clk-phase Content-Language: en-US To: Dinh Nguyen , jh80.chung@samsung.com Cc: ulf.hansson@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, mturquette@baylibre.com, sboyd@kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org References: <20221019170657.68014-1-dinguyen@kernel.org> <20221019170657.68014-5-dinguyen@kernel.org> From: Krzysztof Kozlowski In-Reply-To: <20221019170657.68014-5-dinguyen@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/10/2022 13:06, Dinh Nguyen wrote: > The clock-phase settings for the SDMMC controller in the SoCFPGA > platforms reside in a register in the System Manager. Add a method > to access that register through the syscon interface. > > Signed-off-by: Dinh Nguyen > --- > v5: change error handling from of_property_read_variable_u32_array() > support arm32 by reading the reg_shift > v4: no change > v3: add space before &socfpga_drv_data > v2: simplify clk-phase calculations > --- > drivers/mmc/host/dw_mmc-pltfm.c | 43 ++++++++++++++++++++++++++++++++- > 1 file changed, 42 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c > index 9901208be797..74421d13f466 100644 > --- a/drivers/mmc/host/dw_mmc-pltfm.c > +++ b/drivers/mmc/host/dw_mmc-pltfm.c > @@ -17,10 +17,16 @@ > #include > #include > #include > +#include > +#include > > #include "dw_mmc.h" > #include "dw_mmc-pltfm.h" > > +#define SOCFPGA_DW_MMC_CLK_PHASE_STEP 45 > +#define SYSMGR_SDMMC_CTRL_SET(smplsel, drvsel, reg_shift) \ > + ((((smplsel) & 0x7) << reg_shift) | (((drvsel) & 0x7) << 0)) > + > int dw_mci_pltfm_register(struct platform_device *pdev, > const struct dw_mci_drv_data *drv_data) > { > @@ -62,9 +68,44 @@ const struct dev_pm_ops dw_mci_pltfm_pmops = { > }; > EXPORT_SYMBOL_GPL(dw_mci_pltfm_pmops); > > +static int dw_mci_socfpga_priv_init(struct dw_mci *host) > +{ > + struct device_node *np = host->dev->of_node; > + struct regmap *sys_mgr_base_addr; > + u32 clk_phase[2] = {0}, reg_offset, reg_shift; > + int i, rc, hs_timing; > + > + rc = of_property_read_variable_u32_array(np, "clk-phase-sd-hs", &clk_phase[0], 2, 0); > + if (rc < 0) { > + dev_err(host->dev, "clk-phase-sd-hs not found!\n"); > + return rc; > + } > + > + sys_mgr_base_addr = altr_sysmgr_regmap_lookup_by_phandle(np, "altr,sysmgr-syscon"); > + if (IS_ERR(sys_mgr_base_addr)) { > + dev_err(host->dev, "failed to find altr,sys-mgr regmap!\n"); > + return -ENODEV; Isn't this now an ABI break? I have an impression we talked about this... Best regards, Krzysztof