From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 4FDE13A4F53 for ; Mon, 9 Mar 2026 11:40:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773056431; cv=none; b=rkLssKrvKjYwcRElgAoWTYN9myhQ0FVD+gf8DbKJboy5eRtvU0lUHh5xIbt+9crW5LEK6OImR7mtv+aocpusjVX5sDY2KTTC7kiwBXnBgeEYcfMQ7WeI4g+VGUY7mSdllsMa6WQvo0y1yHtGpzJIX0lNslh8iMuaSVu0BgrKrpA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773056431; c=relaxed/simple; bh=sw+Cc+5HCSi0Q2cmwdwnnqsNb62gjuQjguM1odYVI24=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=LnYqOCxvjpDIFpvPdL74uqEnikHc5xsEV0GJ68HwnK72o1mMw3p3ceGAIYbiDoYkWECEF+O5WoVTNY0qnuAnayS2RHPqMTTSPJLuarjCp1rkUE8Lvito7/BtnD71y6bzyG4mvpJBo+oXTo7OJJRpewl+qb4m4nJ7lakb0In6SF4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HwRxH/Jp; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HwRxH/Jp" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-439b2965d4bso6657973f8f.2 for ; Mon, 09 Mar 2026 04:40:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773056428; x=1773661228; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=S7AMv4ruvD0WDb3IJGhR9swDRb827tGwwDotiEuQEfU=; b=HwRxH/JpsBFfwe+t12fUdPECY2DkbbFg0kOP7ELnCFf+PJuKaWGgSfFnwHzPjco0L8 7tjaM55zWsLZaufMjl0WeF66azIHuvA/taOKMsisb7aAtediZD+ST6ub4qyqKze+Mzf8 Y4/g9ECqiad39EXOxzI4Dz/tdcZIxFEVPoLQCjom106P2E4RnChoruzzJxp9nVSCFQF1 z97/WonLEjgzfbi1eckF+YeArkgHmLQgRW27xS2yBrZo3i84ow+gdfNjkeP9IkZB2SO9 EEMsD+/+id/xP+7U+C3pHv5ZP5WcmW69LnR0T0VhoPbHEQx0ARe4I2oIPRniTaur8RvW tAkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773056428; x=1773661228; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=S7AMv4ruvD0WDb3IJGhR9swDRb827tGwwDotiEuQEfU=; b=feRu4KTW0qciB6D5Oi7PVXZB5TNdbZEgWIFNkOvrySw60DuKU0WRdv2Qd/OGdCPuwu zw5pDI+J+bDBH6hN1WE+YmCs1+pRNqVGpKE85URQVNfDnSMrCkOCPD1zGeXNFGXuj6T8 EoNI7jnrV2xs1S+FCCmStilh4Ou5vlg+JENioR+tMolCy8KN/ZnJL0QnJV7iN9qeEhOb WHo39S4QfB93b3qe2ASM65rgXLLqiw4YVTyhj+eDkrRrTVp8LuuCCw/YgivEXtUd8Qbn qkcW0V5+Z1hhPnyDb/IPgGETUVn9Jgh/mP3E7tYltGyrJVE+a0RP5A5xhaD2KZz0E5iF qRyg== X-Forwarded-Encrypted: i=1; AJvYcCXSGuhGCUKnQyjZLcBW4ycmob0g75/m+hmlH+dRbJxXO2t9q2v6K1O93sk3gBH1YXKjks48qmFq1HnA8nM=@vger.kernel.org X-Gm-Message-State: AOJu0Yw/5m8LnaXCFK77a7YF9VzkOPxvRUbb1A3T4TVp795+w76mR4mX zWdBNEEO6YPDEUgXNV6fi9EmTLS8De0qWNqaQMqawaxwHf5A3S9uqDpC X-Gm-Gg: ATEYQzyMTVBV4MDd/J1DQFMUxNcd09kC2FEOaXg7F44dbDSqZDKCmLnKgKr6u6sOxjU k3Qc5LifgdcUwdhMqSSA69yICs6OvEddSmdJgU7/cTQRX9Z5J/U3gfGRsWMrUWwiynujGmmoP49 u4uJL3q+zvdozmpraNdMl0ta2UiCst7y3dyg8Y2duLDxxTyF2938VHsW38uz7/H6zx4KypE7vjN LQIC3rznJi7dD5QPueCj20Z8MKdsjQukQWBq+qKuXUk8t/ONNOZZ7Yq/njuh8UxYp3rMSVjp/0v L4ArpuAIjB+twfsM78jL4Lo1tCF24437fVl+lLR8OuzqT3KpqqlsgL+nHAbE97lVnPqMbIsP2BW bsH+bE/hx9JSMjzy4LYmzYkFA65TmMMctyggza3wmh7nyx23rW+fCKWB0tRrHk0j2P4jy07SDen yyYYmNXqpGTxOuFinsPdQa2RWyjuJ0wa+5rrNAAS8X7Bko9xbAWGJEYP92wTmwEXGoRRo3jOhy8 tI= X-Received: by 2002:a05:6000:1845:b0:439:c5cf:fc68 with SMTP id ffacd0b85a97d-439da3483b0mr18304868f8f.1.1773056427412; Mon, 09 Mar 2026 04:40:27 -0700 (PDT) Received: from ipedrosa-thinkpadx1carbongen12.rmtes.csb ([67.218.236.52]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439dad8ec97sm28471699f8f.5.2026.03.09.04.40.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 04:40:26 -0700 (PDT) From: Iker Pedrosa Subject: [PATCH v2 0/7] riscv: spacemit: enable SD card support with UHS modes for OrangePi RV2 Date: Mon, 09 Mar 2026 12:40:10 +0100 Message-Id: <20260309-orangepi-sd-card-uhs-v2-0-5bb2b574df5d@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/22NQQ6CMBBFr0Jm7ZhhiEhdeQ/DAoYKkwglrRIN6 d0tuHX5XvLfXyFYrzbAJVvB20WDuikBHzKQoZl6i9olBiYuiblE5zc7K4YOpfEdvoaAZKWlU1W YlgTSdPb2ru89e6sTDxqezn/2lyXf7C9YEP8PLjkSVkY4N+ZcCMm1Hxt9HMWNUMcYv7DDdL64A AAA X-Change-ID: 20260226-orangepi-sd-card-uhs-0ecb05839b0c To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Yixun Lan , 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, Iker Pedrosa X-Mailer: b4 0.14.2 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. Signed-off-by: Iker Pedrosa --- 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 SDR tuning infrastructure 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 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 | 252 +++++++++++++++++++++++ 4 files changed, 372 insertions(+) --- base-commit: ec1fb4e55df47ed043ab2ccc6787e39b9d67e49b change-id: 20260226-orangepi-sd-card-uhs-0ecb05839b0c Best regards, -- Iker Pedrosa