From nobody Sun Dec 29 01:49:11 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1719559187; cv=none; d=zohomail.com; s=zohoarc; b=RJ1DYjK0dvzz7Z1T3MdECEtFw6TlBs1mPTyW6fjwiVEoWGQ+jVLYFVhd6qiTfSdc1QiuPSNuH3s47G5s/2lxDEC8eJx5eK9JMHrysazjyBbYa0/IXI+ip7aCvnlBBIOU2HTm9+Wf/xQmFZA4gSqIE8dHIqAiSJRUCFh2uQxfQak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719559187; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=K1hpuhYvD8c8zKzHH2qCf+bpB7ESZQppXpuiPvi8zTE=; b=QAMstgBAzeu1vTbGjKpmVDcUpQOnRR+u1wQ263MHAXF3UDs6mBY2//usSmQgw3MKEUeyYG6TfXt2LognYj+6Kr+3Virk3mK5XqhA77G+2Yxhr2SonbNz3K3QmyBt/1h+E73zvhsiBTrt+JH6ia/K6HwW6gesAST72DorFzdG5/c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719559187814128.16854928628607; Fri, 28 Jun 2024 00:19:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sN5jm-0006mZ-CL; Fri, 28 Jun 2024 03:09:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sN5jF-0006Ce-Ae for qemu-devel@nongnu.org; Fri, 28 Jun 2024 03:09:06 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sN5jB-0004UF-B8 for qemu-devel@nongnu.org; Fri, 28 Jun 2024 03:09:04 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4256788e13bso2228135e9.2 for ; Fri, 28 Jun 2024 00:09:00 -0700 (PDT) Received: from m1x-phil.lan (cho94-h02-176-184-4-239.dsl.sta.abo.bbox.fr. [176.184.4.239]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a103d18sm1325820f8f.106.2024.06.28.00.08.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 28 Jun 2024 00:08:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719558538; x=1720163338; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=K1hpuhYvD8c8zKzHH2qCf+bpB7ESZQppXpuiPvi8zTE=; b=XaPqiwVCc4p+ls1P3cIggpfhJe524M30oXzIjI4GJRO+f6qU3R8Aw/LxWkxzl0F85w Kvgb/IKO/1zaE6amCCct4ndyEBqqqpulXpmRJZP4Dcn/UMvFKivjRqOvxDuEpVVgs4dn 6MtCJLd9s2U9xn8kxEWqbmLcSIwFrnGif/GT/1lWV8u/AhpvIrcHdMEdNoJ0z0WMyIP+ 0skaHqYnYyt0nOW9Q+JaB1SeLd+2fYmnGGDMlWDqy/LAgicGSika1O5CV0OJexj8t9JB uFrd7LycRBb2cTfHvF8Gf11II/duMF1nf+g9LMvwsyYURtf75Vwvfe6IdMUFo/M+W8rM awPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719558538; x=1720163338; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K1hpuhYvD8c8zKzHH2qCf+bpB7ESZQppXpuiPvi8zTE=; b=lAAG+FJU7mtHxp8GmD3cdgu6ZD6DzuSn1JErqiM73DXC7J8rH5t1u0HiQRdZApzQae wWhlsvjfG9uVj1d6eIOvs37ufSJ7iHnSbIawOpPyBFjiHISkHNP4PKqlnMx/pvsmq+DL an9mkMXyMzVaMRt4YhdvJXZQxFmkogSdwjiEnwpnwcjTKUq2+bgr2yAVLmwPjuC2OKub QMMThEQqr3M9QrOIkZok9aU9ruEsPJZ8Lvr4WSc9KFDV2vCqgyvplrkxoRNaZZNF80sV ou2MbcNnZYoJkVU8r3WY5v1CvC7OlxBHpcH2n8qZ+ERl3+Wx0rO0nWb9UaRM/SfseQpW /OMA== X-Gm-Message-State: AOJu0YzRvf6fD+vZsOz0sM9uwfwxdNP+6u1md2Yj64v1nwKOUWeQ53Pu i9p0uWrzlENs5Jhta0U5aRmsKyy8epO3VY/K9DhosBegHZrt5rC5s0z1SI0QhYSVPX4GX607Z0o +qOE= X-Google-Smtp-Source: AGHT+IFPgiw0+qHt7mr0yeKi47Ss/1C0ce1JIkYTzJkiSSCE9rYRPGVJzr4FWejZBVIGMKOfAbrouA== X-Received: by 2002:a05:6000:184f:b0:366:ee84:6a79 with SMTP id ffacd0b85a97d-366ee846c15mr14263981f8f.51.1719558538098; Fri, 28 Jun 2024 00:08:58 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH v42 66/98] hw/sd/sdcard: Add spi_cmd_READ_OCR handler (CMD58) Date: Fri, 28 Jun 2024 09:01:42 +0200 Message-ID: <20240628070216.92609-67-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240628070216.92609-1-philmd@linaro.org> References: <20240628070216.92609-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1719559188700100001 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: C=C3=A9dric Le Goater --- hw/sd/sd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 50cee5ac40..b3b4cd5a3a 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1660,6 +1660,12 @@ static sd_rsp_type_t sd_cmd_GEN_CMD(SDState *sd, SDR= equest req) } } =20 +/* CMD58 */ +static sd_rsp_type_t spi_cmd_READ_OCR(SDState *sd, SDRequest req) +{ + return sd_r3; +} + static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) { uint64_t addr; @@ -1748,9 +1754,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, S= DRequest req) return sd_cmd_to_receivingdata(sd, req, 0, sizeof(sd->cid)); =20 /* Application specific commands (Class 8) */ - case 58: /* CMD58: READ_OCR (SPI) */ - return sd_r3; - case 59: /* CMD59: CRC_ON_OFF (SPI) */ return sd_r1; =20 @@ -2321,6 +2324,7 @@ static const SDProto sd_proto_spi =3D { [55] =3D {8, sd_spi, "APP_CMD", sd_cmd_APP_CMD}, [56] =3D {8, sd_spi, "GEN_CMD", sd_cmd_GEN_CMD}, [57] =3D {10, sd_spi, "DIRECT_SECURE_WRITE", sd_cmd_optional}, + [58] =3D {0, sd_spi, "READ_OCR", spi_cmd_READ_OCR}, }, .acmd =3D { [41] =3D {8, sd_spi, "SEND_OP_COND", spi_cmd_SEND_OP_COND}, --=20 2.41.0