From nobody Sun Nov 2 12:01:45 2025 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) 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 1527984647302857.3114442361031; Sat, 2 Jun 2018 17:10:47 -0700 (PDT) Received: from localhost ([::1]:33121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPGbe-00053I-7s for importer@patchew.org; Sat, 02 Jun 2018 20:10:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPGZc-0003oQ-I9 for qemu-devel@nongnu.org; Sat, 02 Jun 2018 20:08:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPGZb-0002rp-Jp for qemu-devel@nongnu.org; Sat, 02 Jun 2018 20:08:40 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:44777) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPGZb-0002rf-FM; Sat, 02 Jun 2018 20:08:39 -0400 Received: by mail-qk0-x244.google.com with SMTP id 185-v6so22648499qkk.11; Sat, 02 Jun 2018 17:08:39 -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.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Jun 2018 17:08:38 -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=Ce44WCVkMMagK/1JB1LR6V+RdskOBCGMcjXomGJKki0=; b=f29HmJzfINibmDQY/+zenBE15BMPpgWsCfrFqmPe52kueUpeMJsH3JlybI8tHHzB7W eHCvAK0VSl77LZIhCwJP8r2WXwTvhL3YcPGi67AwYoqpeJi+/LQA9ShhBlQSNAi05zAs dYL0k3BQ6+fxY1PUS9YfaRvF2jarJDHbVEQEbowGXUIpHb0MYjrHYZmj4MWv/CkZximO /xiS4/zxikAHTReq7T07CV9CJ0X9+Ws8Nbh3H+lW0S9U4gbInGRFNBE1BbOuImQGBw2Q G7mRrSRyXUG4A3N51ysLmJSO6UlRNWFRKRa9HOGe4Pq5d4WqnE4a01Q+MT7Q3BWrzRyY fAVQ== 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=Ce44WCVkMMagK/1JB1LR6V+RdskOBCGMcjXomGJKki0=; b=jlNbWNlzwjV/a4yhS4fFJaMiTYv0hwSkZAwfccR75RDM6A7YEDBRPsAKVraCkyQ0R4 B1M/UITQxM5h2xtrpUNSOFciHhvb8/X5lHKHqkoEq/vWwUxyw9KX/ib7ivmgfGqJKXt1 bH+EwLyPq2BHBlzxsIN0phFXL5TFoTmEfRLFwxIEHbpzy/bcn//OpPiZbZOxCXRX+suT 5w0jB+oBllT2qgy1ZoswGROKkpPeSVmhTB7qG8XgrQyycZZln6NccCbi8SnXtg/omPPq nvEd6ofkaAFWrZt/IwvoQSPz50H7QTVy6GuAkjm1wnTHhxCxyZYDj5We2CQoIHBWHeRB 1vcg== X-Gm-Message-State: APt69E21f0W4dttsr/W8tli9KxfWdrr1nIdkM6XGGw9jTol4hLQdORPK UU/ErxZyQVXvYyyw89+Okvg= X-Google-Smtp-Source: ADUXVKJ+jvrF2Rg4tf9Y3P068yZUmLAXT5ffln8YdCJi4MbliLrS2JHkTPclx0VxRcjNFfPYYqXnVg== X-Received: by 2002:a37:10a4:: with SMTP id 36-v6mr14884188qkq.349.1527984519062; Sat, 02 Jun 2018 17:08:39 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Alistair Francis , Peter Maydell Date: Sat, 2 Jun 2018 21:08:20 -0300 Message-Id: <20180603000827.30872-2-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::244 Subject: [Qemu-devel] [PATCH 1/8] sdcard: Update the Configuration Register (SCR) to Spec Version 1.10 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_6 Z_629925259 SPT_0 This register now matches the description of the header: * SD Memory Card emulation as defined in the "SD Memory Card Physical * layer specification, Version 1.10." Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/sd/sd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 7af19fa06c..e1218d1fb6 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -310,8 +310,8 @@ static void sd_ocr_powerup(void *opaque) =20 static void sd_set_scr(SDState *sd) { - sd->scr[0] =3D (0 << 4) /* SCR version 1.0 */ - | 0; /* Spec Versions 1.0 and 1.01 */ + sd->scr[0] =3D (0 << 4) /* SCR structure version 1.0 */ + | 1; /* Spec Version 1.10 */ sd->scr[1] =3D (2 << 4) /* SDSC Card (Security Version 1.01) */ | 0b0101; /* 1-bit or 4-bit width bus modes */ sd->scr[2] =3D 0x00; /* Extended Security is not supported. */ --=20 2.17.1 From nobody Sun Nov 2 12:01:45 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 From nobody Sun Nov 2 12:01:45 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 1527984825010326.7550403106038; Sat, 2 Jun 2018 17:13:45 -0700 (PDT) Received: from localhost ([::1]:33138 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPGeW-0007Pv-4M for importer@patchew.org; Sat, 02 Jun 2018 20:13:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPGZi-0003rs-S2 for qemu-devel@nongnu.org; Sat, 02 Jun 2018 20:08:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPGZh-0002v5-Px for qemu-devel@nongnu.org; Sat, 02 Jun 2018 20:08:46 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:42647) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPGZh-0002un-LA; Sat, 02 Jun 2018 20:08:45 -0400 Received: by mail-qt0-x241.google.com with SMTP id y31-v6so6606837qty.9; Sat, 02 Jun 2018 17:08:45 -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.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Jun 2018 17:08:44 -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=8hDwejCWx11ArNCUrJgK57kvn6QwEkI8TsaoZIyD2nw=; b=aemB3cWoNlPmUfM3sJonXvBTSzU9wlr0R1uw1QwI7d6kyajGJdcoE9Fy7z9dvzvsVe nSWfM5Mf1/HZneGgsA0OQAlMp/6b3hHClcaIYwy0iVEmDe3C0s4yun3To2TB9adheYEG JfgYv0AM/pamv+IfYHEo3lrxarQYmeB22mh2XXqKIJxWVBei51f5du5HuzQdzrGbbBWi BNwci0JrKbzY2v1RPVtGI01oX93l5SKZ4IbGUA1IjEysYJRx7XNxxGcylhZ3rUM/922+ 6Hsk1p0xGYG4nzUOXDk3V7yG03AEqifc+5Ww1TFf7UQ6Mbuq7/iKC+MM5JNHzz+IialY Cb3w== 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=8hDwejCWx11ArNCUrJgK57kvn6QwEkI8TsaoZIyD2nw=; b=oJDZjSU6ipHq0dPQhvlaj1lRXhaWwu6mQtMquSgHT4tvVDZ1Yrn3iEAAqv2Bluss0Y tZfvQxK5Hj883YKA5Y3dTU5awjLsSyLpGupOGNi6ZGUx7CboNBGg98UDcGunCQhLcX3p q9HZUXhRuU31lUaxUKzP24JBpk52vBk0kWcEBt0GbSJackApBZUmGEp9HA4mnDKaAoHQ VuleNAW47x1FTJ/OkcQPBQzNsxTpbDITRHRFmDTQWbvPGQgReu9VvS915PqegC3D7shg gG7S+mijmgCfihfIDxbpE8BwI8pbvb8E5UGykRp7aq88TOkfqBwVOPitQmR1/Jmd0A8M gxXg== X-Gm-Message-State: APt69E0MoWwHo05nBLVndL0Gd4FoNhRx55NLy4OTqKrNesxsGF/Hoigb cYiktVE9ppTZELUdzVTJIXQ= X-Google-Smtp-Source: ADUXVKL4B28C59j6oyzO0enYRvg1WyZztIKrG+nCfYMwB24QAM7Z7g+LL3Auy0+j4yGKieamOfAmLg== X-Received: by 2002:ac8:8d4:: with SMTP id y20-v6mr16417607qth.187.1527984525205; Sat, 02 Jun 2018 17:08:45 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Alistair Francis , Peter Maydell Date: Sat, 2 Jun 2018 21:08:22 -0300 Message-Id: <20180603000827.30872-4-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:c0d::241 Subject: [Qemu-devel] [PATCH 3/8] sdcard: Add a 'spec_version' property 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 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis --- include/hw/sd/sd.h | 4 ++++ hw/sd/sd.c | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index 9bdb3c9285..49f22b0b89 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -54,6 +54,10 @@ #define APP_CMD (1 << 5) #define AKE_SEQ_ERROR (1 << 3) =20 +enum SDPhySpecificationVersion { + SD_PHY_SPECv1_10_VERS =3D 1, +}; + typedef enum { SD_VOLTAGE_0_4V =3D 400, /* currently not supported */ SD_VOLTAGE_1_8V =3D 1800, diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 80e70dd93e..5ddd211114 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -91,6 +91,7 @@ struct SDState { uint8_t sd_status[64]; =20 /* Configurable properties */ + uint8_t spec_version; BlockBackend *blk; bool spi; =20 @@ -2058,6 +2059,14 @@ static void sd_realize(DeviceState *dev, Error **err= p) =20 sd->proto_name =3D sd->spi ? "SPI" : "SD"; =20 + switch (sd->spec_version) { + case SD_PHY_SPECv1_10_VERS: + break; + default: + error_setg(errp, "Invalid SD card Spec version: %u", sd->spec_vers= ion); + return; + } + if (sd->blk && blk_is_read_only(sd->blk)) { error_setg(errp, "Cannot use read-only drive as SD card"); return; @@ -2074,6 +2083,8 @@ static void sd_realize(DeviceState *dev, Error **errp) } =20 static Property sd_properties[] =3D { + DEFINE_PROP_UINT8("spec_version", SDState, + spec_version, SD_PHY_SPECv1_10_VERS), DEFINE_PROP_DRIVE("drive", SDState, blk), /* We do not model the chip select pin, so allow the board to select * whether card should be in SSI or MMC/SD mode. It is also up to the --=20 2.17.1 From nobody Sun Nov 2 12:01:45 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 1527984940385560.7075992964913; Sat, 2 Jun 2018 17:15:40 -0700 (PDT) Received: from localhost ([::1]:33156 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPGgL-0000K9-LQ for importer@patchew.org; Sat, 02 Jun 2018 20:15:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPGZl-0003s5-GX for qemu-devel@nongnu.org; Sat, 02 Jun 2018 20:08:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPGZk-0002w3-FM for qemu-devel@nongnu.org; Sat, 02 Jun 2018 20:08:49 -0400 Received: from mail-qt0-x22e.google.com ([2607:f8b0:400d:c0d::22e]:38730) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPGZk-0002vx-AK; Sat, 02 Jun 2018 20:08:48 -0400 Received: by mail-qt0-x22e.google.com with SMTP id x34-v6so23398247qtk.5; Sat, 02 Jun 2018 17:08:48 -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.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Jun 2018 17:08:47 -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=HqxMyMutU5IjG39a5/VDAMgaCxZPQ4m2y4UZtXqHVEI=; b=G/TaAnHgIHDmWXbDrsRzVx5+doICs7fzljFOrFcw/B5J8vPbKS5/3qk/RZ6jwLqt41 GXWHpBqzkGskvYOdA/CZQWR87VA/vx1fluuHhyQSsbuJE6uXWFzwWzSeBdZm2OXdPPDl Qa3P9PLLhu+6XIRu8eXCaxvi8IydiGFI9WLSGZPb4+gyVEL33uE67z8k5OMqVcscj/J5 q6qQeLuR+l/Hgsi+N3qEjMIsspP6JUkDLgAERUBqUiXlhfEVkY3EPwbdmiapZU8pHhc+ mSIMI0by/jdnhN4E38zxiif4ObegR5+HjMiQlXoi2oVtEgJkXt2Qm8rdqOxiKKYhQ9EH mXWg== 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=HqxMyMutU5IjG39a5/VDAMgaCxZPQ4m2y4UZtXqHVEI=; b=r1JpvebB9WrIKTGdWRBfGIZqIj7Pk7BFL2qi9tMRE2Sl8sdL+H3ocVFwYx9cL2Cyp9 +n8ohioNzfo91u2/CXGFJF+Ch/Li+ddM36Ko2T89fwsFI9x641eiwwPB8EnAWn3yOsqM wsb1tHzT7Lw6IaRT3xhI79is5e1D3771roN4Kg9Oem/YtARGlcJ8mh6QfAi0MY9ONR6c CPChtnA71/C9qzXN93cEjZgdX7NT4EjV7bEzhO86zEp8mF2fF+M5DWtOF3t3wS3Lcizj Gex+YYgqnS8qnKcHw2pI/S5bfNClYwGUvP2W77IvQhrz+xdsjpQGT7Y2TvRqjgrlESDl CWDA== X-Gm-Message-State: APt69E10Heom1JmplvzCvxhCPl9TCrnRraN+Wcrt0RYI49BrS+qWAycC dcAK2aRYc3VbMWt+C6NiXmg= X-Google-Smtp-Source: ADUXVKJFcvzNJVJ07dK8nx64JMh1/+hSdk5m1CmaXjbl0LxKIdxSc1qosKiKKOr07ZgZdFbrMGk+dQ== X-Received: by 2002:ac8:35d7:: with SMTP id l23-v6mr15175125qtb.241.1527984527841; Sat, 02 Jun 2018 17:08:47 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Alistair Francis , Peter Maydell Date: Sat, 2 Jun 2018 21:08:23 -0300 Message-Id: <20180603000827.30872-5-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:c0d::22e Subject: [Qemu-devel] [PATCH 4/8] sdcard: Set Spec v2.00 as default 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 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis --- include/hw/sd/sd.h | 1 + hw/sd/sd.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index 49f22b0b89..7c6ad3c8f1 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -56,6 +56,7 @@ =20 enum SDPhySpecificationVersion { SD_PHY_SPECv1_10_VERS =3D 1, + SD_PHY_SPECv2_00_VERS =3D 2, }; =20 typedef enum { diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 5ddd211114..81f178b36e 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -311,8 +311,12 @@ static void sd_ocr_powerup(void *opaque) =20 static void sd_set_scr(SDState *sd) { - sd->scr[0] =3D (0 << 4) /* SCR structure version 1.0 */ - | 1; /* Spec Version 1.10 */ + sd->scr[0] =3D 0 << 4; /* SCR structure version 1.0 */ + if (sd->spec_version =3D=3D SD_PHY_SPECv1_10_VERS) { + sd->scr[0] |=3D 1; /* Spec Version 1.10 */ + } else { + sd->scr[0] |=3D 2; /* Spec Version 2.00 */ + } sd->scr[1] =3D (2 << 4) /* SDSC Card (Security Version 1.01) */ | 0b0101; /* 1-bit or 4-bit width bus modes */ sd->scr[2] =3D 0x00; /* Extended Security is not supported. */ @@ -2060,7 +2064,8 @@ static void sd_realize(DeviceState *dev, Error **errp) sd->proto_name =3D sd->spi ? "SPI" : "SD"; =20 switch (sd->spec_version) { - case SD_PHY_SPECv1_10_VERS: + case SD_PHY_SPECv1_10_VERS + ... SD_PHY_SPECv2_00_VERS: break; default: error_setg(errp, "Invalid SD card Spec version: %u", sd->spec_vers= ion); @@ -2084,7 +2089,7 @@ static void sd_realize(DeviceState *dev, Error **errp) =20 static Property sd_properties[] =3D { DEFINE_PROP_UINT8("spec_version", SDState, - spec_version, SD_PHY_SPECv1_10_VERS), + spec_version, SD_PHY_SPECv2_00_VERS), DEFINE_PROP_DRIVE("drive", SDState, blk), /* We do not model the chip select pin, so allow the board to select * whether card should be in SSI or MMC/SD mode. It is also up to the --=20 2.17.1 From nobody Sun Nov 2 12:01:45 2025 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) 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 1527984665153544.966034280781; Sat, 2 Jun 2018 17:11:05 -0700 (PDT) Received: from localhost ([::1]:33124 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPGbw-0005Jc-BG for importer@patchew.org; Sat, 02 Jun 2018 20:11:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPGZo-0003vR-8y for qemu-devel@nongnu.org; Sat, 02 Jun 2018 20:08:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPGZn-0002xR-EJ for qemu-devel@nongnu.org; Sat, 02 Jun 2018 20:08:52 -0400 Received: from mail-qk0-x231.google.com ([2607:f8b0:400d:c09::231]:37352) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPGZn-0002x6-9z; Sat, 02 Jun 2018 20:08:51 -0400 Received: by mail-qk0-x231.google.com with SMTP id j12-v6so19310251qkk.4; Sat, 02 Jun 2018 17:08:51 -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.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Jun 2018 17:08:50 -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=cfu73oyW3jgGsFJAn7fsAKURyltF/hX9sO8Jgz7miTc=; b=bpHmXS67IAAtlS2T1ghZvwwlQczWQ+8ZNHKjRS50qBbVUmfoe+BK7tJKb5PVwxpCxP 7/7Eyg97BQ7dvMnEBLcFqA77Y0jsPa6BwdG4Bax1OEmitp7450lxB6Vha77lt+7e1WqS y/VXE+HjQ6wQpS0mioGy+DxFnwBHF27HN8hYEINvcZxe8WdQH4EiMJMdfajL51z+AiVU RlMxGunJAxSB3C3LqNMrvB6rEqGO/ERLxVk9Rs9g/ofATDZ3iS6WNE3hEilNy4FoqIoz esEhyVz6eJPZtTwurNhAnuU64W4jSh/ax2YhFpe4hm6fXu8IN5CNF+V8MfhyVxkhgUH2 9VOw== 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=cfu73oyW3jgGsFJAn7fsAKURyltF/hX9sO8Jgz7miTc=; b=L1ifkF9Z9uK2MtDJ0SP0FLpNFnafuCUphaAFMnsPtrOGXE2KpTXjG6jrnlisBf66ti IE24NYpfwrGw3kxPtoTr+/cKWTf8RgCH0j5s7wU8mL8sUjKiGnmV+ppf6bDPNzze5a+e 9fP1CrqwILdQ8NpfoNK69pFld5pichqRpJ6SQHe3da5kE8kxn+vzjRi/P2PbalPCyfzI vhSyLez/QDWdm9LDOs94rRP7NfyAmMPadR9By2ZNAA8JNCGXhSFrjAD6G0aK4GmvDd48 HzF/83lp+3EL9rG09uucObrgm1Yl1lByrUJULlAmwcJiI0JItB2iV5S1SpljGuOA6uYU /WZA== X-Gm-Message-State: APt69E2oNNpw2THb5H3C1PvqqR+CS4QTo7Q/zX3SZ4tUNuLTdJT5WTgY 6nOszQnrps8M+ORm4Hl/5bU= X-Google-Smtp-Source: ADUXVKKEFYoEsxHGUioA0FvxTU5akwwpTa9zD63vIl2Brh2kqAD/OB4yRguNnmrTJ83JiUjGlyAvoA== X-Received: by 2002:a37:80c7:: with SMTP id b190-v6mr14965234qkd.212.1527984530894; Sat, 02 Jun 2018 17:08:50 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Alistair Francis , Peter Maydell Date: Sat, 2 Jun 2018 21:08:24 -0300 Message-Id: <20180603000827.30872-6-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::231 Subject: [Qemu-devel] [PATCH 5/8] hw/sd/ssi-sd: Force cards connected in SPI mode to use Spec v1.10 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 , Peter Crosthwaite , 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_6 Z_629925259 SPT_0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/sd/ssi-sd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c index ae04b6641b..c62fdc871c 100644 --- a/hw/sd/ssi-sd.c +++ b/hw/sd/ssi-sd.c @@ -253,6 +253,8 @@ static void ssi_sd_realize(SSISlave *d, Error **errp) /* FIXME use a qdev drive property instead of drive_get_next() */ dinfo =3D drive_get_next(IF_SD); carddev =3D qdev_create(&s->sdbus.qbus, TYPE_SD_CARD); + object_property_set_uint(OBJECT(carddev), + SD_PHY_SPECv1_10_VERS, "spec_version", &err); if (dinfo) { qdev_prop_set_drive(carddev, "drive", blk_by_legacy_dinfo(dinfo), = &err); } --=20 2.17.1 From nobody Sun Nov 2 12:01:45 2025 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) 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 1527984757655356.2781295195823; Sat, 2 Jun 2018 17:12:37 -0700 (PDT) Received: from localhost ([::1]:33134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPGdQ-0006VW-S3 for importer@patchew.org; Sat, 02 Jun 2018 20:12:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPGZr-0003zg-NY for qemu-devel@nongnu.org; Sat, 02 Jun 2018 20:08:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPGZq-0002yi-NP for qemu-devel@nongnu.org; Sat, 02 Jun 2018 20:08:55 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:42648) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPGZq-0002yW-JI; Sat, 02 Jun 2018 20:08:54 -0400 Received: by mail-qt0-x241.google.com with SMTP id y31-v6so6607031qty.9; Sat, 02 Jun 2018 17:08:54 -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.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Jun 2018 17:08:53 -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=OOZ7Vcc31wjxZvWvC4/OZIf0JoVPNazx0Zctb+9Jpyg=; b=UFaNscStTnVKq3/f0jmJ7UW6HsC8+H7OPrRaPXmCnCf9YwEHxALqozWiAJduD4KEdC 2UXCkqBYw9lwhm87z4K4r+SpfeaIzAOhALkQN2Q+kq5+Dm9wZITEoP7Haup9s7vgrCUm 5ek7+LaxfSXSurp5Jl3iiTZmTi75Cv0t4I95+heYIpgqdW4T5bsx0lhSByaCrM5N5z+m bvUlW9S/iBJOFe+bRoHnCj5uoYW2EUhUVJo8u0dk+WSTxBimqJLLQ3wT1Cgr5krzeEJC BbaVN19dpBNYSsFyIQHduZhFYgNsVVb+LTcEwoNSlySkqpGyRcgRQQXVEbDThjlWMncm DTbA== 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=OOZ7Vcc31wjxZvWvC4/OZIf0JoVPNazx0Zctb+9Jpyg=; b=Kp78tla20AndsDQVgLO1DTGZdTEvmCh7ubo7HHvu4N3IWmDGma+fCmWoZ9yakx1C0e sntPj0+STr7+8utGCbY50hVbQIKggW/DpgpvvUvAj0Y/uRLhBU9XFSmEjFyUnfTbuoRy WKmVO0VSHZs6W4rTs5WRMQfrEGooXVPjNACCI8xGubkwDAIrzpRxbr3S3U8v5EEimte9 BKvOckAwjBDZ+YG7+kCansrbRv5OMky/VdeWclcMjxTS3RoAAlN4gJfOLoO1EoSAAu72 Z69zanoiw/olDwXQqcMMdFHgzs4qNbx+yENrwe4pyyJ938K5fAnGHg/Z5YpXyPd1w2lI R86A== X-Gm-Message-State: APt69E2bNkt/sNYXfCdksvoqJhO4S1dd/2CZDdDRA9+iXAO0gxkowbpW UAqNZ9SNWih4SsabBAwGGr0= X-Google-Smtp-Source: ADUXVKIBlctV3S8Dt22HIKkEZY6in3rUY72tUcw6kIRFAhPsfrwFsNgqMtSJ+16goSm2tDqvKZt61g== X-Received: by 2002:aed:3e51:: with SMTP id m17-v6mr8450995qtf.283.1527984534233; Sat, 02 Jun 2018 17:08:54 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Alistair Francis , Peter Maydell Date: Sat, 2 Jun 2018 21:08:25 -0300 Message-Id: <20180603000827.30872-7-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:c0d::241 Subject: [Qemu-devel] [PATCH 6/8] sdcard: Disable SEND_IF_COND (CMD8) for Spec v1 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: Peter Crosthwaite , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, qemu-arm@nongnu.org, Paul Brook , Paolo Bonzini 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_6 Z_629925259 SPT_0 SEND_IF_COND got introduced by Spec v2. Firmwares use the CMD8 in SPI mode to poll the Spec version supported: 7.2.1 Mode Selection and Initialization (SPI mode) The SD Card is powered up in the SD mode. It will enter SPI mode if the CS signal is asserted (negative) during the reception of the reset command (CMD0). If the card recognizes that the SD mode is required it will not respond to the command and remain in the SD mode. If SPI mode is required, the card will switch to SPI and respond with the SPI mode R1 response. The only way to return to the SD mode is by entering the power cycle. In SPI mode, the SD Card protocol state machine in SD mode is not observed. All the SD Card commands supported in SPI mode are always available. [...] If the card indicates an illegal command, the card is legacy and does not support CMD8. If the card supports CMD8 and can operate on the supplied voltage, the response echoes back the supply voltage and the check pattern that were set in the command argument. This change restore the SSI/SD functionality of the Stellaris LM3S6965EVB board. Message-Id: 201204252110.20873.paul@codesourcery.com Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- Paolo, I guess this would be a good use of the Based-on: 201204252110.20873.paul@codesourcery.com tag in the git history :P hw/sd/sd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 81f178b36e..da65f2b178 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1017,7 +1017,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, S= DRequest req) break; =20 case 8: /* CMD8: SEND_IF_COND */ - /* Physical Layer Specification Version 2.00 command */ + if (sd->spec_version < SD_PHY_SPECv2_00_VERS) { + break; + } if (sd->state !=3D sd_idle_state) { break; } --=20 2.17.1 From nobody Sun Nov 2 12:01:45 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1527984935165873.1520314215595; Sat, 2 Jun 2018 17:15:35 -0700 (PDT) Received: from localhost ([::1]:33151 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPGgD-00009c-4O for importer@patchew.org; Sat, 02 Jun 2018 20:15:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPGZu-00042n-Ug for qemu-devel@nongnu.org; Sat, 02 Jun 2018 20:08:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPGZt-00030B-Pl for qemu-devel@nongnu.org; Sat, 02 Jun 2018 20:08:58 -0400 Received: from mail-qt0-x230.google.com ([2607:f8b0:400d:c0d::230]:39856) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPGZt-0002zy-Kg; Sat, 02 Jun 2018 20:08:57 -0400 Received: by mail-qt0-x230.google.com with SMTP id p23-v6so11831491qtn.6; Sat, 02 Jun 2018 17:08:57 -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.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Jun 2018 17:08:56 -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=IAGyLwpv3a5J8f3RNphJ9yfBZT3vwTiwYcQDW4gDTOg=; b=n4H8D9QZehbxCCFjBsNgYgK3+9ocBfGsM5oJ4PxOEEL0lrIrmuP6TTeRTgTaK2gqj7 8asjxw7KDc+mU15breNHxAB+hF4vcakZOrQyQghAbtKlwn+uhmcUqr0bEBsjyq4971lR NcL+Lc4eYUQnO01cYZO+9Gx0Ux1/HQeTMzf31i+8wCAM0sU997ndvHo/2m0zVSK5xl9o KUW2hh6wbTl4xBJVSdVbLuwqjo8cCtitHw39iWDtDQQcnFL94rWpXbXQa8MCBSkB237+ Yll+nJhM434XekvvfgPciKbYH03Ur5gJoz7S1UOo/WRa0NaHDUuyZ/vLxelK2+1jl2F3 4H+g== 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=IAGyLwpv3a5J8f3RNphJ9yfBZT3vwTiwYcQDW4gDTOg=; b=rxrhi4JEHAdblNuIiHfqv1B2HYTdAOu4b64W7I3CU3r4zTyMGCPwKSdnvL+rl8vOOU 1HdB+H1IJZVQ1r2V1OM20YRKdTgghUpOHs6JnYfqjjtwSY89Gcr1213L0KNGbF45owF0 qcQKuVzv+oxfs0fFxFu5x7b3l/1rA+8D8Yt5NtVoeGmYgPCkR7oxRO3BpSefjSSPIxZx CacgiFjSxOGa+BurWeuWjZY4m7HsOfQ4nvIMeJBsETA9qyiYSqbXQ+izCMZjxQGkJT4a m88rMsKnkm0iaeY+YcgpnZoN2ixnr8BvmhJ+V81VrVdxYqhjNPWguujAW3dvV3mN0vqH PVog== X-Gm-Message-State: APt69E3We5PBKPU16HIadPXYWQLC1QQJtNMlVSfh4KPICf1+r0Ecqsfa TUZHEbcuVY05DRGNQWcJolU= X-Google-Smtp-Source: ADUXVKJ7/JquHmtU+Fa6qarGpYC74lywEFptxpxzO3ecPyvwpBfLXAH2CC2GSGufFtJ1DSxPHNgynA== X-Received: by 2002:ac8:3f24:: with SMTP id c33-v6mr7541192qtk.235.1527984537220; Sat, 02 Jun 2018 17:08:57 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Alistair Francis , Peter Maydell Date: Sat, 2 Jun 2018 21:08:26 -0300 Message-Id: <20180603000827.30872-8-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:c0d::230 Subject: [Qemu-devel] [PATCH 7/8] sdcard: Reflect when the Spec v3 is supported in the Config Register (SCR) 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 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis --- include/hw/sd/sd.h | 1 + hw/sd/sd.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index 7c6ad3c8f1..b865aafc33 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -57,6 +57,7 @@ enum SDPhySpecificationVersion { SD_PHY_SPECv1_10_VERS =3D 1, SD_PHY_SPECv2_00_VERS =3D 2, + SD_PHY_SPECv3_01_VERS =3D 3, }; =20 typedef enum { diff --git a/hw/sd/sd.c b/hw/sd/sd.c index da65f2b178..83426da133 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -315,11 +315,14 @@ static void sd_set_scr(SDState *sd) if (sd->spec_version =3D=3D SD_PHY_SPECv1_10_VERS) { sd->scr[0] |=3D 1; /* Spec Version 1.10 */ } else { - sd->scr[0] |=3D 2; /* Spec Version 2.00 */ + sd->scr[0] |=3D 2; /* Spec Version 2.00 or Version 3.0X */ } sd->scr[1] =3D (2 << 4) /* SDSC Card (Security Version 1.01) */ | 0b0101; /* 1-bit or 4-bit width bus modes */ sd->scr[2] =3D 0x00; /* Extended Security is not supported. */ + if (sd->spec_version >=3D SD_PHY_SPECv3_01_VERS) { + sd->scr[2] |=3D 1 << 7; /* Spec Version 3.0X */ + } sd->scr[3] =3D 0x00; /* reserved for manufacturer usage */ sd->scr[4] =3D 0x00; @@ -2067,7 +2070,7 @@ static void sd_realize(DeviceState *dev, Error **errp) =20 switch (sd->spec_version) { case SD_PHY_SPECv1_10_VERS - ... SD_PHY_SPECv2_00_VERS: + ... SD_PHY_SPECv3_01_VERS: break; default: error_setg(errp, "Invalid SD card Spec version: %u", sd->spec_vers= ion); --=20 2.17.1 From nobody Sun Nov 2 12:01:45 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 152798504983610.831100455535761; Sat, 2 Jun 2018 17:17:29 -0700 (PDT) Received: from localhost ([::1]:33163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPGi8-0001Jn-Vz for importer@patchew.org; Sat, 02 Jun 2018 20:17:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPGZx-00045R-Cg for qemu-devel@nongnu.org; Sat, 02 Jun 2018 20:09:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPGZw-00031W-9V for qemu-devel@nongnu.org; Sat, 02 Jun 2018 20:09:01 -0400 Received: from mail-qt0-x235.google.com ([2607:f8b0:400d:c0d::235]:44465) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPGZw-00031A-5Q; Sat, 02 Jun 2018 20:09:00 -0400 Received: by mail-qt0-x235.google.com with SMTP id d3-v6so36667494qtp.11; Sat, 02 Jun 2018 17:09:00 -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.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Jun 2018 17:08:59 -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=qbszP7j+MJt4uhKSGaNBrODnWapPPw9GmZ73321LCyU=; b=cvF8Tg33QbdnnOAZ3avZ/yCia33PdV6xnMvUlvmAadoKfL12tt5gCgVP/4i8Bhx+Um gC9YmlNZIsZ/m/T6Ndm7LpB7pk3SA32412XspgzMAPBBgArtpqsy3ATLyclHkLy883B+ RojfbUaSPI+AP7U6ltN4Mc38/JpMwu9VtzJaw+mv5chobZeYfZSzIb9tlCKawmRKPDf0 ybKR72hPaSGAAAfm6mDz1XuF7wljFggqdQqkXCGccJXh55h1NW7UCkjc1hCfNIRti7tn RhTFG1FJ92Rvkw3ktYQIefHGPWBTEcI5MoWvq7n6luMB4Ry1GT0p+5wwwUsfiffhE+EY FmZA== 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=qbszP7j+MJt4uhKSGaNBrODnWapPPw9GmZ73321LCyU=; b=EXfTav7cFPu9jl9RI2DpPuCWyjF29CKiSE50m89PKeu6a6kavjkUOvmjnQeXqzhO7m 35sZfG6hqibSnuK83Ga1UkFgkRRlX0QkurQcVXXtO+E6pBAm45DXD02L+3bIQF3dKZ9J TS9vso+neGHH5ughjl/2JKb+KOlIO0iqkWj6/H3a1P6yNB80qE5OPw3Z0cZPBglYz9dg dy6qkOkqSj3w5P/EwX9AUB1gmqvk/sNrLwvnwjy1pZ7/lX4CfVf9Ec8H3zxCxclf8IZe ek9c8TmRIUQIXYHIp/KN55HjEC+TFlfknX+X8bew20X+oT5W6+UqM3nDM1UrFklL2uzB 6hsg== X-Gm-Message-State: APt69E2zpsuOtEv7OhVqLQ4/VtTDN1BQFy0SK9Gaz8U6L/N9aOnISdOF lJ8b1z12C/FBKFdN4aYVGBM= X-Google-Smtp-Source: ADUXVKL3t8iiw45gS8TO6PEILqm5JG2HwieWcmOnXSOidL+qc57J3yUUyCyaHERZUuvK/lu9/mjoTQ== X-Received: by 2002:ac8:22a1:: with SMTP id f30-v6mr15992160qta.358.1527984539737; Sat, 02 Jun 2018 17:08:59 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Alistair Francis , Peter Maydell Date: Sat, 2 Jun 2018 21:08:27 -0300 Message-Id: <20180603000827.30872-9-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:c0d::235 Subject: [Qemu-devel] [PATCH 8/8] sdcard: Disable CMD19/CMD23 for Spec v2 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 These commands got introduced by Spec v3. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/sd/sd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 83426da133..ac202e05a1 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1178,6 +1178,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, S= DRequest req) break; =20 case 19: /* CMD19: SEND_TUNING_BLOCK (SD) */ + if (sd->spec_version < SD_PHY_SPECv3_01_VERS) { + break; + } if (sd->state =3D=3D sd_transfer_state) { sd->state =3D sd_sendingdata_state; sd->data_offset =3D 0; @@ -1186,6 +1189,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, S= DRequest req) break; =20 case 23: /* CMD23: SET_BLOCK_COUNT */ + if (sd->spec_version < SD_PHY_SPECv3_01_VERS) { + break; + } switch (sd->state) { case sd_transfer_state: sd->multi_blk_cnt =3D req.arg; --=20 2.17.1