From patchwork Fri Jun 28 07:02:07 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: 808244 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp226959wrr; Fri, 28 Jun 2024 00:20:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWEnpoDv8MqQq0DJLUEsJLFqVRW2+I7MBXifK4TjfXKe/UQ1y4a+s6iQAtwhvYx/DHUk4xKGapna9yDXJleT+pd X-Google-Smtp-Source: AGHT+IG/w7SVoYCk00fSn5iv2hMrEMoUMIChdV/86C3zw5x34Y5sgrKNo86ox4Gc/a5i05Uhj+Bb X-Received: by 2002:a05:620a:40d0:b0:79d:55f7:2536 with SMTP id af79cd13be357-79d55f74581mr690099585a.71.1719559235344; Fri, 28 Jun 2024 00:20:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719559235; cv=none; d=google.com; s=arc-20160816; b=AkK02/YzsR4+aTubxUNwW99rBeXKpEc05L5hdmhzXXmaL8IK0H5ejywSlUQnvDxYHL 1G+0AnVRIOFzMtwF7hkPty360CStVh6+1qX6bZw5MlKszGYkOb2jsjbWxK+NFXp+AYeS V5f3jpbKiqLSp+xpL+Pdf0MHV7ZX+2Wq/IZyqIOJ68auUwk7dqEVwPotJLaINF63RnM0 GZJe4r9K1NOkmmXC0j+i/pjdvdhChVqevZ40I4NpOEkMNWocOFFBLubNqhsRXIbkm/AB v7rxkDR1b85Hoei35rOq26X1KuASsbTjAXPKE1/lGPwaa3SMo3uCwVJ0E0zdKv6X8p7w cdPg== 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=rhSRW4lnt4/3qEqJkcY7/by3NHero7LaTXmV3ByZHOM=; fh=Vqz0ILX7NeXJwCG5xiS+Wtk94IhOmAmLtOfN3kRbil4=; b=EfIsOVanWHh6nw7BTHMVl2HFmG51bQHL9MbAmpi+DADzEf2o6SvG7W3tW6zZ0pnxx+ TcR6oOE8uVWcE8tUdLF1b6fuKECTt8VU2mlh37w09LuTtf5luOGrCkJJ5eYqI/vEWsMe uvciPhHnVHsJtLYihxvzCiDVBNc9ZkTvaD3RxNnrVASoP9fqy4WfDRmpE09PVBrk9KeN IWWAQP3LYDJlQ7PRRtg/c9zsbHuvvaylo/OyY85LfZxf4D/k6tmTGeHiZDHMKlXquZ4i i+sx5+eeV0O2vCCauuDYtfQkJa1zTClC+b30UsuipK68vaUkheBDDiw4FirYn9TaIDKs hewA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ERj0+eIa; 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-79d69262c62si125759285a.52.2024.06.28.00.20.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Jun 2024 00:20:35 -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=ERj0+eIa; 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 1sN5lH-0002UW-4v; Fri, 28 Jun 2024 03:11:11 -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 1sN5lF-0002Rk-D7 for qemu-devel@nongnu.org; Fri, 28 Jun 2024 03:11:09 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sN5lD-0004s5-LZ for qemu-devel@nongnu.org; Fri, 28 Jun 2024 03:11:09 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-42565cdf99cso3145635e9.3 for ; Fri, 28 Jun 2024 00:11:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719558666; x=1720163466; 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=rhSRW4lnt4/3qEqJkcY7/by3NHero7LaTXmV3ByZHOM=; b=ERj0+eIaKqiVzbHELASp0pWif0JkmmljjxNJxVxoGLNMIRQhcKN2VVWyz/XO0Gp6o5 hkaVo24tWV/Bnb2b0R6ltRNYYAwO+gV7QtkgjuSKOM3kdQXEEdJFvVbxnJONxFXXFFBh tLAqLHYHmjt7F1uZYduaNeGOyuAuM7+7f2EdJlOcdBW8YywHxctUKXVPUKV3lRvTC7/R Mm/UcHLTfm1fhX236Jfwyhx4u7gcI7B8ACrKJvaS/G/MUdBX3KNHVEGXR8z5xaU+VsjI FgTiyrmVlTgpyNQUzEUok6DK8kRJYPfx2QhyyWNb4DJ8rnLNgXcwQGR3obV6Z/R2111P hiKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719558666; x=1720163466; 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=rhSRW4lnt4/3qEqJkcY7/by3NHero7LaTXmV3ByZHOM=; b=oDjeX6IBZtZnMtS/5UkJP6skgXTQHCNxbgKgcRBmQLHAQVVDQkvASLYesy81OE/VQ3 kgyWNKq4qHn8qVV9oQ+cVBnQYiENVjEWHBZ/lHs7MmJYSYTn3MBHc9OB3z9V4pq65WWC TU1MS07FSFdX85VfzQ0TrLoGwLeS/mNHvA7rtqxpCx3fObRJXOGP95JWzkM9EMmiaYTH I+8LluYRTpkCeduCE/QuhxHw6CwLgu5vSGER6XuhSfNH1yu3dYxiYkvrL/3Wf7aBHFAP /2l06lat28cskzC+q4L5bSIMz/1hpau0B44bh3rljLbdN2Bpn2312cwaXnMsYGVKB17z /ejg== X-Gm-Message-State: AOJu0YwGyda1rZpbScziKjhckXLPEb35BHeH4Sd+TYI1hAdeC5+BiJso jJr7R2UnjvG+7UQpeLjfC8fXj3gupszzcSMJIkdyUbsgis27/32LIN3p9FWStY+V1gLeIZpe/lD Odus= X-Received: by 2002:a05:600c:68cc:b0:425:5eec:bb84 with SMTP id 5b1f17b1804b1-4255eecc517mr65763395e9.36.1719558665800; Fri, 28 Jun 2024 00:11:05 -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-4256af557fesm22071075e9.11.2024.06.28.00.11.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 28 Jun 2024 00:11:05 -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: [RFC PATCH v42 91/98] hw/sd/sdcard: Adapt sd_cmd_ALL_SEND_CID handler for eMMC (CMD2) Date: Fri, 28 Jun 2024 09:02:07 +0200 Message-ID: <20240628070216.92609-92-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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater [PMD: Use aspeed_emmc_kludge] Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index dc692fe1fa..f875fcd741 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1218,7 +1218,13 @@ static sd_rsp_type_t emmc_cmd_SEND_OP_COND(SDState *sd, SDRequest req) static sd_rsp_type_t sd_cmd_ALL_SEND_CID(SDState *sd, SDRequest req) { switch (sd->state) { + case sd_idle_state: + if (!sd->aspeed_emmc_kludge) { + return sd_invalid_state_for_cmd(sd, req); + } + /* fall-through */ case sd_ready_state: + /* Bus always won */ sd->state = sd_identification_state; return sd_r2_i; default: