From patchwork Wed Aug 29 07:02:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 10579563 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 17586139B for ; Wed, 29 Aug 2018 07:03:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0525829417 for ; Wed, 29 Aug 2018 07:03:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB499294A9; Wed, 29 Aug 2018 07:03:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A5C129417 for ; Wed, 29 Aug 2018 07:03:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727054AbeH2K6j (ORCPT ); Wed, 29 Aug 2018 06:58:39 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:46895 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727542AbeH2K6i (ORCPT ); Wed, 29 Aug 2018 06:58:38 -0400 Received: by mail-pg1-f196.google.com with SMTP id b129-v6so1903086pga.13 for ; Wed, 29 Aug 2018 00:03:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=CYM0/IgCTNi0j08mXrPy6EH4E4EJhMeWQe7qtV0tC/s=; b=Y0XC3BltKBhBdHloP8sD/ChdyJYbSd1gytbONLcSoDfs1zCNBU+cw59AcQYc2QReXG PJJ2PagW4onXTb52h3GUd95SqT9qlJkM+iJy3l5Z8rYq8HKCJrWY+a6H6pYf0No3zSdm gy1KQHaghelHo0PP0gqtiOfU8aLHao2uwrG3g= 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; bh=CYM0/IgCTNi0j08mXrPy6EH4E4EJhMeWQe7qtV0tC/s=; b=S9qns29V8sjMKlSl95EcaTurc7f0uin2b9UrkNTNnPPDg89VIWC2H7OSLtJlZDsZj+ 7UPKFBE8vYZZnGCTxdiYODpCYR7X2QwFNT1WMc4DC0Cx9VXvtQrD9h0ksM1wJ34GniMf ETMcpyXg4HvQ6f266xizZbpj97MW9pMKdWXXQeLkUiCgSNkY9SKoA4UeJBEGY5M4n+lH p90hmCakumb38+zPEi1H/3WvfiAsoNkLnVxCjRu/8WHU47Rzj275EqMH2O+FCzvtNcYJ DATrDaHQkazL6rvcbURC2V3PLECY+gJCJ5eMlmVkxEqWZ2UZY4SkgOozZihoFLa9IfBd veLw== X-Gm-Message-State: APzg51C7S7WCDa4Mm8JR4zusWqFA/haAOeMrxPsZEgAh3d7Pv7YB0m4T sSzoTh+dQSBbl08WSThDx7703w== X-Google-Smtp-Source: ANB0VdZAhoP48i6Qw0EFvmTqdQMyAGXeou5pqopQ5fVFANczUokQpxDElwpVNrWjF6HTqgNYlwM/Aw== X-Received: by 2002:a63:a112:: with SMTP id b18-v6mr4555541pgf.384.1535526193329; Wed, 29 Aug 2018 00:03:13 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id d81-v6sm4317342pfj.122.2018.08.29.00.03.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Aug 2018 00:03:12 -0700 (PDT) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Orson Zhai , Baolin Wang , Billows Wu , Jason Wu , Chunyan Zhang , Chunyan Zhang Subject: [PATCH V7 0/9] mmc: add support for sdhci 4.0 Date: Wed, 29 Aug 2018 15:02:55 +0800 Message-Id: <1535526184-32718-1-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From the SD host controller version 4.0 on, SDHCI implementation either is version 3 compatible or version 4 mode. This patch-set covers those changes which are common for SDHCI 4.0 version, regardless of whether they are used with SD or eMMC storage devices. This patchset also added a new sdhci driver for Spreadtrum's controller which supports v4.0 mode. This patchset has been tested on Spreadtrum's mobile phone, emmc can be initialized, mounted, read and written, with these changes for common sdhci framework and sdhci-sprd driver. Changes from V6: - Rebased to the next branch of Ulf' mmc tree; - Replaced SDHCI_QUIRK2_BROKEN_32BIT_BLK_CNT with SDHCI_QUIRK2_USE_32BIT_BLK_CNT, also added a comment to its definition; - Added a 'flags' in sprd_host for recovering host->flags in mmc_host_ops.request. Previous patch series: v6: http://lkml.org/lkml/2018/8/24/205 v5: https://lkml.org/lkml/2018/8/16/122 v4: https://lkml.org/lkml/2018/7/23/269 v3: https://lkml.org/lkml/2018/7/8/239 v2: https://lkml.org/lkml/2018/6/14/936 v1: https://lkml.org/lkml/2018/6/8/108 Chunyan Zhang (9): mmc: sdhci: Add version V4 definition mmc: sdhci: Add sd host v4 mode mmc: sdhci: Change SDMA address register for v4 mode mmc: sdhci: Add ADMA2 64-bit addressing support for V4 mode mmc: sdhci: Add 32-bit block count support for v4 mode mmc: sdhci: Add Auto CMD Auto Select support mmc: sdhci: SDMA may use Auto-CMD23 in v4 mode mmc: sdhci-sprd: Add Spreadtrum's initial host controller dt-bindings: sdhci-sprd: Add bindings for the sdhci-sprd controller .../devicetree/bindings/mmc/sdhci-sprd.txt | 41 ++ drivers/mmc/host/Kconfig | 13 + drivers/mmc/host/Makefile | 1 + drivers/mmc/host/sdhci-sprd.c | 498 +++++++++++++++++++++ drivers/mmc/host/sdhci.c | 224 +++++++-- drivers/mmc/host/sdhci.h | 28 +- 6 files changed, 755 insertions(+), 50 deletions(-) create mode 100644 Documentation/devicetree/bindings/mmc/sdhci-sprd.txt create mode 100644 drivers/mmc/host/sdhci-sprd.c