All of lore.kernel.org
 help / color / mirror / Atom feed
From: fred <fred.ai@bayhubtech.com>
To: adrian.hunter@intel.com, ulf.hansson@linaro.org,
	linux-mmc@vger.kernel.org
Cc: shaper.liu@bayhubtech.com, chevron.li@bayhubtech.com,
	xiaoguang.yu@bayhubtech.com, shirley.her@bayhubtech.com,
	fred.ai@bayhubtech.com
Subject: [PATCH V3 2/2] mmc:sdhci-pci-o2micro:Make the SD clock's base clock frequency correctly according to different card mode
Date: Wed, 15 Dec 2021 22:08:24 -0800	[thread overview]
Message-ID: <20211216060824.357-2-fred.ai@bayhubtech.com> (raw)
In-Reply-To: <20211216060824.357-1-fred.ai@bayhubtech.com>

From: Fred Ai <fred.ai@bayhubtech.com>

Remove SDR104 card, SD clock's base clock
frequency is not right when insert SD2.0/SDR50 card

Signed-off-by: Fred Ai <fred.ai@bayhubtech.com>
---
Change in V3:
1.Set SD clock's base clock frequency to 208MHz when card mode is SDR104/HS200.
2.Set SD clock's base clock frequency to 200MHz when card mode is SD2.0/SDR50.
---
 drivers/mmc/host/sdhci-pci-o2micro.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mmc/host/sdhci-pci-o2micro.c b/drivers/mmc/host/sdhci-pci-o2micro.c
index f55602609f8c..4ca1e8c5b631 100644
--- a/drivers/mmc/host/sdhci-pci-o2micro.c
+++ b/drivers/mmc/host/sdhci-pci-o2micro.c
@@ -577,6 +577,11 @@ static void sdhci_pci_o2_set_clock(struct sdhci_host *host, unsigned int clock)
 
 		if ((scratch_32 & 0xFFFF0000) != 0x2c280000)
 			o2_pci_set_baseclk(chip, 0x2c280000);
+	} else {
+		pci_read_config_dword(chip->pdev, O2_SD_PLL_SETTING, &scratch_32);
+
+		if ((scratch_32 & 0xFFFF0000) != 0x25100000)
+			o2_pci_set_baseclk(chip, 0x25100000);
 	}
 
 	pci_read_config_dword(chip->pdev, O2_SD_OUTPUT_CLK_SOURCE_SWITCH, &scratch_32);
-- 
2.32.0


  reply	other threads:[~2021-12-16  6:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-16  6:08 [PATCH V3 1/2] mmc:sdhci-pci-o2micro:Improve card input timing at SDR104/HS200 mode fred
2021-12-16  6:08 ` fred [this message]
2021-12-17  6:49   ` [PATCH V3 2/2] mmc:sdhci-pci-o2micro:Make the SD clock's base clock frequency correctly according to different card mode Adrian Hunter
2021-12-28 16:57   ` Ulf Hansson
2021-12-17  6:37 ` [PATCH V3 1/2] mmc:sdhci-pci-o2micro:Improve card input timing at SDR104/HS200 mode Adrian Hunter
2021-12-17  6:38 ` Adrian Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211216060824.357-2-fred.ai@bayhubtech.com \
    --to=fred.ai@bayhubtech.com \
    --cc=adrian.hunter@intel.com \
    --cc=chevron.li@bayhubtech.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=shaper.liu@bayhubtech.com \
    --cc=shirley.her@bayhubtech.com \
    --cc=ulf.hansson@linaro.org \
    --cc=xiaoguang.yu@bayhubtech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.