From patchwork Thu Nov 13 16:29:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Shchislowski X-Patchwork-Id: 5299111 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 981369F2F1 for ; Thu, 13 Nov 2014 16:30:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD5D3201F4 for ; Thu, 13 Nov 2014 16:30:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B138A201F2 for ; Thu, 13 Nov 2014 16:30:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933113AbaKMQar (ORCPT ); Thu, 13 Nov 2014 11:30:47 -0500 Received: from mail-bl2on0062.outbound.protection.outlook.com ([65.55.169.62]:41136 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933037AbaKMQar (ORCPT ); Thu, 13 Nov 2014 11:30:47 -0500 Received: from BLUPR02CA043.namprd02.prod.outlook.com (25.160.23.161) by CO1PR02MB128.namprd02.prod.outlook.com (10.242.163.155) with Microsoft SMTP Server (TLS) id 15.1.16.15; Thu, 13 Nov 2014 16:30:42 +0000 Received: from BL2FFO11FD008.protection.gbl (2a01:111:f400:7c09::142) by BLUPR02CA043.outlook.office365.com (2a01:111:e400:8ad::33) with Microsoft SMTP Server (TLS) id 15.1.16.15 via Frontend Transport; Thu, 13 Nov 2014 16:30:42 +0000 Received: from milsmgep12.sandisk.com (63.163.107.173) by BL2FFO11FD008.mail.protection.outlook.com (10.173.161.4) with Microsoft SMTP Server id 15.1.6.13 via Frontend Transport; Thu, 13 Nov 2014 16:30:41 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep12.sandisk.com (Symantec Messaging Gateway) with SMTP id A6.F0.11368.1BCD4645; Thu, 13 Nov 2014 08:30:41 -0800 (PST) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.195.1; Thu, 13 Nov 2014 08:30:40 -0800 X-AuditID: ac160a69-f79066d000002c68-d2-5464dcb19d50 Received: from KFAC110926.sdcorp.global.sandisk.com ( [10.177.8.100]) by milsmgip12.sandisk.com (Symantec Messaging Gateway) with SMTP id AB.89.24031.FACD4645; Thu, 13 Nov 2014 08:30:41 -0800 (PST) From: Avi Shchislowski To: CC: , , , Avi Shchislowski , Alex Lemberg Subject: [PATCH 1/3] mmc: Add eMMC5.0 ffu ext_csd field Date: Thu, 13 Nov 2014 18:29:35 +0200 Message-ID: <1415896175-27379-1-git-send-email-avi.shchislowski@sandisk.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPLMWRmVeSWpSXmKPExsWyRoxnke7GOykhBvumyFhMuLyd0eLI/35G i+Nrwx2YPe5c28PmcePVQiaPz5vkApijuGxSUnMyy1KL9O0SuDI+3n/CVvBKqOLtrcfsDYx7 +LsYOTkkBEwkPiz5zwZhi0lcuLceyObiEBI4wShxff9DVghnB6PE4QXfWWA6tqxcCJU4ySjx e/dLRpAEm4CpxMy2pUxdjBwcIgIyEo0HjEFqmAXWMkpMeNILViMsYC5xd/4NsHUsAqoS9y52 gA3lFfCRWH7mGTtIr4SAgsScSTYgvRIC31gkpq48xQxRIyhxcuYTsHpmAQmJgy9egMWFBDQl Ti5czjaBUXAWkrJZSMoWMDKtYhTLzcwpzk1PLTA00itOzEvJLM7WS87P3cQIDlauzB2MKyaZ H2IU4GBU4uF9wZISIsSaWFZcmXuIUYKDWUmE1/swUIg3JbGyKrUoP76oNCe1+BCjNAeLkjiv 4PQsfyGB9MSS1OzU1ILUIpgsEwenVAOjIueMfuuomRuUtOctPbqIoyxM+8J/i+ObUu8FinzU fp8t9friT6a3wsLOm6v3mj5sbLtikn7j/H+tpoXffhrvOzy9/XrOGrv8pllz+uNNc6SU+fV1 79bIGuhU7s7Py0lRNOrj3HBF+7t10lPuGf/d1p/L/62m8+b+u5QYsR5vB84rPMI8tlJKLMUZ iYZazEXFiQBzN2HkUgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprCJMWRmVeSWpSXmKPExsXCtZEjRXfjnZQQg1e3+SxuPvjBZrFz7zom iwmXtzNaHPnfz2hxfG24A6vHnWt72DxuvFrI5DFtzXkmj8+b5AJYorhsUlJzMstSi/TtErgy Pt5/wlbwSqji7a3H7A2Me/i7GDk5JARMJLasXMgKYYtJXLi3nq2LkYtDSOA4o8SqmRfBEmwC phIz25YygdgiAlISPU+bmUGKmAVWM0ocWbKFGSQhLGAucXf+DTYQm0VAVeLexQ4WEJtXwEdi Y+MvoBoOoA0KEnMm2Uxg5FrAyLCKUSw3M6c4Nz2zwNBIrzgxLyWzOFsvOT93EyPY35xROxiv TzQ/xMjEwSnVwOh3gP31rLs7BV9PcuG76frbf9/8Nt9JrdcP5R09dt/LcV/Nsg8/Vr80Upp0 XnITF9fjEMfSio8Hr5fs7sgxmXhqjeKNbCeR0uX8RdwZEyL3Mu1cm/EoKktcPLMt/XuVunB4 8Y3O9hcTtikWXH3y1OhZSNtGb+t33xaGODbsKf0fdUFQT/OA0RMlluKMREMt5qLiRAB2eo1F pwEAAA== MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:63.163.107.173; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(438002)(199003)(189002)(95666004)(21056001)(81156004)(62966003)(107046002)(97736003)(50226001)(33646002)(99396003)(50986999)(120916001)(229853001)(20776003)(47776003)(64706001)(77156002)(2351001)(104166001)(106466001)(36756003)(89996001)(88136002)(87286001)(31966008)(87936001)(86362001)(4396001)(84676001)(46102003)(44976005)(92726001)(50466002)(102836001)(48376002)(110136001)(92566001)(93916002)(68736004)(69596002)(19580395003)(19580405001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO1PR02MB128; H:milsmgep12.sandisk.com; FPR:; MLV:sfv; PTR:ErrorRetry; A:1; MX:1; LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:CO1PR02MB128; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:CO1PR02MB128; X-Forefront-PRVS: 0394259C80 Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.173 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.173; helo=milsmgep12.sandisk.com; Authentication-Results: spf=pass (sender IP is 63.163.107.173) smtp.mailfrom=Avi.Shchislowski@sandisk.com; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:CO1PR02MB128; X-OriginatorOrg: sandisk.com Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Signed-off-by: Avi Shchislowski Signed-off-by: Alex Lemberg --- drivers/mmc/core/mmc.c | 3 +++ include/linux/mmc/card.h | 1 + include/linux/mmc/mmc.h | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 02ad792..000f7e6 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -571,6 +571,9 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd) card->ext_csd.ffu_capable = (ext_csd[EXT_CSD_SUPPORTED_MODE] & 0x1) && !(ext_csd[EXT_CSD_FW_CONFIG] & 0x1); + card->ext_csd.ffu_mode_op = ext_csd[EXT_CSD_FFU_FEATURES]; + } else { + card->ext_csd.ffu_capable = false; } out: return err; diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 4d69c00..cb97e51 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -89,6 +89,7 @@ struct mmc_ext_csd { unsigned int boot_ro_lock; /* ro lock support */ bool boot_ro_lockable; bool ffu_capable; /* Firmware upgrade support */ + bool ffu_mode_op; /* FFU mode operation */ #define MMC_FIRMWARE_LEN 8 u8 fwrev[MMC_FIRMWARE_LEN]; /* FW version */ u8 raw_exception_status; /* 54 */ diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 49ad7a9..cab1796 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h @@ -277,6 +277,9 @@ struct _mmc_csd { * EXT_CSD fields */ +#define EXT_CSD_FFU_STATUS 26 /* R */ +#define EXT_CSD_MODE_OPERATION_CODES 29 /* W */ +#define EXT_CSD_MODE_CONFIG 30 /* R/W */ #define EXT_CSD_FLUSH_CACHE 32 /* W */ #define EXT_CSD_CACHE_CTRL 33 /* R/W */ #define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */ @@ -334,6 +337,11 @@ struct _mmc_csd { #define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ #define EXT_CSD_PWR_CL_DDR_200_360 253 /* RO */ #define EXT_CSD_FIRMWARE_VERSION 254 /* RO, 8 bytes */ +#define EXT_CSD_PWR_CL_DDR_200_360 253 /* RO */ +#define EXT_CSD_NUM_OF_FW_SEC_PROG 302 /* RO, 4 bytes */ +#define EXT_CSD_FFU_ARG 487 /* RO, 4 bytes */ +#define EXT_CSD_OPERATION_CODE_TIMEOUT 491 /* RO */ +#define EXT_CSD_FFU_FEATURES 492 /* RO */ #define EXT_CSD_SUPPORTED_MODE 493 /* RO */ #define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */ #define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */