From patchwork Tue May 4 16:12:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 430877 Delivered-To: patches@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp3936278jao; Tue, 4 May 2021 09:12:32 -0700 (PDT) X-Received: by 2002:ac2:5393:: with SMTP id g19mr17478702lfh.459.1620144752083; Tue, 04 May 2021 09:12:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620144752; cv=none; d=google.com; s=arc-20160816; b=r0wGXfIciVuLl/DOVo7e4qgB2Bw2Opb+sCYTzzMlXGop1r8/JjaYxPt2SDdi6AYs/J pzictNc8aYCKpxFNWqWbnYLsyu4uwdZiU39I8CXk+5VzLuQtBqQaoZM0kPbFpXOBL9po pgm69z/D2ATEHXk/1sHTpmaWCqqg6Zu4HsxMHJpZYUcoLAc7qjzEDNOCNqctnqW9GPlU Jl8w/MqR/tA37nV45xo+maoXm8OcaOM1VbP2Kic/cun7c5vPLB3+B3KLxn52jOY+FYTq QhxigPWqeiCDJs98+iJI5qwScOmjMjLPo1Go/kFhgvORui4eaWrnyI8PFzf8nNJQNdM0 jtdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=7lkJK3ZMQxyrUYaqzq8/RCOAe7M9iq9dnCm7X+7Tk6w=; b=fpMp6zVgYRyfXVDp68BenVPRKk4d9ynuaI2CY1qACF1j2z0JfxisvWiJb+No9Yd8OH IXprk+NP8jG7BM7VH4d71cnIu+3AbrpOBCFbdQaHSPiXse+sJ6CpkNTxyILMi/ogMaAC XiaOLl6nYZRhUNSzAd0oMYgxJaV5fDhPEhyBb4BeMqlbWdKQbmVb3bka7M0T/5Ln6vmS 5M5RvdSokZ9gjLE5rruYxIEjYs4vyFh6wc4ZNL0jcicMONPKO71sd/JxnXYa58ANGWLa sghe71mjN/LLO5LwXy8lKU93oRNiLnQhiJDayR+qvzU19Fun95lrj1assm6cdo3f5rXZ HFCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tct+1MB0; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id n18sor1312695lfu.176.2021.05.04.09.12.31 for (Google Transport Security); Tue, 04 May 2021 09:12:32 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tct+1MB0; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7lkJK3ZMQxyrUYaqzq8/RCOAe7M9iq9dnCm7X+7Tk6w=; b=Tct+1MB0IFW/9oXqyLhJenJz+W3OxAZ87NhH7cnhGgVMgNaYUzAvGLFV5TamrGpII3 RWUeihnmK/zl5oRlUjqrx8IWtoNhLBWtXnwMtkJBdYXEwPd0YmwBk2rFGPSEOKf5gj4z zM96lEiFyGoiqXzHwz8XD+goa17A3MQ0L1dek03mlWH1VFHsJp8CD7jMf1AheKzR859i bLXgyjsidOSLeqV38gHLR7r44tUixeTmGosF+CdqA8EL6b9XeVAGGfEW05KBUa4Ta60G tRCHjh8QlGZlA8xa3yzu+laXXqqcNdgh3BPpJSr45VFaW+wTVMnKsUpSvLTEowQm/Drq iIUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7lkJK3ZMQxyrUYaqzq8/RCOAe7M9iq9dnCm7X+7Tk6w=; b=DqbxdBINVDHNg8PVvjSVAcoz3RkP4QzkDNrDN/+qetJ6Ft7AE00H3NS9sPf8utHAZb SaWq8G1rG6C67IdlMCtSgkemgCqSCXBgIm0nqToHh7MTEapyOt4J+0PoccrN9AhB0n+R trpbDoSASDzkcDYqSF8bdhFT2o7YxLjnwcJYVyR6KGMJt2XB0qI8YtYzTQCycG6f33OW FBe//UKUIYoqxqd0XzJhayDIjAgMm5l2c4ThpeWurxPeFJo8kj9qUjiL3Flf4zT31QDh LkSNHSYA18l0E+vQhqm+hZo/RTXI1/kwNERQYD6JhV4eX0GAzdTZi6EzPmtl4AuT+6d4 9Ehg== X-Gm-Message-State: AOAM532HDh66vJVlBRwXY5AWtP+B/mb3ODafZRvmD0TfChV1RiLP72gX zpBomSK6IUeGam2E7CnsQV14uHYT X-Google-Smtp-Source: ABdhPJysYt8OkmHwrobuZn1T35XlaRK5aGAipkn4MC0S4T0NJEqylzAwDppNwaSwpmVNWjJJByPTQw== X-Received: by 2002:ac2:44da:: with SMTP id d26mr16518818lfm.522.1620144751714; Tue, 04 May 2021 09:12:31 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-98-128-180-197.NA.cust.bahnhof.se. [98.128.180.197]) by smtp.gmail.com with ESMTPSA id s20sm164193ljs.116.2021.05.04.09.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 May 2021 09:12:30 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter Cc: Linus Walleij , Wolfram Sang , Shawn Lin , Avri Altman , Masami Hiramatsu , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 00/11] Initital support for new power/perf features for SD cards Date: Tue, 4 May 2021 18:12:11 +0200 Message-Id: <20210504161222.101536-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 In the SD spec v4.x the SD function extension registers were introduced, together with a new set of commands (CMD48/49 and CMD58/59) to read and write to them. Moreover, in v4.x a new standard function for power management features were added, while in v6.x a new standard function for performance enhancements features were added. This series implement the basics to add support for these new features (and includes some additional preparations in patch 1->7), by adding support for reading and parsing these new SD registers. In the final patch we add support for the SD poweroff notification feature, which also add a function to write to these registers. Note that, there are no HW updates need for the host to support reading/parsing of the these new SD registers. This has been tested with a 64GB Sandisk Extreme PRO UHS-I A2 card. Tests and reviews are of course greatly appreciated! Kind regards Ulf Hansson Ulf Hansson (11): mmc: core: Drop open coding when preparing commands with busy signaling mmc: core: Take into account MMC_CAP_NEED_RSP_BUSY for eMMC HPI commands mmc: core: Re-structure some code in __mmc_poll_for_busy() mmc: core: Extend re-use of __mmc_poll_for_busy() mmc: core: Enable eMMC sleep commands to use HW busy polling mmc: core: Prepare mmc_send_cxd_data() to be re-used for additional cmds mmc: core: Drop open coding in mmc_sd_switch() mmc: core: Parse the SD SCR register for support of CMD48/49 and CMD58/59 mmc: core: Read the SD function extension registers for power management mmc: core: Read performance enhancements registers for SD cards mmc: core: Add support for Power Off Notification for SD cards drivers/mmc/core/core.c | 22 +-- drivers/mmc/core/mmc.c | 43 ++--- drivers/mmc/core/mmc_ops.c | 137 +++++++------- drivers/mmc/core/mmc_ops.h | 10 +- drivers/mmc/core/sd.c | 371 ++++++++++++++++++++++++++++++++++++- drivers/mmc/core/sd_ops.c | 38 +--- include/linux/mmc/card.h | 22 +++ include/linux/mmc/sd.h | 4 + 8 files changed, 504 insertions(+), 143 deletions(-) -- 2.25.1