Received: by 2002:ac0:8c8e:0:0:0:0:0 with SMTP id r14csp505404ima; Wed, 6 Feb 2019 03:54:59 -0800 (PST) X-Google-Smtp-Source: AHgI3IaUt+y49Rf8YvqKFVCDH+A2gDPaq1IGhIT32Qv4HU9fNTQ01yA5FDCLHZwqIpvlluOmZS5l X-Received: by 2002:a63:3287:: with SMTP id y129mr9243491pgy.337.1549454099721; Wed, 06 Feb 2019 03:54:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549454099; cv=none; d=google.com; s=arc-20160816; b=0GDvgq9xS/DPzMFAcmYAqIEz4J1V709kgB+1JE0OyGkPspRoFrKkkmyyfoEeieJ1Ia MQVLDnYI2MqyfJ+7fXF84xkUbQJiwJv6D45AHSzHHB7l9kHYYBOc4zfA8ZpvtiOUwMFq rCoPNUZM7gTNhX5Cyz7RJmMKl/RG40oS6ywIHK+vy41jzBG6mNteblizqUdeDCOBeZq8 +jC+6ap0FVJpM6cnYOkjuT7UdTk4w+ShO5WkYkbMOM0GU+oBDM0liwTotfRgC9PkA9Fg qkDQvhjhAK1LYoIHGROgTQ3UFbZnEeikVV94/6w2NX/fd4LmYHcevUWGwm6SnlPpPI/c bH+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=JNBPqXdvK6H3JVDMyF1ofnH4Dh+28xIO0yTFL1Cr4/A=; b=MWfl+FTuwZP8+V7geyHfB6r9kycVP7Ejxvbsplvr21eypB6gPkpcgDH0z8cJcv0lPg tDjugdT7glR/eQFmLPFZrTdTUE0WDnaFU3oiDcS2Uv5EhzOimjHymN5Bdl8eep2bg9RM eJeC1zbMQ67vWQgUfRzNj3oGvmO3VSaxtRkrz17Ulx58koQ9i9jWLLClgEP6jT7jSNr+ 7RXsr+W09MWrLydfs/VFMBP55dXTlmeZJsN+nFQWYHYiphSmyiYxNiUX87yKT99FRpTi KaQ6yLSrFY/LWX0kCT2U+Xg1JX4h4Boj5iHaKT/pIXrG+fWrZSWg+j1XsCe8bzfYcEpn cv+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=rJhenRbL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j5si5429937pgq.82.2019.02.06.03.54.43; Wed, 06 Feb 2019 03:54:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=rJhenRbL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729893AbfBFL3F (ORCPT + 99 others); Wed, 6 Feb 2019 06:29:05 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:13332 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727654AbfBFL3E (ORCPT ); Wed, 6 Feb 2019 06:29:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1549452563; x=1580988563; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=gm13DbN1xZZTrIdgUQj2siWrVeO32meXm3sCV1CaE5M=; b=rJhenRbL/L0SrUT5W4+enwAF6a6hAFGepZowf6xplx9AyCnP3pQSWLO6 7akJ1hyFTK6vPeRJIPuO8z2p/GItzZJPlpavbCOB1hqiSrWmBwauLcvAE 5kQVoKMO38stQH8vtEai0q+RMXWEyfzeOBOnH3yD2eK+5qAzqA2OygtB7 S4LDVkwlLWNZZG4U78Txjo3kX8jHi/X2euyYXvXtxM48JOocgOjpnR0jl g/7S+9JSTUNsjlY8iyyAjzqkEqW9IgzCRBBTkqc0Wb/sIxlvbUiGt46aq HhPa3M97qoITG3PPc6SR62+S38koKkUOdSjnAPrsTjhAoRfLPMKm9M/5d w==; X-IronPort-AV: E=Sophos;i="5.56,564,1539619200"; d="scan'208";a="198777078" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 06 Feb 2019 19:29:22 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 06 Feb 2019 03:09:50 -0800 Received: from kfae422988.sdcorp.global.sandisk.com ([10.0.230.227]) by uls-op-cesaip02.wdc.com with ESMTP; 06 Feb 2019 03:29:01 -0800 From: Avri Altman To: Ulf Hansson , linux-mmc@vger.kernel.org Cc: Wolfram Sang , Adrian Hunter , Jaehoon Chung , Shawn Lin , Avi Shchislowski , Alex Lemberg , linux-kernel@vger.kernel.org, Avri Altman Subject: [PATCH v2 2/3] mmc: core: Indicate SD specs higher than 4.0 Date: Wed, 6 Feb 2019 13:28:06 +0200 Message-Id: <1549452487-17193-3-git-send-email-avri.altman@wdc.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1549452487-17193-1-git-send-email-avri.altman@wdc.com> References: <1549452487-17193-1-git-send-email-avri.altman@wdc.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SD specs version 4.x and 5.x have a dedicated slices in the SCR register. Higher versions will rely on a combination of the existing fields. Signed-off-by: Avri Altman --- drivers/mmc/core/sd.c | 5 +++++ include/linux/mmc/card.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index bd48b28..c2db94d 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -209,6 +209,11 @@ static int mmc_decode_scr(struct mmc_card *card) /* Check if Physical Layer Spec v3.0 is supported */ scr->sda_spec3 = UNSTUFF_BITS(resp, 47, 1); + if (scr->sda_spec3) { + scr->sda_spec4 = UNSTUFF_BITS(resp, 42, 1); + scr->sda_specx = UNSTUFF_BITS(resp, 38, 4); + } + if (UNSTUFF_BITS(resp, 55, 1)) card->erased_byte = 0xFF; else diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 8f429b6..d791813f 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -133,6 +133,8 @@ struct mmc_ext_csd { struct sd_scr { unsigned char sda_vsn; unsigned char sda_spec3; + unsigned char sda_spec4; + unsigned char sda_specx; unsigned char bus_widths; #define SD_SCR_BUS_WIDTH_1 (1<<0) #define SD_SCR_BUS_WIDTH_4 (1<<2) -- 1.9.1