From nobody Tue Feb 10 13:37:11 2026 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 1520610124777597.4190438397475; Fri, 9 Mar 2018 07:42:04 -0800 (PST) Received: from localhost ([::1]:46038 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euK9j-00022S-OR for importer@patchew.org; Fri, 09 Mar 2018 10:42:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euK4y-0006PC-E1 for qemu-devel@nongnu.org; Fri, 09 Mar 2018 10:37:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1euK4x-0008Eu-OJ for qemu-devel@nongnu.org; Fri, 09 Mar 2018 10:37:08 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:34351) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1euK4x-0008EZ-I0 for qemu-devel@nongnu.org; Fri, 09 Mar 2018 10:37:07 -0500 Received: by mail-wm0-x241.google.com with SMTP id a20so3955770wmd.1 for ; Fri, 09 Mar 2018 07:37:07 -0800 (PST) Received: from x1.local (ABayonne-654-1-76-150.w86-222.abo.wanadoo.fr. [86.222.219.150]) by smtp.gmail.com with ESMTPSA id m191sm1584175wma.21.2018.03.09.07.37.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Mar 2018 07:37:05 -0800 (PST) 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=8VyWMF/WYHUY8Kbo2EPnma3lq0jO62Bw4K7/gEYXgPw=; b=vGeUmpIqGKXxsjfL0jKtPs/rjYer3KPaiiNwfjGB9syAKCCidDdiT0jW7JCwvtfIJv NOqMB59F/YsLTeSXw83KWeSoZh5Xh3dayN/y5CmNz/w8GV4IG4V7Lz9LXWfpLxpYCkMq JEA1XE69OeQIwhh+QRrxPS+DziF7GIxnDOMeSLKuoQzPyaaP+pZWSpXqCgiiMM/dZ7vi NKbYmmwdUitUFeOXr/UKuFVJH/prkj7XQCVdN2TEJCjgGg3diAX0JXwH84fiAS1QOY+E pzCzeRI32FXRzgiAW95nGCYTw4u23b3iyeB+P8LiC9USN6dsTsXE7WBFaZH3NtizaiF2 8SOw== 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=8VyWMF/WYHUY8Kbo2EPnma3lq0jO62Bw4K7/gEYXgPw=; b=g+czwBVdAPx2fmO1FrRA6Aw1NMLgX3yp7ADiFO3PUSmjan61uif1E3HRByMeQMIgS5 IAlHx7doeYfu5utPhyUrgRwmh31qPxVaS0ADaZKJEhyngeqawGrkDrkTBnD3qSDrxaUA D9tNFoBOw3kTqgwT8CEzKaOV9lTzpVW0r3oPbmj/x86MlQ/yWMkoPVqCGx4NnDpfQXUf Vh+R+po0RTrgUb9GS6r3mfUKTmV88RlwwFXCLGaWymY1fohENL34sll3Y6xH5Rf2WG0f p0tMxGDOS4qP9xKLjfO5oOnHfQ52ZlRvgeXTttRO41TXt7a+DB74gqD3yoj9gPlapNxd oHhg== X-Gm-Message-State: AElRT7GBK9s6HWzO2YLuPc4u9IGtLNmYgZ3bfnbTBdKsFquA8GA6lrsi qLq+uVdMZMhFROHUO9P61zE= X-Google-Smtp-Source: AG47ELt6HHLTujPxz3dUKNMk99SN/Tpw059E3IrZ/uMGlyWl650IAYh9jTUBIU4EzcP9TZgc+gzcnQ== X-Received: by 10.28.147.12 with SMTP id v12mr2373867wmd.139.1520609826510; Fri, 09 Mar 2018 07:37:06 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Alistair Francis , Peter Maydell , "Edgar E . Iglesias" Date: Fri, 9 Mar 2018 16:36:52 +0100 Message-Id: <20180309153654.13518-7-f4bug@amsat.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180309153654.13518-1-f4bug@amsat.org> References: <20180309153654.13518-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: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PATCH 6/8] sdcard: Add a 'uhs' property, update the OCR register ACCEPT_SWITCH_1V8 bit 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: =?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 --- hw/sd/sd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index b907d62aef..611094447c 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -93,6 +93,7 @@ struct SDState { /* Configurable properties */ BlockBackend *blk; bool spi; + uint8_t uhs_mode; =20 uint32_t mode; /* current card mode, one of SDCardModes */ int32_t state; /* current card state, one of SDCardStates */ @@ -292,6 +293,9 @@ static void sd_set_ocr(SDState *sd) { /* All voltages OK */ sd->ocr =3D R_OCR_VDD_VOLTAGE_WIN_HI_MASK; + + sd->ocr =3D FIELD_DP32(sd->ocr, OCR, ACCEPT_SWITCH_1V8, + sd->uhs_mode !=3D UHS_NOT_SUPPORTED); } =20 static void sd_ocr_powerup(void *opaque) @@ -2198,6 +2202,7 @@ static Property sd_properties[] =3D { * board to ensure that ssi transfers only occur when the chip select * is asserted. */ DEFINE_PROP_BOOL("spi", SDState, spi, false), + DEFINE_PROP_UINT8("uhs", SDState, uhs_mode, UHS_NOT_SUPPORTED), DEFINE_PROP_END_OF_LIST() }; =20 --=20 2.16.2