From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emRmm-0004rr-UN for qemu-devel@nongnu.org; Thu, 15 Feb 2018 17:13:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emRmi-00055r-0N for qemu-devel@nongnu.org; Thu, 15 Feb 2018 17:13:48 -0500 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:40917) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1emRmh-00055e-S4 for qemu-devel@nongnu.org; Thu, 15 Feb 2018 17:13:43 -0500 Received: by mail-qt0-x243.google.com with SMTP id c19so1619020qtm.7 for ; Thu, 15 Feb 2018 14:13:43 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Thu, 15 Feb 2018 19:13:09 -0300 Message-Id: <20180215221325.7611-5-f4bug@amsat.org> In-Reply-To: <20180215221325.7611-1-f4bug@amsat.org> References: <20180215221325.7611-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v4 04/20] sdcard: clean the SCR register and add few comments List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alistair Francis , Peter Maydell , Igor Mitsyanko Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, "Edgar E . Iglesias" , Prasad J Pandit , Andrzej Zaborowski Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- hw/sd/sd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 14c1cb1332..41fac9a4aa 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -299,10 +299,13 @@ static void sd_ocr_powerup(void *opaque) static void sd_set_scr(SDState *sd) { - sd->scr[0] = 0x00; /* SCR Structure */ - sd->scr[1] = 0x2f; /* SD Security Support */ - sd->scr[2] = 0x00; + sd->scr[0] = (0 << 4) /* SCR version 1.0 */ + | 0; /* Spec Versions 1.0 and 1.01 */ + sd->scr[1] = (2 << 4) /* SDSC Card (Security Version 1.01) */ + | 0b0101; /* 1-bit or 4-bit width bus modes */ + sd->scr[2] = 0x00; /* Extended Security is not supported. */ sd->scr[3] = 0x00; + /* reserved for manufacturer usage */ sd->scr[4] = 0x00; sd->scr[5] = 0x00; sd->scr[6] = 0x00; -- 2.16.1