From patchwork Tue Jul 15 05:43:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yisun1 X-Patchwork-Id: 4551121 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C60F9C0514 for ; Tue, 15 Jul 2014 05:49:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ECEF720158 for ; Tue, 15 Jul 2014 05:49:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CCCE320155 for ; Tue, 15 Jul 2014 05:49:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757207AbaGOFtc (ORCPT ); Tue, 15 Jul 2014 01:49:32 -0400 Received: from mga02.intel.com ([134.134.136.20]:6322 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751739AbaGOFtb (ORCPT ); Tue, 15 Jul 2014 01:49:31 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 14 Jul 2014 22:49:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,662,1400050800"; d="scan'208";a="543423233" Received: from yisun2-hp-compaq-8200-elite-sff-pc.bj.intel.com ([172.16.181.152]) by orsmga001.jf.intel.com with ESMTP; 14 Jul 2014 22:49:29 -0700 From: yisun1 To: linux-mmc@vger.kernel.org Cc: yunpeng.gao@intel.com, yi.y.sun@intel.com Subject: [PATCH] mmc: sdhci: support eMMC, SD, SDIO on Moorefield. Date: Tue, 15 Jul 2014 13:43:31 +0800 Message-Id: <1405403011-13070-1-git-send-email-yi.y.sun@intel.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch is to enable eMMC, SD and SDIO on Moorefield. Signed-off-by: yisun1 --- drivers/mmc/host/sdhci-pci.c | 62 ++++++++++++++++++++++++++++++++++++++++++ drivers/mmc/host/sdhci-pci.h | 3 ++ 2 files changed, 65 insertions(+) diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c index 52c42fc..1817fa1 100644 --- a/drivers/mmc/host/sdhci-pci.c +++ b/drivers/mmc/host/sdhci-pci.c @@ -316,6 +316,43 @@ static const struct sdhci_pci_fixes sdhci_intel_mrfl_mmc = { .probe_slot = intel_mrfl_mmc_probe_slot, }; +static int intel_moor_emmc_probe_slot(struct sdhci_pci_slot *slot) +{ + slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | + MMC_CAP_NONREMOVABLE | + MMC_CAP_1_8V_DDR; + + /* Enable HS200 */ + slot->host->mmc->caps2 |= MMC_CAP2_HS200; + + return 0; +} + +static int intel_moor_sdio_probe_slot(struct sdhci_pci_slot *slot) +{ + slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE; + + return 0; +} + +static const struct sdhci_pci_fixes sdhci_intel_moor_emmc = { + .quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC, + .allow_runtime_pm = true, + .probe_slot = intel_moor_emmc_probe_slot, +}; + +static const struct sdhci_pci_fixes sdhci_intel_moor_sd = { + .quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC, + .allow_runtime_pm = true, +}; + +static const struct sdhci_pci_fixes sdhci_intel_moor_sdio = { + .quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC, + .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN, + .allow_runtime_pm = true, + .probe_slot = intel_moor_sdio_probe_slot, +}; + /* O2Micro extra registers */ #define O2_SD_LOCK_WP 0xD3 #define O2_SD_MULTI_VCC3V 0xEE @@ -911,6 +948,31 @@ static const struct pci_device_id pci_ids[] = { .subdevice = PCI_ANY_ID, .driver_data = (kernel_ulong_t)&sdhci_intel_mrfl_mmc, }, + + { + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_MOOR_EMMC, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .driver_data = (kernel_ulong_t)&sdhci_intel_moor_emmc, + }, + + { + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_MOOR_SD, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .driver_data = (kernel_ulong_t)&sdhci_intel_moor_sd, + }, + + { + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_MOOR_SDIO, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .driver_data = (kernel_ulong_t)&sdhci_intel_moor_sdio, + }, + { .vendor = PCI_VENDOR_ID_O2, .device = PCI_DEVICE_ID_O2_8120, diff --git a/drivers/mmc/host/sdhci-pci.h b/drivers/mmc/host/sdhci-pci.h index 6d71871..e006ecd 100644 --- a/drivers/mmc/host/sdhci-pci.h +++ b/drivers/mmc/host/sdhci-pci.h @@ -12,6 +12,9 @@ #define PCI_DEVICE_ID_INTEL_BYT_SD 0x0f16 #define PCI_DEVICE_ID_INTEL_BYT_EMMC2 0x0f50 #define PCI_DEVICE_ID_INTEL_MRFL_MMC 0x1190 +#define PCI_DEVICE_ID_INTEL_MOOR_EMMC 0x1490 +#define PCI_DEVICE_ID_INTEL_MOOR_SD 0x1491 +#define PCI_DEVICE_ID_INTEL_MOOR_SDIO 0x1492 #define PCI_DEVICE_ID_INTEL_CLV_SDIO0 0x08f9 #define PCI_DEVICE_ID_INTEL_CLV_SDIO1 0x08fa #define PCI_DEVICE_ID_INTEL_CLV_SDIO2 0x08fb