From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DFDD2C38142 for ; Tue, 31 Jan 2023 12:43:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C1F338595F; Tue, 31 Jan 2023 13:43:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ezqu3Vyj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 33C7385A4F; Tue, 31 Jan 2023 13:40:48 +0100 (CET) Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 95DA5859EF for ; Tue, 31 Jan 2023 13:40:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jh80.chung@gmail.com Received: by mail-pl1-x632.google.com with SMTP id k13so14977112plg.0 for ; Tue, 31 Jan 2023 04:40:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=QOmSNz68wcH5ajSTSSm49FJwKn4ZDJyF/jszOGxhtoY=; b=ezqu3VyjRAHvUnVCaGQz5K7uf1IcFxPI0hE98GrjtSFHs5Sih7tzlWuc5/jxxIhiOg pBJlKInnTOg+ORRW6xscZWaQXplF//VJdMExmkcacVQG/h7g9NM0utYI5itVL95nINDj p51KRpUoGVE2jKAx7XeNMyX5gHA8qqofytms1LF6bldvnqeGAwy6LyoG9MK4Jr+Gq7Ye wH7Ice2aNyqS5ELhh9g78+00NqvzY6zSEsOF/O8xwieexVTECVu0N7gP90L//QPT3Q08 BkEPI4appyH6uAt2U/5FYQ71MNkJUkWcQhTO8f5BVpUxQt2dyDnpi9YytfVUIMv+BVbM YAXA== 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=QOmSNz68wcH5ajSTSSm49FJwKn4ZDJyF/jszOGxhtoY=; b=kI7NBsxENNvoQetsgJFgcKJVPjtC2DLW3QfH+Q4WP4QbfJjdNt0Q4h7E/uLQlJQVSj fZD+D5ugWNWEmxdHvT4pmHFBq6rVEEq3cTxsN1kHcuJM1O/n39r5BMwI2/ZxUuPcTcRF nbYndMTtNFU8sqVoQpzALZmD9qcEOTb3QNK4Q9rbGNfBOeaVnJ2YPpD1m4TgDGtENoLg W3KdsRWs+ENc7/un7JlBH+X+uelLB5bEEES5e7DpMbu6GS5YSUmEZmE+7ee7TyaGWUvX R7dM++d66Eu9r/eC2KWLJC/rvITnxZhSPly/Iy+ZDJJP+jKuNqhkXlElut+a+1IVgCY1 zT2Q== X-Gm-Message-State: AO0yUKUCPo0BYzjO9mf625hBXGQkjqkiGtnXDRNOYV/5OsbxpsYcN6vg rfASAGuj93RH7zSk/G1pEmc= X-Google-Smtp-Source: AK7set/Wn5xl2D6JwfQ6iGctaa+ZK5TJL5zZB/K24d+vjw/02T6D3PfGNXS+fR241+HHPWzOsaLqFA== X-Received: by 2002:a05:6a20:1443:b0:be:993b:10ee with SMTP id a3-20020a056a20144300b000be993b10eemr5951592pzi.58.1675168837890; Tue, 31 Jan 2023 04:40:37 -0800 (PST) Received: from [192.168.0.19] ([183.99.112.216]) by smtp.gmail.com with ESMTPSA id l10-20020a170902eb0a00b00196503444b0sm8520089plb.43.2023.01.31.04.40.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Jan 2023 04:40:37 -0800 (PST) Message-ID: <0b1efa1d-70ff-3ac4-ab09-6ceb10dca600@gmail.com> Date: Tue, 31 Jan 2023 21:40:34 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [2/4] mmc: sdhci: Check and call config_dll callback functions Content-Language: en-US To: Ashok Reddy Soma , u-boot@lists.denx.de Cc: peng.fan@nxp.com, jh80.chung@samsung.com, kever.yang@rock-chips.com, hayashi.kunihiko@socionext.com, alpernebiyasak@gmail.com, xypron.glpk@gmx.de, git@amd.com, michal.simek@amd.com References: <20230110113124.1434-1-ashok.reddy.soma@amd.com> <20230110113124.1434-3-ashok.reddy.soma@amd.com> From: Jaehoon Chung In-Reply-To: <20230110113124.1434-3-ashok.reddy.soma@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On 1/10/23 20:31, Ashok Reddy Soma wrote: > Check if the low level driver supports config_dll callback function and > call it if it does. Call with dll disable before calling set_clock and > with dll enable after it. > > Signed-off-by: Ashok Reddy Soma Reviewed-by: Jaehoon Chung Best Regards, Jaehoon Chung > --- > drivers/mmc/sdhci.c | 16 ++++++++++++++++ > include/sdhci.h | 2 ++ > 2 files changed, 18 insertions(+) > > diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c > index a80ad8329a..181ab9b7cb 100644 > --- a/drivers/mmc/sdhci.c > +++ b/drivers/mmc/sdhci.c > @@ -396,6 +396,14 @@ int sdhci_set_clock(struct mmc *mmc, unsigned int clock) > } > } > > + if (host->ops && host->ops->config_dll) { > + ret = host->ops->config_dll(host, clock, false); > + if (ret) { > + printf("%s: Error while configuring dll\n", __func__); > + return ret; > + } > + } > + > if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) { > /* > * Check if the Host Controller supports Programmable Clock > @@ -439,6 +447,14 @@ int sdhci_set_clock(struct mmc *mmc, unsigned int clock) > if (host->ops && host->ops->set_clock) > host->ops->set_clock(host, div); > > + if (host->ops && host->ops->config_dll) { > + ret = host->ops->config_dll(host, clock, true); > + if (ret) { > + printf("%s: Error while configuring dll\n", __func__); > + return ret; > + } > + } > + > clk |= (div & SDHCI_DIV_MASK) << SDHCI_DIVIDER_SHIFT; > clk |= ((div & SDHCI_DIV_HI_MASK) >> SDHCI_DIV_MASK_LEN) > << SDHCI_DIVIDER_HI_SHIFT; > diff --git a/include/sdhci.h b/include/sdhci.h > index 24b4599b85..64a3d309da 100644 > --- a/include/sdhci.h > +++ b/include/sdhci.h > @@ -272,6 +272,8 @@ struct sdhci_ops { > void (*set_clock)(struct sdhci_host *host, u32 div); > int (*platform_execute_tuning)(struct mmc *host, u8 opcode); > int (*set_delay)(struct sdhci_host *host); > + /* Callback function to set DLL clock configuration */ > + int (*config_dll)(struct sdhci_host *host, u32 clock, bool enable);> int (*deferred_probe)(struct sdhci_host *host); > > /**