From patchwork Fri Jul 12 16:27:13 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: 812334 Delivered-To: patch@linaro.org Received: by 2002:adf:fac3:0:b0:367:895a:4699 with SMTP id a3csp776686wrs; Fri, 12 Jul 2024 09:29:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUK6/A3f++LlJd6KFM3olLGPBOz3EIs+7RNhwpe6vUYMO0neg/N4SUcxhIP2v1MpS9nzZY1khuUkjXXnam0VoGD X-Google-Smtp-Source: AGHT+IEccMSWYR0XrO7ZnZBzSS9BqFmnr+QoLOwZ2KZrIUb0u17OhE7KDpIBA44bQG7ESIdkbpSO X-Received: by 2002:a05:6808:189b:b0:3d9:2b15:65d4 with SMTP id 5614622812f47-3d93c01937bmr13695172b6e.21.1720801761426; Fri, 12 Jul 2024 09:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720801761; cv=none; d=google.com; s=arc-20160816; b=Dpl0hJ4T/xZd3ITDpCR3GoeHCLHBLRcBsKKKUszV9oAammomFCJU4nU66rVWm2FqPr t85ASVvsKE/k28knK+NROfjUIkSsIPcpJONHr4YyxJWjley6YomM5NGOSTq5XQe9Wr3U 3ljQ0uNckbo86kB0Tzr6Src36GbW/OiuDvbEL83SHo6dYYiMGSgHhoRgZYT5qrSK9pYZ CLEHXnM9AvHG22bhRO3KCS7rsTKKHBG98CW7Ov4e7lCPVp8V+qTchmYeUJjXzoaYSKSY b5jFGkxymChe2Rm8aq11oNNijuT7O2LGIIOBbm/eHLPUh06AYpF1JOMN/2eqjDJjO4zR YoxQ== 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=haoIBckcRPKFI1igV/tcFjqM0juY8TSEYfggrZriKRI=; fh=PL8ckMkyAhAkso3TNNQ58kdISuodHNUfk6+te16KrPk=; b=rSCLuQBea8jzkSNlSLHbCQ0WJgPjZPW9VA0+3rCseTack5nJhx2lJPgnfSd59C/Eqm K4/ckwNBCB5dhiERch1m2V95pHPlq/ptEXo+Bez2nPnsKXFSU7KmC+sLzu7/Emfk1zIk S/rKmSCXFwshsyWVw8vP9TdqmDSoElXc7uHi3Ee3Iwlc99wjL6kfFBvNVw2XulwxnUdp zqdetIjb3A+WkEQHPfzbOOXvvkadD6tG1Yba17ycFtrw5/LfbjzL8SwibBvypmT/xrGd Y1AePQAzjVJW/rhtP+FTQaX1OHCb3VGZOAuKtn8t/D1hDlNGvJyN4yYB4+PE4FsU7zLM 2s9g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k0XS1zph; 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 af79cd13be357-79f1901160csi963263185a.96.2024.07.12.09.29.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Jul 2024 09:29:21 -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=k0XS1zph; 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 1sSJ7o-0005JF-WD; Fri, 12 Jul 2024 12:28:01 -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 1sSJ7j-000583-Fm for qemu-devel@nongnu.org; Fri, 12 Jul 2024 12:27:56 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sSJ7h-00020G-Qg for qemu-devel@nongnu.org; Fri, 12 Jul 2024 12:27:55 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4277a5ed48bso16039885e9.2 for ; Fri, 12 Jul 2024 09:27:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720801671; x=1721406471; 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=haoIBckcRPKFI1igV/tcFjqM0juY8TSEYfggrZriKRI=; b=k0XS1zphO2XQB86m/ufL94bWvNCNJSP3OX8vg5cXWj9Um7mICioFQUMXi/Tqu9ilfM 55XpN6X2Z2nAHETr18USd4hZ8XkFVx3Kedye5ND1X0alH+NgkOsd7NO3/uR6SE4Q+ilk V2EKahkOBshXkcV+Q7mgB2LnlxllyiewQtWf97SlO1CAzO/89whkGPDxPcmemBoaRV1I 5W42XoLdqlsoeglANWOcHDzbUJoduclr2XrzYr8l0iOgCgscbUFklthBZthjxwjUq1no 88Ff4XfwZwzWuLPdKyCO020iPDEGg8U5aEX1kjAdKCJSxPj6lrYl4nTGQuh/vB2mzq4X 197g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720801671; x=1721406471; 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=haoIBckcRPKFI1igV/tcFjqM0juY8TSEYfggrZriKRI=; b=vaBYVTWqMNFO0PxWxVm0Df3gTw72HARZC+/8muJRZ3VXUTxLGtRfxvbGjCHZIm9fPW mRYBx0cMQ8n28YRONzayM6gS6eiLqGz9wTCV0jKuTnbTo2yMTPFweUu+zVUz1kTDxeUP as7S5dtCHjhCJwcamy9vEcvPObY02le4oi8aBJEfNf1fsTzwdOErJZL95mIGDwgrj3vc 2RoHXHOTXZT2SpcnpyCsLpxN1Brrzfcg2k+0OP+Wlmo3MkFnCko4yJMPPQUdXKSPC7NY FdlRicjFWjNXflY9JXpnltrRX97RgNoJBD7qSX7CtLm4SLxn5xJWIf9PBP/mI7seZeao NUGA== X-Gm-Message-State: AOJu0YwkZ1auXIpN+AWsPoOVDu1YTSL7P3l+IBV3BbTocW272E7O+vb2 ZBs+PcbPRcO/+dH/h/lKCMqF5IPIpAGqRsQMLzipxMNdPiKpj1gBihcMJPlibunuXBcDOmhnWp1 n X-Received: by 2002:a5d:408d:0:b0:362:41a4:974a with SMTP id ffacd0b85a97d-367cead83eemr7223482f8f.66.1720801671703; Fri, 12 Jul 2024 09:27:51 -0700 (PDT) Received: from localhost.localdomain (nsg93-h02-176-184-54-152.dsl.sta.abo.bbox.fr. [176.184.54.152]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367cde890f6sm10542001f8f.53.2024.07.12.09.27.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 12 Jul 2024 09:27:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Andrew Jeffery , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= Subject: [PATCH v49 05/11] hw/sd/sdcard: Fix SET_BLOCK_COUNT command argument on eMMC (CMD23) Date: Fri, 12 Jul 2024 18:27:13 +0200 Message-ID: <20240712162719.88165-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240712162719.88165-1-philmd@linaro.org> References: <20240712162719.88165-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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 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é Tested-by: Cédric Le Goater --- hw/sd/sd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index ab502d19b8..09077f0154 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;