From nobody Sun Dec 29 01:37:49 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=1719559076; cv=none; d=zohomail.com; s=zohoarc; b=miWc/rj0DRZTITAgfReVhbBUgJqxFV1SoF5jxJm8PEyV1LAW/d5AZD2dKjfWo6C1vW233cQI+NBUUZq6qFXhR69P7o4JBaSbI6NCcQW1jqM66WWPBDN43c4/ksAePH/2BdZbDqKlQBfMLxVrouRpuhqCxR4dAJR1+BXtVmtSl5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719559076; 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=ojivM3IaWwWzglQz4g05HwWNW+Y8YVh/DQQ1yO/B8Js=; b=b31i/xxSvSSuH//QZqf2pQmnMFqMPMECOcmYmilr5/pDLILsx9RZfDNiFBwON5Fq0Fkah7IyGXDYzRDuuDe1yJ1MlVhbrXHd/niFMt+R2jxapPrN3rcqbcpjNdSROfcNuzUYocWED2cC122gFFulGPGIgN2RLjCtiAEe2HSQEus= 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 1719559076319867.6864333921575; Fri, 28 Jun 2024 00:17:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sN5lN-0002fi-2f; Fri, 28 Jun 2024 03:11:17 -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 1sN5lK-0002d2-On for qemu-devel@nongnu.org; Fri, 28 Jun 2024 03:11:14 -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 1sN5lJ-0004sM-03 for qemu-devel@nongnu.org; Fri, 28 Jun 2024 03:11:14 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4256f102e89so1287155e9.0 for ; Fri, 28 Jun 2024 00:11:12 -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 5b1f17b1804b1-424a2abcfd0sm62373955e9.1.2024.06.28.00.11.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 28 Jun 2024 00:11:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719558671; x=1720163471; 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=ojivM3IaWwWzglQz4g05HwWNW+Y8YVh/DQQ1yO/B8Js=; b=gRpHobt0fg9khKD4RVG24jp6wuVZwOKC6cqlx7qDGRr7NlHfsMugQAzjzK4xAdltID Z9pVrAAp9CmOwKAC3s3rlcrJfQZ56mC9tr7XQEVx6+9RUBA7LhnIa9VIn2+GA34T9KUA lJCPHQGwnn8BMrWeYHCSxA5WcQTqhlmnzXvjjJ+yIfinN68gac29fDb6XQLOd3RFypFP PF2PMfykUG6Wxw46reVioF+6CUH6eZe02WHVlKpL2jBWgazkJz1nLMh4mtQiXfqctS0V e4XmK67an7OklKCcM7IUKNKUaFOPsdc5wzyoXDXTUivejc7IucLK3zBuFNKhomrxjdeC qXxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719558671; x=1720163471; 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=ojivM3IaWwWzglQz4g05HwWNW+Y8YVh/DQQ1yO/B8Js=; b=l3FxAAdlICLLU17Xr/9iLwopo+VF7HqsHFjngIt2NMlIlCpteWhamIWIU6f+/QFqNg gi31bYMQ4NyhUhTKi8Jrm0areQxnKFzvSOeeBwPuS06GhzjHGGyNayirw1GZhzP/UOad 5Yq8CzUoLArYLCFAssWxLPQNFVUjLpDRikzi8mulrf/16vNJkXheogT3ocsJOnOqVYPy eFI6BiibTCWVI+c7lG/8/7gv5lTIgNvG4eWartQWOqNaaJAU+QGoIJlbfWvhcOIcGnDn 2z8jrCWnfEQNtRY5cD8IBdLurRNNdn2sEbT9zodOFgCZ+Yv3ijmDgpTLE3GKX/u8j4jX BhUw== X-Gm-Message-State: AOJu0YwhPPeboc3DH+spektx0RRyCB8dkQWfeJ1cicqN5mS9HGZfv7Q8 GW0PffqiX1UOPORID2UOV1T8zNeRf0yfEsG1Lf/fIfJqBnk7h0xdf4vnQPDUPEZclObcZhBufwm OC1o= X-Google-Smtp-Source: AGHT+IFX+qfOMZGKPWNS0Kz2JFKQBhOJ2wL/tK1dIW446bn8/0sp55dzVE8cjS/c5ONifm/UTF53zA== X-Received: by 2002:a05:600c:929:b0:425:65c5:79b4 with SMTP id 5b1f17b1804b1-42565c57b9amr28625005e9.26.1719558670999; Fri, 28 Jun 2024 00:11:10 -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: [RFC PATCH v42 92/98] hw/sd/sdcard: Adapt sd_cmd_APP_CMD handler for eMMC (CMD55) Date: Fri, 28 Jun 2024 09:02:08 +0200 Message-ID: <20240628070216.92609-93-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::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=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: 1719559078164100001 From: C=C3=A9dric Le Goater Signed-off-by: C=C3=A9dric Le Goater [PMD: Use aspeed_emmc_kludge] Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/sd/sd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index f875fcd741..82e0b5838f 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1693,6 +1693,9 @@ static sd_rsp_type_t sd_cmd_APP_CMD(SDState *sd, SDRe= quest req) case sd_sleep_state: return sd_invalid_state_for_cmd(sd, req); case sd_idle_state: + if (sd_is_emmc(sd)) { + return sd_invalid_state_for_cmd(sd, req); + } if (!sd_is_spi(sd) && sd_req_get_rca(sd, req) !=3D 0x0000) { qemu_log_mask(LOG_GUEST_ERROR, "SD: illegal RCA 0x%04x for APP_CMD\n", req.cmd); @@ -1707,7 +1710,7 @@ static sd_rsp_type_t sd_cmd_APP_CMD(SDState *sd, SDRe= quest req) sd->expecting_acmd =3D true; sd->card_status |=3D APP_CMD; =20 - return sd_r1; + return sd->aspeed_emmc_kludge ? sd_r0 : sd_r1; } =20 /* CMD56 */ --=20 2.41.0