From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E1BD3859CB for ; Tue, 17 Mar 2026 20:23:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773778990; cv=none; b=inkdkxQDIyLmdZtjPGxJN9QoPWNCHxzND3F9mH+ReMUQXf5S3pxdJROckgeS9f8zAnWRBN+z6/q0sxh4g93NIWuLOHyJlonEN5opkAlUZNPKlVqUr1NIjytI8U+ChlSax/5qt8OZR8B84V984NacDuIAtRnNgaUzLy9fy1EK0P8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773778990; c=relaxed/simple; bh=1Tvow8X4Db0N1osozsscW2uTEW7kegN9/O8TPDZlMdo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=W+33POEWi8t7M3sDv7CR1NfBOJmO9EkRgk6bD7V6aLYFM6hjYdAEOQxCrmFb1BBaTTghAxmHtpZZuPz2N+i3tFacnUsv3EUoIPFvyBQuDIXXaoYRn3MEIQYp5HjyNdPLQvbuFIQXbjt0+kG/cCaGMMVqlo62SNogilg0ycrMrvk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=XpHcv8Cw; arc=none smtp.client-ip=209.85.222.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="XpHcv8Cw" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-8cd8a189f44so2092285a.0 for ; Tue, 17 Mar 2026 13:23:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1773778987; x=1774383787; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=5QyiDZ5RSYUOfAeS5ZUUKET2WqUdsSAGFaGllFAZ7XM=; b=XpHcv8CwDm19zVbApdbMBEOu8/+J3kUt/ANcqfaFWeKBOGtPBJxf8t5ehGRi9Bhqzb DvwoW1t2wud0RH+UyHd175gDqy3RTsvNlWDhS+PkCl1P0gE9Chaugc2lj3hx4nF4WCLY CVVfXBrVF9Gr9FDxkn1DxZxs1nTVMk07ypWMjuXBnrWqzx6itdLrfeQuMuSJdlVnLHWA hKGsyp1rvsmimpBjGT8TmntLOazP2mcgt/pXs4NohvTHi2U2IWvTE3vexryKuW33MgSm Ig5Tg/AkyZg0F6cKcq1EeeuH/FuTTHLzCED+jiiOdfl+MpTaN+MGcBwGeg4Zd2zjqfB4 573w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773778987; x=1774383787; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5QyiDZ5RSYUOfAeS5ZUUKET2WqUdsSAGFaGllFAZ7XM=; b=QclbagY/GwiYAzTT01q8D8oCguFS5HAfuauOjqFz28UO6K9s39UTZqhbLn5DVOX5R9 JLiIulLT8p13kyebzOJV46ReUosuo6B+pqhyd5olhoM6xePqq+zmsy4o1r/X0U8206os dWDOZpJMT95I871sC3VqeDeUUVW9kt2UnKSHgvCOdq6CtVXkPrwIUn1cE+LzRpkcOsti IPBM5jN92RRXYMwGXYPWU7X8dObLr80FGCJIoRbpO2UpDTCmAysefH9C8xFcNeczEWCl 7N0LXyXy8rh3IKpNBqJBl7ybCItmQXAtpE93nOXGOsVYdq22FZI7yyRpg+uibusutbU7 Ap4w== X-Forwarded-Encrypted: i=1; AJvYcCWkLTp3iHjaoNCbr6S7/ltgSaOXpFKDDX5QyfNDJXpy6S5gWiTcvurmcEax8yWlAs6ZpAbaIbc2UFYcTdc=@vger.kernel.org X-Gm-Message-State: AOJu0YzP5AoL53+S4EYF4lJgsGjUaCHc3/WVLEPKkH0Bj6vGWe5oltq3 lCwm9i8YVItNv6nf5NvvstSbUhy71Quv654Qpao8Dkgh6IO9q+hhiICGWhMkkmTS6E38sy3SiVs 0hk8Giv8= X-Gm-Gg: ATEYQzxYcOuTinU5UZFJCMrDkwvo7rIDUZA9E4ccP5vrDTzDH5Qtxccg+cfPGAor5Na h8BwcsW5cocSHZEwvhOM52DS0hhPIdXugmWZqd3KT5SgCbbXZuQeo2WEkuyJ/MIRspRFXUwfzwD 4TbE3XidmvdfK/PlVsuiyZLM1phi2buX1s3MiIYgA098+DUOkxbldEp4zr6wCMlPBfRB28XlhuH yJKNbvszNDXAV/DdPzzvOvmjAkLTyQ6acQ7d/Qe95DSsHYc5aSg0rkrBtS1/mJBBhkxWkADb8hn 1dTOijWcU8HzAicc+guOi4GZ3DFRb8ayFilrHTWQFMPnkg+FanrSKdXocactZqobvH4DhYEEkj3 N1AcDTZJSbhH2pfPfYgByA+l6eODx/Lr9W6DKhv8rSwbDEW40NP0US2lrMFTNBMFULn3AjOA/wF 9BULXvBrEUSKmARr6QmJezhv7/vEwTYSzqnekyT+6lmH9FhUfbMjqK19CJVeUlNGjkifD9mxluA 3jr X-Received: by 2002:a05:620a:bc5:b0:8cd:b90f:fc1e with SMTP id af79cd13be357-8cfad3df061mr133791185a.70.1773778987159; Tue, 17 Mar 2026 13:23:07 -0700 (PDT) Received: from ?IPV6:2001:1970:3847:e000:4c82:63a9:39e9:5c17? ([2001:1970:3847:e000:4c82:63a9:39e9:5c17]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8cfacdeb785sm57993585a.16.2026.03.17.13.23.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Mar 2026 13:23:05 -0700 (PDT) Message-ID: Date: Tue, 17 Mar 2026 16:23:03 -0400 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 0/7] riscv: spacemit: enable SD card support with UHS modes for OrangePi RV2 To: Iker Pedrosa , Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Yixun Lan Cc: 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, Anand Moon References: <20260316-orangepi-sd-card-uhs-v3-0-aefd3b7832df@gmail.com> Content-Language: en-US From: Trevor Gamblin In-Reply-To: <20260316-orangepi-sd-card-uhs-v3-0-aefd3b7832df@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2026-03-16 10:03, Iker Pedrosa wrote: > This series enables complete SD card support for the Spacemit K1-based > OrangePi RV2 board, including UHS (Ultra High Speed) modes for > high-performance SD card operation. > > Background > > The Spacemit K1 SoC includes an SDHCI controller capable of supporting > SD cards up to UHS-I speeds (SDR104 at 208MHz). However, mainline > currently lacks basic SD controller configuration, SDHCI driver > enhancements for voltage switching and tuning, and power management > infrastructure. > > Implementation > > The series enables SD card support through coordinated layers: > > - Hardware infrastructure (patches 1-2): Device tree bindings for voltage > switching hardware and essential clock infrastructure. > - SDHCI driver enhancements (patches 3-7): Regulator framework > integration, pinctrl state switching for voltage domains, AIB register > programming, and comprehensive SDR tuning support for reliable UHS > operation. > - SoC and board integration (patches 8-10): Complete K1 SoC controller > definitions, PMIC power infrastructure, and OrangePi RV2 board enablement > with full UHS support. > > This transforms the OrangePi RV2 from having no SD card support to full > UHS-I capability, enabling high-performance storage up to 208MHz. Hi, For all patches except 7/7 (k1-bananapi-f3): Tested-by: Trevor Gamblin > > Signed-off-by: Iker Pedrosa > --- > Changes in v3: > - Rebase on mmc.git/next to resolve conflicts with "mmc: sdhci-of-k1: > add reset support" patch. > - Squash tuning infrastructure and implementation patches (3 and 4) > together to form complete functionality and avoid unused function > warnings. > - Reduce code nesting: implemented an early return sanity check in > spacemit_sdhci_voltage_switch() to reduce indentation and improve > logic flow. > - Refactor pinctrl initialization: moved pinctrl resource acquisition > and state lookup into a dedicated helper function, > spacemit_sdhci_get_pins(). > - Use generic regulator node names (buck4, aldo1) instead of > device-specific aliases (sd_vmmc, sd_vqmmc) to better reflect that > these PMIC outputs serve multiple devices. > - Remove dead code handling 3.3V voltage switching from > spacemit_sdhci_voltage_switch(). > - Optimize tuning algorithm to use single-pass window detection instead > of storing results in array, reducing memory usage and complexity. > - Remove unnecessary card detect check in execute_tuning() - rely on MMC > core. > - Clarify commit message to mention both SD (UHS-I) and eMMC (HS200) > tuning support. > - Add SD card support for Banana Pi BPI-F3 board with UHS-I capabilities > following the same pattern as OrangePi RV2. > - Link to v2: https://lore.kernel.org/r/20260309-orangepi-sd-card-uhs-v2-0-5bb2b574df5d@gmail.com > > Changes in v2: > - Removed custom AIB voltage switching code per maintainer feedback. The > existing pinctrl driver already handles AIB voltage switching > automatically via power-source property changes during UHS mode > transitions. This eliminates code duplication. > - Squashed regulator and pinctrl commits into single voltage switching > implementation. > - Moved voltage switching callback from dynamic probe assignment to > static sdhci_ops declaration. Removed redundant SDHCI core call since > the framework handles standard voltage switching automatically. > - Made clock override (SDHC_OVRRD_CLK_OEN | SDHC_FORCE_CLK_ON) > conditional for SD/SDIO cards only. This follows vendor driver pattern > of differentiating SD and eMMC card handling. > - Include no-mmc property for SD card. > - Link to v1: https://lore.kernel.org/r/20260302-orangepi-sd-card-uhs-v1-0-89c219973c0c@gmail.com > > --- > Iker Pedrosa (7): > mmc: sdhci-of-k1: enable essential clock infrastructure for SD operation > mmc: sdhci-of-k1: add regulator and pinctrl voltage switching support > mmc: sdhci-of-k1: add comprehensive SDR tuning support > riscv: dts: spacemit: k1: add SD card controller and pinctrl support > riscv: dts: spacemit: k1-orangepi-rv2: add PMIC and power infrastructure > riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes > riscv: dts: spacemit: k1-bananapi-f3: add SD card support with UHS modes > > arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts | 23 ++- > arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts | 67 +++++++ > arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 40 ++++ > arch/riscv/boot/dts/spacemit/k1.dtsi | 13 ++ > drivers/mmc/host/sdhci-of-k1.c | 243 +++++++++++++++++++++++ > 5 files changed, 384 insertions(+), 2 deletions(-) > --- > base-commit: f38f518dda1f1decc7a39556fe3231b0d1b84e1e > change-id: 20260226-orangepi-sd-card-uhs-0ecb05839b0c > > Best regards,