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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2A1DFFC9EC3 for ; Sat, 7 Mar 2026 02:30:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MqZCP8d9bFCdQ0fzF7+FOC4My/gjeb5osPDg9R4I/zo=; b=SR0EP0IGDwtFDq xEbs3G2SChn4l4kC7zfbCQnilaaa4M6R1b2hwrw/A5fXoayCk7PDtc2yEK90VbY3yFKAyqzJt+Ecn KvccOuVF4mFQJROyV0p2c1UKE5E17hB1IRFcinmziif44Vwqtu6fp5SKLuX4UMjF0KbEnVlUVjDl9 ZyVY6oO8leaUHI0Whcrhn7mfZZ7cwhehH99vDOA4V4Wwh9N4s8kWR9XDtAkvYSHnLOgenBwgPpLK6 1q8ahf5y0QLGimBozzsu6i//VTPJ8Ar+FnBLeGcjofe8u4DNSIjXDs0tnMBesZvy1HdFLcwkZVmom U1N/ZhwN1TMvtn7SEjGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vyhQU-00000004oU7-0LU5; Sat, 07 Mar 2026 02:29:58 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vyhQR-00000004oTh-405l for linux-riscv@lists.infradead.org; Sat, 07 Mar 2026 02:29:57 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id D49F243636; Sat, 7 Mar 2026 02:29:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCD0CC4CEF7; Sat, 7 Mar 2026 02:29:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772850594; bh=vOYMV5oYzY1jb9kI2UnsuEVGQtVsXkECOuklSwooqNY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lh82RDczpDMmseaAIlLrISM5VihBBYyxrLaA6CWswNEj8+Hs3pd2/maWsJnnBjUDD XRZT8wu6vDkPRF3QkLhR6u9qadcTBQb22iltFZNfB3IPmYskDvTmt4NnlPUrLpe343 eTdW8CMi71n/FHDogxGtiRyL+yh/pG7c4nTWNVmBAc0xntlaI9HOgTDPzz5abmi/gj Of4YaziLG0jcABTOGBC/L4xzOUjH/8HaUIB94BzUyu5UKTnLyNBDoMMbuMJKImtJwL FDr8I1gxj8numN1KOyCM9vttPjnXeI1xTF4wW9ZVvmu3CJ8lmBEdCReLCbCNuf1Tbf 1zkJOAWhVo+ww== Date: Sat, 7 Mar 2026 10:29:51 +0800 From: Yixun Lan To: Iker Pedrosa Cc: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Michael Opdenacker , Javier Martinez Canillas , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 02/10] mmc: sdhci-of-k1: enable essential clock infrastructure for SD operation Message-ID: <20260307022951-GKC302167@kernel.org> References: <20260302-orangepi-sd-card-uhs-v1-0-89c219973c0c@gmail.com> <20260302-orangepi-sd-card-uhs-v1-2-89c219973c0c@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260302-orangepi-sd-card-uhs-v1-2-89c219973c0c@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260306_182956_055750_AB359A61 X-CRM114-Status: GOOD ( 15.08 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Hi Iker, On 16:13 Mon 02 Mar , Iker Pedrosa wrote: > Ensure SD card pins receive clock signals by enabling pad clock > generation and overriding automatic clock gating. Required for all SD > operation modes. > > Signed-off-by: Iker Pedrosa > --- > drivers/mmc/host/sdhci-of-k1.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/mmc/host/sdhci-of-k1.c b/drivers/mmc/host/sdhci-of-k1.c > index 0cc97e23a2f9c7b2f9376318a8a7ebb860571504..b703b78282ed8d89183c816477c149c0a565618a 100644 > --- a/drivers/mmc/host/sdhci-of-k1.c > +++ b/drivers/mmc/host/sdhci-of-k1.c > @@ -20,6 +20,13 @@ > #include "sdhci.h" > #include "sdhci-pltfm.h" > [snip] > + spacemit_sdhci_setbits(host, SDHC_OVRRD_CLK_OEN | SDHC_FORCE_CLK_ON, > + SPACEMIT_SDHC_OP_EXT_REG); As I'm testing on Bananapi F3 board with emmc chip, this line will cause timeout problem [ 27.613806] mmc2: Timeout waiting for hardware interrupt. [ 27.616592] mmc2: sdhci: ============ SDHCI REGISTER DUMP =========== [ 27.623007] mmc2: sdhci: Sys addr: 0x00000400 | Version: 0x00000002 [ 27.629429] mmc2: sdhci: Blk size: 0x00007200 | Blk cnt: 0x000003a6 [ 27.635853] mmc2: sdhci: Argument: 0x001ca0a0 | Trn mode: 0x0000002b [ 27.642277] mmc2: sdhci: Present: 0x01f70106 | Host ctl: 0x00000035 [ 27.648700] mmc2: sdhci: Power: 0x0000000f | Blk gap: 0x00000000 [ 27.655124] mmc2: sdhci: Wake-up: 0x00000000 | Clock: 0x00000107 [ 27.661547] mmc2: sdhci: Timeout: 0x0000000e | Int stat: 0x00000000 [ 27.667971] mmc2: sdhci: Int enab: 0x03ff000b | Sig enab: 0x03ff000b [ 27.674394] mmc2: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000 [ 27.680818] mmc2: sdhci: Caps: 0x35fc0080 | Caps_1: 0x00002f77 [ 27.687241] mmc2: sdhci: Cmd: 0x0000193a | Max curr: 0x00000000 [ 27.693666] mmc2: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0xfff6dbff [ 27.700088] mmc2: sdhci: Resp[2]: 0x320f5903 | Resp[3]: 0x00000900 [ 27.706513] mmc2: sdhci: Host ctl2: 0x0000400d [ 27.710940] mmc2: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x02080208 [ 27.717363] mmc2: sdhci: ============================================ Drop it will make emmc work again.. but I'm still unable to make SD card driver work, that's probably another problem I've took a look at current K3's sdhci driver, all operations on SPACEMIT_SDHC_OP_EXT_REG register are used only when doing voltage switch with SD card, snip of the code from vendor if (host->mmc->caps2 & MMC_CAP2_NO_MMC) { /* sd/sdio has no phy */ spacemit_sdhci_setbits(host, SDHC_TX_INT_CLK_SEL, SPACEMIT_SDHC_TX_CFG_REG); } else { /* use phy func mode */ spacemit_sdhci_setbits(host, SDHC_PHY_FUNC_EN | SDHC_PHY_PLL_LOCK, SPACEMIT_SDHC_PHY_CTRL_REG); spacemit_sdhci_clrsetbits(host, SDHC_PHY_DRIVE_SEL, SDHC_RX_BIAS_CTRL | FIELD_PREP(SDHC_PHY_DRIVE_SEL, 4), SPACEMIT_SDHC_PHY_PADCFG_REG); /* mmc card mode */ spacemit_sdhci_setbits(host, SDHC_MMC_CARD_MODE, SPACEMIT_SDHC_MMC_CTRL_REG); } -- Yixun Lan (dlan) _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv