From nobody Mon Nov 3 00:31:43 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152798481536915.17080189204728; Sat, 2 Jun 2018 17:13:35 -0700 (PDT) Received: from localhost ([::1]:33137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPGeM-0007Gf-IZ for importer@patchew.org; Sat, 02 Jun 2018 20:13:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPGZg-0003pj-2k for qemu-devel@nongnu.org; Sat, 02 Jun 2018 20:08:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPGZf-0002tw-8b for qemu-devel@nongnu.org; Sat, 02 Jun 2018 20:08:44 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:46175) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPGZf-0002th-4A; Sat, 02 Jun 2018 20:08:43 -0400 Received: by mail-qk0-x242.google.com with SMTP id k86-v6so22643674qkh.13; Sat, 02 Jun 2018 17:08:43 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id 17-v6sm10610894qkg.97.2018.06.02.17.08.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Jun 2018 17:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Kfb3Zgxde4K04GDGwPruMPMUzW7ywonlxLgymJq+28w=; b=j7A33qYCntLxv7I4151KpWX6l/dP9xS9460anu+HpXPyZFdc8DpK3EOdK/aUjyrguF 87wXp/BQFv8YGLcqRn9a5YDXkiGyDS70TdoU8KX80AcCNyE7v4DjebWM2fM2id1bsz2+ JTh+ZJufx0Vq9Oe2svdDfnHKafgvS3weFK0Br1LvpUmtVTZpv2BTmnxBP8kBWd1x+hSs gUnPI6Auyx06CsS5FYHOYTO/wTUbqYX6f6ob16sfAksliec8uJzZozMaeQULg8wBP3KT RKgK4b3DN29UIkW3AGVumSXvejQInwx03TsCphm5W3CVlAYb3VVCi+RJSIth0TvZGYR3 4lZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Kfb3Zgxde4K04GDGwPruMPMUzW7ywonlxLgymJq+28w=; b=gb7QXY+lDUWRcVFXRg4UQ0fystpVhK3ypHGvzIlti9kJ8iVHGvUm3YrhUh+2c89T+L S1N1M5C4/KP8Z3GapxanbQXqoCjTAHYzS762CJCrgvasfIrqk35CkIOnKV5xlgi5lxje 5fl/4+IJhy1t1QCdBpANYC8Sk/Hnx8hyFXQA43ha6EbrMXqJTJgfdUsqLhKC5shyh5v+ t2sljgHU5bTKAsfw0gtocD9YX0U+oI0vHs7MeiUZ/WPCaeIqQs5GEyvCAqicudtwyeSc eyzjFdavHYvASMxJN/nCeqgOZ3+CU3GQ9cTgHuDKawFtjRo1IAxU48uC7q/zSxkBUSJi lFSQ== X-Gm-Message-State: APt69E0PfQjsx3XcOb3x8PE+qjqbqlzllNouPw63yqg5hgIpznFChqSf /Qcx0bDYvhF1v4phdh0jG/0= X-Google-Smtp-Source: ADUXVKKxL7O/qOtGJ/Mwmha0+YKPJ4w6jtTdlAIFcnHUo7JUuucBeOF4/HKdQvttZewFg1P7cg6h7w== X-Received: by 2002:a37:1624:: with SMTP id g36-v6mr14241620qkh.327.1527984522674; Sat, 02 Jun 2018 17:08:42 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Alistair Francis , Peter Maydell Date: Sat, 2 Jun 2018 21:08:21 -0300 Message-Id: <20180603000827.30872-3-f4bug@amsat.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180603000827.30872-1-f4bug@amsat.org> References: <20180603000827.30872-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 2/8] sdcard: Allow commands valid in SPI mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From the "Physical Layer Simplified Specification Version 1.10" Chapter 7.3 "SPI Mode Transaction Packets" Table 57: "Commands and arguments" Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Alistair Francis --- hw/sd/sd.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index e1218d1fb6..80e70dd93e 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -960,8 +960,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDR= equest req) return sd_illegal; =20 case 6: /* CMD6: SWITCH_FUNCTION */ - if (sd->spi) - goto bad_cmd; switch (sd->mode) { case sd_data_transfer_mode: sd_function_switch(sd, req.arg); @@ -1190,9 +1188,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, S= DRequest req) =20 /* Block write commands (Class 4) */ case 24: /* CMD24: WRITE_SINGLE_BLOCK */ - if (sd->spi) { - goto unimplemented_spi_cmd; - } switch (sd->state) { case sd_transfer_state: /* Writing in SPI mode not implemented. */ @@ -1217,9 +1212,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, S= DRequest req) break; =20 case 25: /* CMD25: WRITE_MULTIPLE_BLOCK */ - if (sd->spi) { - goto unimplemented_spi_cmd; - } switch (sd->state) { case sd_transfer_state: /* Writing in SPI mode not implemented. */ @@ -1259,9 +1251,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, S= DRequest req) break; =20 case 27: /* CMD27: PROGRAM_CSD */ - if (sd->spi) { - goto unimplemented_spi_cmd; - } switch (sd->state) { case sd_transfer_state: sd->state =3D sd_receivingdata_state; @@ -1371,9 +1360,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, S= DRequest req) =20 /* Lock card commands (Class 7) */ case 42: /* CMD42: LOCK_UNLOCK */ - if (sd->spi) { - goto unimplemented_spi_cmd; - } switch (sd->state) { case sd_transfer_state: sd->state =3D sd_receivingdata_state; --=20 2.17.1