Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp2510691ima; Sun, 3 Feb 2019 00:53:27 -0800 (PST) X-Google-Smtp-Source: ALg8bN6rfnI/jLQa7JIAjPCHbau5TuYPIqmvEO9GL3uEFgz4LNashv+VBhuQ7n9rYl3uyKbCWnvy X-Received: by 2002:a62:2fc3:: with SMTP id v186mr46824594pfv.82.1549184007653; Sun, 03 Feb 2019 00:53:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549184007; cv=none; d=google.com; s=arc-20160816; b=We5K4xlEYVNVXBIJnOiKOpFNdXhvKyGlZFAPwZIW5D+Q6cUD3PmULBceHLNCkiGEbd 0+V41er2JFqZYMZU6yis4Jm0xr7a5FEPc7bUFGgnu/KfXUQEENmYc9fTte6qREJY5daV q5lf0ndUkluqdLISOqXqZNZJXzVw+7fA2yDl55asgGMO3kKtwDtjYpPHeNOiLOqWJqOk en9QwjRQqHHpEqyOX/WGVdCZZqcXue202uP0VVtH8UCjFOdjkVfJGknFilvhueLZ5kOh i7wAlBeP8sdwEFIybdPNhLBw/jYEVrcw/e0c2L3KgoroFeiKvR9uzC1ey1NjeJg5cswy kyow== 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=J0YIQL3ZQ+OkbKrJVGX4JwyeC87PIxW7RYtqT+peKzs=; b=tIDAK5kQ2ArVDfAxdk6nW3uqpce5r6K309XP1ARqP1zd2L4oZ7hWrRaEH288P2+LoS VOPbpvsT0MKz19wkk59yXU7h0HjB0zWf2bK32+wYig13nAsFnONotPfFEu4GVelOqqNs Oo/KEbOOcl0GcvmXU4M1xeCGDG/H9gQFxa3QKrkvWymEGvL+xWGAZ7gvsM0UFeGvqXw8 XodU/h248JCW2KA4GSHL8JuS8AtbRAkFio6Y8gRDWPt3DUxOld4Dqd9MyTLL0G9ENXfe FxQr45FEys9nE5X4v64LHl3LUi5MyjBicYLoIGQI01hcQXVzym8p3Rjj3OhVNwvYA6Ow nz/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=TQndOTfv; 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 r18si3770893pfc.199.2019.02.03.00.53.12; Sun, 03 Feb 2019 00:53:27 -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=TQndOTfv; 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 S1727755AbfBCIvU (ORCPT + 99 others); Sun, 3 Feb 2019 03:51:20 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:10972 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727323AbfBCIvU (ORCPT ); Sun, 3 Feb 2019 03:51:20 -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=1549183879; x=1580719879; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=uvIHv4YRB8ADXpT53jyv+XRLLwWBOTOF3+b4NWRgMFQ=; b=TQndOTfv/M0Zc03Rf7V+61D62qREJnjNs401K/690hft8QmXQuZVOjbm DHEjmwwbCIt8cDK6kaZNIH0RvMtuciuhoNidiUJ6D5KNjsrH/2lajTBqn FyG7UvC6uwgOzfqDr6gBNGgPIzXzA0nLzTZhSYQ6bE8soAFRzgCO+Qcoa y9kkdUq+m91Ie4ewtWfwUwmQv/3kwDA9fW+I/1C4EHk0knjFfW2/ggmJi c1wOHgHGjx/cz6x4xt+704roQygaGFmEb6BPx6xdl2EPEaO1SWMDphALv 2RhFBgAu6alREO75NR5iiikv7eoKEg3ausLTRfeWAMhoNgnSUcGVtf6CO g==; X-IronPort-AV: E=Sophos;i="5.56,555,1539619200"; d="scan'208";a="102183788" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 03 Feb 2019 16:51:19 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 03 Feb 2019 00:30:10 -0800 Received: from kfae422988.sdcorp.global.sandisk.com ([10.0.230.227]) by uls-op-cesaip01.wdc.com with ESMTP; 03 Feb 2019 00:51:16 -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 2/3] mmc: core: Indicate SD specs higher than 4.0 Date: Sun, 3 Feb 2019 10:50:27 +0200 Message-Id: <1549183828-17316-3-git-send-email-avri.altman@wdc.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1549183828-17316-1-git-send-email-avri.altman@wdc.com> References: <1549183828-17316-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 d0d9f90..44f4cbc 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 447648b..919e644 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