From patchwork Fri Aug 24 09:20:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 10574935 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 E793714E1 for ; Fri, 24 Aug 2018 09:20:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D55D92C1C8 for ; Fri, 24 Aug 2018 09:20:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7E7B2C767; Fri, 24 Aug 2018 09:20:49 +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 6263B2C1C8 for ; Fri, 24 Aug 2018 09:20:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727524AbeHXMya (ORCPT ); Fri, 24 Aug 2018 08:54:30 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:38603 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbeHXMya (ORCPT ); Fri, 24 Aug 2018 08:54:30 -0400 Received: by mail-pl1-f195.google.com with SMTP id u11-v6so851833plq.5 for ; Fri, 24 Aug 2018 02:20:44 -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=f/whnT45VLYYT7w6rFBlzxRiuaWu7shxKSHq6DL46Lo=; b=QC1FLX8NO+5Z5Qx4mk2qc2OYS/dPke18g604agAfWM8KHjicg8oxmog4sc0LIQOy+p uxORZiwVSpvou8xnClCjeXyG5MDXN5oXwj2QUd0UKlN7Knf6p3Nr3W29zN90d5DzZXCL whquSrHXHlpWrkvkRzNqunFjWQaXKVWFi4sII= 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=f/whnT45VLYYT7w6rFBlzxRiuaWu7shxKSHq6DL46Lo=; b=tBizBEPlNYF4K92SmQulXrbnpzj5+POJVEpUVW6VpM6NYHV3OGBWTkrArswfzwy+MX 8UskMd9H8Ayq5/dWrAdULiQ0Qtm3/Qn0qwiWsY6IEe1/SUZYGEp/QPaQCD3XewqG44BW mEDQpSbJRDYu40ZDqIwfr9s1lnggtTDy+wlKK7QmkbYxXa+0YiiSty/A4qWFbueuWyGF +mV57BMW4EcdUynMo5JHFxKLB4/LZQlWuXw+HFD3iuBVa7O5HDwcSGP6gB3WojzAO7ay QHSOQwOOPtYcI93Q7WqJh52FeBjlcX7w72FvPdl5K8t4yMM4CyUWfc8jL0qqztk6U7iv lrCg== X-Gm-Message-State: APzg51BKLZKh5N8y9tb3c3cen4IdsjeVWmEF/1EURjg30oaKP6q66k40 y8mqZWvR0SlCe9jeSHvOBSYjOw== X-Google-Smtp-Source: ANB0VdZCabWDlP9qEEmSf1dxbCk/NQ4AHBBc1ktAG8lcJgLIExw+rg39lZqjQDlmFrisNq/CfFh4kQ== X-Received: by 2002:a17:902:7246:: with SMTP id c6-v6mr909938pll.38.1535102444372; Fri, 24 Aug 2018 02:20:44 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id g6-v6sm9520314pfb.11.2018.08.24.02.20.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Aug 2018 02:20:43 -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 V6 0/9] mmc: add support for sdhci 4.0 Date: Fri, 24 Aug 2018 17:20:19 +0800 Message-Id: <1535102428-20332-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. This patchset is based on the unmerged patch: https://lkml.org/lkml/2018/8/20/140 Changes from V5: - Added SDHCI_QUIRK2_BROKEN_32BIT_BLK_CNT; - Removed sdhci_enable_cmd23(); - Added setting SDHCI_ARGUMENT2 for CMD23 in v4_mode; - Clear SDHCI_CMD23_ENABLE when not using CMD23; - Moved disabling auto-CMD23 to sprd sdhci driver; - Added sdhci_sprd_request() function to hook to mmc_host_ops.request. Previous patch series: 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 | 485 +++++++++++++++++++++ drivers/mmc/host/sdhci.c | 225 ++++++++-- drivers/mmc/host/sdhci.h | 23 +- 6 files changed, 738 insertions(+), 50 deletions(-) create mode 100644 Documentation/devicetree/bindings/mmc/sdhci-sprd.txt create mode 100644 drivers/mmc/host/sdhci-sprd.c