From patchwork Thu Jun 27 17:10:49 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: 807891 Delivered-To: patch@linaro.org Received: by 2002:adf:e842:0:b0:362:4979:7f74 with SMTP id d2csp913753wrn; Thu, 27 Jun 2024 10:13:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUfrDZ8rctnJybLhzgQqBfFYnaGYlAR1JA+WyID42PhZLe/4KmsbmxWad2NcdQwuBNM+UDvA4OhEF1XJnVePLia X-Google-Smtp-Source: AGHT+IEsS/HU4dsnR59FM89pwGn6iNDhYtwn9YAW8wiGb+5XwOOsCHvhkn14cppi1XW0XDyIhDjr X-Received: by 2002:a05:6122:168a:b0:4ef:5744:483 with SMTP id 71dfb90a1353d-4ef6a5fe3e8mr14511622e0c.6.1719508403524; Thu, 27 Jun 2024 10:13:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719508403; cv=none; d=google.com; s=arc-20160816; b=Y6fhQBLgfBN0cGsBGGQ6IXaqq7J22NyjjUUjP9zk0oc+SVjBxMEJImfRpcciYcY4IM MngWnIeCFjfGnUtpqK5cLOeRNlPXrmnutoAdMYQhQyvX9aXC1/CDCE43fWiEk+qLH2JY QrLjzO/8Qs4Lk1zHOeJ1bQwuRAzjJM214n3A+XEbHugzMto7QArCndzzqjKRFyG1O5B3 4PXbNWhj/VtyjMWKCoaWLX7rNTQIyS0RoyH5Q9z7vWLjqJREBNK6RkWwkhwGF4zsgyzk 4CpMDsbbtaq+y19sHlELmxE23Wv/SKsBJvUGqe+67zi5YasJAJMORK4dPFAPuguGOSvg 72Jw== 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:cc:to :from:dkim-signature; bh=CppPyHBGnGyh+KeMhLUUfKK62hbBIjgp+PC1jB0KmHY=; fh=WUqfD5CNolTLXU3odpyK/irI96uSRBSbw3kHmNv9290=; b=yo6ISwYKR2zh1nWOv7gkk6fzFXb949ZN9O5sBC/Kn7654yfzoKihxvbYwAN8lSDsv7 wM3lJZ2GIUAE8Un0FDNNgJawgqfo3UTbp5tLyiPWdjKJsx3yf3PhNQIKE08Dt12NFjw/ s2sK3/1AibPt1/+thN7BYrZpUL39GCYZU9RpeonZs1sLwzpFeV8GNymfPSOT/Qhwcs9J R7mrKbQos5lpqfkmE54EhRlBJv2Yqmy+Vrh3DkEeEPcnZgvUZR2DrjO1ATgxCdWrm1Ci SegfkdoccRdjZhsNXNz2VNNO/hA/SpAlrpNsq02OSESPsEfp8u1LMglYD171WiQqwmQl 9zkg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Unozw+Wb; 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 71dfb90a1353d-4f292265f91si26273e0c.237.2024.06.27.10.13.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Jun 2024 10:13:23 -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=Unozw+Wb; 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 1sMsfu-0001X4-ND; Thu, 27 Jun 2024 13:12:46 -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 1sMsfs-0001Mb-Su for qemu-devel@nongnu.org; Thu, 27 Jun 2024 13:12:44 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMsfr-0002KL-5g for qemu-devel@nongnu.org; Thu, 27 Jun 2024 13:12:44 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3636c572257so6588110f8f.0 for ; Thu, 27 Jun 2024 10:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719508361; x=1720113161; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CppPyHBGnGyh+KeMhLUUfKK62hbBIjgp+PC1jB0KmHY=; b=Unozw+WbqFhAtxGSCVcjHM2f4ppAu4pQhNXLSiN915fkY4m8t4Zla8HEOWFwUXNScz jjIh84omHzKMeZIXFIxCtlPc4B23Ta/n4uygMVlFD86fvKJcELvJoDVkgVBac0he8Vek gBkFF6rEUuGQ6nvvOynVYP8rv6v46JGCl/BFX5fFF5qKDVACREWkXqv2vH045EyIvXoP DIKCJnU4IWNKTDVUBa3nhbjfrZ5R3wQFeDD0/+YpY4NjSkozlocCzFCuk3LOCNYInMox i0SqLkV9X9ZqZNny3VDXLuMPmCvK6d6QxKxibVIY+xeyDOCSPpHbD8GiN+I3ZQ6hrfW6 i4yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719508361; x=1720113161; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CppPyHBGnGyh+KeMhLUUfKK62hbBIjgp+PC1jB0KmHY=; b=rXfq5QRW50F5BQdUZZbiEuj8YtqD0Z2741uPH0wGKoRcfyfQujBixWbYlqxKCHItrm gvxricdeXj6La/aS+BkGFvDFGFLx23/ZZ1s96BasS/G2x/4PDBkEcSs2ZWhPiKOtxJHy fltUIoHKY//8ppmeRFfoCSc9zn7EkIyoKuP9rogXSj7UqXHVQhP4P2hXRDSapcEVraFh FuI7TWsw1CJRmJJWvn+tmFsBge9i4D1zQ/AaPdK7W4Id8Pbuvkw/U2IIrfq1JkdqFyev GL8hKfwBXTJ8XhXcZRsDNl1xS2dluaEiBz46qSw0tw1YtZInlfjdGu0iytnbZqfkVkWH Xcdw== X-Gm-Message-State: AOJu0YwT1i82JZkRnVknlItcuSSXSQyXjLLjmIzvy64Ejk7SmLOXLx78 IdPF/wZLmqLn+oFRPeaCJ2ozn3Pl4fby8FF/1qLObyhhYgcoO/7V13LTkt01Tp2Go2f41sGNuUF 12hA= X-Received: by 2002:adf:b1d1:0:b0:362:ff67:272f with SMTP id ffacd0b85a97d-366e94db3e5mr11678812f8f.41.1719508361364; Thu, 27 Jun 2024 10:12:41 -0700 (PDT) Received: from localhost.localdomain (33.red-95-127-46.staticip.rima-tde.net. [95.127.46.33]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3674369ebaesm2489133f8f.91.2024.06.27.10.12.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 27 Jun 2024 10:12:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Joel Stanley , Luc Michel , Francisco Iglesias , qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Vincent Palatin , Sai Pavan Boddu , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= Subject: [PATCH 09/19] hw/sd/sdcard: Add mmc_cmd_PROGRAM_CID handler (CMD26) Date: Thu, 27 Jun 2024 19:10:49 +0200 Message-ID: <20240627171059.84349-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240627171059.84349-1-philmd@linaro.org> References: <20240627171059.84349-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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=unavailable 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é --- 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 7c6f5ccc72..0f9bab105e 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1520,6 +1520,12 @@ static sd_rsp_type_t sd_cmd_WRITE_SINGLE_BLOCK(SDState *sd, SDRequest req) return sd_cmd_to_receivingdata(sd, req, addr, sd->blk_len); } +/* CMD26 */ +static sd_rsp_type_t mmc_cmd_PROGRAM_CID(SDState *sd, SDRequest req) +{ + return sd_cmd_to_receivingdata(sd, req, 0, sizeof(sd->cid)); +} + /* CMD27 */ static sd_rsp_type_t sd_cmd_PROGRAM_CSD(SDState *sd, SDRequest req) { @@ -1868,9 +1874,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 26: /* CMD26: PROGRAM_CID */ - return sd_cmd_to_receivingdata(sd, req, 0, sizeof(sd->cid)); - default: qemu_log_mask(LOG_GUEST_ERROR, "SD: Unknown CMD%i\n", req.cmd); return sd_illegal; @@ -2429,6 +2432,7 @@ static const SDProto sd_proto_emmc = { [19] = {0, sd_adtc, "BUSTEST_W", sd_cmd_unimplemented}, [23] = {2, sd_ac, "SET_BLOCK_COUNT", sd_cmd_SET_BLOCK_COUNT}, [24] = {4, sd_adtc, "WRITE_SINGLE_BLOCK", sd_cmd_WRITE_SINGLE_BLOCK}, + [26] = {4, sd_adtc, "PROGRAM_CID", mmc_cmd_PROGRAM_CID}, [27] = {4, sd_adtc, "PROGRAM_CSD", sd_cmd_PROGRAM_CSD}, [28] = {6, sd_ac, "SET_WRITE_PROT", sd_cmd_SET_WRITE_PROT}, [29] = {6, sd_ac, "CLR_WRITE_PROT", sd_cmd_CLR_WRITE_PROT},