From patchwork Wed Jul 10 14:14:01 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: 811776 Delivered-To: patch@linaro.org Received: by 2002:adf:ee12:0:b0:367:895a:4699 with SMTP id y18csp774781wrn; Wed, 10 Jul 2024 07:14:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVBvqNfZhURT96zq4GiN4c5xuqIH9puGfbpBeQr+yRZBy0pyyEUm9Z4Tdcigpq303P3O4VgmTsvZcA+hxAhuUdb X-Google-Smtp-Source: AGHT+IErkaqvHxyz16oOZl/z7asvJODKYHsmTNj51RjY+vI0RLMq/82lzDzo+LLeJvel1JDXz9Mx X-Received: by 2002:a05:6214:20ce:b0:6b5:7d92:3dd3 with SMTP id 6a1803df08f44-6b61bce16d3mr73725356d6.24.1720620897313; Wed, 10 Jul 2024 07:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720620897; cv=none; d=google.com; s=arc-20160816; b=CTNbG31gL8ZLjC4r8Q4UuIIVDBpV5mLKB9Vz9kxkHCI8ULvhcgBkhQ7OdsN1k/FfDo k5RQWsN8bWTN8BPYQ2YS7ee6XWpZpGSannYOZqIXV5QSgDX3WshRlSncF/OEjVLzio4j rbgJHzFeHkIYpzl5LwilxbRXp8VJEPnjKbLTtI9E4BeQ6QOOhfgTRbbzHRrlZlN820ll 8AZHzjdrlTa9MkB8HbJ4N3yP7qONJLKtrNEVcug0TCy9mocv/Lgy0hVqEMGJHbk7U34j kMuXXlF04e5q3eGgheRWfkv2sED82PYWtZWVeTtxp6ROpI89D3en3yF0kzrCa/sMbwGt gM7w== 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=dSXWTIJRY6bXt8qFvPRs+ninmnXE9NGGsYv1EsJJ090=; fh=GH5Q+RtWzBCNH9E515TvTIpLJh2pWY/kifiV2Cu7nrY=; b=FhDGqlrGmupf0tREVZoqlrALAksfiec+clcb0sRg0U9xnN3uhzlGw44N+4lvfzLtHl B8VGj2XitPMQKfQXb4mGz4gA8HTVrrQt3B8Q/cracsKMjmMrZ5gaHdgKZxnETilBY4LQ anlVStyJCBeZN2hJqkTCxcCZSWulf4GlEQ273/l/uEsbRINu/FmGsgEU3kCzFJbdMvoC nhhUQJoVEkCM8MWAThlIJer8ls/DlFVFL/DDZWg7f/exPTv+BRvuq8XeNbJgNrxmgwST RbgWPD+MKFblgar3ZwkP8ARTwuikd6REfadIgHpomNsR8Yq9CdeDG5OTPwfIGohYUHR3 Axfg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gg75dxbE; 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 d75a77b69052e-447f9bc533dsi46638501cf.479.2024.07.10.07.14.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jul 2024 07:14:57 -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=gg75dxbE; 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 1sRY5p-0007ED-BJ; Wed, 10 Jul 2024 10:14:49 -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 1sRY5o-00076O-7B for qemu-devel@nongnu.org; Wed, 10 Jul 2024 10:14:48 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sRY5m-0003xN-Mc for qemu-devel@nongnu.org; Wed, 10 Jul 2024 10:14:47 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4266182a9d7so26127165e9.0 for ; Wed, 10 Jul 2024 07:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720620884; x=1721225684; 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=dSXWTIJRY6bXt8qFvPRs+ninmnXE9NGGsYv1EsJJ090=; b=gg75dxbEbAUxE08kNdqfuHAsFsznd9xgDtM8xCLYuMTn6g/CmRNWV3PZVeapWmPwn7 hQr7MNOZVfT8DljvQQru1ud4/pK7SKNbGQpOVWeH7yGnZxLdu7/KbfBzbBd6SnKjJzVA 7UwMatmtKAgzYuJu2K/fjs5b3gq6UuOOUllp31EoRJrKllDmLk0hHDbwfdcTqtxhCfW8 HFwFz69ZWQZW5bn3pO1CMOnFJSZJBg0YJoOC/0GwU4NoJlSmX3NgqyZclD4lCEj0xmKq OyFyhibdfxY3EPvswP9YwoScm3KIyDvGQsK2uHtk4vDCf3YqxDzuIh/hIsMy9OpEZz7t /N5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720620884; x=1721225684; 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=dSXWTIJRY6bXt8qFvPRs+ninmnXE9NGGsYv1EsJJ090=; b=YxLCDDxtbQwoZ+fjDBxpyfR8O5vOsjIHi0hh0vU6+UlBlDJcbw+B15ccCmLSnGVNcV JtPSVANwFRgKBe7DKsHgW0lUn1D7i+QV+k/LN1k42u4pfWB/41jRM8mNXuoQkDfu4Mw0 P9ioKTPsJQ3f5i/Gsz1hUOOodb9/DcxsinDIylmtuSpyMjcZeO1olg/bMxKP39whZLpr 6qoZieRAOqZsJ+DFJESQqwWlLrp+fDsfom7QOVStlFX+tL2R22jewdb7xpH+gjHkESLz qUDExoHze2SiSofKqYhodvU3OEcsl+Ogm4LcktxD/BUbH3xgh9Fz0m/zaEda2upDMN7W Q+Sg== X-Gm-Message-State: AOJu0YwI3akLcf2MOKIzE7HVIrA9rgLQFWU4Od50SjVZQxlaNzcAb+Dt PSTIIKgRdCQeyxl2HIVTQEWPq5OWhmqD86uez0zVkvxKGrzh/PdRd91KxB6zzpyunuPpbPBWrV2 O X-Received: by 2002:a05:600c:245:b0:426:6099:6eaa with SMTP id 5b1f17b1804b1-426708f2020mr34787305e9.26.1720620883921; Wed, 10 Jul 2024 07:14:43 -0700 (PDT) Received: from m1x-phil.lan ([176.176.167.117]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42726c62ed2sm52106205e9.15.2024.07.10.07.14.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jul 2024 07:14:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bin Meng , Steven Lee , Andrew Jeffery , Francisco Iglesias , Sai Pavan Boddu , Luc Michel , qemu-arm@nongnu.org, qemu-block@nongnu.org, Troy Lee , Jamin Lin , Peter Maydell , Joel Stanley , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E . Iglesias" , =?utf-8?q?C=C3=A9dric_Le_Goa?= =?utf-8?q?ter?= Subject: [PATCH v48 05/12] hw/sd/sdcard: Fix SET_BLOCK_COUNT command argument on eMMC (CMD23) Date: Wed, 10 Jul 2024 16:14:01 +0200 Message-ID: <20240710141408.69275-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240710141408.69275-1-philmd@linaro.org> References: <20240710141408.69275-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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 From: Cédric Le Goater The number of blocks is defined in the lower bits [15:0]. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater Tested-by: Andrew Jeffery Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 7e17bd0736..550f63418e 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1533,6 +1533,9 @@ static sd_rsp_type_t sd_cmd_SET_BLOCK_COUNT(SDState *sd, SDRequest req) } sd->multi_blk_cnt = req.arg; + if (sd_is_emmc(sd)) { + sd->multi_blk_cnt &= 0xffff; + } trace_sdcard_set_block_count(sd->multi_blk_cnt); return sd_r1;