From patchwork Sun Feb 28 19:33:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108391 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10856C433E0 for ; Sun, 28 Feb 2021 19:34:53 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9FCF164DEE for ; Sun, 28 Feb 2021 19:34:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FCF164DEE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRq7-0006PN-NR for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:34:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRlB-0000Fe-Hf; Sun, 28 Feb 2021 14:29:45 -0500 Received: from mail-dm6nam12on2046.outbound.protection.outlook.com ([40.107.243.46]:4096 helo=NAM12-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRkz-0003Bo-Rb; Sun, 28 Feb 2021 14:29:45 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BencsjVH2lIgpPa5nHz66gijgYX0RP8Klx0vxPDxnSp3FGSO6P1wkE0AFX0+qCbSFMbrQfUEDyIku2cbpngZFyXaF9SUlwpZsp63A9QlJsgdLLJ+9p0iL2OhMqKA80yBbvW9jcpDvYNXi2nDRJNbo2zDbhA6hYCwtsE69Nw7wA2Q6zGjPY7lA3zKbJPAjqPxzYVdlsLnqAibzX6QavmAs+wRlhyV9SxvSPT50y12wj0750ZyHJRPOYxldtO1N6u1STRTZM6ge+Vd3BrUR3fe5XtfGIXL4FT7rbRHOavKphEDz8TGhh6jXQfyyOUOyu7fnoBRQQUKS9d9Mpr9tq4zOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+e9XFGU0YRS8i227VrynEUaXS6C9LJ8Z0iOADrj+eNE=; b=iKgdJdrsP8A8gmDm8Vi0VIRpHd0nJS/Dr727hpbiK2nfoaFoc15xE1NpiKa3jAIkN3x6rsLjR8ANBV7IsZr81gw/DpEqmGyqBlXoTx4hRjbpVG5vou0KtSMg7z/YZDL5C712OSn2cIXkSFwLnyE/DmTOv5/UPt3TWchQzam8aVIgFYXUousdMroqcPb77Zq9A8DwQLIwpVbL8RbZ75dFP774ZJ4mCO6Gzne3+FO/LETZFHc5V2gDwRugxEc26FuitJVRhh1LWXkfjByxymE2ogMO5ELdJDi9J02gUsqpwB6yOJDHHaviwB3+5cfIbd+DuVw9EsejQp2PgPbn3CclvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+e9XFGU0YRS8i227VrynEUaXS6C9LJ8Z0iOADrj+eNE=; b=V3gaHbxKQ1uci0q7jfL6txBOEmYplR/S8bec52+9FTKa9DERZjl7D7/QytdMTmqAUVNNDybO/f+RVtCdyRRUIDAJN0gp/TZ4zMpj4hxdZfXpGY8PWhBGqUltfD3bmJ7h+L2Kfmd+K91BN9WYufZ3ZtXuxI6jBR+7r93zk/UA9OE= Received: from CY4PR03CA0015.namprd03.prod.outlook.com (2603:10b6:903:33::25) by SN6PR02MB5199.namprd02.prod.outlook.com (2603:10b6:805:70::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.26; Sun, 28 Feb 2021 19:29:28 +0000 Received: from CY1NAM02FT032.eop-nam02.prod.protection.outlook.com (2603:10b6:903:33:cafe::21) by CY4PR03CA0015.outlook.office365.com (2603:10b6:903:33::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT032.mail.protection.outlook.com (10.152.75.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:28 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:17 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:17 -0800 Received: from [10.140.6.35] (port=57756 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRki-0003ME-9e; Sun, 28 Feb 2021 11:29:17 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 4ADBD13C0542; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 01/21] sd: sd: Remove usage of tabs in the file Date: Mon, 1 Mar 2021 01:03:07 +0530 Message-ID: <1614540807-30686-2-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c4ef8f26-763f-4680-852c-08d8dc1f2a14 X-MS-TrafficTypeDiagnostic: SN6PR02MB5199: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jfz2lR9Uc4t1+7Faet2XcQyUTah9C9VHzExHrau2mJp6KVMFI2KtJ8XtruR4ChokFkzjwfKiPgKzQU8aHE42m8EksafnW5Xvd56YVUbpCLLrDjQ3L0Jfc9GpKkOwA7lruRNTS9pqrlnuSt1Dhmx4ZgHQRwoodzipzqA/Z1XrencPOaLR/1sGW/602SZ+//8TxzMDHMZ+VtWpKwhKW7Ax3sjkHDzV3krQL8dwqHhL9YGkJmPUeyRTdI6f4IOGi1tHPdMibQntUaKUFDk4Mpbbve1iWvTc7zIK1qUhdwke05WKIGvprD2QtE521mElexTKIrmrClK3SvOzMIVUml0xQrLG0sMcuv3ELDavpqNOFmjqH2QMqrKwPnKdd0sWMO2OK2EBU3MnFyiQocKixITf5aHNyApVcobW2H7NjUlAtLXn/PdO7mfG2ZNHGA4SgJuOOQfs+6aGBezzDJeKt8umqXCgpsKkutaW/Su1un5LwFhyebUSEQ79E7Y6CN4DQkretZf+95I42CiWIl+FyjNR/kl8PqYuaeF21fUu3e6iMTKN+8ImOnxaS+xWLiIXodqxqtpvcXtFc64/VimYjucQNp3LUXjuWQpzgAwRC+kT9C+s3PnYN0izdIgJxc4coKTPVL+5uvyR3ed3oUxvquEgxDFkxZMjVak0Kw4ifx3I41+8NH0bGSRaJLIAZLAued959kLWOIx+fyOn4mEsqE/20g== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(136003)(39850400004)(396003)(376002)(346002)(46966006)(36840700001)(54906003)(186003)(36756003)(316002)(82740400003)(107886003)(336012)(5660300002)(26005)(83380400001)(42186006)(356005)(478600001)(7636003)(36860700001)(921005)(4326008)(2906002)(110136005)(82310400003)(30864003)(70586007)(8936002)(47076005)(8676002)(426003)(7416002)(2616005)(6266002)(70206006)(36906005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:28.0370 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c4ef8f26-763f-4680-852c-08d8dc1f2a14 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT032.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB5199 Received-SPF: pass client-ip=40.107.243.46; envelope-from=saipava@xilinx.com; helo=NAM12-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Set tabstop as 4 and used expandtabs Signed-off-by: Sai Pavan Boddu --- hw/sd/sd.c | 190 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 8517dbc..74b9162 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -332,39 +332,39 @@ static void sd_set_scr(SDState *sd) sd->scr[7] = 0x00; } -#define MID 0xaa -#define OID "XY" -#define PNM "QEMU!" -#define PRV 0x01 -#define MDT_YR 2006 -#define MDT_MON 2 +#define MID 0xaa +#define OID "XY" +#define PNM "QEMU!" +#define PRV 0x01 +#define MDT_YR 2006 +#define MDT_MON 2 static void sd_set_cid(SDState *sd) { - sd->cid[0] = MID; /* Fake card manufacturer ID (MID) */ - sd->cid[1] = OID[0]; /* OEM/Application ID (OID) */ + sd->cid[0] = MID; /* Fake card manufacturer ID (MID) */ + sd->cid[1] = OID[0]; /* OEM/Application ID (OID) */ sd->cid[2] = OID[1]; - sd->cid[3] = PNM[0]; /* Fake product name (PNM) */ + sd->cid[3] = PNM[0]; /* Fake product name (PNM) */ sd->cid[4] = PNM[1]; sd->cid[5] = PNM[2]; sd->cid[6] = PNM[3]; sd->cid[7] = PNM[4]; - sd->cid[8] = PRV; /* Fake product revision (PRV) */ - sd->cid[9] = 0xde; /* Fake serial number (PSN) */ + sd->cid[8] = PRV; /* Fake product revision (PRV) */ + sd->cid[9] = 0xde; /* Fake serial number (PSN) */ sd->cid[10] = 0xad; sd->cid[11] = 0xbe; sd->cid[12] = 0xef; - sd->cid[13] = 0x00 | /* Manufacture date (MDT) */ + sd->cid[13] = 0x00 | /* Manufacture date (MDT) */ ((MDT_YR - 2000) / 10); sd->cid[14] = ((MDT_YR % 10) << 4) | MDT_MON; sd->cid[15] = (sd_crc7(sd->cid, 15) << 1) | 1; } -#define HWBLOCK_SHIFT 9 /* 512 bytes */ -#define SECTOR_SHIFT 5 /* 16 kilobytes */ -#define WPGROUP_SHIFT 7 /* 2 megs */ -#define CMULT_SHIFT 9 /* 512 times HWBLOCK_SIZE */ -#define WPGROUP_SIZE (1 << (HWBLOCK_SHIFT + SECTOR_SHIFT + WPGROUP_SHIFT)) +#define HWBLOCK_SHIFT 9 /* 512 bytes */ +#define SECTOR_SHIFT 5 /* 16 kilobytes */ +#define WPGROUP_SHIFT 7 /* 2 megs */ +#define CMULT_SHIFT 9 /* 512 times HWBLOCK_SIZE */ +#define WPGROUP_SIZE (1 << (HWBLOCK_SHIFT + SECTOR_SHIFT + WPGROUP_SHIFT)) static const uint8_t sd_csd_rw_mask[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -385,31 +385,31 @@ static void sd_set_csd(SDState *sd, uint64_t size) csize = (size >> (CMULT_SHIFT + hwblock_shift)) - 1; if (size <= SDSC_MAX_CAPACITY) { /* Standard Capacity SD */ - sd->csd[0] = 0x00; /* CSD structure */ - sd->csd[1] = 0x26; /* Data read access-time-1 */ - sd->csd[2] = 0x00; /* Data read access-time-2 */ + sd->csd[0] = 0x00; /* CSD structure */ + sd->csd[1] = 0x26; /* Data read access-time-1 */ + sd->csd[2] = 0x00; /* Data read access-time-2 */ sd->csd[3] = 0x32; /* Max. data transfer rate: 25 MHz */ - sd->csd[4] = 0x5f; /* Card Command Classes */ - sd->csd[5] = 0x50 | /* Max. read data block length */ + sd->csd[4] = 0x5f; /* Card Command Classes */ + sd->csd[5] = 0x50 | /* Max. read data block length */ hwblock_shift; - sd->csd[6] = 0xe0 | /* Partial block for read allowed */ + sd->csd[6] = 0xe0 | /* Partial block for read allowed */ ((csize >> 10) & 0x03); - sd->csd[7] = 0x00 | /* Device size */ + sd->csd[7] = 0x00 | /* Device size */ ((csize >> 2) & 0xff); - sd->csd[8] = 0x3f | /* Max. read current */ + sd->csd[8] = 0x3f | /* Max. read current */ ((csize << 6) & 0xc0); - sd->csd[9] = 0xfc | /* Max. write current */ + sd->csd[9] = 0xfc | /* Max. write current */ ((CMULT_SHIFT - 2) >> 1); - sd->csd[10] = 0x40 | /* Erase sector size */ + sd->csd[10] = 0x40 | /* Erase sector size */ (((CMULT_SHIFT - 2) << 7) & 0x80) | (sectsize >> 1); - sd->csd[11] = 0x00 | /* Write protect group size */ + sd->csd[11] = 0x00 | /* Write protect group size */ ((sectsize << 7) & 0x80) | wpsize; - sd->csd[12] = 0x90 | /* Write speed factor */ + sd->csd[12] = 0x90 | /* Write speed factor */ (hwblock_shift >> 2); - sd->csd[13] = 0x20 | /* Max. write data block length */ + sd->csd[13] = 0x20 | /* Max. write data block length */ ((hwblock_shift << 6) & 0xc0); - sd->csd[14] = 0x00; /* File format group */ - } else { /* SDHC */ + sd->csd[14] = 0x00; /* File format group */ + } else { /* SDHC */ size /= 512 * KiB; size -= 1; sd->csd[0] = 0x40; @@ -503,7 +503,7 @@ static int sd_req_crc_validate(SDRequest *req) buffer[0] = 0x40 | req->cmd; stl_be_p(&buffer[1], req->arg); return 0; - return sd_crc7(buffer, 5) != req->crc; /* TODO */ + return sd_crc7(buffer, 5) != req->crc; /* TODO */ } static void sd_response_r1_make(SDState *sd, uint8_t *response) @@ -803,19 +803,19 @@ static void sd_function_switch(SDState *sd, uint32_t arg) int i, mode, new_func; mode = !!(arg & 0x80000000); - sd->data[0] = 0x00; /* Maximum current consumption */ + sd->data[0] = 0x00; /* Maximum current consumption */ sd->data[1] = 0x01; - sd->data[2] = 0x80; /* Supported group 6 functions */ + sd->data[2] = 0x80; /* Supported group 6 functions */ sd->data[3] = 0x01; - sd->data[4] = 0x80; /* Supported group 5 functions */ + sd->data[4] = 0x80; /* Supported group 5 functions */ sd->data[5] = 0x01; - sd->data[6] = 0x80; /* Supported group 4 functions */ + sd->data[6] = 0x80; /* Supported group 4 functions */ sd->data[7] = 0x01; - sd->data[8] = 0x80; /* Supported group 3 functions */ + sd->data[8] = 0x80; /* Supported group 3 functions */ sd->data[9] = 0x01; - sd->data[10] = 0x80; /* Supported group 2 functions */ + sd->data[10] = 0x80; /* Supported group 2 functions */ sd->data[11] = 0x43; - sd->data[12] = 0x80; /* Supported group 1 functions */ + sd->data[12] = 0x80; /* Supported group 1 functions */ sd->data[13] = 0x03; memset(&sd->data[14], 0, 3); @@ -940,7 +940,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) switch (req.cmd) { /* Basic commands (Class 0 and Class 1) */ - case 0: /* CMD0: GO_IDLE_STATE */ + case 0: /* CMD0: GO_IDLE_STATE */ switch (sd->state) { case sd_inactive_state: return sd->spi ? sd_r1 : sd_r0; @@ -952,14 +952,14 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 1: /* CMD1: SEND_OP_CMD */ + case 1: /* CMD1: SEND_OP_CMD */ if (!sd->spi) goto bad_cmd; sd->state = sd_transfer_state; return sd_r1; - case 2: /* CMD2: ALL_SEND_CID */ + case 2: /* CMD2: ALL_SEND_CID */ if (sd->spi) goto bad_cmd; switch (sd->state) { @@ -972,7 +972,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 3: /* CMD3: SEND_RELATIVE_ADDR */ + case 3: /* CMD3: SEND_RELATIVE_ADDR */ if (sd->spi) goto bad_cmd; switch (sd->state) { @@ -987,7 +987,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 4: /* CMD4: SEND_DSR */ + case 4: /* CMD4: SEND_DSR */ if (sd->spi) goto bad_cmd; switch (sd->state) { @@ -1002,7 +1002,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) case 5: /* CMD5: reserved for SDIO cards */ return sd_illegal; - case 6: /* CMD6: SWITCH_FUNCTION */ + case 6: /* CMD6: SWITCH_FUNCTION */ switch (sd->mode) { case sd_data_transfer_mode: sd_function_switch(sd, req.arg); @@ -1016,7 +1016,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 7: /* CMD7: SELECT/DESELECT_CARD */ + case 7: /* CMD7: SELECT/DESELECT_CARD */ if (sd->spi) goto bad_cmd; switch (sd->state) { @@ -1054,7 +1054,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 8: /* CMD8: SEND_IF_COND */ + case 8: /* CMD8: SEND_IF_COND */ if (sd->spec_version < SD_PHY_SPECv2_00_VERS) { break; } @@ -1072,7 +1072,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) sd->vhs = req.arg; return sd_r7; - case 9: /* CMD9: SEND_CSD */ + case 9: /* CMD9: SEND_CSD */ switch (sd->state) { case sd_standby_state: if (sd->rca != rca) @@ -1094,7 +1094,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 10: /* CMD10: SEND_CID */ + case 10: /* CMD10: SEND_CID */ switch (sd->state) { case sd_standby_state: if (sd->rca != rca) @@ -1116,7 +1116,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 12: /* CMD12: STOP_TRANSMISSION */ + case 12: /* CMD12: STOP_TRANSMISSION */ switch (sd->state) { case sd_sendingdata_state: sd->state = sd_transfer_state; @@ -1133,7 +1133,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 13: /* CMD13: SEND_STATUS */ + case 13: /* CMD13: SEND_STATUS */ switch (sd->mode) { case sd_data_transfer_mode: if (sd->rca != rca) @@ -1146,7 +1146,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 15: /* CMD15: GO_INACTIVE_STATE */ + case 15: /* CMD15: GO_INACTIVE_STATE */ if (sd->spi) goto bad_cmd; switch (sd->mode) { @@ -1163,7 +1163,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) break; /* Block read commands (Classs 2) */ - case 16: /* CMD16: SET_BLOCKLEN */ + case 16: /* CMD16: SET_BLOCKLEN */ switch (sd->state) { case sd_transfer_state: if (req.arg > (1 << HWBLOCK_SHIFT)) { @@ -1180,7 +1180,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 17: /* CMD17: READ_SINGLE_BLOCK */ + case 17: /* CMD17: READ_SINGLE_BLOCK */ switch (sd->state) { case sd_transfer_state: @@ -1199,7 +1199,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 18: /* CMD18: READ_MULTIPLE_BLOCK */ + case 18: /* CMD18: READ_MULTIPLE_BLOCK */ switch (sd->state) { case sd_transfer_state: @@ -1244,7 +1244,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) break; /* Block write commands (Class 4) */ - case 24: /* CMD24: WRITE_SINGLE_BLOCK */ + case 24: /* CMD24: WRITE_SINGLE_BLOCK */ switch (sd->state) { case sd_transfer_state: /* Writing in SPI mode not implemented. */ @@ -1274,7 +1274,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 25: /* CMD25: WRITE_MULTIPLE_BLOCK */ + case 25: /* CMD25: WRITE_MULTIPLE_BLOCK */ switch (sd->state) { case sd_transfer_state: /* Writing in SPI mode not implemented. */ @@ -1304,7 +1304,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 26: /* CMD26: PROGRAM_CID */ + case 26: /* CMD26: PROGRAM_CID */ if (sd->spi) goto bad_cmd; switch (sd->state) { @@ -1319,7 +1319,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 27: /* CMD27: PROGRAM_CSD */ + case 27: /* CMD27: PROGRAM_CSD */ switch (sd->state) { case sd_transfer_state: sd->state = sd_receivingdata_state; @@ -1333,7 +1333,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) break; /* Write protection (Class 6) */ - case 28: /* CMD28: SET_WRITE_PROT */ + case 28: /* CMD28: SET_WRITE_PROT */ switch (sd->state) { case sd_transfer_state: if (addr >= sd->size) { @@ -1352,7 +1352,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 29: /* CMD29: CLR_WRITE_PROT */ + case 29: /* CMD29: CLR_WRITE_PROT */ switch (sd->state) { case sd_transfer_state: if (addr >= sd->size) { @@ -1371,7 +1371,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 30: /* CMD30: SEND_WRITE_PROT */ + case 30: /* CMD30: SEND_WRITE_PROT */ switch (sd->state) { case sd_transfer_state: sd->state = sd_sendingdata_state; @@ -1386,7 +1386,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) break; /* Erase commands (Class 5) */ - case 32: /* CMD32: ERASE_WR_BLK_START */ + case 32: /* CMD32: ERASE_WR_BLK_START */ switch (sd->state) { case sd_transfer_state: sd->erase_start = req.arg; @@ -1397,7 +1397,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 33: /* CMD33: ERASE_WR_BLK_END */ + case 33: /* CMD33: ERASE_WR_BLK_END */ switch (sd->state) { case sd_transfer_state: sd->erase_end = req.arg; @@ -1408,7 +1408,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 38: /* CMD38: ERASE */ + case 38: /* CMD38: ERASE */ switch (sd->state) { case sd_transfer_state: if (sd->csd[14] & 0x30) { @@ -1428,7 +1428,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) break; /* Lock card commands (Class 7) */ - case 42: /* CMD42: LOCK_UNLOCK */ + case 42: /* CMD42: LOCK_UNLOCK */ switch (sd->state) { case sd_transfer_state: sd->state = sd_receivingdata_state; @@ -1451,7 +1451,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) return sd_illegal; /* Application specific commands (Class 8) */ - case 55: /* CMD55: APP_CMD */ + case 55: /* CMD55: APP_CMD */ switch (sd->state) { case sd_ready_state: case sd_identification_state: @@ -1474,7 +1474,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) sd->card_status |= APP_CMD; return sd_r1; - case 56: /* CMD56: GEN_CMD */ + case 56: /* CMD56: GEN_CMD */ switch (sd->state) { case sd_transfer_state: sd->data_offset = 0; @@ -1518,7 +1518,7 @@ static sd_rsp_type_t sd_app_command(SDState *sd, req.cmd, req.arg, sd_state_name(sd->state)); sd->card_status |= APP_CMD; switch (req.cmd) { - case 6: /* ACMD6: SET_BUS_WIDTH */ + case 6: /* ACMD6: SET_BUS_WIDTH */ if (sd->spi) { goto unimplemented_spi_cmd; } @@ -1533,7 +1533,7 @@ static sd_rsp_type_t sd_app_command(SDState *sd, } break; - case 13: /* ACMD13: SD_STATUS */ + case 13: /* ACMD13: SD_STATUS */ switch (sd->state) { case sd_transfer_state: sd->state = sd_sendingdata_state; @@ -1546,7 +1546,7 @@ static sd_rsp_type_t sd_app_command(SDState *sd, } break; - case 22: /* ACMD22: SEND_NUM_WR_BLOCKS */ + case 22: /* ACMD22: SEND_NUM_WR_BLOCKS */ switch (sd->state) { case sd_transfer_state: *(uint32_t *) sd->data = sd->blk_written; @@ -1561,7 +1561,7 @@ static sd_rsp_type_t sd_app_command(SDState *sd, } break; - case 23: /* ACMD23: SET_WR_BLK_ERASE_COUNT */ + case 23: /* ACMD23: SET_WR_BLK_ERASE_COUNT */ switch (sd->state) { case sd_transfer_state: return sd_r1; @@ -1571,7 +1571,7 @@ static sd_rsp_type_t sd_app_command(SDState *sd, } break; - case 41: /* ACMD41: SD_APP_OP_COND */ + case 41: /* ACMD41: SD_APP_OP_COND */ if (sd->spi) { /* SEND_OP_CMD */ sd->state = sd_transfer_state; @@ -1613,7 +1613,7 @@ static sd_rsp_type_t sd_app_command(SDState *sd, return sd_r3; - case 42: /* ACMD42: SET_CLR_CARD_DETECT */ + case 42: /* ACMD42: SET_CLR_CARD_DETECT */ switch (sd->state) { case sd_transfer_state: /* Bringing in the 50KOhm pull-up resistor... Done. */ @@ -1624,7 +1624,7 @@ static sd_rsp_type_t sd_app_command(SDState *sd, } break; - case 51: /* ACMD51: SEND_SCR */ + case 51: /* ACMD51: SEND_SCR */ switch (sd->state) { case sd_transfer_state: sd->state = sd_sendingdata_state; @@ -1808,9 +1808,9 @@ static void sd_blk_write(SDState *sd, uint64_t addr, uint32_t len) } } -#define BLK_READ_BLOCK(a, len) sd_blk_read(sd, a, len) -#define BLK_WRITE_BLOCK(a, len) sd_blk_write(sd, a, len) -#define APP_READ_BLOCK(a, len) memset(sd->data, 0xec, len) +#define BLK_READ_BLOCK(a, len) sd_blk_read(sd, a, len) +#define BLK_WRITE_BLOCK(a, len) sd_blk_write(sd, a, len) +#define APP_READ_BLOCK(a, len) memset(sd->data, 0xec, len) #define APP_WRITE_BLOCK(a, len) void sd_write_byte(SDState *sd, uint8_t value) @@ -1833,7 +1833,7 @@ void sd_write_byte(SDState *sd, uint8_t value) sd_acmd_name(sd->current_cmd), sd->current_cmd, value); switch (sd->current_cmd) { - case 24: /* CMD24: WRITE_SINGLE_BLOCK */ + case 24: /* CMD24: WRITE_SINGLE_BLOCK */ sd->data[sd->data_offset ++] = value; if (sd->data_offset >= sd->blk_len) { /* TODO: Check CRC before committing */ @@ -1846,7 +1846,7 @@ void sd_write_byte(SDState *sd, uint8_t value) } break; - case 25: /* CMD25: WRITE_MULTIPLE_BLOCK */ + case 25: /* CMD25: WRITE_MULTIPLE_BLOCK */ if (sd->data_offset == 0) { /* Start of the block - let's check the address is valid */ if (sd->data_start + sd->blk_len > sd->size) { @@ -1881,7 +1881,7 @@ void sd_write_byte(SDState *sd, uint8_t value) } break; - case 26: /* CMD26: PROGRAM_CID */ + case 26: /* CMD26: PROGRAM_CID */ sd->data[sd->data_offset ++] = value; if (sd->data_offset >= sizeof(sd->cid)) { /* TODO: Check CRC before committing */ @@ -1900,7 +1900,7 @@ void sd_write_byte(SDState *sd, uint8_t value) } break; - case 27: /* CMD27: PROGRAM_CSD */ + case 27: /* CMD27: PROGRAM_CSD */ sd->data[sd->data_offset ++] = value; if (sd->data_offset >= sizeof(sd->csd)) { /* TODO: Check CRC before committing */ @@ -1924,7 +1924,7 @@ void sd_write_byte(SDState *sd, uint8_t value) } break; - case 42: /* CMD42: LOCK_UNLOCK */ + case 42: /* CMD42: LOCK_UNLOCK */ sd->data[sd->data_offset ++] = value; if (sd->data_offset >= sd->blk_len) { /* TODO: Check CRC before committing */ @@ -1935,7 +1935,7 @@ void sd_write_byte(SDState *sd, uint8_t value) } break; - case 56: /* CMD56: GEN_CMD */ + case 56: /* CMD56: GEN_CMD */ sd->data[sd->data_offset ++] = value; if (sd->data_offset >= sd->blk_len) { APP_WRITE_BLOCK(sd->data_start, sd->data_offset); @@ -1987,29 +1987,29 @@ uint8_t sd_read_byte(SDState *sd) sd_acmd_name(sd->current_cmd), sd->current_cmd, io_len); switch (sd->current_cmd) { - case 6: /* CMD6: SWITCH_FUNCTION */ + case 6: /* CMD6: SWITCH_FUNCTION */ ret = sd->data[sd->data_offset ++]; if (sd->data_offset >= 64) sd->state = sd_transfer_state; break; - case 9: /* CMD9: SEND_CSD */ - case 10: /* CMD10: SEND_CID */ + case 9: /* CMD9: SEND_CSD */ + case 10: /* CMD10: SEND_CID */ ret = sd->data[sd->data_offset ++]; if (sd->data_offset >= 16) sd->state = sd_transfer_state; break; - case 13: /* ACMD13: SD_STATUS */ + case 13: /* ACMD13: SD_STATUS */ ret = sd->sd_status[sd->data_offset ++]; if (sd->data_offset >= sizeof(sd->sd_status)) sd->state = sd_transfer_state; break; - case 17: /* CMD17: READ_SINGLE_BLOCK */ + case 17: /* CMD17: READ_SINGLE_BLOCK */ if (sd->data_offset == 0) BLK_READ_BLOCK(sd->data_start, io_len); ret = sd->data[sd->data_offset ++]; @@ -2018,7 +2018,7 @@ uint8_t sd_read_byte(SDState *sd) sd->state = sd_transfer_state; break; - case 18: /* CMD18: READ_MULTIPLE_BLOCK */ + case 18: /* CMD18: READ_MULTIPLE_BLOCK */ if (sd->data_offset == 0) { if (sd->data_start + io_len > sd->size) { sd->card_status |= ADDRESS_ERROR; @@ -2049,28 +2049,28 @@ uint8_t sd_read_byte(SDState *sd) ret = sd_tuning_block_pattern[sd->data_offset++]; break; - case 22: /* ACMD22: SEND_NUM_WR_BLOCKS */ + case 22: /* ACMD22: SEND_NUM_WR_BLOCKS */ ret = sd->data[sd->data_offset ++]; if (sd->data_offset >= 4) sd->state = sd_transfer_state; break; - case 30: /* CMD30: SEND_WRITE_PROT */ + case 30: /* CMD30: SEND_WRITE_PROT */ ret = sd->data[sd->data_offset ++]; if (sd->data_offset >= 4) sd->state = sd_transfer_state; break; - case 51: /* ACMD51: SEND_SCR */ + case 51: /* ACMD51: SEND_SCR */ ret = sd->scr[sd->data_offset ++]; if (sd->data_offset >= sizeof(sd->scr)) sd->state = sd_transfer_state; break; - case 56: /* CMD56: GEN_CMD */ + case 56: /* CMD56: GEN_CMD */ if (sd->data_offset == 0) APP_READ_BLOCK(sd->data_start, sd->blk_len); ret = sd->data[sd->data_offset ++]; From patchwork Sun Feb 28 19:33:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBE85C433DB for ; Sun, 28 Feb 2021 19:31:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 44C9C64E74 for ; Sun, 28 Feb 2021 19:31:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 44C9C64E74 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:36040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRn7-0001zq-Tn for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:31:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRks-0008RS-RZ; Sun, 28 Feb 2021 14:29:27 -0500 Received: from mail-bn8nam11on2070.outbound.protection.outlook.com ([40.107.236.70]:15841 helo=NAM11-BN8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRkp-000362-9S; Sun, 28 Feb 2021 14:29:26 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z69JlYF1ODv7h/kBSqAHmn4P3+QhqZQq8g0NoXlgS29+JGlLGciXUAo0fNwmNNkSYXqK91O119m88/1ICdRTU3nu3/XnZveWdfulFi/PnVNZvSsclPqNQyZXHW0yNhg6lL435XbIeYWv27fmn4cMoZQAsU0YNHfCA6P7r0e8TmWBgRuPIsVGtdrQF9l5arqFsh77q7INMe9OUjVukdw1x3VWqXKQjtQZQ5cq96CxsYt4pIN9lVLMIqKfY58GoHqozLrotUzEySQCt+oxQqsaA6jsGCwyA7XY88LUymuDroQflgVbFcwuhkKWUahFruDCem5r33q0Vl034v+itNKZVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cGy9GcG0CU7abFaeloxi27yUkQXVPaROea2F52tDwlE=; b=cEsVaN2a2BWJAZt6ibDh4HN1QzPSx0D3z1ORks2zf+kEE/YwUKvspV599ILl0J/9sfxKL6kJMbIlFPMcd4XR7V39lj4aKdEfJlnfkvtFy0+ifevND62XKRDbpeRut6T+/e9HslXI01OJWyxol1+nb8ULtdh70O0MsQ+oLciMVlsb+euZayrBhRdHOE0vrGv9UIQGb9J3WowEPvwhPK/ZqDIoR54ZOHnGoGF+hou9Qe9rpyzK4+yJzPcQ6BFGV8xW92YjnNl5oIfh3hYqWzx9SjN8I89WsOI6uryZ2cJLA/S+GtNZWWJQJBSPnM7cJz476El7SzTB0XY+qRhmQPvUFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cGy9GcG0CU7abFaeloxi27yUkQXVPaROea2F52tDwlE=; b=U/7KZGzDA5W9Vw5gXJxChxXFXOK6NbwWrOjbe9GHk/izzrzDLPcp3E6F4xIehc5U2JKp2XkcEGP7ZERz4+T327bTpwKFFVHjntzFofjYQT7aLsAhYFQ0wkYMEvXAOr/ZyCm0iubl6ypIRVaJziuWwrQXMcnF0IuikQZBMhgX26U= Received: from DM6PR03CA0002.namprd03.prod.outlook.com (2603:10b6:5:40::15) by SN6PR02MB5247.namprd02.prod.outlook.com (2603:10b6:805:72::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.31; Sun, 28 Feb 2021 19:29:18 +0000 Received: from CY1NAM02FT021.eop-nam02.prod.protection.outlook.com (2603:10b6:5:40:cafe::5b) by DM6PR03CA0002.outlook.office365.com (2603:10b6:5:40::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT021.mail.protection.outlook.com (10.152.75.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:18 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:16 -0800 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:16 -0800 Received: from [10.140.6.35] (port=57758 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRki-0008Am-AN; Sun, 28 Feb 2021 11:29:16 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 4FE2E13C0677; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 02/21] sd: emmc: Add support for eMMC cards Date: Mon, 1 Mar 2021 01:03:08 +0530 Message-ID: <1614540807-30686-3-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15050a6c-9d1e-45ae-0a35-08d8dc1f243f X-MS-TrafficTypeDiagnostic: SN6PR02MB5247: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:352; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KUAFdjyytFUVBw4Gl+qWT/hNp2H8feOKx8wVfl7325N4++RGY5AIuRJYOlHb9zn3ZoWamh3QZP76VbKcOvwJg4jNrB9Aj0GNS3g0TLt6TgBnyy7Ge509OTZvse5AgNB2q/Bqw92RYhaG8WAMG+sG8EWDuSM9gwKHFmaoExey3nDuacjFlTcgASn3JuBg3hTNx29Rye51/3M2YCL8at5+nwEaD9Wc1Ng2BHTBveg4wCCuRUukf38KWaD1YTTGpk+tNaj77b9apNsbQIuc6NDICkKJ9rgR8moqQ4VlN6IPVMGG020165CgXurF7FQaA+EzQLdsnzhC3pEBw8RWtWTbgbHvHRIQ/dNxWF1PVQbMiJHAP0Na6pC3/Vds2QwaDRQbgz87GmU4pBDnVyBTaHcbTx3/6FrripwwgEVS7s5IXk5Zo/CbuWQYGMSCVhmSdWiu088nDgIfin92LzzZFGg8yqKs7dQrGoSyAyrcrpsIHN7PZ4lxUKpchxozSklHWZlJvsKtqrNz/N+DLDqjlWmiSzurRfHfP+H11P2eh9M8MWtyrrWHYZAtOBYrmDnCaUggOxTTkqrBkZAVCmBJlM9s3uoDC0eDEFXAby2Je57Os8h6gAPu5pq5WZPiwOYlFSpgBhsO6JMIaDJ6sGDwge64cE7x+0RNVtFRskjhto/fENNn71ANifRW4u20MDzz1pR20S3qE2l50uF17ndtjml9ZQ== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(396003)(376002)(346002)(136003)(39850400004)(36840700001)(46966006)(6266002)(70206006)(54906003)(336012)(82740400003)(26005)(7416002)(110136005)(82310400003)(36906005)(316002)(478600001)(107886003)(8676002)(70586007)(5660300002)(4326008)(47076005)(8936002)(7636003)(36860700001)(356005)(83380400001)(36756003)(2616005)(42186006)(2906002)(426003)(186003)(921005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:18.2493 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15050a6c-9d1e-45ae-0a35-08d8dc1f243f X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT021.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB5247 Received-SPF: pass client-ip=40.107.236.70; envelope-from=saipava@xilinx.com; helo=NAM11-BN8-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add eMMC device built on top of SD card. Signed-off-by: Sai Pavan Boddu --- include/hw/sd/sd.h | 2 ++ hw/sd/sd.c | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index 05ef9b7..b402dad 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -90,6 +90,8 @@ typedef struct { } SDRequest; +#define TYPE_EMMC "emmc" +OBJECT_DECLARE_SIMPLE_TYPE(EMMCState, EMMC) #define TYPE_SD_CARD "sd-card" OBJECT_DECLARE_TYPE(SDState, SDCardClass, SD_CARD) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 74b9162..a23af6d 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -108,6 +108,7 @@ struct SDState { uint8_t spec_version; BlockBackend *blk; bool spi; + bool emmc; /* Runtime changeables */ @@ -143,6 +144,10 @@ struct SDState { bool cmd_line; }; +struct EMMCState { + SDState parent; +}; + static void sd_realize(DeviceState *dev, Error **errp); static const char *sd_state_name(enum SDCardStates state) @@ -2105,6 +2110,13 @@ static void sd_instance_init(Object *obj) sd->ocr_power_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, sd_ocr_powerup, sd); } +static void emmc_instance_init(Object *obj) +{ + SDState *sd = SD_CARD(obj); + + sd->emmc = true; +} + static void sd_instance_finalize(Object *obj) { SDState *sd = SD_CARD(obj); @@ -2213,9 +2225,17 @@ static const TypeInfo sd_info = { .instance_finalize = sd_instance_finalize, }; +static const TypeInfo emmc_info = { + .name = TYPE_EMMC, + .parent = TYPE_SD_CARD, + .instance_size = sizeof(EMMCState), + .instance_init = emmc_instance_init, +}; + static void sd_register_types(void) { type_register_static(&sd_info); + type_register_static(&emmc_info); } type_init(sd_register_types) From patchwork Sun Feb 28 19:33:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C85ABC433E0 for ; Sun, 28 Feb 2021 19:34:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4EAA364E74 for ; Sun, 28 Feb 2021 19:34:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4EAA364E74 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRps-0005ot-CP for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:34:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRl1-00004u-VA; Sun, 28 Feb 2021 14:29:37 -0500 Received: from mail-dm6nam10on2083.outbound.protection.outlook.com ([40.107.93.83]:7764 helo=NAM10-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRkx-0003Ax-J3; Sun, 28 Feb 2021 14:29:35 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aL7MJcquxIgzUT+LDKxTCDQ3/6Qv1rZGt3Z9WtCqqkg/ZIzjm58U/nuQUbnfc60GASylmDyZZ5d/FvBrvb7UXK6JXIBd9UKXm9PEAS8W5qxrXzbOV0bu2kM/yoUxH6UpHFuCdIJvk9/8/Wu3xTouNaV5pJL/P16vYCwzhUgaPC32bEQmVyAbmDISoYe2j/3BfPAx0dwQDKcpaW6PDaxWsorkqAZSOtCmLbA8WDOamycmCGupXE2fHR0DRuFU8X+PNAdggI2/CnmF3ktsbvmxfED7rVpCYEH31lwZOBMJwt/wppouhrzjZZD3ERv6mmXIkrVeMY8wm91WFTVKjFpK1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gJjid8O73JbjGuZhgnVYVSjPII4cATb/znl6qcWgJLE=; b=WxHJRa4mbb/VuprHNaOPumNRUvkl+oOfOZWQnrPBQY0+ucTtQHDBELkYG9oGpDVKgk9IvClYL1FmE6ufR+/nkE2oKdoF0tpYX8v2sEVpbjM0PUSNb3TGe6+gqI2tZLpNCPp6SUTB81K+Fh1TmCJUdqJlwgGcxF7yaezeNHGG/39XHrA5N4O0XyVK4ILvuzkoOA31ivh3zA3M9m9cW/SFEWhbNgnTpwbwmtcNGY+P+XR8wxsvGolKCebO4RgbeSaoPfDVJSuaqdrL/XcWSGePvFwIPR6PKQyOybkxm4TlsORbny/DBpC2asYZ7DeEHx9bpmrBdCI2etEqvRSFq4i9+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gJjid8O73JbjGuZhgnVYVSjPII4cATb/znl6qcWgJLE=; b=R0q5fAifWLK1BNfbFQnB8EgYR7kbNEpz0FoaaBRmNrAHKW4CdQxyhbJw7/nMByYAaTm2sedtfYCOLd2uYalP4xbjHhQqCeLTXHa96uUazdZftj0/sT7XcQQ9uVJoyqjDmxuIJw5rjVEFC/xvJfXDGovuxrkrBp6VyqgW/MBeXcQ= Received: from CY4PR03CA0021.namprd03.prod.outlook.com (2603:10b6:903:33::31) by BYAPR02MB5445.namprd02.prod.outlook.com (2603:10b6:a03:a4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19; Sun, 28 Feb 2021 19:29:27 +0000 Received: from CY1NAM02FT032.eop-nam02.prod.protection.outlook.com (2603:10b6:903:33:cafe::19) by CY4PR03CA0021.outlook.office365.com (2603:10b6:903:33::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT032.mail.protection.outlook.com (10.152.75.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:26 +0000 Received: from xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:16 -0800 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:16 -0800 Received: from [10.140.6.35] (port=57760 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRki-0008An-Ba; Sun, 28 Feb 2021 11:29:16 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 5983E13C089C; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 03/21] sd: emmc: Update SET_RELATIVE_ADDR command Date: Mon, 1 Mar 2021 01:03:09 +0530 Message-ID: <1614540807-30686-4-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 13aa54f6-fbec-4ee2-a77a-08d8dc1f2917 X-MS-TrafficTypeDiagnostic: BYAPR02MB5445: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:519; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s5bFa6DT8nZFK3NygKB23Itro4DMj64+6QWnK9L3x7zcwr753qQ0auTEO/7i4cKnvr8cQ9n0O/RuzAQkJDBkA2SGaTsTKTLKVijUY/Vl9hLP1jkBq7Gt52L+qmbXkPzhupbvlJI9GiSKybR0pVH3TRO73y3H5WyVic65RRzpsHzMNE435ISU3prPX9FwUpYFJsD5PmvswVQsU5qBwSJ8YV0hi7iX0/Sn1Y7zJr/fdKAOlUBwteySyQFIFRTmv5NbCq6rzT8LXW61dspcB7JVqDOrC/fskIh4ZobvKN4jZm0V8VNHngJH1Xu2KTa/EvvBzp9MLXqdTKRXyo2fK8IBV4oP5QAfFGBHnXSKsQfJU7oJXLdFMDdvvbYUgIjVLQWCEbSmdYrbJ8StS7PSrLznyaVa52/B5+omuUmQQO3xzWTUU1QyMF6mO+48vNf8+HACFZ9GlUDLBD0ynUwXOWGtJuC0EaamWvKDzp3Zc0cQ/NJSJWnlkySD3C/+vonCqvMr/uiYc7W2S7nA793bR4jKeoWvzeGDvHBkfDjWv1U2TWZxssLXJ3UdAJvYyKIbxON/CVI8F9OZwj0AK5U5LcACAE4pd31WUDT7NqyaED589BbNPtI2ue/LUyJVrLfW+XVwSsAIY15NDFoOGS6g0dO+an6GF6WlWAVGj11U5A81zlTTciB0PIMRvYZQt6iM2BronJ5cG/Z+aPrLG5D8Tjvq5A== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(346002)(396003)(39850400004)(376002)(136003)(46966006)(36840700001)(42186006)(8676002)(70586007)(2906002)(70206006)(82740400003)(921005)(316002)(478600001)(4326008)(107886003)(82310400003)(110136005)(54906003)(6266002)(36906005)(7416002)(356005)(336012)(2616005)(5660300002)(7636003)(426003)(83380400001)(36860700001)(186003)(8936002)(47076005)(36756003)(26005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:26.3808 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 13aa54f6-fbec-4ee2-a77a-08d8dc1f2917 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT032.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB5445 Received-SPF: pass client-ip=40.107.93.83; envelope-from=saipava@xilinx.com; helo=NAM10-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Vincent Palatin Change SET_RELATIVE_ADDR command to assign relative address as requested by user. Signed-off-by: Vincent Palatin Signed-off-by: Joel Stanley Signed-off-by: Cédric Le Goater [spb: Split original patch series] Signed-off-by: Sai Pavan Boddu --- hw/sd/sd.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index a23af6d..6de414b 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -436,9 +436,13 @@ static void sd_set_csd(SDState *sd, uint64_t size) sd->csd[15] = (sd_crc7(sd->csd, 15) << 1) | 1; } -static void sd_set_rca(SDState *sd) +static void sd_set_rca(SDState *sd, uint16_t value) { - sd->rca += 0x4567; + if (sd->emmc) { + sd->rca = value; + } else { + sd->rca += 0x4567; + } } FIELD(CSR, AKE_SEQ_ERROR, 3, 1) @@ -984,8 +988,8 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) case sd_identification_state: case sd_standby_state: sd->state = sd_standby_state; - sd_set_rca(sd); - return sd_r6; + sd_set_rca(sd, req.arg >> 16); + return sd->emmc ? sd_r1 : sd_r6; default: break; From patchwork Sun Feb 28 19:33:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108409 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92CC8C433DB for ; Sun, 28 Feb 2021 19:42:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DEB2D601FF for ; Sun, 28 Feb 2021 19:42:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DEB2D601FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:44818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRxf-0000cu-K3 for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:42:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRlE-0000Mz-7g; Sun, 28 Feb 2021 14:29:48 -0500 Received: from mail-bn8nam11on2041.outbound.protection.outlook.com ([40.107.236.41]:43360 helo=NAM11-BN8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRl5-0003BA-TH; Sun, 28 Feb 2021 14:29:47 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J52gA+BX8IeKlSWR0aS/LAEVwA3IQSPMS0rovhotb8+z87xtB9tMVF2Pgm7jY72lpcg48FgQb6+7uQ56xGp8b+nRAXBNsaTRGR2CuHp7EUXe5f0QouG+0KuYGSHyQmalqDOTb997hSXa8scKB1/D5DLT+hWPndM1mD2F7IjU2WzQQzjKv7BYhLHUyxgpkJPE09dJT1vIkk8KqMHEUKcoIHfYHW5rBHxIfzQbdIp0ETA5u+v0+NENFHCCexkKIUIT/LgKi4P3UhgHtcMcJCtJaOeEHD4tVeqatSKjhtjCF8CTwetR3D8gAulGfPn3FbQdV/abyyJV0cMq7udaJvnftA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8fY9HpVPoQ5z0IBxhOa1n/ZuBIQZwWxDpcKbgQV9lnI=; b=TBkD/tLNnHe+CD+JaCAr16pnbFEh6sAMCraKaqMLCxpjxkfn0RKl4TE3ZP7lwKHQENaWmt0Q+Q214sY00BgJORvOX0Dp2hQNfaf0p2p34CxXPFMj8BEtwdEVpZDxAT8XOFLIoiKgGf9a0FVXdjSKQfjRs1gy/GoV6AH5y9MHfNNpHdqbdLZaQZCGwa28V9Bi731U0vpDGo4FN7Z+sy3e5zmkK4AHOGS5Y2c1gNo3G5rkwN5HwFF/SZcoA1c3fEKgtUOnGcokyc/Wxgl015ZNerUeIqVza1IsvupjM9KkOP5soanSdaTV5EHqNYgkLTJfGSNQ0HRO81wpC9LRzhH4lA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8fY9HpVPoQ5z0IBxhOa1n/ZuBIQZwWxDpcKbgQV9lnI=; b=r2QnrJODxG0ZmoJej5tAp8su8cDVdZUm4IW76SaziIAAq8jtcnEu2TaTLDS2qb+IQe2E9+FXuz04G+fZ+fXAe+MAOsg2N0C+3zKlD5kFHKf70QkBdFOlyUcyGSYMQ3RoIZiZeA9bRJh1kgzVgifm67jAnpKARnId3NB2+Zd5aeU= Received: from CY4PR03CA0015.namprd03.prod.outlook.com (2603:10b6:903:33::25) by MWHPR02MB2302.namprd02.prod.outlook.com (2603:10b6:300:5b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.20; Sun, 28 Feb 2021 19:29:27 +0000 Received: from CY1NAM02FT032.eop-nam02.prod.protection.outlook.com (2603:10b6:903:33:cafe::21) by CY4PR03CA0015.outlook.office365.com (2603:10b6:903:33::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT032.mail.protection.outlook.com (10.152.75.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:27 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:16 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:16 -0800 Received: from [10.140.6.35] (port=57762 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRki-0003MF-Cd; Sun, 28 Feb 2021 11:29:16 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 6111813C091C; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 04/21] sd: emmc: update OCR fields for eMMC Date: Mon, 1 Mar 2021 01:03:10 +0530 Message-ID: <1614540807-30686-5-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 862776a0-36e1-4ee0-338b-08d8dc1f29ac X-MS-TrafficTypeDiagnostic: MWHPR02MB2302: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:153; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EugIWa4zWn/aDdGnfrSxXdgwl8r84/PPp8evrYnB5Fjgfyp8BSVeo/LLPuj5wJSIZvJaoJbglC31S9JQ6YeKo+XbLdHoF4IR/ynGAanwFpvxQK+fHBavLGI7PzkLZwsJ+JDFPBMdXxiBmJwVWi9L9rAPp6AdvRKFqUQQuvk2/qrH1BmUBQUsCKasPR1tgsSh5+55r51i8rhZwFqdhWzQr6yI+a4ggvXswIA0XyKbIH+od6lku/kc+wBrMj4F4SDSlYFM/9tzKlKBtswy2SCHJTNAl5RG68ZuQRoZefHDaHu9mb+A88evSSNI0qrxiH++mFRBBH44uJEbX4p09oOGPD/OnaD7NyovAgU9biJiIqLKRUgRSPvGDxdPa/ArPHPDFNTLtyBjqEZdWq1B8yco+YQ1J6caXUw9WfhcGoD9JXMdcHsX+XBpk2TT81LVH9ColQGGTTcesB8fM3CrQ5J1iH2Kbeikp03713mw7Eo/VSJ9cUMK9p2bcsec30R2Z+tJMpeB/OrCZ9xDGwSPPsqh82vZsGiVxaa5Fe42pmQrU6/SMHLbj2XLhoM/iAvxJFWTMiNW0SSiNKIJLFVJa+HM2PSOaoLoDscPF7BD7d+jug3coLnx0y0b5T5n6C83NPbKNf6clpQjtYhxzSqQp19etX4wJORiI+z1Zfp6eP3WJve2XCUibKMr8isD566HCVkp41Y+LL67q2mWsIzTikwvsg== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(39850400004)(396003)(136003)(376002)(346002)(36840700001)(46966006)(5660300002)(82740400003)(8936002)(70586007)(921005)(7416002)(54906003)(2906002)(2616005)(356005)(186003)(70206006)(36860700001)(4326008)(7636003)(42186006)(110136005)(6666004)(6266002)(336012)(316002)(426003)(83380400001)(36906005)(36756003)(47076005)(478600001)(26005)(107886003)(82310400003)(8676002)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:27.3543 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 862776a0-36e1-4ee0-338b-08d8dc1f29ac X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT032.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2302 Received-SPF: pass client-ip=40.107.236.41; envelope-from=saipava@xilinx.com; helo=NAM11-BN8-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Vincent Palatin eMMC OCR register doesn't has UHS-II field and voltage fields are different. Signed-off-by: Vincent Palatin Signed-off-by: Sai Pavan Boddu --- hw/sd/sd.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 6de414b..bc9d913 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -287,6 +287,15 @@ FIELD(OCR, UHS_II_CARD, 29, 1) /* Only UHS-II */ FIELD(OCR, CARD_CAPACITY, 30, 1) /* 0:SDSC, 1:SDHC/SDXC */ FIELD(OCR, CARD_POWER_UP, 31, 1) +/* + * eMMC OCR register + */ +FIELD(EMMC_OCR, VDD_WINDOW_0, 7, 1) +FIELD(EMMC_OCR, VDD_WINDOW_1, 8, 7) +FIELD(EMMC_OCR, VDD_WINDOW_2, 15, 9) +FIELD(EMMC_OCR, ACCESS_MODE, 29, 2) +FIELD(EMMC_OCR, POWER_UP, 31, 1) + #define ACMD41_ENQUIRY_MASK 0x00ffffff #define ACMD41_R3_MASK (R_OCR_VDD_VOLTAGE_WIN_HI_MASK \ | R_OCR_ACCEPT_SWITCH_1V8_MASK \ @@ -296,8 +305,16 @@ FIELD(OCR, CARD_POWER_UP, 31, 1) static void sd_set_ocr(SDState *sd) { - /* All voltages OK */ - sd->ocr = R_OCR_VDD_VOLTAGE_WIN_HI_MASK; + if (sd->emmc) { + /* + * Dual Voltage eMMC card + */ + sd->ocr = R_EMMC_OCR_VDD_WINDOW_0_MASK | + R_EMMC_OCR_VDD_WINDOW_2_MASK; + } else { + /* All voltages OK */ + sd->ocr = R_OCR_VDD_VOLTAGE_WIN_HI_MASK; + } } static void sd_ocr_powerup(void *opaque) @@ -525,7 +542,11 @@ static void sd_response_r1_make(SDState *sd, uint8_t *response) static void sd_response_r3_make(SDState *sd, uint8_t *response) { - stl_be_p(response, sd->ocr & ACMD41_R3_MASK); + if (sd->emmc) { + stl_be_p(response, sd->ocr); + } else { + stl_be_p(response, sd->ocr & ACMD41_R3_MASK); + } } static void sd_response_r6_make(SDState *sd, uint8_t *response) From patchwork Sun Feb 28 19:33:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108413 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54F74C433E0 for ; Sun, 28 Feb 2021 19:43:36 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9473160C41 for ; Sun, 28 Feb 2021 19:43:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9473160C41 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRyY-0001hZ-Ph for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:43:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54398) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRlA-0000Cj-C6; Sun, 28 Feb 2021 14:29:44 -0500 Received: from mail-dm6nam11on2067.outbound.protection.outlook.com ([40.107.223.67]:52800 helo=NAM11-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRl2-0003ER-56; Sun, 28 Feb 2021 14:29:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uv5Pac6BVZbTs2wdfoH+rZYXqPtp8CS3+V8vS9GSICki0xoZI7jfbM9EmhPFQGoQgMkTyrKnOzBEA4OeMq1AsOCSkGTNEfAAWU7fV+AaCvc7YFBObdSUsHZC7Y5/9O3Wlj1wT2RcNTfJ7Qf+ZguYwbgyJJvHXBhMJIxzqx1J5/cwGQwZhwlQqqOOUvgfl7o5GZQkPQrEVlfroWYGzdw/UKXyt38E6aZA69BZm+Hf6+0PdkPtKdZGybMaeCm+Hv/vYgJW3jrRzsT2/e6gI2Y4NtviB8zSBEUtbxTI8VaTDf4JRdHx9W32eZmiXdg+38/0xREVUIxAEciUKAr4KY4fRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xJPvQMryhZRpSdyg+7ffy7+Taz5WzYNokWUtSoFYIjw=; b=L6gxhtnKLkp9eq7ttNc2wf70r2VtLKuTZ4rBwtD9tMsVfwZouS+Y7gCMnabPDoettgM7FRs/9dkkl4bB8NIjIyuSHLBfe9hbVCg2zmSS46mlzP7m43oDCe/EdMy5seVpLfukCZD03ueSDjcaPpbo/fPrxlOkKQIh4aE52QR5FGtAkkeGBSC5c5qeWjGSFq/ma7gcjWf6vD2WhW9+9emEUQu6wrSw5CJroXRbrXkC67Bbnjod5nAJW5wOuYEYvXddasB7CzseYPg16tnQx+DWkz/F7WV21/wCAcdynbJeaU8BcUhLb1ZHY6lIC/JfJEcAm3Y6uVoePAFVNjcVi9Jskg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xJPvQMryhZRpSdyg+7ffy7+Taz5WzYNokWUtSoFYIjw=; b=orU5vmydr0MssFe2ATBOH3ZCP+K3jUZRaPQIQuPDHGw8Ee04TlYknGloT/3uyDqXxI8/OYYjSVYNiFBu365I/gAiRbUsAO81mROqc21p6z6f5J29ZJ2qlnQuDEMM/poZD7dqHRFRQ5Jg3HzuWmVXxPOtMOFJbNya2JhyOz+pKYA= Received: from CY4PR03CA0014.namprd03.prod.outlook.com (2603:10b6:903:33::24) by MWHPR0201MB3545.namprd02.prod.outlook.com (2603:10b6:301:79::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.28; Sun, 28 Feb 2021 19:29:32 +0000 Received: from CY1NAM02FT032.eop-nam02.prod.protection.outlook.com (2603:10b6:903:33:cafe::fe) by CY4PR03CA0014.outlook.office365.com (2603:10b6:903:33::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT032.mail.protection.outlook.com (10.152.75.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:32 +0000 Received: from xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:18 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:18 -0800 Received: from [10.140.6.35] (port=57770 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRkj-0003MM-Eb; Sun, 28 Feb 2021 11:29:17 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 6890D13C09CF; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 05/21] sd: emmc: Add support for EXT_CSD & CSD for eMMC Date: Mon, 1 Mar 2021 01:03:11 +0530 Message-ID: <1614540807-30686-6-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 162b0378-04a7-4fa0-b536-08d8dc1f2c8c X-MS-TrafficTypeDiagnostic: MWHPR0201MB3545: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:81; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: niBRxuejSM88lB0AndN1BsDbCwaM6MVzkxfPV5yqhk8UnFVXVpaG21u2oGVPAmbLDsBF+UGDr0ELJ3pE9tjRDF2HWUBq6qfDJiy4upDF76HwDaLDEMRqGo8K3iYaA9ltJ/TydPekRsIso+tf3xZC3OLlNOxDTHKhegMYG5qtv7BZgIvbbEikWA5UhEOB785E2JjPrPnnKjgwM9uO1Z2a7t7L2ON3rZ8Gj+HjBOWYLIRG2ANqJ00kXqVjowNyhvs4xziSi5b+md4HNIKS4cqCiGuSDeWeoAAUPGwqxIqO8WFSPibQkRm/nNe0sop4knVkE1pqD0gqXt7eHFeFZKtK72v63u1aPpVYk+ES69C63ySSwOh3AUZUA4AkNan05ZyPQLKVLsgp+jxkdmZooguGtCeQIomEeYHkbJ/u+FOf8U96rkwxEqGUMbVjaFs4jvqpEVoS77TyCSKvFbnIfvb8ybOE4lcMc59J2qRH8WVb9GUaAcpnLc2WLbJeCigaADmRuGSK2dlHM6qNcnGVA5jwzVmtNZDppke3msGdyhxapV7o0ry98WDcbRLty5vCDe7OUk/yP2DY0B+S9ercBOUpV10ZipCDjqpwo0Ok+Efxr8P+qUt240KpkbzWdkUTc+w+yFxz4u3E0AUo1VQ93xTgPzpj0UKTfdPMq9UXdtsGkhRfeaR4f7HyOG36xH/RiPEnX5cyjefsnFCl48AAKQBmkw== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(396003)(136003)(346002)(39850400004)(376002)(46966006)(36840700001)(82740400003)(316002)(478600001)(186003)(7636003)(42186006)(26005)(356005)(6666004)(426003)(70206006)(36906005)(70586007)(36756003)(4326008)(110136005)(6266002)(36860700001)(8676002)(54906003)(7416002)(8936002)(921005)(107886003)(82310400003)(2906002)(66574015)(83380400001)(336012)(47076005)(2616005)(5660300002)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:32.1021 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 162b0378-04a7-4fa0-b536-08d8dc1f2c8c X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT032.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0201MB3545 Received-SPF: pass client-ip=40.107.223.67; envelope-from=saipava@xilinx.com; helo=NAM11-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Vincent Palatin eMMC CSD is similar to SD with an option to refer EXT_CSD for larger devices. Signed-off-by: Vincent Palatin [clg: Add user friendly macros for EXT_CSD register] Signed-off-by: Cédric Le Goater [spb: updated commit message] Signed-off-by: Sai Pavan Boddu --- hw/sd/sdmmc-internal.h | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++ hw/sd/sd.c | 61 +++++++++++++++++++++++++++++-- 2 files changed, 156 insertions(+), 2 deletions(-) diff --git a/hw/sd/sdmmc-internal.h b/hw/sd/sdmmc-internal.h index d8bf17d..7ab7b4d 100644 --- a/hw/sd/sdmmc-internal.h +++ b/hw/sd/sdmmc-internal.h @@ -37,4 +37,101 @@ const char *sd_cmd_name(uint8_t cmd); */ const char *sd_acmd_name(uint8_t cmd); +/* + * EXT_CSD fields + */ + +#define EXT_CSD_CMDQ_MODE_EN 15 /* 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 */ +#define EXT_CSD_PACKED_FAILURE_INDEX 35 /* RO */ +#define EXT_CSD_PACKED_CMD_STATUS 36 /* RO */ +#define EXT_CSD_EXP_EVENTS_STATUS 54 /* RO, 2 bytes */ +#define EXT_CSD_EXP_EVENTS_CTRL 56 /* R/W, 2 bytes */ +#define EXT_CSD_DATA_SECTOR_SIZE 61 /* R */ +#define EXT_CSD_GP_SIZE_MULT 143 /* R/W */ +#define EXT_CSD_PARTITION_SETTING_COMPLETED 155 /* R/W */ +#define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ +#define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ +#define EXT_CSD_HPI_MGMT 161 /* R/W */ +#define EXT_CSD_RST_N_FUNCTION 162 /* R/W */ +#define EXT_CSD_BKOPS_EN 163 /* R/W */ +#define EXT_CSD_BKOPS_START 164 /* W */ +#define EXT_CSD_SANITIZE_START 165 /* W */ +#define EXT_CSD_WR_REL_PARAM 166 /* RO */ +#define EXT_CSD_RPMB_MULT 168 /* RO */ +#define EXT_CSD_FW_CONFIG 169 /* R/W */ +#define EXT_CSD_BOOT_WP 173 /* R/W */ +#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ +#define EXT_CSD_PART_CONFIG 179 /* R/W */ +#define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ +#define EXT_CSD_BUS_WIDTH 183 /* R/W */ +#define EXT_CSD_STROBE_SUPPORT 184 /* RO */ +#define EXT_CSD_HS_TIMING 185 /* R/W */ +#define EXT_CSD_POWER_CLASS 187 /* R/W */ +#define EXT_CSD_REV 192 /* RO */ +#define EXT_CSD_STRUCTURE 194 /* RO */ +#define EXT_CSD_CARD_TYPE 196 /* RO */ +#define EXT_CSD_DRIVER_STRENGTH 197 /* RO */ +#define EXT_CSD_OUT_OF_INTERRUPT_TIME 198 /* RO */ +#define EXT_CSD_PART_SWITCH_TIME 199 /* RO */ +#define EXT_CSD_PWR_CL_52_195 200 /* RO */ +#define EXT_CSD_PWR_CL_26_195 201 /* RO */ +#define EXT_CSD_PWR_CL_52_360 202 /* RO */ +#define EXT_CSD_PWR_CL_26_360 203 /* RO */ +#define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ +#define EXT_CSD_S_A_TIMEOUT 217 /* RO */ +#define EXT_CSD_S_C_VCCQ 219 /* RO */ +#define EXT_CSD_S_C_VCC 220 /* RO */ +#define EXT_CSD_REL_WR_SEC_C 222 /* RO */ +#define EXT_CSD_HC_WP_GRP_SIZE 221 /* RO */ +#define EXT_CSD_ERASE_TIMEOUT_MULT 223 /* RO */ +#define EXT_CSD_HC_ERASE_GRP_SIZE 224 /* RO */ +#define EXT_CSD_ACC_SIZE 225 /* RO */ +#define EXT_CSD_BOOT_MULT 226 /* RO */ +#define EXT_CSD_BOOT_INFO 228 /* RO */ +#define EXT_CSD_SEC_TRIM_MULT 229 /* RO */ +#define EXT_CSD_SEC_ERASE_MULT 230 /* RO */ +#define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */ +#define EXT_CSD_TRIM_MULT 232 /* RO */ +#define EXT_CSD_PWR_CL_200_195 236 /* RO */ +#define EXT_CSD_PWR_CL_200_360 237 /* RO */ +#define EXT_CSD_PWR_CL_DDR_52_195 238 /* RO */ +#define EXT_CSD_PWR_CL_DDR_52_360 239 /* RO */ +#define EXT_CSD_BKOPS_STATUS 246 /* RO */ +#define EXT_CSD_POWER_OFF_LONG_TIME 247 /* RO */ +#define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */ +#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_PRE_EOL_INFO 267 /* RO */ +#define EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A 268 /* RO */ +#define EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B 269 /* RO */ +#define EXT_CSD_CMDQ_DEPTH 307 /* RO */ +#define EXT_CSD_CMDQ_SUPPORT 308 /* RO */ +#define EXT_CSD_SUPPORTED_MODE 493 /* RO */ +#define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */ +#define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */ +#define EXT_CSD_MAX_PACKED_WRITES 500 /* RO */ +#define EXT_CSD_MAX_PACKED_READS 501 /* RO */ +#define EXT_CSD_BKOPS_SUPPORT 502 /* RO */ +#define EXT_CSD_HPI_FEATURES 503 /* RO */ +#define EXT_CSD_S_CMD_SET 504 /* RO */ + +/* + * EXT_CSD field definitions + */ + +#define EXT_CSD_WR_REL_PARAM_EN (1 << 2) +#define EXT_CSD_WR_REL_PARAM_EN_RPMB_REL_WR (1 << 4) + +#define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) +#define EXT_CSD_PART_CONFIG_ACC_DEFAULT (0x0) +#define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) + +#define EXT_CSD_PART_CONFIG_EN_MASK (0x7 << 3) +#define EXT_CSD_PART_CONFIG_EN_BOOT0 (0x1 << 3) +#define EXT_CSD_PART_CONFIG_EN_USER (0x7 << 3) + #endif diff --git a/hw/sd/sd.c b/hw/sd/sd.c index bc9d913..a26695b 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -135,6 +135,7 @@ struct SDState { uint64_t data_start; uint32_t data_offset; uint8_t data[512]; + uint8_t ext_csd[512]; qemu_irq readonly_cb; qemu_irq inserted_cb; QEMUTimer *ocr_power_timer; @@ -393,6 +394,55 @@ static const uint8_t sd_csd_rw_mask[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfe, }; +static void mmc_set_ext_csd(SDState *sd, uint64_t size) +{ + uint32_t sectcount = size >> HWBLOCK_SHIFT; + + memset(sd->ext_csd, 0, sizeof(sd->ext_csd)); + sd->ext_csd[EXT_CSD_S_CMD_SET] = 0x1; /* supported command sets */ + sd->ext_csd[EXT_CSD_HPI_FEATURES] = 0x3; /* HPI features */ + sd->ext_csd[EXT_CSD_BKOPS_SUPPORT] = 0x1; /* Background operations + support */ + sd->ext_csd[241] = 0xA; /* 1st initialization time after partitioning */ + sd->ext_csd[EXT_CSD_TRIM_MULT] = 0x1; /* Trim multiplier */ + sd->ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT] = 0x15; /* Secure feature + support */ + sd->ext_csd[EXT_CSD_SEC_ERASE_MULT] = 0x96; /* Secure erase support */ + sd->ext_csd[EXT_CSD_SEC_TRIM_MULT] = 0x96; /* Secure TRIM multiplier */ + sd->ext_csd[EXT_CSD_BOOT_INFO] = 0x7; /* Boot information */ + sd->ext_csd[EXT_CSD_BOOT_MULT] = 0x8; /* Boot partition size. 128KB unit */ + sd->ext_csd[EXT_CSD_ACC_SIZE] = 0x6; /* Access size */ + sd->ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] = 0x4; /* HC Erase unit size */ + sd->ext_csd[EXT_CSD_ERASE_TIMEOUT_MULT] = 0x1; /* HC erase timeout */ + sd->ext_csd[EXT_CSD_REL_WR_SEC_C] = 0x1; /* Reliable write sector count */ + sd->ext_csd[EXT_CSD_HC_WP_GRP_SIZE] = 0x4; /* HC write protect group size */ + sd->ext_csd[EXT_CSD_S_C_VCC] = 0x8; /* Sleep current VCC */ + sd->ext_csd[EXT_CSD_S_C_VCCQ] = 0x7; /* Sleep current VCCQ */ + sd->ext_csd[EXT_CSD_S_A_TIMEOUT] = 0x11; /* Sleep/Awake timeout */ + sd->ext_csd[215] = (sectcount >> 24) & 0xff; /* Sector count */ + sd->ext_csd[214] = (sectcount >> 16) & 0xff; /* ... */ + sd->ext_csd[213] = (sectcount >> 8) & 0xff; /* ... */ + sd->ext_csd[EXT_CSD_SEC_CNT] = (sectcount & 0xff); /* ... */ + sd->ext_csd[210] = 0xa; /* Min write perf for 8bit@52Mhz */ + sd->ext_csd[209] = 0xa; /* Min read perf for 8bit@52Mhz */ + sd->ext_csd[208] = 0xa; /* Min write perf for 4bit@52Mhz */ + sd->ext_csd[207] = 0xa; /* Min read perf for 4bit@52Mhz */ + sd->ext_csd[206] = 0xa; /* Min write perf for 4bit@26Mhz */ + sd->ext_csd[205] = 0xa; /* Min read perf for 4bit@26Mhz */ + sd->ext_csd[EXT_CSD_PART_SWITCH_TIME] = 0x1; /* Partition switching + timing */ + sd->ext_csd[EXT_CSD_OUT_OF_INTERRUPT_TIME] = 0x1; /* Out-of-interrupt busy + timing */ + sd->ext_csd[EXT_CSD_CARD_TYPE] = 0xFF; /* Card type */ + sd->ext_csd[EXT_CSD_STRUCTURE] = 0x2; /* CSD Structure version */ + sd->ext_csd[EXT_CSD_REV] = 0x5; /* Extended CSD revision */ + sd->ext_csd[EXT_CSD_RPMB_MULT] = 0x1; /* RPMB size */ + sd->ext_csd[EXT_CSD_PARTITION_SUPPORT] = 0x3; /* Partinioning support */ + sd->ext_csd[159] = 0x00; /* Max enhanced area size */ + sd->ext_csd[158] = 0x00; /* ... */ + sd->ext_csd[157] = 0xEC; /* ... */ +} + static void sd_set_csd(SDState *sd, uint64_t size) { int hwblock_shift = HWBLOCK_SHIFT; @@ -406,8 +456,11 @@ static void sd_set_csd(SDState *sd, uint64_t size) } csize = (size >> (CMULT_SHIFT + hwblock_shift)) - 1; - if (size <= SDSC_MAX_CAPACITY) { /* Standard Capacity SD */ - sd->csd[0] = 0x00; /* CSD structure */ + if (size <= SDSC_MAX_CAPACITY || sd->emmc) { /* Standard Capacity SD */ + if (sd->emmc && size >= SDSC_MAX_CAPACITY) { + csize = 0xfff; + } + sd->csd[0] = sd->emmc ? 0xd0 : 0x00; /* CSD structure */ sd->csd[1] = 0x26; /* Data read access-time-1 */ sd->csd[2] = 0x00; /* Data read access-time-2 */ sd->csd[3] = 0x32; /* Max. data transfer rate: 25 MHz */ @@ -451,6 +504,10 @@ static void sd_set_csd(SDState *sd, uint64_t size) sd->csd[14] = 0x00; } sd->csd[15] = (sd_crc7(sd->csd, 15) << 1) | 1; + + if (sd->emmc) { + mmc_set_ext_csd(sd, size); + } } static void sd_set_rca(SDState *sd, uint16_t value) From patchwork Sun Feb 28 19:33:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B146C433DB for ; Sun, 28 Feb 2021 19:37:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BFFB264DEE for ; Sun, 28 Feb 2021 19:37:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BFFB264DEE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:55342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRsh-0001gh-Ql for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:37:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRlA-0000DE-KY; Sun, 28 Feb 2021 14:29:44 -0500 Received: from mail-eopbgr750078.outbound.protection.outlook.com ([40.107.75.78]:59093 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRl1-0003Db-2t; Sun, 28 Feb 2021 14:29:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ebCRFoSxxh8G+XAj8Bf2fOCWPazEi/ULBlcq5484xMD83DtIxuAvDm9LMA0lSxLIMeYlbKy8x8b49pEzsn+4WCj5Mi9L3GPMlTO+M0DOwnEN/caz/mrRymfAOcii+hhwNV2oI1mwqZboy7HB2eL9aVILCKSyhIZ/WqmY4kFps6OgdnoTROi0ePhALclbCRQKM1I4pssh2hswGeiphqI9vYLFkvEwpzM84Yxp5HALkRnhhr1MyPNmnS51Rni01gU7Z1FF/FZudyeTGuhe9K3c08ZeRaDb2YfBgieJV5MgWZQqPhJkp1V4i2/QDQezogeo1oHi9s3hSjyqZhxpE6chCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QlKzBhFbXxVpm+CJh8vjnZ+UTu8vBUD0PsWP8Ogh/RY=; b=UnhIsFpj/qEETRnDehVaAuM6tFhD5hBISXBTbb/LBiRTTWBaDYw2/f0GdMEwTh53n0KTdKJ827MvbqbZrbV7vo684DHjxQMYFzIuoldVXwHTo79JlrzTZr7XVzkf3fEY/AQcqCWohV72O10M1j9ISPjb5MS7Y6A7nY9nR8iV3rBz57bOV2Zo5Xeb+ULx9S83RDwp8om+bBK5dtuDVkdO5EDPJKp7DW324UzJDkxiBDhkGRS2UDzf7PcyR8cq2sxO1uB+fXW6R0Q9E9rQrGdJgKiD6CFBTpIgj7jDUekENuNTBOGPapPmaHYfwVP5rML8H2p62HL/YPA8De2YsC9TtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QlKzBhFbXxVpm+CJh8vjnZ+UTu8vBUD0PsWP8Ogh/RY=; b=XCwVGLkbPVkzk4LDauKboiH3PK+TYZM89lczT4p/echCf1gF+vuHeoaPLPpNnNJur/lkUgx8ktSdR1bkMKA7zLlGZbRDUsUlC3+q2TQQjhkz8ZPbHmhHhL0RxYYYMiFwZsaxkaxuY86x1jIzoNoRwpyAMgYG0tsr0oqGQxERc6s= Received: from CY4PR03CA0010.namprd03.prod.outlook.com (2603:10b6:903:33::20) by CH2PR02MB6505.namprd02.prod.outlook.com (2603:10b6:610:34::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.23; Sun, 28 Feb 2021 19:29:31 +0000 Received: from CY1NAM02FT032.eop-nam02.prod.protection.outlook.com (2603:10b6:903:33:cafe::fe) by CY4PR03CA0010.outlook.office365.com (2603:10b6:903:33::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT032.mail.protection.outlook.com (10.152.75.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:31 +0000 Received: from xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:17 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:17 -0800 Received: from [10.140.6.35] (port=57764 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRkj-0003ML-Dk; Sun, 28 Feb 2021 11:29:17 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 707EE13C0A6E; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 06/21] sd: emmc: Update CMD8 to send EXT_CSD register Date: Mon, 1 Mar 2021 01:03:12 +0530 Message-ID: <1614540807-30686-7-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d0ba6fcf-2cfa-41d1-919a-08d8dc1f2c44 X-MS-TrafficTypeDiagnostic: CH2PR02MB6505: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:2803; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wLu1QXD7/yYoNUwNPm1o5gpy8Rt1XBBwfjuQH9v2QmPaswWSQlP7ENm+V7XO/j4SM/In//yvf4O8hOsQjqKW6JlkBOvwIM+SwTORdtOOXAG3EK+tar7VzibKhaMh6xwMWDJsA49itcSqFtnahrfdARNIC/ete91ujl5z640q2vER2Iab+x7IHIREvuST1Ci8P8RafuQHVy0cTk6yOWqCRiDn0q0psBNtGtKGJwA2QwnugPfbFZjMi8fH0wTiBBexvob1iDPDzfyQM8n/9kcC4r7pjy7cNytwums5hRqBE9GimG9HiWjhptPtZMvwF2HC2nRu60obQtKHT8k+juN3ftoC57nqzuw6EFSgvK8DS08cmoHJQyiBrb53rqgprBaJpW1IEJggTilax+8SDYu4bu2j3tE/roIsq9Mi1Hgzf+i5tM9eMLVbjANoDlDRUHRj8XESBqM3xZY72rLMWRZI9Dn8J/7kLpRoOLQxF+gmtjGN4uCU/XcmOGrD/5fDclKuTWdWVNvZro0FOgCO6Z6/YC2KIrDJiYm7XxJ0bvhp72Ve5LBp/yBXFJdckm6NhAuoP6RDP4mRUExzI0BjXq41gezk48q3J6BBKCpAA+DEPfPWkDoxtpxFoeyDb/dgMBfEsVpA5QRtyF2meGUFmFZwydg4O3Gb9rbTRFxQv4hsosH57xi6A4Py+2iMOILORZVIM5hD1UXIETL5QoU3utAL5w== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(396003)(346002)(376002)(136003)(39850400004)(46966006)(36840700001)(83380400001)(7636003)(356005)(82740400003)(316002)(82310400003)(42186006)(110136005)(54906003)(921005)(47076005)(36860700001)(36906005)(4326008)(478600001)(5660300002)(70206006)(6666004)(186003)(26005)(6266002)(36756003)(107886003)(7416002)(426003)(2616005)(336012)(8676002)(70586007)(2906002)(8936002)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:31.7083 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0ba6fcf-2cfa-41d1-919a-08d8dc1f2c44 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT032.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR02MB6505 Received-SPF: pass client-ip=40.107.75.78; envelope-from=saipava@xilinx.com; helo=NAM02-BL2-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Vincent Palatin Sends the EXT_CSD register as response to CMD8. Signed-off-by: Vincent Palatin Signed-off-by: Sai Pavan Boddu --- hw/sd/sd.c | 52 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index a26695b..181e7e2 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1141,24 +1141,37 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 8: /* CMD8: SEND_IF_COND */ - if (sd->spec_version < SD_PHY_SPECv2_00_VERS) { - break; - } - if (sd->state != sd_idle_state) { - break; - } - sd->vhs = 0; - - /* No response if not exactly one VHS bit is set. */ - if (!(req.arg >> 8) || (req.arg >> (ctz32(req.arg & ~0xff) + 1))) { - return sd->spi ? sd_r7 : sd_r0; - } + case 8: /* CMD8: SEND_IF_COND / SEND_EXT_CSD */ + if (sd->emmc) { + switch (sd->state) { + case sd_transfer_state: + /* MMC : Sends the EXT_CSD register as a Block of data */ + sd->state = sd_sendingdata_state; + memcpy(sd->data, sd->ext_csd, sizeof(sd->ext_csd)); + sd->data_start = addr; + sd->data_offset = 0; + return sd_r1; + default: + break; + } + } else { + if (sd->spec_version < SD_PHY_SPECv2_00_VERS) { + break; + } + if (sd->state != sd_idle_state) { + break; + } + sd->vhs = 0; - /* Accept. */ - sd->vhs = req.arg; - return sd_r7; + /* No response if not exactly one VHS bit is set. */ + if (!(req.arg >> 8) || (req.arg >> (ctz32(req.arg & ~0xff) + 1))) { + return sd->spi ? sd_r7 : sd_r0; + } + /* Accept. */ + sd->vhs = req.arg; + return sd_r7; + } case 9: /* CMD9: SEND_CSD */ switch (sd->state) { case sd_standby_state: @@ -2081,6 +2094,13 @@ uint8_t sd_read_byte(SDState *sd) sd->state = sd_transfer_state; break; + case 8: /* CMD8: SEND_EXT_CSD on MMC */ + ret = sd->data[sd->data_offset++]; + if (sd->data_offset >= sizeof(sd->ext_csd)) { + sd->state = sd_transfer_state; + } + break; + case 9: /* CMD9: SEND_CSD */ case 10: /* CMD10: SEND_CID */ ret = sd->data[sd->data_offset ++]; From patchwork Sun Feb 28 19:33:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108381 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21231C433E6 for ; Sun, 28 Feb 2021 19:31:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C0C5E64DEE for ; Sun, 28 Feb 2021 19:31:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C0C5E64DEE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:36712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRnH-0002JU-O6 for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:31:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRkz-0008Tm-L3; Sun, 28 Feb 2021 14:29:33 -0500 Received: from mail-co1nam11on2085.outbound.protection.outlook.com ([40.107.220.85]:62369 helo=NAM11-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRkt-00039L-Bc; Sun, 28 Feb 2021 14:29:32 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I02gLvEmjJoaypxlAK6lkK5b8Vb27tkBsZSGzDDaEpdLLlLTQafkge1aPvMNTnGCmvwxAN7p3xQl/nXkg3SjRlUrcyBd9S+zJa8mkK9lJH1hXWt1BkWjG9L3uIFh3EO3lPNIKNgiLDNfj4FPuMJ5qhSLo+XYE+OJGtGph4hgydd44XfeJiSO1AP6pvBN2TF2KDKo2Ym37vo0nUOXJWxfpMHlEfBort/iJomQmRrDMFZHJUcJhnAIwEgg7JMhqhvcP7ikAK7RCBdJtE+OJiQT9HgM8NshsVMsUle/7hrlTbJZ6wvqgSAezdoW1yQh6TEe0VbGswRyl0HNZh4RYViV6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=49822Fx4kiWHj6GdrggARoggno8Z+Qc9mfLCL8CMIqE=; b=Z1DGo9iEIZWvwgnjehJqwaJKhNl/SGZtmjznCTl6OdPpAK6/NelijR0GjQM5l6uznGrGaOrd9yCvrXvFmteaZv/37uN8DjjjWB/tBxeSZIUh0X/bEgaNFzgboiw8jw9lCvxNP3MVrtJe5xX4/xgoTYSzBs58SklrIr8Weya8FaAGa8t73F9q2BjIw66tPzRrVPYNJX/o2wP1xke07T2t+Vn0rBdaEdrJdQXDpoZImrQ5ku9jgzmvaT7oy9Cz82p/jqgf+/FzGxTjzHol7WVTneUfkG/xVtOuK5zgTNyV+rm90MtiYE0hZ73AwCmKTDx2Q2S/PcF7qIDR8HADFziXuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=49822Fx4kiWHj6GdrggARoggno8Z+Qc9mfLCL8CMIqE=; b=J5wU43lkvCAC6VFxtCwpK79x6THd2qBQuxA+ti/Qx/8tZHl9Jscw3SdblAlL4dBwqsnx1wmteH2GBNx5CW97s7G44mVcNQY4UHZearneEphSDOs6hq+x4soH7mT2mZmw2Akeuixh5GhT0h1j2bMWxcA/Na3SEa43F5HjgZTasQQ= Received: from CY4PR20CA0027.namprd20.prod.outlook.com (2603:10b6:903:cb::13) by DM6PR02MB4092.namprd02.prod.outlook.com (2603:10b6:5:99::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19; Sun, 28 Feb 2021 19:29:23 +0000 Received: from CY1NAM02FT025.eop-nam02.prod.protection.outlook.com (2603:10b6:903:cb:cafe::dc) by CY4PR20CA0027.outlook.office365.com (2603:10b6:903:cb::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.20 via Frontend Transport; Sun, 28 Feb 2021 19:29:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT025.mail.protection.outlook.com (10.152.75.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:22 +0000 Received: from xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:17 -0800 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:17 -0800 Received: from [10.140.6.35] (port=57766 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRkj-0008Aw-EV; Sun, 28 Feb 2021 11:29:17 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 7580513C06CA; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 07/21] sd: sdmmc-internal: Add command string for SEND_OP_CMD Date: Mon, 1 Mar 2021 01:03:13 +0530 Message-ID: <1614540807-30686-8-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 548b0814-7f4c-4cde-6c16-08d8dc1f26ec X-MS-TrafficTypeDiagnostic: DM6PR02MB4092: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:166; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EU/iL1vnlz2+jXQ/Zl9uvtsjrM1YiwV4oSbs2RGl44VJHLuQTXRRTOdlv1YNbS+nqYfviMvNoNxijPwlXrCyLc9411MLE2yMLTSrgxZyWqoM728k17SIKtZO+YV4CzhTwxqfJIpV8tqPgEMOU9rwSBM5ty28hi5WOrNRwhGNrX+GqJYDoE3namBb9tuabmMMeTR6TMaDcNsP771JvKKA74Qq0eEzmoIBK5/BbbM8Z6ON2y+z/j0/RcmXL4U/YU9iTpa8mgjG3Ef2jLCIWpxraJg+s5G+C61d2lYaM7nklatHMAyWkee/RIifFuOwDC9AE9dLtwU0/vLnKveYHKY0KPqPHz93W4Mu/F72B4ljNn/1iLGcKxZyeh6V4H3r/na9tD8cnP8SOoIjIM95Tg8dr7pXgf4LIHdTwRuo6NTWqV5+8Uruz4sDFShA0pNszfyrqVbYHru1gF1hm5+tZ1TR2pv6+V8wXt6BgqBU/ywnG9bU9v7VmrvA4Kt6ogpGHnCQiZ9CrJoc9YNYF3OxWYNlZCokaeIOdM056LJ5qjGy5axrk/asyASovGCPdTtisi8Y/mFGniukc3NuYQH+snBTC0UWDSQU2cDU4akRn60v13jvYQ7uj+NBsD5Ipz+g+Q0L60440+cJd6lhWcuiOCIVitxloSodzhSr1MPqAN0vSxElNZRJAtx0AuR5jr+PFg3Vf+aL6l89b31bOeiBVd9Aag== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(346002)(136003)(376002)(396003)(39850400004)(36840700001)(46966006)(356005)(316002)(70586007)(36906005)(42186006)(426003)(7416002)(4744005)(478600001)(921005)(2616005)(186003)(83380400001)(7636003)(2906002)(336012)(70206006)(82740400003)(26005)(6266002)(36756003)(8676002)(36860700001)(47076005)(107886003)(6666004)(54906003)(5660300002)(8936002)(4326008)(66574015)(110136005)(82310400003)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:22.7420 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 548b0814-7f4c-4cde-6c16-08d8dc1f26ec X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT025.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4092 Received-SPF: pass client-ip=40.107.220.85; envelope-from=saipava@xilinx.com; helo=NAM11-CO1-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Cédric Le Goater This adds extra info to trace log. Signed-off-by: Sai Pavan Boddu --- hw/sd/sdmmc-internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sd/sdmmc-internal.c b/hw/sd/sdmmc-internal.c index 2053def..8648a78 100644 --- a/hw/sd/sdmmc-internal.c +++ b/hw/sd/sdmmc-internal.c @@ -14,7 +14,7 @@ const char *sd_cmd_name(uint8_t cmd) { static const char *cmd_abbrev[SDMMC_CMD_MAX] = { - [0] = "GO_IDLE_STATE", + [0] = "GO_IDLE_STATE", [1] = "SEND_OP_CMD", [2] = "ALL_SEND_CID", [3] = "SEND_RELATIVE_ADDR", [4] = "SET_DSR", [5] = "IO_SEND_OP_COND", [6] = "SWITCH_FUNC", [7] = "SELECT/DESELECT_CARD", From patchwork Sun Feb 28 19:33:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E085C433E6 for ; Sun, 28 Feb 2021 19:34:38 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ED49B64DEE for ; Sun, 28 Feb 2021 19:34:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED49B64DEE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRpt-0005qE-0M for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:34:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRkx-0008S7-Jr; Sun, 28 Feb 2021 14:29:31 -0500 Received: from mail-dm6nam12on2048.outbound.protection.outlook.com ([40.107.243.48]:16556 helo=NAM12-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRks-00039K-V1; Sun, 28 Feb 2021 14:29:31 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HnjLEEOaxVoh8l2xUiQK70GH4OclEQf8FXPi0ZMFtR9pnU3odQGeN+YgG1Hlfrhc+OiSb5TKdGthykyRnplY+eRbN55Xj4AP8X3JKGoeED0KpOn4wr84siTyrS6gfelEciZk0QtM0bY0//C+cQTXSzZxX9aSdNeZmviMejsG+kyF7lMv7j/KxPxGRpAKCFuUvj05opSlQGGUeLiquYF9Myrb6sa0QNSMDSPpyCSS5yxf+61AHeUWvtwGZ5YHM0O7Vl4leb4/LmOkPPlsMWnCwH3CCzqf1a4GMWmrBoa2JdXjguDUo2jFB2MCtF/1ZcnEY+UgDUWJ0aLUKmWNYrUU1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A8zukIHfoPtN2nUzsZ2wbyDYviBosaS9aQO43YfgFFY=; b=MjZhDGTzLu6ZYngTpbnMJwoXNJ9EYgtfu90Mm+apbD3QSY2fePfBVXYu67GdB/i3hbaB+SFdSi3XJrMium5IQ/5axl7aC/LcgT81+28KP5tvs7t+0W8u1nMQ8N5m/gQ6VaHfl5Inu5Q8H/py3iR4+9HwY0FDYwAv1v8ZE8Mei0+KX66R2TB89mSjvzge1dp+l7uRCjei57HCdEdmF6o/RBnMb+jKddTP/8mzYw9wGcAEOmopk8DBpkKXsM1kTOROLh4GQ33G56E9LyJQgb2Ahy84Vgz/JTY2PgJmNcTrkfdkPT+mOkEtG3WMS4C/91r63E8RmIDzLVEZs4iVG34m2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A8zukIHfoPtN2nUzsZ2wbyDYviBosaS9aQO43YfgFFY=; b=kzWzqrmJAyQvmu+WVxIFis5dD3A01gVuA6Tid+XFycQNHpDky/JbggEyx7SIEtjK+4lI9zMlSDAlPWboONbsBASYxBqpLEKqap/a9mzOLq6qrb13aP/6htET9c1UuFiCYuWT343pxL6XMbbvuO32tXnefecwqESr9YNsjfQa4uk= Received: from CY4PR20CA0035.namprd20.prod.outlook.com (2603:10b6:903:cb::21) by PH0PR02MB7255.namprd02.prod.outlook.com (2603:10b6:510:16::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.20; Sun, 28 Feb 2021 19:29:22 +0000 Received: from CY1NAM02FT025.eop-nam02.prod.protection.outlook.com (2603:10b6:903:cb:cafe::4) by CY4PR20CA0035.outlook.office365.com (2603:10b6:903:cb::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT025.mail.protection.outlook.com (10.152.75.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:22 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:17 -0800 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:17 -0800 Received: from [10.140.6.35] (port=57768 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRkj-0008Ax-EW; Sun, 28 Feb 2021 11:29:17 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 81D3913C0A83; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 08/21] sd: emmc: Dont not update CARD_CAPACITY for eMMC cards Date: Mon, 1 Mar 2021 01:03:14 +0530 Message-ID: <1614540807-30686-9-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 866fc1c1-7040-4f5e-a7de-08d8dc1f26a5 X-MS-TrafficTypeDiagnostic: PH0PR02MB7255: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:862; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AipwyJ9uUcMPgbzz2YFQPZqXmYlfhYuXsWc6fHoLRYqUpiDwqGEFA31giaZ6/5tMEJOnx01hUfh2x01gPXHVobNJefpu6KhGxgc0CJIWgppgRpnW1Kf/TDUWuGPBhvRFVNXqJbPnlbuKB6eVFb8cIdcBchIiGT2L8bKsmqo+YM+girpbG3q9SEM/fcGJoSSOhCQMPGKRRyHsSmfY2lWZWdiONAtBN4iLTDhmfpLNljX7hEcHjXA1N8M58oczCf5vNWaywV3CMnyzvOSoowtf6zYZyEPP7fCKfmWjxleGPFVBqcP/a9QOCERk02hgwJF4DeDGkrNLSseAgvUseIg82dO0a7slPLJRT0FDPHgpXA99VggGzwTMMmuRhR4MC/pR3S/YhtOyqt33wsCqb0XduZsRRkREYNEtLiBTLlQP+CjaFODJdhkQXHAD72cwibzcTJXvCWcBXLWFVjIG4u/ZtL8NcBoz3FvbHvbAF3d08Q1Hamy2UfUW5Ti7CBxyWoGfz4V/5C37+94L0ZuphdmrPbkEsbPXwZgXE0EJPJ3bqAez6CMzR+dVYqFktyj9j3oRwft+uVD+pqLUgauPKTElc1ghn7VokZJWdaUblk5BHNeYBbPL2PFV+9zMwKyDqteaq9A4SnInp8CY1yFXNBCrkDTRQqFOz2X/oExLS0qs85iSgmuA4Wlq3PXupZGMjp3vBRYCGkqj3/a46I+UYsluZyXRFc2uVZiH9E8bqRTLmkE= X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(346002)(376002)(39850400004)(136003)(396003)(46966006)(36840700001)(2906002)(82310400003)(83380400001)(7416002)(82740400003)(356005)(107886003)(6266002)(7636003)(110136005)(54906003)(316002)(36756003)(36906005)(42186006)(4744005)(5660300002)(47076005)(26005)(8676002)(70206006)(2616005)(186003)(478600001)(36860700001)(921005)(426003)(4326008)(8936002)(70586007)(336012)(6666004)(102446001)(192303002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:22.2783 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 866fc1c1-7040-4f5e-a7de-08d8dc1f26a5 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT025.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR02MB7255 Received-SPF: pass client-ip=40.107.243.48; envelope-from=saipava@xilinx.com; helo=NAM12-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" OCR.CARD_CAPACITY field is only valid for sd cards, So skip it for eMMC. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis --- hw/sd/sd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 181e7e2..2612135 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -328,7 +328,8 @@ static void sd_ocr_powerup(void *opaque) /* card power-up OK */ sd->ocr = FIELD_DP32(sd->ocr, OCR, CARD_POWER_UP, 1); - if (sd->size > SDSC_MAX_CAPACITY) { + /* eMMC supports only Byte mode */ + if (!sd->emmc && sd->size > SDSC_MAX_CAPACITY) { sd->ocr = FIELD_DP32(sd->ocr, OCR, CARD_CAPACITY, 1); } } From patchwork Sun Feb 28 19:33:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5236C433E0 for ; Sun, 28 Feb 2021 19:31:55 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5806564E74 for ; Sun, 28 Feb 2021 19:31:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5806564E74 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:36676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRnG-0002IX-Dn for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:31:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRkx-0008S4-8S; Sun, 28 Feb 2021 14:29:31 -0500 Received: from mail-eopbgr680043.outbound.protection.outlook.com ([40.107.68.43]:30466 helo=NAM04-BN3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRkp-00035Q-79; Sun, 28 Feb 2021 14:29:28 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UnLyJubD9f1vQshG2nxP9o0ej8Cdslbe6B5eqJy2VJIA3Hc+L+IB49UEU1WiKtpivylr477y/t0WBnjZitviQG/YSHOsjSvqMOuDIIowd3loiwaFm7DBefy26kAAs09yOYbOUL78HfdWxMNBdrVq2k61H7sOpQk07QeaZ0n1TvK+5L3MWLX8nYfZcJ+SMkbZXqYmw+oog/enzdeY6JFp/rRFgeqDDkdZ4gtvHcpkfj9+NpicfiNAFXC50Mgf4TjqrmgdwbYHrM2K7TdRLPYAUIL5QJWpf0JoblKzGptRCI/WEqTJu7/XwfuiGtGEgQXcmkxpyuj8AnXxh2MQSF0OwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xcTdhq5/ZjbE4yLIDkftIyqLFevvx3Q4L90Zglaihvk=; b=IqAtpByaL9EMCXfN+RaXcDKaGe7JUeDt2Uo8hDUiAGLTEwAKG1BQSZPQ6nviBcrgl4fXYuMAhrLmdbgv3QZD811YJ9qDWn74NNse6rRbvXwuos2b58xz6FHFe+X6B+nZvSgAZuvDN+I4sgdXa3NZNrgQy2A4begadpVM/XkHeugDbtKdcGHNuQcqF+6fAtXbL9oMU4y55xrCB7X//TIXEp0s625m56c22FAfffbozhWWVxoNkF33X/0fHRIUb8emK9TS4KV3JM+BAPPN+uMPPZtQ3w1TxAvfMF7YRhG+a93DECiw/VdV70ZlKxCUrT85UD23y7iNMtl9qVDKcxqvCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xcTdhq5/ZjbE4yLIDkftIyqLFevvx3Q4L90Zglaihvk=; b=NPEGypQJ9u+r8lzFzEBbQFpD3vvz7ZHPk620iHeJRNFynFQEJuM8iW0zQoVeDIPEnpEYfcnZV+iuSCUSDroZF6W71NJ+/QJ3w6icDCGhUrFbner8pLHDp2mrF91hE/hZWT9FT8LIxPwYjOOIbDlgP4aMMu2iJLuCIrqcTVpsxMI= Received: from CY4PR20CA0034.namprd20.prod.outlook.com (2603:10b6:903:cb::20) by DM6PR02MB5740.namprd02.prod.outlook.com (2603:10b6:5:159::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.26; Sun, 28 Feb 2021 19:29:18 +0000 Received: from CY1NAM02FT025.eop-nam02.prod.protection.outlook.com (2603:10b6:903:cb:cafe::a1) by CY4PR20CA0034.outlook.office365.com (2603:10b6:903:cb::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT025.mail.protection.outlook.com (10.152.75.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:18 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:17 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:17 -0800 Received: from [10.140.6.35] (port=57772 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRkj-0003MO-FE; Sun, 28 Feb 2021 11:29:17 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 8BD8713C0A85; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 09/21] sd: emmc: Update CMD1 definition for eMMC Date: Mon, 1 Mar 2021 01:03:15 +0530 Message-ID: <1614540807-30686-10-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5f1306c1-579f-410c-ee7a-08d8dc1f2458 X-MS-TrafficTypeDiagnostic: DM6PR02MB5740: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wtqXd1dOSScRoT2OoZ7hW31tL3pv1wUECh5YSbG6W81PFc+3y/l5x7T5G4JWwMVuuSPiKG1USmFyP1Lq1NG1eQJ/53GLUQDc7U/eGEMBFPMzRGaCDB3TgtNI3awq5eAV9NoRFMPDEp09UjIRQ8arFWWF8gLvJPztlNuWrHlVb+0da5lU31aP3OfdK81TzfbzR2ykJ5ektj1yD0AqqBRXMMMmp2emLO2hdhIAGWMvAUYOC0+8wrq7APpc7WzsBD2AtzbE+aim1zjW3L3jhZ5V1AjMS/JKyIoIwgyrp5k8strzY8+U+2XpYnu8RW3PdP0VTLVWab4z3rNN69ezZxRMc6/PZb+RzuDUIlRwYTgD4EiciGn0v5zDIpraCD1Ym9GYGm87+LyjWTFRIEwUBJoRUPYUqc/pkHhtrcjnFfAEqVYpfVIS4CWkpVyZ6G9XqJYiAhXRA9O5kXvw20NOfV9hO2p6zXQtFKanUwscp0fAo6WXzVAm4pJL9SbM54k6wjpIb5pAjtZWODIpG6zAO1puqBllboYbHPLAryFwreoTHB0QObrlDgE05gZwRNeaVvxuXZ3l7CpkEVgbTolk8lZtPqX+EfoOEX2WdzzaFHEVt9HEiS6qBaRb1Fv58cJ8mL6Ur7uFYGWyM3/YMZM/EFjCI/DfBGlZjVmPOj6lOySbFDYz+TZY2wa14bABLROO52mGXVWrG4MruybQ9m+Xo6sqzQ== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(396003)(39850400004)(346002)(136003)(376002)(46966006)(36840700001)(82740400003)(83380400001)(356005)(426003)(110136005)(47076005)(82310400003)(26005)(70586007)(6266002)(42186006)(336012)(4744005)(107886003)(186003)(54906003)(70206006)(2906002)(5660300002)(36860700001)(2616005)(7636003)(36906005)(6666004)(316002)(921005)(8936002)(36756003)(8676002)(7416002)(478600001)(4326008)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:18.4200 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f1306c1-579f-410c-ee7a-08d8dc1f2458 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT025.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB5740 Received-SPF: pass client-ip=40.107.68.43; envelope-from=saipava@xilinx.com; helo=NAM04-BN3-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add support to Power up the card and send response r3 in case of eMMC. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis --- hw/sd/sd.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 2612135..054ad1e 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1041,8 +1041,16 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) break; case 1: /* CMD1: SEND_OP_CMD */ - if (!sd->spi) + /* MMC: Powerup & send r3 + * SD: send r1 in spi mode + */ + if (sd->emmc) { + sd_ocr_powerup(sd); + return sd->state == sd_idle_state ? + sd_r3 : sd_r0; + } else if (!sd->spi) { goto bad_cmd; + } sd->state = sd_transfer_state; return sd_r1; From patchwork Sun Feb 28 19:33:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108401 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2451C433E0 for ; Sun, 28 Feb 2021 19:39:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6B4D664E74 for ; Sun, 28 Feb 2021 19:39:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B4D664E74 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:36364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRuw-0005Ti-Db for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:39:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRlD-0000Jh-0T; Sun, 28 Feb 2021 14:29:47 -0500 Received: from mail-dm6nam10on2084.outbound.protection.outlook.com ([40.107.93.84]:7041 helo=NAM10-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRkz-0003Bi-9B; Sun, 28 Feb 2021 14:29:46 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OjSTPUdKoKaMnHtJZQDx+ZPlbofIsi/dk6POwYB4nDF8eV4uVLXVoJ3+9qFsjHkwGLnMFjeJW3lsl2UnOQYl8hCKWmKdm9dibOHLNhRiDAfsqbbG0bPCtaXmWNeOU8zYV5KgDMhXqFyIGGpbrsPZJOzRMcymymnnbL54a9e32b3QN1DwE94zHSUihjkNi1UAuyIXPOk2gO9dlmoG2JJg1u7G9dmyfw4x/XqFvFW6bMe0zf9Q9JFCNMw2PaKO/N/ofpzReiOUY8Ox8onoYUNXfXFeoxfZ9L2EspfPqD2tgV4moi09wucmNpE48aYzE/yKa7gtiILajRxTMzoUEYLc4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8ho/XR5Sd1fi4MdutOw970iZqJNp5oVehh3b5BLlhmo=; b=RN5c4DXBRsFpNPRorABgvbyDr6TqQTEYx8W1MyaI3KY533BaFdsXQKw47ULKiI2VAjZNa2lYSpMRCs8/ocgOtXvojH+buBYOhaG6Ir2/4esXjKDLETgg159j89Zx5i4Ht9enLqv+sQqFFWFCA9XV2eZiavvmhxlmxhJQbhk3oWgbiJeECg6lTrBPLU7iSiaW/2J11lHgg94hYWoxwTBBWCw4niGkey1IGe/lqBiEHo6NUtNmpAhg5ImeyLlSWVK7xDijCCYzXoEzR1XHocmYf4ngKDXYFwj+fFQ3wa7FN+fB1ro6Rv1MCLAUioEY5EcDEHy2GnisrNkPF4RHiA/wgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8ho/XR5Sd1fi4MdutOw970iZqJNp5oVehh3b5BLlhmo=; b=hXAwFtWWJsdIDhVX3a1LAkfIygTYMj0EiLUdUXOsMOkZ4WitJkCoUkm1akLIwaBLX/ourf58NxbQ9U/sUJh0FhaYEIYfPMnWL6AklH4gjJJPXEgvLIgFMh6WA41ZX2/HB3LyI4OGvuBBqBdVPAw/BTi6q/fCFEp9gzmv4URsVag= Received: from CY4PR03CA0021.namprd03.prod.outlook.com (2603:10b6:903:33::31) by SN6PR02MB5696.namprd02.prod.outlook.com (2603:10b6:805:e9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.23; Sun, 28 Feb 2021 19:29:29 +0000 Received: from CY1NAM02FT032.eop-nam02.prod.protection.outlook.com (2603:10b6:903:33:cafe::19) by CY4PR03CA0021.outlook.office365.com (2603:10b6:903:33::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT032.mail.protection.outlook.com (10.152.75.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:29 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:17 -0800 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:17 -0800 Received: from [10.140.6.35] (port=57774 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRkj-0008Ay-FK; Sun, 28 Feb 2021 11:29:17 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 9303A13C0A8E; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 10/21] sd: emmc: support idle state in CMD2 Date: Mon, 1 Mar 2021 01:03:16 +0530 Message-ID: <1614540807-30686-11-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cc6e42b9-5676-4c0c-c6ef-08d8dc1f2ad5 X-MS-TrafficTypeDiagnostic: SN6PR02MB5696: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:1850; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xdpOwCFZXuCs6zg/wD/n8MiL3W+v2UKxNEpColpVdwzb1q3dOYqgztDyfgvAF6IAur1+zOF6s1o6OL4kUuXZPWXKwwu82Bxhc5EJDYSI2KObZYSSRgSoq9b7QGFsMOockv8WO3tXLVLPvxwkIpHE5jTAKlvJVY+DnugFMmN/m2Qf+i+EBnA21g55tIvb3II0wdzrxHmPw7lCbpyQ4aeax1lbXTAAnEp3juezQH7LErVDmftzd4oI9MCEW2zvGIWnf8M6asgX4qK14va9MBTQwAyKctF0o/3njsI8rSABHBgMmk2+CUEXbs1tPCwzJMXipX+eqLLZXUh0Cree+bY4crI/DNWRpWdVdiqtw/u8ElwgN4h0wZkEkPqd/yFlh53g1hRPgBlUR4zb1Rb2LwvZNUgTxEPf5Jtb0SHFckHD0aY7nnj3b9v+6mJm8nnNidnFS8S/vuvOHAaBpl5RhV52roCNh/xUgli3WDaG2H/85ZRffCcUo60gtraMAzb2NIirDF262RRTLpixscgSrM2vZtbBufuKctzNFgKevq+OA82YlUAS8rxMjZ/zM++81iRjCdt1jMBNpVF6tm81vgcXD3ObUKMmA72/3OSFtrgq2WhWQnBKcV+yDEK+CbZHZS3G+OBCAs2sMGFdPY2ivWPQpIQrPQHYf0meXuyKH1zFQHxDJJGbdotPBIwofxN4htx8yQFWsK4uJclxR3ZePZBGIA== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(396003)(136003)(39850400004)(376002)(346002)(46966006)(36840700001)(4326008)(316002)(82310400003)(36906005)(478600001)(921005)(5660300002)(426003)(2616005)(110136005)(336012)(83380400001)(82740400003)(4744005)(54906003)(107886003)(36756003)(8676002)(2906002)(7636003)(7416002)(70206006)(356005)(70586007)(6266002)(8936002)(186003)(6666004)(26005)(36860700001)(42186006)(47076005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:29.3045 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cc6e42b9-5676-4c0c-c6ef-08d8dc1f2ad5 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT032.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB5696 Received-SPF: pass client-ip=40.107.93.84; envelope-from=saipava@xilinx.com; helo=NAM10-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" eMMC is expected to be in idle-state post CMD1. Ready state is an intermediate stage which we don't come across in Device identification mode. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis --- hw/sd/sd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 054ad1e..8a7d0de 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1059,6 +1059,10 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) if (sd->spi) goto bad_cmd; switch (sd->state) { + case sd_idle_state: + if (!sd->emmc) { + break; + } case sd_ready_state: sd->state = sd_identification_state; return sd_r2_i; From patchwork Sun Feb 28 19:33:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA162C433E0 for ; Sun, 28 Feb 2021 19:34:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4554264E74 for ; Sun, 28 Feb 2021 19:34:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4554264E74 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRpv-0005vQ-9C for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:34:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRl9-00009Z-Cd; Sun, 28 Feb 2021 14:29:43 -0500 Received: from mail-bn8nam12on2074.outbound.protection.outlook.com ([40.107.237.74]:12928 helo=NAM12-BN8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRky-0003Aq-3M; Sun, 28 Feb 2021 14:29:42 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LmIb5RedANLZ6jeD8toT/NqlXlnZNwWzvjb5BqjaM77u21Qcl8ZeC/vkdJTaGX+tak3t2xLqOpyQkQMd39yM5Lfe0xXuM3cPYqPlRHNR8QMHrBIt1160/0GiD3JDR+PMT2hqyCeqCseKEhOd8YZfT5vlyN9qRJU4ggVtmwOY1sXbdjd63WHGvvR7+j31mSv0PCPy1PfMFXzTvwqN1AvzgL7N/NbfzUHCWANArX1kRiwbze7iVaCSycqpEkfq1oVJfMcKjo4BUemhm3tpBCgnt2xg48Ywuj3cdWROMKyX9AP/VJPO23Yjw3GlgktQ63YXAai8uq13xmRnLvo9rEdXug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HRUVfeGhlAifpE3RRsN8dffnGuj2I0re8LcDWEDB0LA=; b=hyV6VP7DfQ/Lh6emvtEHI2n19qi093SaPfaR+ZquUS/k7I9A5ING9/FMeRK9Gk4V4OQlLc6vpBXeBKKuN+cO/b33JnDHZNhBqMFSvZMK9TzPBKUVAf58cHNHjbDOeUto4x9jeWyrtwHfDSVo7Z0QysM6wPvRIj50J1atOXDXDXqpVwXGdrzZE+5IxhZK3KmS5v7oZcAygk3Khy25utwCVEUcfGCGRUmb7XMMgQkL4HRqh8Reol9dglNMs8W8thD+W43RuJTa6/eLZ4+DVcEHADhA5Aouk53JvSRtEXOYt1hQfDrMs8w5h6Un7WhMgtWyjepxuvavQJ4S+K01Q6n16A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HRUVfeGhlAifpE3RRsN8dffnGuj2I0re8LcDWEDB0LA=; b=VvmeiEo8LBr6TOyZHQ5VeHQFJPzAGyBiw6faqgusuiQEf7rbo6mL/voNm/h0IXVCQcRRni6U631vaBjT+Ca7zd1/g1URoa7+8LK+evNTQ6K1/zhDBN37ggn16eAInRvEs5BLxwQMfxRLo18G/jRuROFid8XcFZ3elSUaSJiMZzY= Received: from CY4PR13CA0077.namprd13.prod.outlook.com (2603:10b6:903:152::15) by BYAPR02MB4838.namprd02.prod.outlook.com (2603:10b6:a03:48::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.20; Sun, 28 Feb 2021 19:29:24 +0000 Received: from CY1NAM02FT051.eop-nam02.prod.protection.outlook.com (2603:10b6:903:152:cafe::6c) by CY4PR13CA0077.outlook.office365.com (2603:10b6:903:152::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.9 via Frontend Transport; Sun, 28 Feb 2021 19:29:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT051.mail.protection.outlook.com (10.152.74.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:23 +0000 Received: from xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:17 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:17 -0800 Received: from [10.140.6.35] (port=57778 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRkj-0003MP-GA; Sun, 28 Feb 2021 11:29:17 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id 9A83113C0AA0; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 11/21] sd: emmc: Add mmc switch function support Date: Mon, 1 Mar 2021 01:03:17 +0530 Message-ID: <1614540807-30686-12-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bab75258-3deb-4b68-29eb-08d8dc1f277b X-MS-TrafficTypeDiagnostic: BYAPR02MB4838: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sdRlUEaf5iQjKrCKlV3hNTd+8/GA5Uko804QOYbOsQjNMEfLTYbEw51PUvuOsiHZ5xmdhpp0LjbBrQhEfWMCP39u/xOEF/CzBFShViwKMjH+OocmGOedUloVnGbgLGa/0VYr2fy7p7DoHD9N7mPmqqqTqDIBobW4kF8dgmSv1W9ug+GwcosbpZKOyNxXcH40m2zTD7//0RuHPV8rcSORjf0c/IAh3xCEzadsAdadqDA0F4RWWgwxvlM/zh76oxle/4WBoXtwioZbS8CtCZoNrui7fy2TNTwAD0GrQiuSQzPPHiNGZ8ll+y7cIpexIRKCw/fE2nyxs9omqeIg6X+sYLrgRIdOU535Hkd3XUmRSPqCoITw/VkQ4llyY5vQxVCHcGQKWBiaRIWFB9a1/DjSioXZUs3JYxCVmf48kbydxE5BzJWtKTuV1L4SDB5DKLJKFyK9D5P0BVQz4MkC62Q9Fml/85ccLnOP/9XAoOih2i3OHKSR6NzOu5RZqTXzbWJAFmEr5BrowKxMLD8hbYmRAyLFTqiR6qd5g1hdCvIWrhqVwgxG9nNSsmU2tWx7eQhNYdY1vZ68R9Cjb8dFEviOwbbF+AuLGQAm/OXAp+03HEuy1VHc0GD7xLhY7j2ImLF7ygmQv0WHgjbDqK6T/QAkBXoKTFql6g8bh4VkdfgsVRXsZk4H53vMSKAlem/K7SXb7LSW0a9xZYZPq+v7JVNarQ== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(396003)(136003)(39850400004)(376002)(346002)(36840700001)(46966006)(2616005)(2906002)(70206006)(82740400003)(7416002)(7636003)(8936002)(8676002)(5660300002)(47076005)(921005)(70586007)(186003)(36860700001)(36906005)(110136005)(356005)(336012)(316002)(54906003)(26005)(82310400003)(6266002)(478600001)(6666004)(36756003)(4326008)(42186006)(426003)(83380400001)(107886003)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:23.6785 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bab75258-3deb-4b68-29eb-08d8dc1f277b X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT051.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB4838 Received-SPF: pass client-ip=40.107.237.74; envelope-from=saipava@xilinx.com; helo=NAM12-BN8-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" switch operation in eMMC card updates the ext_csd register to request changes in card operations. Here we implement similar sequence but requests are mostly dummy and make no change. Implement SWITCH_ERROR if the write operation extends goes beyond length of ext_csd. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias --- hw/sd/sd.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 6 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 8a7d0de..bf963ec 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -523,6 +523,7 @@ static void sd_set_rca(SDState *sd, uint16_t value) FIELD(CSR, AKE_SEQ_ERROR, 3, 1) FIELD(CSR, APP_CMD, 5, 1) FIELD(CSR, FX_EVENT, 6, 1) +FIELD(CSR, SWITCH_ERROR, 7, 1) FIELD(CSR, READY_FOR_DATA, 8, 1) FIELD(CSR, CURRENT_STATE, 9, 4) FIELD(CSR, ERASE_RESET, 13, 1) @@ -886,6 +887,43 @@ static uint32_t sd_wpbits(SDState *sd, uint64_t addr) return ret; } +enum { + MMC_CMD6_ACCESS_COMMAND_SET = 0, + MMC_CMD6_ACCESS_SET_BITS, + MMC_CMD6_ACCESS_CLEAR_BITS, + MMC_CMD6_ACCESS_WRITE_BYTE, +}; + +static void mmc_function_switch(SDState *sd, uint32_t arg) +{ + uint32_t access = extract32(arg, 24, 2); + uint32_t index = extract32(arg, 16, 8); + uint32_t value = extract32(arg, 8, 8); + uint8_t b = sd->ext_csd[index]; + + switch (access) { + case MMC_CMD6_ACCESS_COMMAND_SET: + qemu_log_mask(LOG_UNIMP, "MMC Command set switching not supported\n"); + return; + case MMC_CMD6_ACCESS_SET_BITS: + b |= value; + break; + case MMC_CMD6_ACCESS_CLEAR_BITS: + b &= ~value; + break; + case MMC_CMD6_ACCESS_WRITE_BYTE: + b = value; + break; + } + + if (index >= 192) { + sd->card_status |= R_CSR_SWITCH_ERROR_MASK; + return; + } + + sd->ext_csd[index] = b; +} + static void sd_function_switch(SDState *sd, uint32_t arg) { int i, mode, new_func; @@ -1105,12 +1143,18 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) case 6: /* CMD6: SWITCH_FUNCTION */ switch (sd->mode) { case sd_data_transfer_mode: - sd_function_switch(sd, req.arg); - sd->state = sd_sendingdata_state; - sd->data_start = 0; - sd->data_offset = 0; - return sd_r1; - + if (sd->emmc) { + sd->state = sd_programming_state; + mmc_function_switch(sd, req.arg); + sd->state = sd_transfer_state; + return sd_r1b; + } else { + sd_function_switch(sd, req.arg); + sd->state = sd_sendingdata_state; + sd->data_start = 0; + sd->data_offset = 0; + return sd_r1; + } default: break; } From patchwork Sun Feb 28 19:33:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108399 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CFEFC433E0 for ; Sun, 28 Feb 2021 19:38:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E4C2F64DEE for ; Sun, 28 Feb 2021 19:38:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E4C2F64DEE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRtb-00037L-PK for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:38:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRlC-0000Iy-OC; Sun, 28 Feb 2021 14:29:46 -0500 Received: from mail-dm6nam10on2040.outbound.protection.outlook.com ([40.107.93.40]:18689 helo=NAM10-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRl1-0003D6-34; Sun, 28 Feb 2021 14:29:46 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W2RgbJrkv1tTBiHDYzJXHDM7eQgUB0d3kkXnPwwrA7pljRM2hx22IkkdZEOSwVfJ+LjVc0pkyqw8DBMdRJL4t51gN5VBG0eYjAmI1BL8p6r9aCSFEVrwE7QlRoX1Ilkd/SyLtX1bjUrvCMCw+GVe0dNoRxQC84j+teJMJeXKRVCePY2BziKi1RdCCpXAaMq5l0VCTj0QESKsS5hUbxc9m70o3PLkd8Q2xo2LJphne3YfpldfxE9hxW/VAMbhe3L9bwdsU9RUqSZ6Gb1OeTtX0idFHRxXK7zBjMNFCYelZE8UWcZwghdiGH7/BkiFrEnQuCDJ2OnPZBKMcK0kKoVHWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f6be1+AbxDPGus3FHMFVJGltK9t34CkzB952bL3rumo=; b=ffw4Xzxf/6DfDQ+N41T+BrtuWchUG46wwrbhSzuvKpRkcLSfg7SLA6BSaXQN1TbaWN5Uocd0VynxPBSjyKSILeIkPLRt8MiBg0Zsk0sCUKPPnE1bUOaC1GmX77ZOftA3tGjVOM4urcd9vxzLWrqTX7jdTqEXSNYKRe2UWEfeBeIrwjo/vuZSg20KxMwTlSliuurlCVlyjLbrALh0zFvzFf43MF6tXaRkyllCw3ctDTmPxsV8cuI/p5C20txoEvw50be+yB9EI3n6ERFr5IjgvXchW6JXiqKyjERVATb3dikEwL/qXs3DZf6Hr5HcZf0df4+nbj6weWdJnglhcSK3rQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f6be1+AbxDPGus3FHMFVJGltK9t34CkzB952bL3rumo=; b=AG/2ro38BoEG35Xzsn4+c9RjKUoNrfmea9a3/kIuqV3U5ZCzLqExZ6UMs71o5v4H53mM4HvX7gk80INYhtl8gmHuxcltfbuWN4QJlDmpuZE+d3ZLUD4ezc1vwT9KY2elXayCqFl0oPJ6XzLiyTPkbIjHupDWY1zfD0gh2EJs5go= Received: from CY4PR03CA0014.namprd03.prod.outlook.com (2603:10b6:903:33::24) by BN6PR02MB2516.namprd02.prod.outlook.com (2603:10b6:404:54::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19; Sun, 28 Feb 2021 19:29:31 +0000 Received: from CY1NAM02FT032.eop-nam02.prod.protection.outlook.com (2603:10b6:903:33:cafe::fe) by CY4PR03CA0014.outlook.office365.com (2603:10b6:903:33::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT032.mail.protection.outlook.com (10.152.75.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:31 +0000 Received: from xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:17 -0800 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:17 -0800 Received: from [10.140.6.35] (port=57776 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRkj-0008Az-Fx; Sun, 28 Feb 2021 11:29:17 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id A1FF013C0AB0; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 12/21] sd: emmc: add CMD21 tuning sequence Date: Mon, 1 Mar 2021 01:03:18 +0530 Message-ID: <1614540807-30686-13-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 03ed527f-51c5-479f-20db-08d8dc1f2bf3 X-MS-TrafficTypeDiagnostic: BN6PR02MB2516: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:2803; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HFQ7LFJx7x+xhWOZ1FClOZGegKRcMuxYBVstXQkJnBWMN9WI/YFSSrn6thALYa9+CHM4JlgQB8+fXZMZTi7MUxvrO0BwUTaOGM5enwnWFgi1F0N28eKBu68qWoHDnsR3NHd0PmLADvD9mAU9xIs/rH+BICs74kccLO3IvZ1wkCT1cp8xyQxgkpf5XPUY52y+bXHFloHgPQMTo4ZwimMmcXfkK3AtPQsjqp//Pwg31t7NNs8rE96L+TpKNPgwBPTJOsl5rvWJJH0H1viRzMmYX++FNf4fArfuy0fnVbyXtrWrYIwpHJSZ4NPnjzeF+R0bJAamI1iP3ld3S+tPtG7d9hFQ79vyWkqwAQKRt/ZDI3EDMhriXAr4qqMENFvoonfoLXX8nU3vuzFmXNaXbji6kb/aqIxTgaBw3tKA9OyTsn12vauD9HgoJaF8SbZU7yRQCUxovq1EjGxYGKHYxP0Xmei0dGgvDXfu+t3S9jnu9Fyo7oq/x/9J0RDdMGVhj8QXCK95M++TcipMEMbNEcYKb1o6e54ACkPgCnQdYXdT5W3VJfDBmK6TfsG40PoZOaUaoybES0B3POg4FQnHvqnzj2csixpi0UwZebdhCMP7Ip9RUWV6cVJm1RVgOIEjoV7B21xczMKNqo+tXsPyCe8F7sXnZScyDGbK45ZQs/7GGXrmJFqktOnZa3K9ANuHFyK+ipjLTbWASWVu7uwV4bG6ww== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(346002)(136003)(39850400004)(396003)(376002)(36840700001)(46966006)(4326008)(70206006)(6666004)(107886003)(336012)(426003)(70586007)(478600001)(6266002)(186003)(36756003)(26005)(83380400001)(8936002)(7416002)(2906002)(5660300002)(7636003)(42186006)(36860700001)(2616005)(36906005)(82310400003)(82740400003)(54906003)(47076005)(356005)(8676002)(316002)(921005)(110136005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:31.1736 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 03ed527f-51c5-479f-20db-08d8dc1f2bf3 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT032.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB2516 Received-SPF: pass client-ip=40.107.93.40; envelope-from=saipava@xilinx.com; helo=NAM10-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" eMMC cards support tuning sequence for entering HS200 mode. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias --- hw/sd/sd.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index bf963ec..174c28e 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1386,6 +1386,14 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; + case 21: /* CMD21: mmc SEND TUNING_BLOCK */ + if (sd->emmc && (sd->state == sd_transfer_state)) { + sd->state = sd_sendingdata_state; + sd->data_offset = 0; + return sd_r1; + } + break; + case 23: /* CMD23: SET_BLOCK_COUNT */ if (sd->spec_version < SD_PHY_SPECv3_01_VERS) { break; @@ -2120,6 +2128,30 @@ static const uint8_t sd_tuning_block_pattern[SD_TUNING_BLOCK_SIZE] = { 0xbb, 0xff, 0xf7, 0xff, 0xf7, 0x7f, 0x7b, 0xde, }; +#define EXCSD_BUS_WIDTH_OFFSET 183 +#define BUS_WIDTH_8_MASK 0x4 +#define BUS_WIDTH_4_MASK 0x2 +#define MMC_TUNING_BLOCK_SIZE 128 + +static const uint8_t mmc_tunning_block_pattern[128] = { + 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, + 0xff, 0xff, 0xcc, 0xcc, 0xcc, 0x33, 0xcc, 0xcc, + 0xcc, 0x33, 0x33, 0xcc, 0xcc, 0xcc, 0xff, 0xff, + 0xff, 0xee, 0xff, 0xff, 0xff, 0xee, 0xee, 0xff, + 0xff, 0xff, 0xdd, 0xff, 0xff, 0xff, 0xdd, 0xdd, + 0xff, 0xff, 0xff, 0xbb, 0xff, 0xff, 0xff, 0xbb, + 0xbb, 0xff, 0xff, 0xff, 0x77, 0xff, 0xff, 0xff, + 0x77, 0x77, 0xff, 0x77, 0xbb, 0xdd, 0xee, 0xff, + 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x00, 0xff, 0xff, 0xcc, 0xcc, 0xcc, 0x33, 0xcc, + 0xcc, 0xcc, 0x33, 0x33, 0xcc, 0xcc, 0xcc, 0xff, + 0xff, 0xff, 0xee, 0xff, 0xff, 0xff, 0xee, 0xee, + 0xff, 0xff, 0xff, 0xdd, 0xff, 0xff, 0xff, 0xdd, + 0xdd, 0xff, 0xff, 0xff, 0xbb, 0xff, 0xff, 0xff, + 0xbb, 0xbb, 0xff, 0xff, 0xff, 0x77, 0xff, 0xff, + 0xff, 0x77, 0x77, 0xff, 0x77, 0xbb, 0xdd, 0xee, +}; + uint8_t sd_read_byte(SDState *sd) { /* TODO: Append CRCs */ @@ -2213,6 +2245,21 @@ uint8_t sd_read_byte(SDState *sd) ret = sd_tuning_block_pattern[sd->data_offset++]; break; + case 21: /* CMD21: SEND_TUNNING_BLOCK (MMC) */ + if (sd->data_offset >= MMC_TUNING_BLOCK_SIZE - 1) { + sd->state = sd_transfer_state; + } + if (sd->ext_csd[EXCSD_BUS_WIDTH_OFFSET] & BUS_WIDTH_8_MASK) { + ret = mmc_tunning_block_pattern[sd->data_offset++]; + } else { + /* Return LSB Nibbles of two byte from the 8bit tuning block + * for 4bit mode + */ + ret = mmc_tunning_block_pattern[sd->data_offset++] & 0x0F; + ret |= (mmc_tunning_block_pattern[sd->data_offset++] & 0x0F) << 4; + } + break; + case 22: /* ACMD22: SEND_NUM_WR_BLOCKS */ ret = sd->data[sd->data_offset ++]; From patchwork Sun Feb 28 19:33:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108393 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F678C433E0 for ; Sun, 28 Feb 2021 19:37:20 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0F36D64DEE for ; Sun, 28 Feb 2021 19:37:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F36D64DEE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:54478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRsV-0001KB-56 for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:37:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRl1-0008W4-HZ; Sun, 28 Feb 2021 14:29:35 -0500 Received: from mail-eopbgr760082.outbound.protection.outlook.com ([40.107.76.82]:62966 helo=NAM02-CY1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRkw-0003Ah-BJ; Sun, 28 Feb 2021 14:29:34 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HJ7JA3K+2HcBr0nGpZUMK11SkVRXhEox/ILMhf0pydKeRNsMb4mvQ6L9KJuu6aRxmsBoHTRcUaXcpb33mybkLyad2zLkZ/QyWuKFvW5Qi3m2IfjjyPxbRUyGWUmTbyBlvk6q4vVKKXVZ088OneGTUp4AOAiN2KS0j+GJRMHu4eo0+qRefqr9x8ytFJRF7us/kmTCLA5yiFRR1+bOt+ITcY870/6S7PfXMc0LkZuXCfe8u+gulUUQt2cUEf81v5qBWUHXqSEHRtm9EYFNAw+m7CbsQwQTF0kIQAkE9k1BeJD8hgY5UTz6dM13yDUdj0NdC9R2noK8TgYRClMqqJQr9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bexQYWFQDKgVeKFcENO51wp6aYgVP9K4I8K1x1iMD+8=; b=d8e57URZm2Zu8t3PRU1nVBKZqAUv3/PJitGqh4g5zfhC7V9aeSf39QUzR5dRCNWwAYJlLUuEATnRNC26DFLxQMsROpxGhEl5GxDPprekGRqUO+bNCrEELHfTszGzWjF7aaWoQ4UfAOk3z6wBugtNV5Kyl4q82yzEuugYyCtV9Bjj9DFcBRWP6LFxLyspQdLI9Wu5oXGxJxDCDxnGealNDzrm9lRU6D32rZeBBP2DKOGk+ruda6ogucln8EyW/PBpIroGBvMKnUr5aqfjDIt+T4nR6MBiah5Y59b7b/xUMATT4anlsF883OF7g3qvvA/47pvkIZVnqyS2/smVSlsW3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bexQYWFQDKgVeKFcENO51wp6aYgVP9K4I8K1x1iMD+8=; b=e7fxeC7kR7FJ9UWG6EE207E1M3pLTLsBXDEGbOsUGWMFZdZEelR9nQ3rkMVQEF4yQkG7nOtLVp4JEWtvBvMDY0pQW5wspGJT9EUyKyTW1qj3HK1JEXq1MIIcLlSy30AMduYBJ3VjXbiw4iirlZadbvsdSo46MxQpftuBK8O6MlE= Received: from CY4PR13CA0081.namprd13.prod.outlook.com (2603:10b6:903:152::19) by MWHPR02MB3167.namprd02.prod.outlook.com (2603:10b6:301:6a::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.20; Sun, 28 Feb 2021 19:29:25 +0000 Received: from CY1NAM02FT051.eop-nam02.prod.protection.outlook.com (2603:10b6:903:152:cafe::b8) by CY4PR13CA0081.outlook.office365.com (2603:10b6:903:152::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.9 via Frontend Transport; Sun, 28 Feb 2021 19:29:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT051.mail.protection.outlook.com (10.152.74.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:25 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:18 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:18 -0800 Received: from [10.140.6.35] (port=57780 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRkj-0003MR-Sd; Sun, 28 Feb 2021 11:29:18 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id A982313C0AB5; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 13/21] sd: emmc: Make ACMD41 illegal for mmc Date: Mon, 1 Mar 2021 01:03:19 +0530 Message-ID: <1614540807-30686-14-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 18fcd6e1-152c-4276-c856-08d8dc1f2871 X-MS-TrafficTypeDiagnostic: MWHPR02MB3167: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:2958; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gs7h/KtbUuUd/qRHyXAoj457Fr9iyxtllGl0Noz3V8q+7PED9d1RiEOtOwkiiMijNhjXC1/4JBFzRSf5is+G4G1Ck/kILNUBuHiEFZovI9kSzu/uKrrewicvBXetSAeNtsrwKCQpaMNRq7O+5Ow2XXrLEiSN5CTXHMbvC5yBKsSEbFlDTjo/DjcV4c+MGJYlC5gmhf8F19NBBVN3t7xipVUjvkLkXP2/E5ndi3gsfHNwMwzGXNvUJifRlz1n/zSfyJ3gPUnXKCVrbjSH+3KswYcO/e9RiRuuv+BeJi0lBh+XYTtFEY7SVupWiLDt9dR4VDkIBc3ShMRoJuieZEGI8452RghtD1WVENbnyS0SCshrtE6YoGarsdIP81RYcEXB2lha71rDINwjw8oJzS0hXX2T9ccuq0U4flhHOo2o/L3kLAMLptx51Int6erhxQiIOvMg9HGq4PcVVkLfQn4GK3LGlWTzCfOXp34+dPqvzQmaZcScq0PEnDlwM/+/AJ15luRtQfz8LLM2ToQxpIEyHfxxKjkg7wa8sD/eZ4ekBIuyTBi//aXsPdqntLAAgK3wE+8KkHFyWJh99sfEdAGIuy1xEDxwdgbwB7GlgKchKSA+sLl8adJ2MgOAkHW+0zzVK4VrMX8HBDD4XC3LHvp6OseUiZI+7x0NpMhvLQjCBRjFREz3y+UEIzDHo6L48dUibmoaIUryv87oDWIUlhOIfA== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(346002)(39850400004)(136003)(396003)(376002)(46966006)(36840700001)(2616005)(26005)(70206006)(47076005)(5660300002)(70586007)(186003)(8936002)(426003)(4744005)(336012)(6666004)(36860700001)(4326008)(8676002)(921005)(478600001)(82740400003)(7416002)(82310400003)(110136005)(54906003)(36906005)(316002)(42186006)(2906002)(36756003)(356005)(7636003)(107886003)(6266002)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:25.2917 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 18fcd6e1-152c-4276-c856-08d8dc1f2871 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT051.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB3167 Received-SPF: pass client-ip=40.107.76.82; envelope-from=saipava@xilinx.com; helo=NAM02-CY1-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" ACMD41 is not applicable for eMMC. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias --- hw/sd/sd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 174c28e..09c1222 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1737,6 +1737,9 @@ static sd_rsp_type_t sd_app_command(SDState *sd, break; case 41: /* ACMD41: SD_APP_OP_COND */ + if (sd->emmc) { + break; + } if (sd->spi) { /* SEND_OP_CMD */ sd->state = sd_transfer_state; From patchwork Sun Feb 28 19:33:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108415 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4FA8C433DB for ; Sun, 28 Feb 2021 19:44:39 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8416960C41 for ; Sun, 28 Feb 2021 19:44:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8416960C41 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:52032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRza-0003aI-Fa for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:44:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRlE-0000Np-Go; Sun, 28 Feb 2021 14:29:48 -0500 Received: from mail-eopbgr760050.outbound.protection.outlook.com ([40.107.76.50]:39651 helo=NAM02-CY1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRl5-0003GA-RS; Sun, 28 Feb 2021 14:29:48 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VP9AFLdkMGiPTKBjbCOPwbFgmTnIR4tTL7/pyp3r5lAaBUTyJ6zz+JnadnflowuvdAC8tw7oSVP1L+dMy5xKjflP+I/ZBD6TXM1U7IIlc0ynNkAsTYzQNihYp0SXJJxUys0SxUiMU80mM6eBgXbrQMVUm9bf5fpYTaRtD5j7gBF83K3Kz+yfhGt/KhIxPJZ7ZoIFKdwnsqSn0OYrjh13gCVuTFdiAFI4QmESET65eteesvVso2ihDhyeR7lSMpjV19vz2jbyi2WJVYFGlarMdyMWgE2Jo2R5KnL8sbx3KPykHwmuagrM5fITESxsWHlkJ6SDf8kcsCmBbj8NwieenA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vK0drmK3qmsWWuhMkAHCjTpGIn2Dpoqsy7kEAMwQCZg=; b=TbX3/sRCuniPUhtaexayp0BXddKI98/5B6Q4VrFO0T6nWC6H+HThYMOPdICs/P18ZjGISC78/aBNBOJgO+xyWmKffh36b73lDdPj/xmWcEnbwtR49uXcIhCeLxiRXKmiCRM0W475eKGo5TvE8Zo5bPqdRJDQTeHPTvIujRoyjj37AJJvW0K+8ieW5aF8gJiU8NTe5Pkg+VKabN6SL1oiOT/Fy5WymfXVkWUMPEgJMxu9/y+j1C12oR7tMPmxotWKVHTg7CexA0GmBca2d1mZfQBLfGl969bWiPBlG2ciNsibvSwWKPCNwA25Qj2DYwWt1prdYnpdrsCbvWbhDgjo+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vK0drmK3qmsWWuhMkAHCjTpGIn2Dpoqsy7kEAMwQCZg=; b=Gmq6QR4p4gVSJgK0XfDr/KQbZvO/RC0E+EjubYWNxMahsXXBKh29ey9U/1+MK9GnxCi1YpupYgCoK6DGY8WtS3ixGdN2MFibMfUydWRaugJb8Hh3Vd2BbCrYeOiqa0cKvyyOaKU3lvmWmp/Z+OlbgO7jXQ338q/9TdPDq8VK03w= Received: from CY4PR03CA0020.namprd03.prod.outlook.com (2603:10b6:903:33::30) by MWHPR02MB2733.namprd02.prod.outlook.com (2603:10b6:300:109::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19; Sun, 28 Feb 2021 19:29:33 +0000 Received: from CY1NAM02FT032.eop-nam02.prod.protection.outlook.com (2603:10b6:903:33:cafe::6e) by CY4PR03CA0020.outlook.office365.com (2603:10b6:903:33::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT032.mail.protection.outlook.com (10.152.75.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:32 +0000 Received: from xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:18 -0800 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:18 -0800 Received: from [10.140.6.35] (port=57782 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRkj-0008B1-St; Sun, 28 Feb 2021 11:29:18 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id B172513C0ABB; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 14/21] sd: emmc: Add support for emmc erase Date: Mon, 1 Mar 2021 01:03:20 +0530 Message-ID: <1614540807-30686-15-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c374fbce-f712-451c-ba41-08d8dc1f2cd0 X-MS-TrafficTypeDiagnostic: MWHPR02MB2733: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:626; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zstPc1RXELP46Q659iwed0Jc6k26V+MgTa6XFNTieQSlR8+0LgnkBUofBJvyB/fQmBNuneAFngrjjDsSPDMh4v/Xbxwg9qAP0f5wHsfP7bCdWpvPqkJnqJbgznK9rdhmFmHLJuSysTDMpeXf+0LvytQRRNBXEU3lr7tpaO21gSTKCFUVwbgep2soH5rztp2aXubMNlUoOWQA40bXyrAP7OQdX47NedwS3AW08WfqbuAvw5lRPCGESsSKoS5YBZJlouapWW9Gt+tbouR+G+2qi4/Dp3Ip4UuARTwLsf9qv52fjSXGHESkfeAHf+vawo8RzRuKWAWkjAKs0FqjGmqQ1qtsfNC05xGqV7GI934M7K/wiYFnIlDIWspnkhXmYtH9U6q42nuAeJtP92oQkT68lkDjIS97ThAUM4klbhSgYLCx2/2TcpKuGZy7kI9bZfiN+SIUYmlxIev9yLZqPd8KL3N3O2SQhcIwHmMmvu8odSvHbi8pY2QnniXGbct0EXVM/9Zzcnr5XxxyjLhHjrOWQ/FydtOdiXmlE5c3lVFhMiQZ5oyP6dl9Jq+QV0646sIcL5V49mzBpgxiGCXzNONH8pH0TFvMUqzQJAKw7PnK2uwh49DPIJ/SboEShIGt/AkQvjQ5cUT6YLhL/Ua0pla4D5IAIy5MjgL2U/Edh5qQKe2uPAHFbdQVCRY4M1bUnKB+cpCqASeBKuSipxS4DNYxtg== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(376002)(396003)(346002)(136003)(39850400004)(46966006)(36840700001)(186003)(4326008)(7636003)(478600001)(83380400001)(26005)(36756003)(316002)(6266002)(426003)(82740400003)(107886003)(336012)(47076005)(7416002)(8676002)(70586007)(70206006)(2906002)(2616005)(36860700001)(5660300002)(921005)(6666004)(356005)(82310400003)(54906003)(110136005)(4744005)(8936002)(42186006)(36906005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:32.6259 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c374fbce-f712-451c-ba41-08d8dc1f2cd0 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT032.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2733 Received-SPF: pass client-ip=40.107.76.50; envelope-from=saipava@xilinx.com; helo=NAM02-CY1-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add CMD35 and CMD36 which sets the erase start and end. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias --- hw/sd/sd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 09c1222..bba0446 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1552,6 +1552,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) /* Erase commands (Class 5) */ case 32: /* CMD32: ERASE_WR_BLK_START */ + case 35: /* CMD35: ERASE_GROUP_START */ switch (sd->state) { case sd_transfer_state: sd->erase_start = req.arg; @@ -1563,6 +1564,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) break; case 33: /* CMD33: ERASE_WR_BLK_END */ + case 36: /* CMD36: ERASE_GROUP_END */ switch (sd->state) { case sd_transfer_state: sd->erase_end = req.arg; From patchwork Sun Feb 28 19:33:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA8A5C433E0 for ; Sun, 28 Feb 2021 19:32:30 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 583B864DEE for ; Sun, 28 Feb 2021 19:32:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 583B864DEE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRnp-0002nr-Cd for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:32:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRl5-00006s-5i; Sun, 28 Feb 2021 14:29:39 -0500 Received: from mail-bn8nam11on2041.outbound.protection.outlook.com ([40.107.236.41]:43360 helo=NAM11-BN8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRkx-0003BA-Pv; Sun, 28 Feb 2021 14:29:38 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PnxtgFTCAiNnRgJHz0FmceMlAByU6OJg6gtd7D+0lj7shPczb7RrIZac0FAG3EBQgFvWdzm2qSrqdrhB9ufOVhv2nQJezPBfBj5Qd0w0yOFwBOyJLOfaAWFPg9WymsWPIJTuy0Jc/85B+P9fQ9K69vBrYTkmyMoRsGInz55oeO7Kzmi6xvnVV71RK2H2sD8zVEUAI6VmyPGNnPUkgVH71+dnnIiKP6I9i2MLuGf+t8SeCslBjJ0BRfZs04XdpL4JeygB4l0CtX/STtIqGhitjkOIT5catjlGdMHjPz6+GGgMMwR7GWtot4wG75j+YDAI9IvIQUtmm8gH8I+8eNSYJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zM/wb83RADPwb/lNDgTWDciL4aUC3VqMx5JRIZDRQR0=; b=InpS5Z/s/rG8rqmrsmDfwOIooMbZTfpNeTlhM52OKnamKwu+R7/M8eNW3eV7qWAxl6NVMO68KegckJqWTj9v5SuZwvUZ+cHK1+YMGepags+bQvbjtFP+8pQF5e//zpcr58iUsXzDcGpYcNp12gWm493c6zS+kWdD8ashiUGhXh1zhaYByqIduQoXqc6m1HFHtzIB70FxvNE7mo5YPxXFXiqYDa4BykuNKHpqzZmF1CgrpOAnN7WI6LjKxRqBtYioR0/U1NZS4bIWfqwFMUpuYRnG7SwiVQu68pFmjYtYEBia4dA8MwduK6yXoZZjoUAsv9bKTbZHA+ITcVK84YY4iA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zM/wb83RADPwb/lNDgTWDciL4aUC3VqMx5JRIZDRQR0=; b=j+IvkQlOJOVvhCP/ALx+RPjf4O7k9/ygKp5oa8RlV5EnQPK2uP+h27pkw9HRn+a5pCOQh2OjqE4G5fL1uaDfyq7+HAwzjMsPgFiTohKZmDLPPqTivlFUrzDCUoJFF2N/ua0R+O/YaWyXW2X3NYD1jeKfiA85lJ3LDxBnc7OLjfU= Received: from CY4PR13CA0080.namprd13.prod.outlook.com (2603:10b6:903:152::18) by MWHPR02MB2302.namprd02.prod.outlook.com (2603:10b6:300:5b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.20; Sun, 28 Feb 2021 19:29:27 +0000 Received: from CY1NAM02FT051.eop-nam02.prod.protection.outlook.com (2603:10b6:903:152:cafe::a8) by CY4PR13CA0080.outlook.office365.com (2603:10b6:903:152::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.9 via Frontend Transport; Sun, 28 Feb 2021 19:29:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT051.mail.protection.outlook.com (10.152.74.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:27 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:18 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:18 -0800 Received: from [10.140.6.35] (port=57764 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRkk-0003ML-3B; Sun, 28 Feb 2021 11:29:18 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id B675A13C0A7E; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 15/21] sd: emmc: Update CID structure for eMMC Date: Mon, 1 Mar 2021 01:03:21 +0530 Message-ID: <1614540807-30686-16-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a17fd97e-b6c7-4ff5-ae07-08d8dc1f29a0 X-MS-TrafficTypeDiagnostic: MWHPR02MB2302: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:2000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wUDGks30FdjxjZTjlP9r+J2GXBYqHrHpdEaVtwiHhnkXuk593QCSX/HIi2y+rtLWQl/X5qxEsM4KhjXHinCx8xF+3T4lqazxPQJk2/kEREPlF60w6dMjnVFv3n90DvqdukH/CfP/J8jiKZi358L3U/lJcHugKH3/Pik7/v01kmhVbLGKDitJmZ9RuOb77d2xCVK3vy8UyC1mD+Ht8XFGrtXMdIWl7eITFoBoL/lcU7tLdsRblJrmMQl/TVylldZSpJX5H2nMrTeDdDxbCEBEA2CqKyH2b8x0PKpHlAEFAOOMyTs56Dokm7gZCc8/cmA0mGtSyb7c/lBXlB54oEDLkepNKGUIAudxMk/ayA4/xKlPzab/kWILKIsES4jl5/e7Nu/6m8a0sBgbAzXhwNYDeEHlkZFBBJ73fVzzduhHr/O46tjPIBFCLc7HbeefCd54Vvhk7oUygYOH56pmNS1jiW+q1wVAlHWIquulH/nwXlyLtph1zUbqWu5ldR84OZnqiym+iyfkVND7bjoFJriqSckEpb4/VeEdq7IQd3/PZURceXdtaxyFsUsC+f10INO3jp3eytociy5991cruedLJGFUzrG55mf8RtGj6zCpvapBpXpQI2g+EMf4BF8XdvD9hgRCGkAlkqdKDVvuSind5ywvl+tukVQnqTwH/pLAxEc/P/ZgbiLLN+5UcSWXlY5JiIs5osDnnJUqMIj2VB1BfA== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(39850400004)(396003)(136003)(376002)(346002)(36840700001)(46966006)(5660300002)(82740400003)(8936002)(70586007)(921005)(7416002)(54906003)(2906002)(2616005)(356005)(186003)(70206006)(36860700001)(4326008)(7636003)(42186006)(110136005)(6666004)(6266002)(336012)(316002)(426003)(83380400001)(36906005)(36756003)(47076005)(478600001)(26005)(107886003)(82310400003)(8676002)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:27.2778 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a17fd97e-b6c7-4ff5-ae07-08d8dc1f29a0 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT051.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2302 Received-SPF: pass client-ip=40.107.236.41; envelope-from=saipava@xilinx.com; helo=NAM11-BN8-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" CID structure is little different for eMMC, w.r.t to product name and manufacturing date. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias --- hw/sd/sd.c | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index bba0446..08b77ad 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -365,23 +365,36 @@ static void sd_set_scr(SDState *sd) static void sd_set_cid(SDState *sd) { - sd->cid[0] = MID; /* Fake card manufacturer ID (MID) */ - sd->cid[1] = OID[0]; /* OEM/Application ID (OID) */ - sd->cid[2] = OID[1]; - sd->cid[3] = PNM[0]; /* Fake product name (PNM) */ - sd->cid[4] = PNM[1]; - sd->cid[5] = PNM[2]; - sd->cid[6] = PNM[3]; - sd->cid[7] = PNM[4]; - sd->cid[8] = PRV; /* Fake product revision (PRV) */ - sd->cid[9] = 0xde; /* Fake serial number (PSN) */ - sd->cid[10] = 0xad; - sd->cid[11] = 0xbe; - sd->cid[12] = 0xef; - sd->cid[13] = 0x00 | /* Manufacture date (MDT) */ - ((MDT_YR - 2000) / 10); - sd->cid[14] = ((MDT_YR % 10) << 4) | MDT_MON; - sd->cid[15] = (sd_crc7(sd->cid, 15) << 1) | 1; + if (sd->emmc) { + sd->cid[0] = MID; + sd->cid[1] = 0x1; /* CBX */ + sd->cid[2] = OID[0]; /* OEM/Application ID (OID) */ + sd->cid[8] = 0x0; + sd->cid[9] = PRV; /* Fake product revision (PRV) */ + sd->cid[10] = 0xde; /* Fake serial number (PSN) */ + sd->cid[11] = 0xad; + sd->cid[12] = 0xbe; + sd->cid[13] = 0xef; + sd->cid[14] = ((MDT_YR - 1997) % 0x10); /* MDT */ + } else { + sd->cid[0] = MID; /* Fake card manufacturer ID (MID) */ + sd->cid[1] = OID[0]; /* OEM/Application ID (OID) */ + sd->cid[2] = OID[1]; + sd->cid[8] = PRV; /* Fake product revision (PRV) */ + sd->cid[9] = 0xde; /* Fake serial number (PSN) */ + sd->cid[10] = 0xad; + sd->cid[11] = 0xbe; + sd->cid[12] = 0xef; + sd->cid[13] = 0x00 | /* Manufacture date (MDT) */ + ((MDT_YR - 2000) / 10); + sd->cid[14] = ((MDT_YR % 10) << 4) | MDT_MON; + } + sd->cid[3] = PNM[0]; /* Fake product name (PNM) 48bit */ + sd->cid[4] = PNM[1]; + sd->cid[5] = PNM[2]; + sd->cid[6] = PNM[3]; + sd->cid[7] = PNM[4]; + sd->cid[15] = (sd_crc7(sd->cid, 15) << 1) | 1; } #define HWBLOCK_SHIFT 9 /* 512 bytes */ From patchwork Sun Feb 28 19:33:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108417 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5618AC433E0 for ; Sun, 28 Feb 2021 19:45:01 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BC35760C41 for ; Sun, 28 Feb 2021 19:45:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC35760C41 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRzv-00040Y-Pm for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:44:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRlC-0000HA-1o; Sun, 28 Feb 2021 14:29:46 -0500 Received: from mail-bn7nam10on2055.outbound.protection.outlook.com ([40.107.92.55]:41166 helo=NAM10-BN7-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRl4-0003Eq-0d; Sun, 28 Feb 2021 14:29:45 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pp11Uq1jTvI2Tb/DNn+M5UYqcsreFr4Dy5Niq8+yNsaISZnZQtVJ1M9t6lPmuiErWaB5e0zY0e55wrLR/GLL2K6AjkaO/pYdJcVuwpESKbY4mur1AZ/azfONi7jKbT+Goh6t7ncwZPhR+WgC/vAddplZrSZYyk4HJk4TukrTA3cd64kzJo2ShBODvCRdA0Da7uSuHEjMQ0R6uh25J+ZTK9+gu7mp/l/goG7m2B14IfnTEK2eGs5pqcVIbKxkyYa9MXCZ9qwgQ55CfxeA5Nnd1azqCEGc34lf1Vv251NQopi/b6k+6dIncOOj55wQuAll35DSByvJmt3Y0C2mmfafsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ONaUjwyttncTJFMFFQQWpbnFlFdnI6o3ClKeDqPg8fo=; b=AJh2VoA4jY60Q0vc5/n+hbg6FK9A18LlpfV37sbGiuBrcjdw/N82sax3KaZVKceV1PjHc2AE346Dg8jJjdFaP4RpTZI85xubyveusqrSGGHqSDpHaNbLHQVX3OsMLmJ4AypPeRtkW4lGWDVDHT0/bM8G+dwfshGyhxruUM+ZZSKFCPSzXMA3CUUZ87WRZOe5/dfkL0yCpgTsMPXu68736/N4XQFW3KC5nSpwKgFGxj4DznWmaZmKM5l7Y3TkiZs/DSsiDW9D/LlExRkZWmD9RvvZEahFc65SW3aBOkgaEFrdg2TpVxdxRa5A2nsuWub9nvkarRVMjCdz7RepvusY4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ONaUjwyttncTJFMFFQQWpbnFlFdnI6o3ClKeDqPg8fo=; b=gvC3+ppYxjUFo0n2+hngxryVR2lPlq28yS3OyzoBLSxTUyyrVSFEl0NRpsIBe90GJH1G68ZB+8IEn8zP6I2RaWrddJ4xjfJ3SYLXXLqk5Xn2sT6CeD05pUXelUGIp/xm93hNrtZk92KOo7fahS6tKCaEoqdjcUuL8yJgFqxq6Ec= Received: from CY4PR03CA0010.namprd03.prod.outlook.com (2603:10b6:903:33::20) by SN6PR02MB5648.namprd02.prod.outlook.com (2603:10b6:805:e8::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.27; Sun, 28 Feb 2021 19:29:33 +0000 Received: from CY1NAM02FT032.eop-nam02.prod.protection.outlook.com (2603:10b6:903:33:cafe::fe) by CY4PR03CA0010.outlook.office365.com (2603:10b6:903:33::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT032.mail.protection.outlook.com (10.152.75.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:33 +0000 Received: from xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:18 -0800 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:18 -0800 Received: from [10.140.6.35] (port=57766 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRkk-0008Aw-3O; Sun, 28 Feb 2021 11:29:18 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id C044813C0AD2; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 16/21] sd: emmc: Support boot area in emmc image Date: Mon, 1 Mar 2021 01:03:22 +0530 Message-ID: <1614540807-30686-17-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c1869b37-a5e3-44b6-6e27-08d8dc1f2d53 X-MS-TrafficTypeDiagnostic: SN6PR02MB5648: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:972; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ggaQy71QIKWUKtH3uKeL0cBHcY5HQVs5QxWW+SJ5u2G8OdXh/CUWaWehVO8BzT/WPuPJ4uhrkwYxpp9cOdPFCVusLEHVPJGlHnzroohyfRVc7+G+OWZB6J14vIc+ziNWIMVg2rbmifig3NdZy4/3/2YRat7hKzEOmDiI/YDWw9aO9k3tnSAIh3iM9evNBF7fCiX/Bd14DZMjzFaEYs8IGUDckEJHuBcuO/bs7l9+MSOmMXxVShoqhhQae7mcoZ5WAhzarb9cT50hshgQFkxBlps+lo9GjcZ49zpFs83GyPR02Vgdh/X3/0YUBqi15zaFHLwrlKMwjaKkuQG/aNme/qoMooDb3wvhRZh4WFoifcnUiy8bKrfryA70qv6vAaYzwRzP20wFiLq4rcKFkmGYy9HBErtLUxqfHT9DtjPtkw9JMAP9dvvyRyf9379S5EDl9uFl4iixkshWOhoCVIMsCDOuXg9uhWNYtxi4EIEsfdhL0MWglJ4JsBGjYEaXp5cE/F1kJ3+eK7tXLdfg6AZKqV2rYqXfKILuixD+v4OhEdM3s7S1yUoFb5YVoRsSqi/8Um2FcwGcOUai2jvWdekBT1ORVta7pfiXhEYfLcU4QUk3oSojVoCSKP2pJ7R6hkmkbLPYOusO0VxdxadwoB3Ugb0NDYYLxxJjOWbJu4AL4anBSNipTPkAoNainoQSfYkPyQt8oj8dPH6d+Xsynd1eLw== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(376002)(39850400004)(396003)(136003)(346002)(46966006)(36840700001)(36756003)(186003)(336012)(107886003)(4326008)(426003)(66574015)(2616005)(5660300002)(82740400003)(26005)(47076005)(36860700001)(356005)(7636003)(70586007)(70206006)(921005)(478600001)(6266002)(8936002)(8676002)(54906003)(83380400001)(82310400003)(6666004)(36906005)(110136005)(7416002)(2906002)(42186006)(316002)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:33.4834 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c1869b37-a5e3-44b6-6e27-08d8dc1f2d53 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT032.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB5648 Received-SPF: pass client-ip=40.107.92.55; envelope-from=saipava@xilinx.com; helo=NAM10-BN7-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Joel Stanley This assumes a specially constructued image: dd if=/dev/zero of=mmc-bootarea.img count=2 bs=1M dd if=u-boot-spl.bin of=mmc-bootarea.img conv=notrunc dd if=u-boot.bin of=mmc-bootarea.img conv=notrunc count=64 bs=1K cat mmc-bootarea.img obmc-phosphor-image.wic > mmc.img truncate --size 16GB mmc.img truncate --size 128MB mmc-bootarea.img Signed-off-by: Joel Stanley [clg: - changes on the definition names ] Signed-off-by: Cédric Le Goater [spb: use data_start property to access right emmc partition, Clean up PARTITION_ENABLE support as incomplete, Fix commit message to be generic.] Signed-off-by: Sai Pavan Boddu --- hw/sd/sd.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 08b77ad..d311477 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1044,6 +1044,34 @@ static void sd_lock_command(SDState *sd) sd->card_status &= ~CARD_IS_LOCKED; } +/* + * This requires a disk image that has two boot partitions inserted at the + * beginning of it. The size of the boot partitions are configured in the + * ext_csd structure, which is hardcoded in qemu. They are currently set to + * 1MB each. + */ +static uint32_t sd_bootpart_offset(SDState *sd) +{ + unsigned int access = sd->ext_csd[EXT_CSD_PART_CONFIG] & + EXT_CSD_PART_CONFIG_ACC_MASK; + unsigned int boot_capacity = sd->ext_csd[EXT_CSD_BOOT_MULT] << 17; + + if (!sd->emmc) { + return 0; + } + + switch (access) { + case EXT_CSD_PART_CONFIG_ACC_DEFAULT: + return boot_capacity * 2; + case EXT_CSD_PART_CONFIG_ACC_BOOT0: + return 0; + case EXT_CSD_PART_CONFIG_ACC_BOOT0 + 1: + return boot_capacity * 1; + default: + g_assert_not_reached(); + } +} + static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) { uint32_t rca = 0x0000; @@ -1359,6 +1387,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) return sd_r1; } + if (sd->emmc) { + addr += sd_bootpart_offset(sd); + } sd->state = sd_sendingdata_state; sd->data_start = addr; sd->data_offset = 0; @@ -1378,6 +1409,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) return sd_r1; } + if (sd->emmc) { + addr += sd_bootpart_offset(sd); + } sd->state = sd_sendingdata_state; sd->data_start = addr; sd->data_offset = 0; @@ -1434,6 +1468,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) return sd_r1; } + if (sd->emmc) { + addr += sd_bootpart_offset(sd); + } sd->state = sd_receivingdata_state; sd->data_start = addr; sd->data_offset = 0; @@ -1464,6 +1501,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) return sd_r1; } + if (sd->emmc) { + addr += sd_bootpart_offset(sd); + } sd->state = sd_receivingdata_state; sd->data_start = addr; sd->data_offset = 0; From patchwork Sun Feb 28 19:33:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108411 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A5F9C433DB for ; Sun, 28 Feb 2021 19:42:52 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E0AB460C41 for ; Sun, 28 Feb 2021 19:42:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E0AB460C41 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRxq-0000uR-TT for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:42:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRl7-00008V-8n; Sun, 28 Feb 2021 14:29:41 -0500 Received: from mail-mw2nam10on2057.outbound.protection.outlook.com ([40.107.94.57]:17569 helo=NAM10-MW2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRkx-0003B4-Qe; Sun, 28 Feb 2021 14:29:40 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b4fMDYDxBUYK7VcXO+dtwTSFMWFZsZpghITPloNga0SuPF/FJUBBIaT83GOQbOjwqnUGZ55DbJPxGZhzmqaLElmzvLey3Lk1pO9fun9wsjWr2AD/jX2M2PGtiePynf8tmo86AVedYirZauV7tH0w0LayilhjAm+57CVwxIGCRDlLFUmjHOGuoczSDt6hd6aayKdAsnLrV7u74emiW+9Pz/ihu+jmIGPnbjrXnC70DFC3m45hSrNCA7LD3oJQF84Hrv6C8AqGd7T5fnS0Ldl9n7XY7X070EvdBDgmNtIpUwApUt19/TI7nRxTQOe4F3fClu2Lm86PwNpY/g7syuwRPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ctjkaWEmSZXRuCrFXbTqFcjFBKnsZ7eBlJzNNPJKJL0=; b=awYUxJyzyGe9wJ/bvRW2/5QprfiWeaypQCkEwpybsuVVWausb+P2BnGi9mriPtIqAV41zF8WOqj7m2cepM+TYjXJHBmjptkL/FfiDu0YKgAq85JEvBW45ROjaz/1d06z6GSAEO4Tu5XPOsaTyZmV4n4/NeQVIoB/N/3oEwogQ7Wey4eNANPtgiyZEL0MfJvLJl72FcUuI+d0DWzhxspo5jLXw3U1Lw7yGBorv1TZN9Nq65PekyGqVf1RIh4n2+LyLZXGM5yerByQZ5UaReWTHpLbKx5Nb4P/JEe1pu3pzKmafL9VHN/cdqeZjGOnAVVDNzcWGavN4QaK8+Q+LQWFmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ctjkaWEmSZXRuCrFXbTqFcjFBKnsZ7eBlJzNNPJKJL0=; b=AVyISLPUU3rEJ/k1aWXI9R0mdz8qOEaIRiIJwJQ19WF6WZY4VCu4zKdC8uEt2FQGMbflcxJQwYs+Rl70NY6U3nFpLqO3tDtMpHEGHiJjCi283sLrI+ALbI3qo3UTjUfa9SDAPTvT7PrPf/OL4hubxim5+GzoWCiJJD/s6TORBrk= Received: from CY4PR13CA0086.namprd13.prod.outlook.com (2603:10b6:903:152::24) by MW4PR02MB7489.namprd02.prod.outlook.com (2603:10b6:303:75::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.20; Sun, 28 Feb 2021 19:29:27 +0000 Received: from CY1NAM02FT051.eop-nam02.prod.protection.outlook.com (2603:10b6:903:152:cafe::8b) by CY4PR13CA0086.outlook.office365.com (2603:10b6:903:152::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.9 via Frontend Transport; Sun, 28 Feb 2021 19:29:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT051.mail.protection.outlook.com (10.152.74.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:26 +0000 Received: from xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:18 -0800 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:18 -0800 Received: from [10.140.6.35] (port=57768 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRkk-0008Ax-3c; Sun, 28 Feb 2021 11:29:18 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id C547E13C0AC4; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 17/21] sd: emmc: Subtract bootarea size from blk Date: Mon, 1 Mar 2021 01:03:23 +0530 Message-ID: <1614540807-30686-18-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: de7b889c-cc01-4fd2-7c80-08d8dc1f2967 X-MS-TrafficTypeDiagnostic: MW4PR02MB7489: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c+k2MLA2DgW+Sqb4W6p9RNxT14Va5DrjOVAc7CR484hgZnslt5CQil5H0ccMUci1XsjtdvZ0SegmoBD+EodTWF5/84NOnvW2KuO6GxYDvNScOZwk1X/s2Ecp2q2enOopbVxlHQGy0i9RjzgdMUohNuXyV3gtJs9caKVSI0XSOomD0bexopHuvI/brKJUkiAJK8iEEFGTgAw+2p6rZmjDMG2fGPDJea5spysNesIwpyr0eonxJn/LyafIIYrahJWY09t0FtGwTn8bnxDVllOyR/XtszggrUdmZ00z6hlCbnrvi4IHCobrU6v35NGNtyTjJ+9IvQ2Cl9bPowdD9u11r0B+1z9S3D6D8gpWJiJI+MEibM4jtoOs/wwd0L3XZ9ip8wYiMd5YCzE60533h/GtMEwmgj5dlr2iVLuEXHeDcafUNWCQ83GW5UoAzlnYpsNHaZHV8xLhCx845sqPzSHDltB3vJfynK2B58Lzf45oeAMfWgFDyhpzk1Ys7dKkKj3HOWjJqOLPcUYvDgrHVdw2rmGNeAHnrVH+W53tRoj+WdUgqesl2dlRTozElpgg7KMyAwln4h/bc75CnVdOUQYhTKlRbbioVtVppp8d9VqEOg4RwI+6xGfEYJ8uQpDl1CexuBvYDIfs0HK/KhbPvg2emZMcoNticMDcMP39/CmtJUV1xtBvIU65/oM98/Y5et5/5SaeI1IkD61dLRl9ryz/dQ== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(376002)(39850400004)(346002)(136003)(396003)(36840700001)(46966006)(316002)(6266002)(82310400003)(26005)(70206006)(478600001)(70586007)(36860700001)(921005)(36906005)(83380400001)(426003)(107886003)(42186006)(8936002)(66574015)(47076005)(36756003)(4326008)(110136005)(356005)(7416002)(6666004)(186003)(4744005)(82740400003)(54906003)(8676002)(2616005)(2906002)(5660300002)(336012)(7636003)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:26.9050 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: de7b889c-cc01-4fd2-7c80-08d8dc1f2967 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT051.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR02MB7489 Received-SPF: pass client-ip=40.107.94.57; envelope-from=saipava@xilinx.com; helo=NAM10-MW2-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Joel Stanley The userdata size is derived from the file the user passes on the command line, but we must take into account the boot areas. Signed-off-by: Joel Stanley Signed-off-by: Cédric Le Goater --- hw/sd/sd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index d311477..5135a64 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -657,6 +657,11 @@ static void sd_reset(DeviceState *dev) } size = sect << 9; + if (sd->emmc) { + unsigned int boot_capacity = sd->ext_csd[EXT_CSD_BOOT_MULT] << 17; + size -= boot_capacity * 2; + } + sect = sd_addr_to_wpnum(size) + 1; sd->state = sd_idle_state; From patchwork Sun Feb 28 19:33:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108419 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C7AAC433DB for ; Sun, 28 Feb 2021 19:46:18 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3EF3A6146B for ; Sun, 28 Feb 2021 19:46:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3EF3A6146B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGS1B-0005lQ-Cx for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:46:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRlF-0000Pt-4N; Sun, 28 Feb 2021 14:29:49 -0500 Received: from mail-dm6nam11on2056.outbound.protection.outlook.com ([40.107.223.56]:62049 helo=NAM11-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRl4-0003Ek-5O; Sun, 28 Feb 2021 14:29:48 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E++7tcvhis8IsYYq8258WAOGeqMs8rkTIg+FaEZDUs1/M+1oYp6/YsnRB/6/gJ8R+0AETod0yjcnYxPjiXUNAebtA2FrQEpkDQbUL8UZ0AdQ4d/CPBAMIfO98s1qDQ4ekGzqY9bpFZp4P8/9rAaltiiW10VIp2Kjvo/N1qxeu7JPxZwdySz1jpwGUn/hieEyEZB+ZoWbuUMMfukuznX+8IpBrz6ymwc0cKSqDYM1eBH/G/ivAdS9hmJHTND3vDjAxo7DVjBEQICpLMfb08If2GRSDkY1lb6JN+X4gcvCrVKIQGiTto/4gMVOVyyHQnZQQQ9Q5532CFUOuFJYZdiewA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YwNf6MLkBbcRRneJqO0oqOP0h3ttUCTSUQYQ7jo9xQ0=; b=cSBalAvfzCWkuUqx1I52eomO0LXh8U9lEgXEQunIRvQoz2vfzPvLggXUok1cakLe/N5f77FkI1+kkG/eI07RssW0cNW595mxz1jo01tqdvs7ZeL0+kCgDCXXIcdXbPM6xEBxIZ1yUyGWDUErLP9X9q6UboQBsWty+flYfxsupVFQR0iRq9oAllAI0NWKO0Hs8ZSudFh3ambotZrPq5fmyQEUjA5hQz8cC5uG4dfXCGoozqvSA91knVl0HZe3jdIksjrkJJE5v1nAnxZIQfAgN6o0hi851erb08tveDlCmsL55vqeeE/418N/pxNZsdAp9mH7tv2SubcSmw6QX0+MdA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YwNf6MLkBbcRRneJqO0oqOP0h3ttUCTSUQYQ7jo9xQ0=; b=VsiI51nNJFGqrUwatfUPCjIYIDo9IOJsA1u+1DWLIFBlDx2wCk9BhjCkUH6pOIp0znZGoy6n1pg92AYXnMrct9S26fSMEF2+H9HYT10hwsQ3ZohsqHdvX3Yzk671djHXdPeGwV1xw/Anlxeexo4G9rwGgnCTJKn709BQg/ODjP4= Received: from CY4PR03CA0011.namprd03.prod.outlook.com (2603:10b6:903:33::21) by BY5PR02MB6834.namprd02.prod.outlook.com (2603:10b6:a03:211::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.20; Sun, 28 Feb 2021 19:29:34 +0000 Received: from CY1NAM02FT032.eop-nam02.prod.protection.outlook.com (2603:10b6:903:33:cafe::42) by CY4PR03CA0011.outlook.office365.com (2603:10b6:903:33::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT032.mail.protection.outlook.com (10.152.75.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:33 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:18 -0800 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:18 -0800 Received: from [10.140.6.35] (port=57784 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRkk-0008BB-HM; Sun, 28 Feb 2021 11:29:18 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id CEF1D13C0ADF; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 18/21] sd: sdhci: Support eMMC devices Date: Mon, 1 Mar 2021 01:03:24 +0530 Message-ID: <1614540807-30686-19-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0da70025-9101-47eb-9172-08d8dc1f2d9b X-MS-TrafficTypeDiagnostic: BY5PR02MB6834: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:167; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x95U8UgR56QtkHRACwkRqnImmHy83/XnP1CGF7SPfx8cFl/tf/CGJbRfQvUq0zNiqqDXWhxW9yPpn12G/ZLB692p05JwoaRmIppmV3jgjNXSkv9R7XOR6CtXc9Gsx5oSC2nfoT10iJXF+APAZoealdtcbIHKVo/SKwa7H6LjxY5oaeXLZMRiEUKLYKDzma7pOmi5QFgxqUciuRUucMgLv4sSJe7HJOYtI7+O2jMb9+P5n7jquc42cSutTqZo+Wn9JEz8bKXC3G8ZUNpZdaoHnqJikuSg7eWj5IMjN4sl2PVUvNsNZMQo9C8RsUm10dpRHRLmCxT0zmdFOBQJwuPTAD4tXdH8ttEMkaRW8T9PVSqMOgBxkHhoYJ5gCLWTMqiznOYdFC442UKTieWCy27jD4tACobE0E9Lp8pZvHb6idaU2V5ljWmZJsFJFOlVd3HlK3VFainacLZQiroEZYPPzVcwVdSiW7dZNKZT8s4VwjGWYQZcg1A656G143HrDONNMC6jQNtTg3SPpRr6AdmDokpprkYeTvIpkVW6Y0qYODhy1FP9kJUvuBDQrkdMpygxD7bQBVZXtmYbyJEQpVXJuVNhP97OaYb6pNiGItaAni5JrPDS3lgxshiZTCDUsBZ9AR+EOxjgRgSlkFEqUTgY6hDuFBYiSjo+9dIFQ0anpVrtAMXAKx0i8TjfYB7IzLxql2dNQg4M6kN6q3lQBau++g== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(396003)(39850400004)(376002)(136003)(346002)(46966006)(36840700001)(186003)(82740400003)(4744005)(316002)(36906005)(921005)(82310400003)(8676002)(478600001)(356005)(2616005)(7636003)(426003)(83380400001)(6266002)(6666004)(107886003)(7416002)(8936002)(54906003)(42186006)(110136005)(26005)(2906002)(70586007)(36756003)(5660300002)(36860700001)(70206006)(4326008)(47076005)(336012)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:33.9552 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0da70025-9101-47eb-9172-08d8dc1f2d9b X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT032.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR02MB6834 Received-SPF: pass client-ip=40.107.223.56; envelope-from=saipava@xilinx.com; helo=NAM11-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Embedded device slots should be allowed as support of eMMC is available. Signed-off-by: Sai Pavan Boddu --- hw/sd/sdhci.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 8ffa539..771212a 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -99,10 +99,6 @@ static void sdhci_check_capareg(SDHCIState *s, Error **errp) msk = FIELD_DP64(msk, SDHC_CAPAB, ASYNC_INT, 0); val = FIELD_EX64(s->capareg, SDHC_CAPAB, SLOT_TYPE); - if (val) { - error_setg(errp, "slot-type not supported"); - return; - } trace_sdhci_capareg("slot type", val); msk = FIELD_DP64(msk, SDHC_CAPAB, SLOT_TYPE, 0); From patchwork Sun Feb 28 19:33:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108407 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7184FC433E0 for ; Sun, 28 Feb 2021 19:40:44 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 02C8860230 for ; Sun, 28 Feb 2021 19:40:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02C8860230 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRvm-0006co-1B for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:40:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRlD-0000Lr-OG; Sun, 28 Feb 2021 14:29:47 -0500 Received: from mail-dm6nam12on2050.outbound.protection.outlook.com ([40.107.243.50]:5633 helo=NAM12-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRl5-0003FQ-0E; Sun, 28 Feb 2021 14:29:47 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M2CO8O5XBW3gw/UsbjB0V8Pi4hyatuwXew2xk3cPxPf8YrMdzcN+0AX/ZzvQhY21dSh1ADWvdb+AIjkedrQJb6Ce296yhVRBZ3s1iU4Sse7wquMhrgZMNb7JS4I9Wrujm8/9Lmnq12YMcEtwspnmcm6JwYBmnbrYUR4EqNRMqoC/IxJ0ErsYzHstEnhvC/8CI53ocENosIrYhpespy4JdMLntiiakqe7OF9hknAeu292UfbJc+iPFGLl5+L1F0bq8s7E31seu4+5mEfkaXWU8mSVhu3WuPdirfxWXiwiBCmpqjPikHFTzgU00OqtiuGNmYFA360XdGi96R7yZoUQdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=26Ynk5b8zIUW8+RGoW5k1ZHeHD1bLhu9coPmF+7Jjcc=; b=YKZwE35RHC8Nb00oo5kV6RNpmwWl0jUfddJoG4bSUpz6oAXXhMA5riJHKsKcNa3EINcZ7gpLkJu+CAjo1aOu6WjpoNPVleZfY2EyBBE2MbZB7zvPf6CSrik523/C2VcG6fbNPr464VnggQIhr/0vCuN1sDw4v7ZuhCITlwtRv2rA9kPI04LHraLRpO4YKCUYo3omVGb8D8kcYeMWp5qolN0DjLGkHibmXe0mv25kIhQhTQ40N5eRwCkE1WjfNXTw4QkvgyYjS3v/EzNfrN/gxzibh/wQJ6/16joo56CEjCsz/TwxptkiPbRj382OlWZ2iAjaafGrmk2u2zzSg3MSxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=26Ynk5b8zIUW8+RGoW5k1ZHeHD1bLhu9coPmF+7Jjcc=; b=QuuZa51nkuDZqegRx+72udkjaY1CmKD0mXmRZg56kCqvjyIr73fZ6XmYE5oGqyn7ukI8GpxhMJoETwabSn5Hx8b0wRQ/R+jUFf8rQ02a+3RYNokVaGE/MNHNw5pBst/LQC2N+wrx+Wkm0MMDBuGhL9f0t7gkyjrnap7FuNKSeBI= Received: from DM6PR08CA0056.namprd08.prod.outlook.com (2603:10b6:5:1e0::30) by MW4PR02MB7233.namprd02.prod.outlook.com (2603:10b6:303:65::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.23; Sun, 28 Feb 2021 19:29:35 +0000 Received: from CY1NAM02FT003.eop-nam02.prod.protection.outlook.com (2603:10b6:5:1e0:cafe::ba) by DM6PR08CA0056.outlook.office365.com (2603:10b6:5:1e0::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT003.mail.protection.outlook.com (10.152.74.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:34 +0000 Received: from xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:19 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:19 -0800 Received: from [10.140.6.35] (port=57786 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRkk-0003Md-HY; Sun, 28 Feb 2021 11:29:18 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id D66D413C0AFA; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 19/21] arm: xlnx-versal: Add emmc to versal Date: Mon, 1 Mar 2021 01:03:25 +0530 Message-ID: <1614540807-30686-20-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bb7df4f3-9986-4878-2031-08d8dc1f2e1d X-MS-TrafficTypeDiagnostic: MW4PR02MB7233: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:335; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uH0TRR+ral6tkf0eqFpCdia5BuVs4rY0qrmOXORqxgp9KJAW/qVzwsJSCHf2k/c/ow9tAuf6DVHnbpnNOphfvHv25/58zLALK8aYte3/+XkWEJ8JYxbm5vLN5T81zme16cCjcqT/dgyWj+XWorfsWWV+lhrFukHvMDWBwi02bckyz7dBSOGRtl4i3lpzQnx30hcJKv6mj8efzx7eLzi4El/hW4RqKepQMmh7rDlP1gARk52ftsmrYOZB6bo7msIZ7mtWTGs/V98r63el9ZffIXMWqYkEDW4mRsPn6hL0J9EzqPiks2qZOzyFTsWRCcFpeVB685kj8HbpP9jw7fvOlmwqTdkJnJPOml4++UpCGhWcr1Z4Xjf94N73PB4/+o28z0ECParx6q20pOG8x+bi47NPK0GwURg0F0FUOijV3OQmSV3YFRpVo9ECXGzCOGBxUUqBcTwg6bEfQhZQpQelRg+fmwruP1tM26/z6p8yN6UkPwuZUL+kRZvUIldprf10Kw3ZdJVlGvTXU4ie+PEVWOrqLuicJ77f0HAgtDlWCPF6PXyF3KL53GstvJ/EvWzPzU9NYszWraBhnLqf7ZvYaa5BalLFDaqMUEJuOi7tisLl9D29j1R1WJw6FClfVfinUsvhafVmiWD3uXpaP8AgbkST4fTInsrvqBr6RQ54v1wzKx/Ey5y/a4Rfb/wnM7nHKXAv8xLAWyqwD3qTd7Udrw== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(346002)(136003)(396003)(39850400004)(376002)(46966006)(36840700001)(186003)(5660300002)(36756003)(8676002)(8936002)(2906002)(36860700001)(26005)(107886003)(6666004)(82310400003)(6266002)(4326008)(83380400001)(47076005)(54906003)(426003)(110136005)(36906005)(42186006)(316002)(478600001)(82740400003)(7636003)(921005)(70206006)(356005)(2616005)(336012)(70586007)(7416002)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:34.8053 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bb7df4f3-9986-4878-2031-08d8dc1f2e1d X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT003.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR02MB7233 Received-SPF: pass client-ip=40.107.243.50; envelope-from=saipava@xilinx.com; helo=NAM12-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Configuring SDHCI-0 to act as eMMC controller. Signed-off-by: Sai Pavan Boddu --- include/hw/arm/xlnx-versal.h | 1 + hw/arm/xlnx-versal-virt.c | 29 +++++++++++++++++++++++++---- hw/arm/xlnx-versal.c | 14 ++++++++++++-- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h index 2b76885..440f3b4 100644 --- a/include/hw/arm/xlnx-versal.h +++ b/include/hw/arm/xlnx-versal.h @@ -76,6 +76,7 @@ struct Versal { struct { MemoryRegion *mr_ddr; uint32_t psci_conduit; + bool has_emmc; } cfg; }; diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c index 8482cd6..053a322 100644 --- a/hw/arm/xlnx-versal-virt.c +++ b/hw/arm/xlnx-versal-virt.c @@ -46,6 +46,7 @@ struct VersalVirt { struct { bool secure; + bool has_emmc; } cfg; }; @@ -333,6 +334,13 @@ static void fdt_add_sd_nodes(VersalVirt *s) qemu_fdt_setprop_sized_cells(s->fdt, name, "reg", 2, addr, 2, MM_PMC_SD0_SIZE); qemu_fdt_setprop(s->fdt, name, "compatible", compat, sizeof(compat)); + /* + * eMMC specific properties + */ + if (s->cfg.has_emmc && i == 0) { + qemu_fdt_setprop(s->fdt, name, "non-removable", NULL, 0); + qemu_fdt_setprop_sized_cells(s->fdt, name, "bus-width", 1, 8); + } g_free(name); } } @@ -524,11 +532,17 @@ static void sd_plugin_card(SDHCIState *sd, DriveInfo *di) &error_fatal); } +static void versal_virt_set_emmc(Object *obj, bool value, Error **errp) +{ + VersalVirt *s = XLNX_VERSAL_VIRT_MACHINE(obj); + + s->cfg.has_emmc = value; +} + static void versal_virt_init(MachineState *machine) { VersalVirt *s = XLNX_VERSAL_VIRT_MACHINE(machine); int psci_conduit = QEMU_PSCI_CONDUIT_DISABLED; - int i; /* * If the user provides an Operating System to be loaded, we expect them @@ -560,6 +574,8 @@ static void versal_virt_init(MachineState *machine) &error_abort); object_property_set_int(OBJECT(&s->soc), "psci-conduit", psci_conduit, &error_abort); + object_property_set_bool(OBJECT(&s->soc), "has-emmc", s->cfg.has_emmc, + &error_abort); sysbus_realize(SYS_BUS_DEVICE(&s->soc), &error_fatal); fdt_create(s); @@ -581,10 +597,12 @@ static void versal_virt_init(MachineState *machine) memory_region_add_subregion_overlap(get_system_memory(), 0, &s->soc.fpd.apu.mr, 0); - /* Plugin SD cards. */ - for (i = 0; i < ARRAY_SIZE(s->soc.pmc.iou.sd); i++) { - sd_plugin_card(&s->soc.pmc.iou.sd[i], drive_get_next(IF_SD)); + if (!s->cfg.has_emmc) { + sd_plugin_card(&s->soc.pmc.iou.sd[0], + drive_get_next(IF_SD)); } + /* Plugin SD cards. */ + sd_plugin_card(&s->soc.pmc.iou.sd[1], drive_get_next(IF_SD)); s->binfo.ram_size = machine->ram_size; s->binfo.loader_start = 0x0; @@ -621,6 +639,9 @@ static void versal_virt_machine_class_init(ObjectClass *oc, void *data) mc->default_cpus = XLNX_VERSAL_NR_ACPUS; mc->no_cdrom = true; mc->default_ram_id = "ddr"; + object_class_property_add_bool(oc, "emmc", + NULL, versal_virt_set_emmc); + } static const TypeInfo versal_virt_machine_init_typeinfo = { diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c index 628e77e..6ca2c8f 100644 --- a/hw/arm/xlnx-versal.c +++ b/hw/arm/xlnx-versal.c @@ -230,6 +230,9 @@ static void versal_create_admas(Versal *s, qemu_irq *pic) } #define SDHCI_CAPABILITIES 0x280737ec6481 /* Same as on ZynqMP. */ +#define SDHCI_EMMC_CAPS ((SDHCI_CAPABILITIES & ~(3 << 30)) | \ + (1 << 30)) + static void versal_create_sds(Versal *s, qemu_irq *pic) { int i; @@ -242,11 +245,17 @@ static void versal_create_sds(Versal *s, qemu_irq *pic) TYPE_SYSBUS_SDHCI); dev = DEVICE(&s->pmc.iou.sd[i]); + dev->id = g_strdup_printf("sdhci%d", i); object_property_set_uint(OBJECT(dev), "sd-spec-version", 3, &error_fatal); - object_property_set_uint(OBJECT(dev), "capareg", SDHCI_CAPABILITIES, + object_property_set_uint(OBJECT(dev), "capareg", SDHCI_EMMC_CAPS, &error_fatal); - object_property_set_uint(OBJECT(dev), "uhs", UHS_I, &error_fatal); + /* + * UHS is not applicable for eMMC + */ + if (!s->cfg.has_emmc || i == 1) { + object_property_set_uint(OBJECT(dev), "uhs", UHS_I, &error_fatal); + } sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal); mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0); @@ -386,6 +395,7 @@ static Property versal_properties[] = { DEFINE_PROP_LINK("ddr", Versal, cfg.mr_ddr, TYPE_MEMORY_REGION, MemoryRegion *), DEFINE_PROP_UINT32("psci-conduit", Versal, cfg.psci_conduit, 0), + DEFINE_PROP_BOOL("has-emmc", Versal, cfg.has_emmc, false), DEFINE_PROP_END_OF_LIST() }; From patchwork Sun Feb 28 19:33:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108397 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACD86C433E0 for ; Sun, 28 Feb 2021 19:38:09 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3ACD264E83 for ; Sun, 28 Feb 2021 19:38:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3ACD264E83 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRtI-0002UG-8R for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:38:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRl5-00007M-OT; Sun, 28 Feb 2021 14:29:39 -0500 Received: from mail-bn7nam10on2056.outbound.protection.outlook.com ([40.107.92.56]:13057 helo=NAM10-BN7-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRkx-0003Aj-Dj; Sun, 28 Feb 2021 14:29:39 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bvVGIF3HgnSJRjcaE0OWtRZ/eaken0x4rJ1EEXLGTeLvQuR7vAEpYYMoZptkWzDKHp1Dq+HBTdShIh/6psqXIQPD/V+V8gfIaQzZMxccArJYrXq1HXjEgA7wKx3RPJINH99X16twsQCOAcpWr5QaE9YDFL+G6Jq6Ed9Rh2+5YMtWx/YxL5xw4Qvv4HzxS/QxA1j84xeuwdlNbPEaLj8+naXDBmxg/Z/FB5Q/fwvNI9/sydoepvkyiKscVF0Sbi+YJyk1A86b12oZud6V+Cu2FPFSPGRthqs/bg0NjIoQ+XW/Mjs+YqrSilzizq9PhIJAyYrsQYPBdcxK6A7Jey7bAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hZCRtAFYeCGAH6jbrO1832cRDu6eTw00apG72bJmoLc=; b=aHYBpewnMUkSOmG4gjJchibkeJbjcsvAUsuuXJ92YkyqHLf9WLORtXB2iJSwHZ82FkzxVMkxRRziuIn2n3tu6Ss5fS+CEKKeLiY9AzaD9iXyYBh6G1AT9L7t861Fyz2+t0T7KpK38l3FlLkDePXppa/soBX/QrI0OQqShRi8AxMXSqy8P9wBJJkd/kXx/dg53vEY0G9sjJeOA3d02maIluSXtDFqxFoTGN8cI435G+RfLm8k1EtZDC8ts3hZSkDPlS72KhD5mgp+N83KeN6Fa4boIP2Firo6TjYGWSoFOI1YmhuqeMyChZ+WM1Tf9YKHDZC23vLh70cCzfG+rLjfCQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hZCRtAFYeCGAH6jbrO1832cRDu6eTw00apG72bJmoLc=; b=E2bDRNSxy/VwCL2Wnz6Tk4Pd3/8/2a8UpxMEBOKVQ8lp2M4Io47uQ+XueEPPbP05afLYqALFwLhmlCmKyLFHV8TrHLqKAEXUpSfZjIBUpvxdNM+0OR44QIdRbe1yXUNtXJNDTjqNGMqzZOfqX8+pIo8VqaHuOjbxZByH7aWNmno= Received: from CY4PR13CA0086.namprd13.prod.outlook.com (2603:10b6:903:152::24) by SN6PR02MB4653.namprd02.prod.outlook.com (2603:10b6:805:af::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.20; Sun, 28 Feb 2021 19:29:26 +0000 Received: from CY1NAM02FT051.eop-nam02.prod.protection.outlook.com (2603:10b6:903:152:cafe::8b) by CY4PR13CA0086.outlook.office365.com (2603:10b6:903:152::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.9 via Frontend Transport; Sun, 28 Feb 2021 19:29:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT051.mail.protection.outlook.com (10.152.74.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:26 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:18 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:18 -0800 Received: from [10.140.6.35] (port=57788 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRkk-0003Me-Hf; Sun, 28 Feb 2021 11:29:18 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id DDEDE13C0AFC; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 20/21] docs: devel: emmc: Add a doc for emmc card emulation Date: Mon, 1 Mar 2021 01:03:26 +0530 Message-ID: <1614540807-30686-21-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 26708fec-7fc9-4a4a-b38c-08d8dc1f2922 X-MS-TrafficTypeDiagnostic: SN6PR02MB4653: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w77q/U1B8H4U/zdcJmMcSwGd23/Iwcbnqce1Tek/O6hnBXdqG1U5JXgZBBHYeaRu+W046bxeuxWgobGeajj9gdat/0EV4B3XtiFO3dycxqNDZSFdO+f3+KdgR7gV6MWEicMAO5d8ezObn+ea1j1rUdli7rzuNfxk5HKweo8LYVEbfFtJ15K05bD4l7ETS97l1SncE6Jf8LU61xmncwwSHDZNvwuJNNrQxkRtS2KL1hOpdC1juz1vGMV58CPrS0jdoRJJRuFzccEsF4c6D5Q9TDw3LBEekK+vFX4B6A7UdYLdJh0Cd4CIeo0E4GpQxDVy3hyEu8Pa+pR4MurzTnS5HTz8v5rrhYDhI5uWmhyGR4DtNMshxEsJMEy9HczJACa16sN81SPKdW9xdxvPKS1HKSdg0lsGyu1VYVzle8evcP3F85UqLv+6nHLDtz6CcxQ54hubamVrRqWyFatrNTqiJCJ+6RlkBC1/6lPC+6DFJf4KY2BIA51Kj7X2/7Q3855EUbYH0mVcvPMAj1nZjguzDWNtsg5f1rSYMDXniOBVxHLt1LQTvnTXjrTqAAd2SxrwHgPTD3Ryvf5x5pIexDRt+1oqavTwAtMcrphmmIYptt8gbzr/+0CPYopZ9TEXpZ5OanZMzLPueDmbC0e7uJO5pip877ZUuvOx/xD68DWhX8VUo5znsQAh1glxOuo/NtkQs1LTNDtyS5n0B2DlDyK/dw== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(136003)(39850400004)(396003)(346002)(376002)(36840700001)(46966006)(82310400003)(4744005)(70586007)(47076005)(2616005)(36756003)(5660300002)(186003)(426003)(4326008)(70206006)(26005)(921005)(2906002)(8936002)(8676002)(478600001)(7636003)(356005)(42186006)(6266002)(36860700001)(54906003)(336012)(316002)(110136005)(7416002)(6666004)(36906005)(83380400001)(107886003)(82740400003)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:26.4532 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 26708fec-7fc9-4a4a-b38c-08d8dc1f2922 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT051.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB4653 Received-SPF: pass client-ip=40.107.92.56; envelope-from=saipava@xilinx.com; helo=NAM10-BN7-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add few simple steps to create emmc card with boot and user data partitions. Signed-off-by: Sai Pavan Boddu --- docs/devel/emmc.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 docs/devel/emmc.txt diff --git a/docs/devel/emmc.txt b/docs/devel/emmc.txt new file mode 100644 index 0000000..2d098fe --- /dev/null +++ b/docs/devel/emmc.txt @@ -0,0 +1,16 @@ +==================== +eMMC block emulation +==================== + +Any eMMC devices has 3 kinds of partitions Boot, RPMB and User data. We +are supporting Boot and User data partitions. Boot area partitions are +expected to be 1MB size as hard coded in EXT_CSD register. + +Below is the example of combining two 1MB bootarea partition and +user data partitions. + + cat mmc-bootarea0.bin mmc-bootarea1.bin image.wic > mmc.img + qemu-img resize mmc.img 4G + +Note: mmc-bootarea0/1 are just raw paritions. User data can have +partition tables. From patchwork Sun Feb 28 19:33:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 12108405 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT, WEIRD_QUOTING autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD95FC433DB for ; Sun, 28 Feb 2021 19:40:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8A8AD601FF for ; Sun, 28 Feb 2021 19:40:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8A8AD601FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGRvY-0006HD-In for qemu-devel@archiver.kernel.org; Sun, 28 Feb 2021 14:40:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRl7-00008j-Gm; Sun, 28 Feb 2021 14:29:41 -0500 Received: from mail-eopbgr770072.outbound.protection.outlook.com ([40.107.77.72]:57574 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGRkx-0003Am-U5; Sun, 28 Feb 2021 14:29:41 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kV5FgiqYL9jVyIgela7BzVJpxfcnDuWeWTqiQMLMZaOS8IBPcd/+XGyKFpNeXD4ByX+3iM/8qmPMnGcnUnONcEB9dRDod3WfzBCZKSMt52/L/clOUaqoswYXMMRY1+heDYu7T1GBfaCKX/zRz7tcxCkbT//KEdsEMS3YTBwFvl4hKdAwM89eqcWdFGslmdz0AFDuaH3CXZIGwNspK5JzLzbEepMJPyg/98TONmPD+HYtcdt2tbKdRm+Tt7j7yFx90V4I+EWujgpC9n6eOH6Kl+4xBdLIP4FfuAHTTDHJQurvTrg07qiqcjQwI6i/H/YsSsZAfI5IL83zW0jiuZa01g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=k/kLlHt3sNvFRKoBrjTykrarDocZp5C7m6n7LZo4pfU=; b=oXo6lCp8pkoKj368zOr5hdWtZIDUzzk3ozIP6QI8tHkUrJLjfVlZKftqS5BfZKrrW+yJta0O0NFqy0aZluNkoHZ+nENBUnHtDL+s9x6XoWezrNdBsEIKiRdcpLyJtzHmuL6p8M+JaupcTrPuqwnf9tCcyf6gGoUsC6tkJXTaCoCraXR8dkgGgb7tmOQXmkD2bvTp2IM9ZnNhPbxhIlMqGAqqKivXDWgYwVClOkpKanhZ/Xu7ULPWAzWgxhdMEiy3J7q5JU4gNP8w/tjpLEPjFdsnuJxAj/AsZD1xz/dnWM78/V5Biiv9NStO+wl1U//4ieisTsF+stdjo8YJnbV6Nw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=k/kLlHt3sNvFRKoBrjTykrarDocZp5C7m6n7LZo4pfU=; b=YF4u9cIBCWR0s94uJkCHp5SmyAiyDm2ivIUTpmtd2ZSldaCnp6zsssZGBhzFPs0CqVrBxJB+im+qeu+lqg8CUOeY15S+1gJ2zF7xygmf4r66YqwoBXNvrnYpo1Vz0RSpo3JqUZIpyAmOYXM0jXzgZZSoPLjb6dui/T/4XIqhCmg= Received: from CY4PR13CA0077.namprd13.prod.outlook.com (2603:10b6:903:152::15) by MN2PR02MB6336.namprd02.prod.outlook.com (2603:10b6:208:1b8::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.23; Sun, 28 Feb 2021 19:29:26 +0000 Received: from CY1NAM02FT051.eop-nam02.prod.protection.outlook.com (2603:10b6:903:152:cafe::6c) by CY4PR13CA0077.outlook.office365.com (2603:10b6:903:152::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.9 via Frontend Transport; Sun, 28 Feb 2021 19:29:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT051.mail.protection.outlook.com (10.152.74.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Sun, 28 Feb 2021 19:29:25 +0000 Received: from xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 28 Feb 2021 11:29:18 -0800 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Sun, 28 Feb 2021 11:29:18 -0800 Received: from [10.140.6.35] (port=57774 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lGRkk-0008Ay-4b; Sun, 28 Feb 2021 11:29:18 -0800 Received: by xhdsaipava40.xilinx.com (Postfix, from userid 14131) id E573D13C0B03; Mon, 1 Mar 2021 01:04:01 +0530 (IST) From: Sai Pavan Boddu To: Markus Armbruster , Kevin Wolf , "Max Reitz" , Vladimir Sementsov-Ogievskiy , Eric Blake , Joel Stanley , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Vincent Palatin , "Dr. David Alan Gilbert" , Thomas Huth , Stefan Hajnoczi , Peter Maydell , "Alistair Francis" , "Edgar E. Iglesias" , Luc Michel , "Paolo Bonzini" Subject: [PATCH v3 21/21] docs: arm: xlnx-versal-virt: Add eMMC support documentation Date: Mon, 1 Mar 2021 01:03:27 +0530 Message-ID: <1614540807-30686-22-git-send-email-sai.pavan.boddu@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> References: <1614540807-30686-1-git-send-email-sai.pavan.boddu@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3e424894-085d-41ec-f7e5-08d8dc1f28d7 X-MS-TrafficTypeDiagnostic: MN2PR02MB6336: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 22k6jLLmEdpaKGXA+E1zokMacJHOkyCa+pWB6WWCdUHxwZar7ixqalPZQfodoD2hM6kHKHIjkiGE2PZI/utmCPftRRYyoWBQ5Z81eM+L4UMtikTD+HNb/lo6IA2iWAR7iuWazmqEpwqVfg/HzHhoIMndQD66B5pPnVKI0Pm5abbFT7M6OGHirAsgqG02OZNZlmDxtxKoWYdOn15cK0vX9Fuw7Wdq8bW1pNdbV4fTXjaFBNIAJGQnMLpz33YyHHEicCDE6j/6oMIyQ9axbGXZAP1Q9MYM3XGpHSCC4gqNXp1EyoFsgswJtxKsaUY1nU0zmJxIGzHV0qqg4sUWOuXQeayhU87T/QlHtZgW3UwkE74Ucdcr3fYwPqQgn0MNHBIGENigGQKz3GHUAONG2mIksR7VQCeEuacfZkoaX+cqnlrvv/9Fyi1k0P09tOZhSNk4kuoOHMSpdZy6QEc3H3UprE3JEubXVEoEohLi1tHa3V104uroZsuGGcVxHt/vLpu+F1v706NbmSyINLBrZhnI4JgvlmgE33NY/+SPpWRzQnGbdmEkpzbKSiGhQEmw2jan+49YJy4/gJ/6VwGKOSp9BETfrPlhB/kHXJzZxhtkiO+x/G9wa41etQlvhznhMeF24wpHa0LHc9PFRLL8ZbTr09vV+hhRVV/mLjG71bRKDPge1BKpcCWyMtjRyf0a2zbXFry9oTBAETtoFTquwPmHAQ== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(346002)(376002)(136003)(39850400004)(396003)(36840700001)(46966006)(7636003)(921005)(36906005)(8676002)(316002)(4326008)(2616005)(7416002)(36860700001)(5660300002)(6666004)(36756003)(478600001)(8936002)(110136005)(42186006)(82310400003)(107886003)(83380400001)(82740400003)(70586007)(426003)(26005)(356005)(47076005)(70206006)(54906003)(2906002)(336012)(186003)(6266002)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2021 19:29:25.9644 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3e424894-085d-41ec-f7e5-08d8dc1f28d7 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT051.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6336 Received-SPF: pass client-ip=40.107.77.72; envelope-from=saipava@xilinx.com; helo=NAM02-SN1-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, WEIRD_QUOTING=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saipava@xilinx.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add details of eMMC specific machine property and example for passing eMMC device. Signed-off-by: Sai Pavan Boddu --- docs/system/arm/xlnx-versal-virt.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/system/arm/xlnx-versal-virt.rst b/docs/system/arm/xlnx-versal-virt.rst index 2602d0f..d1099fa 100644 --- a/docs/system/arm/xlnx-versal-virt.rst +++ b/docs/system/arm/xlnx-versal-virt.rst @@ -29,6 +29,7 @@ Implemented devices: - 2 GEMs (Cadence MACB Ethernet MACs) - 8 ADMA (Xilinx zDMA) channels - 2 SD Controllers + * SDHCI0 can be configured as eMMC - OCM (256KB of On Chip Memory) - DDR memory @@ -43,6 +44,19 @@ Other differences between the hardware and the QEMU model: - QEMU provides 8 virtio-mmio virtio transports; these start at address ``0xa0000000`` and have IRQs from 111 and upwards. +Enabling eMMC +""""""""""""" +In order to enable eMMC pass the following machine property "emmc=on". +ex: + "-M xlnx-versal-virt,emmc=on" + +Above switch would configure SDHCI0 to accept eMMC. More details on eMMC +emulation can be found in docs/devel/emmc.txt. + +Below is the command to pass eMMC device. + "-drive file=emmc.img,if=none,id=emmc,format=raw + -device emmc,drive=emmc,id=emmc0,bus=/sdhci0/sd-bus" + Running """"""" If the user provides an Operating System to be loaded, we expect users