Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753691AbbFDPIt (ORCPT ); Thu, 4 Jun 2015 11:08:49 -0400 Received: from mail-by2on0143.outbound.protection.outlook.com ([207.46.100.143]:26465 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751677AbbFDPIq (ORCPT ); Thu, 4 Jun 2015 11:08:46 -0400 Authentication-Results: spf=none (sender IP is 165.204.84.222) smtp.mailfrom=amd.com; gmail.com; dkim=none (message not signed) header.d=none; X-WSS-ID: 0NPFCLH-08-58F-02 X-M-MSG: From: Wan ZongShun To: , CC: , Vincent Wan , "Wan ZongShun" , Wan ZongShun Subject: [PATCH] SDHCI: Change AMD SDHCI quirk application scope Date: Thu, 4 Jun 2015 22:33:57 +0800 Message-ID: <1433428437-6067-1-git-send-email-Vincent.Wan@amd.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD035;1:SLhMTWgveJgoJTmRy4OIH69CFynjKt4FMFwOu75zXs4wRSJW/ltUvG1pPCPPLayQv28nnxJp74R8vH4mdaxy38aVhoauU3Ci4Iw1AidFIgXOFNKI9ryHuKZhQL2/hc/w8+q9+WUqIQ6XqHUCsSC+gWdfgE+tCWhcgnQq3Luz6OfoxYeqUc0qvIVGvvZ1M/7QBIhjOH9We3/n0Jo2i4c5aoViS1rPuDr8tZNyO4AeKAL485TqcRNnZc1wauqahKzfJkV+9bfJys3B3qmYuXDCF1rY4t+vXU18OTHThPArYN7WVFg++Zrd2CkK+vkiaG9KoLtWCPIS2KfZJMYYXB5GxA== X-Forefront-Antispam-Report: CIP:165.204.84.222;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(428002)(189002)(199003)(53416004)(105586002)(46102003)(229853001)(50466002)(48376002)(86362001)(77156002)(62966003)(87936001)(19580405001)(19580395003)(106466001)(64706001)(47776003)(5001860100001)(50226001)(5001830100001)(5001770100001)(101416001)(36756003)(4001540100001)(68736005)(50986999)(77096005)(189998001)(97736004)(92566002)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BN1PR02MB071;H:atltwp02.amd.com;FPR:;SPF:None;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR02MB071; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(520003)(5005006)(3002001);SRVR:BN1PR02MB071;BCL:0;PCL:0;RULEID:;SRVR:BN1PR02MB071; X-Forefront-PRVS: 0597911EE1 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2015 14:36:58.5593 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96;Ip=[165.204.84.222];Helo=[atltwp02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR02MB071 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2399 Lines: 78 From: Vincent Wan Change this quirk to apply to AMD Carrizo platform. Signed-off-by: Vincent Wan Signed-off-by: Wan ZongShun Signed-off-by: Wan ZongShun Tested-by: Nath, Arindam Tested-by: Ramesh, Ramya --- drivers/mmc/host/sdhci-pci.c | 25 ++++++++++++++++++++++++- include/linux/pci_ids.h | 1 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c index f208f20..94f54d2 100644 --- a/drivers/mmc/host/sdhci-pci.c +++ b/drivers/mmc/host/sdhci-pci.c @@ -724,14 +724,37 @@ static const struct sdhci_pci_fixes sdhci_rtsx = { .probe_slot = rtsx_probe_slot, }; +/*AMD chipset generation*/ +enum amd_chipset_gen { + AMD_CHIPSET_BEFORE_ML, + AMD_CHIPSET_CZ, + AMD_CHIPSET_NL, + AMD_CHIPSET_UNKNOWN, +}; + static int amd_probe(struct sdhci_pci_chip *chip) { struct pci_dev *smbus_dev; + enum amd_chipset_gen gen; smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, NULL); + if (smbus_dev) { + gen = AMD_CHIPSET_BEFORE_ML; + } else { + smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, + PCI_DEVICE_ID_AMD_KERNCZ_SMBUS, NULL); + if (smbus_dev) { + if (smbus_dev->revision < 0x51) + gen = AMD_CHIPSET_CZ; + else + gen = AMD_CHIPSET_NL; + } else { + gen = AMD_CHIPSET_UNKNOWN; + } + } - if (smbus_dev && (smbus_dev->revision < 0x51)) { + if ((gen == AMD_CHIPSET_BEFORE_ML) || (gen == AMD_CHIPSET_CZ)) { chip->quirks2 |= SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD; chip->quirks2 |= SDHCI_QUIRK2_BROKEN_HS200; } diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 2f7b9a4..cb63a7b 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -579,6 +579,7 @@ #define PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE 0x7800 #define PCI_DEVICE_ID_AMD_HUDSON2_SMBUS 0x780b #define PCI_DEVICE_ID_AMD_HUDSON2_IDE 0x780c +#define PCI_DEVICE_ID_AMD_KERNCZ_SMBUS 0x790b #define PCI_VENDOR_ID_TRIDENT 0x1023 #define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000 -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/