From patchwork Fri Jun 28 07:01:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 808242 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp226684wrr; Fri, 28 Jun 2024 00:19:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWEv/KfERKeNqZe2uBRVqOlgWSArhvq8FeQ/2sCRIaI6TvPl5dvE/J9sR/VRspvxC+p+9ZoGehCJ6VY4Y/QVsbB X-Google-Smtp-Source: AGHT+IHd/UF9ep6AN5zwYxBnlSDZMjKCx6PY978aM5UFRKck9b75jF9LPdXCbyiFujU2LHBnqJib X-Received: by 2002:a0c:e611:0:b0:6b4:fea8:6bfc with SMTP id 6a1803df08f44-6b53635d67amr177212496d6.10.1719559188221; Fri, 28 Jun 2024 00:19:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719559188; cv=none; d=google.com; s=arc-20160816; b=QOCaTyH+J3BMqM06YYCmsRWE5tTHqejmSNgeztkL7fgosLUo2RpvboizL/T8Kw5kBL swbZsKM7rW7SdG9dr2ytf4qMDHuK2D739QVGta1ZWB8I2aAqG6ukcTFU3+mUORUuQg/G yBFCB77/LyWp2VfGyknf5dXg30YA0ARYN+ncrcCQ4JcT3ClEMcTNludDgoRdCUrzpLQP 9ck3QWGMuSAMz34E1CYA2CYowLIZQ9AUE0Mdb6oAXJrTeVzcjWO//QEIHnDHO4QlQx4Y Q9FG+QdOHOuvKDzmx1/iQ5VHGArqBtBQxM3AHBgZxAj9yl3Gf1/teiP2DGGsDE8vrLYv 0W3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=K1hpuhYvD8c8zKzHH2qCf+bpB7ESZQppXpuiPvi8zTE=; fh=Vqz0ILX7NeXJwCG5xiS+Wtk94IhOmAmLtOfN3kRbil4=; b=EhNDAzynVwrLSMOR4Lazu0/M0yi6LONC3bJ2t2RnvLA8oyVjSbbupJNmOjv16q5yTV q9l2QwAO9ljs55xAxbdo+FwyBAgAJRoNIT5RsvHmc+Nl4pt5a11c84nubIrLiuM4appr iZL7H8QUSAGpqqNcUrIvcqXRAUa6aGJAOOC7TWDRMw5EmVbJBWxx//bmiLIfPTUMNjI3 K0f4YuvDrsbrldyzwcMgmToLni7yJItnzo+V1rcspQEeELAERKlRIoeh/rni0ZwmHJD6 OsmO2aFcuH/glt+M3VY2k1aFzMh7foYeq1UfGBSmlQJauHUb66t7y6WIijzF4KHd9tvH 0o8Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XaPqiwVC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6b59e36b4f9si14833786d6.126.2024.06.28.00.19.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Jun 2024 00:19:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XaPqiwVC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, =?utf-8?q?C=C3=A9dric_Le_Goater?= 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric 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, SDRequest req) } } +/* 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, SDRequest req) return sd_cmd_to_receivingdata(sd, req, 0, sizeof(sd->cid)); /* Application specific commands (Class 8) */ - case 58: /* CMD58: READ_OCR (SPI) */ - return sd_r3; - case 59: /* CMD59: CRC_ON_OFF (SPI) */ return sd_r1; @@ -2321,6 +2324,7 @@ static const SDProto sd_proto_spi = { [55] = {8, sd_spi, "APP_CMD", sd_cmd_APP_CMD}, [56] = {8, sd_spi, "GEN_CMD", sd_cmd_GEN_CMD}, [57] = {10, sd_spi, "DIRECT_SECURE_WRITE", sd_cmd_optional}, + [58] = {0, sd_spi, "READ_OCR", spi_cmd_READ_OCR}, }, .acmd = { [41] = {8, sd_spi, "SEND_OP_COND", spi_cmd_SEND_OP_COND},