From patchwork Thu Jun 27 17:10:42 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: 807885 Delivered-To: patch@linaro.org Received: by 2002:adf:e842:0:b0:362:4979:7f74 with SMTP id d2csp913274wrn; Thu, 27 Jun 2024 10:12:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUztOVVqEs3UDUWrwtCjgGrmacfj68hFfFP0xgya3uS92yZZGCbJo63PomWeNvYK5gSGGnZa8kgnKgiF6cT6XqT X-Google-Smtp-Source: AGHT+IH3KqYzA1hdpOOtsqRjlMrhRh2Og0LWgfwBd5N+Ppb+huUDJMFUNeBEagaQOtAqU2jtzNWC X-Received: by 2002:a05:6122:4a1b:b0:4ec:f018:ee1e with SMTP id 71dfb90a1353d-4ef6a7394ebmr11801571e0c.12.1719508352954; Thu, 27 Jun 2024 10:12:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719508352; cv=none; d=google.com; s=arc-20160816; b=OaetgTOmi0lDleV+STdMlSzvSCOH6BhR4bhqv7DaS9hDIm2C0anQ1qErxhtvsneKXI ZXMDdGVr7M4GuvfXraEQiHcKypU2zbyjPgGWFH6e9fSD4GNp6s8RaCGeLjbnFB+F4X/b 7acYKewy21mEHcJqmekoY7Om6i8LmjqJ+gGMjtiPOindVsrhH2jex1pXzX0NFPtc9Raz ZrutE5BoP4WpfAsrhPwpxt7RZZv36IjV3nyHvj8p2ZIn8ZIs7lgM8o4vVcrA0NxUKTLL tYpdPC6Ipph52Uhm8FrAB0lXNLQgdvTRIsJhBqQwvAQAeTN+4Z+Ow/irJnQl+vJ/Y1tz AHfw== 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=l5dk8XRtaZNYeklBLa17/11yculQIx4J+IHrxLfyvgU=; fh=WUqfD5CNolTLXU3odpyK/irI96uSRBSbw3kHmNv9290=; b=IWDcMATi1YHMqU5qHqhmuiirDiiNw3U85C2dLJJ7pumAy0bq7JBOK9Ul/+hxvlVo0u pqH/LeeMkF5KK/UiaMoDRn7d3o5Edr1pqHFzkpKGt3VT51cC++RwVjAZMdBpto83zIXV udsvGX+X0yS7EMC4c9P+5EgzyYUpD0MjvTLETt5JfqYr9dY/9l0wiiyzhxUXkmWopPC7 Dl8ntG1ocw7VSWTu4oJog7ooIVgNMZvJQ9xvOFauRkPpwZJ5wnVn4MGYbu9lATbvld11 FC+zjOVY25WBf4aN+VhmfXv0sA39VUX/ZQo0uH48NEy3sF4F+NezNaTocpL5CsLMQNQ6 NGGA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QrwAPP5d; 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-4f2922874cesi22558e0c.295.2024.06.27.10.12.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Jun 2024 10:12:32 -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=QrwAPP5d; 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 1sMsev-0007LX-79; Thu, 27 Jun 2024 13:11:45 -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 1sMsel-0007HQ-Gs for qemu-devel@nongnu.org; Thu, 27 Jun 2024 13:11:38 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMsej-0001qR-9d for qemu-devel@nongnu.org; Thu, 27 Jun 2024 13:11:35 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-424ad289912so17956945e9.2 for ; Thu, 27 Jun 2024 10:11:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719508291; x=1720113091; 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=l5dk8XRtaZNYeklBLa17/11yculQIx4J+IHrxLfyvgU=; b=QrwAPP5d927dS7uwysiG4MPvGT4rp3ZsfRiYi0HZu1MTmnip1y8OxfGE98PTXCuyUy Z6JakFiV/AUbYKs0N7ycGGURdy2nZuHutrMote5GiS7J/XKvdZjBkkyzDhIvmR3oilts h0msTtkGPk90uL5nqxbvhzzyEDiZRnWaDWJylPQ1A8UYIMrgPGsjEbF09HccDT0medKX PD7WZJwy4q9qFUzchZLOk6BEdiSbD7eah3vCZPDZymF84VoiwNtuuBgY0bU+Lx9UQvue 3r1XaeqJWpmqK0j6LnD0VeoEFSnSIHGUqvlsM+SxEcR8cds9dKBO4wrpaEw0XaTDwZnJ d+LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719508291; x=1720113091; 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=l5dk8XRtaZNYeklBLa17/11yculQIx4J+IHrxLfyvgU=; b=iw3EHIPwTtWsNAEe5UYL7eodL/Yfl2fdDdtw+bD6dK0QUu3Ky1eKjrz8rSUQX6qb6Q cncCvNE6wFCxgwX5spP3ZmsR2IQmJMFwnkSfzbGNVYrpCfiTOa1GltHpsD3KAe1F7kWl 9zGVgGK1AlrnTc0KlhakkdocheGfp6cLiXzgpWREAta/RlQj+N3hJIt+fxspwZzEtsUH ioSxeeD47UHam/sJAFHQdd5/56qQFVB1e2qcl9hi45FRz/Z/vj+pBTrbxFRMEMCU4qAk 7vbB7Jb2jRHi+B2Xo1pYKJ2YGIEAvql1qmWCvm5xJyKEKppFUsR/2rxZGVZ15lMXc4oy jpBg== X-Gm-Message-State: AOJu0YxquggJuz1/5iLLX9l5GdXAE0WuCuisE6+KkR+n5TXLXeQXwyvQ /sUIYbAUeLF5P3KTF+zLr9M4oqeuQ/YCE5VCCVJtBT56M/4x/hX9F4hyryeDM+haWphJSivSK4H LPUo= X-Received: by 2002:a05:600c:888:b0:424:a779:b5c1 with SMTP id 5b1f17b1804b1-424a779b687mr48905595e9.20.1719508291578; Thu, 27 Jun 2024 10:11:31 -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 5b1f17b1804b1-4256b0c0fbesm435835e9.43.2024.06.27.10.11.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 27 Jun 2024 10:11:31 -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 02/19] hw/sd/sdcard: Cover more SDCardStates Date: Thu, 27 Jun 2024 19:10:42 +0200 Message-ID: <20240627171059.84349-3-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::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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 So far eMMC will only use sd_sleep_state, but all all states specified for completeness. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index b0ef252001..92ac57a648 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -76,7 +76,9 @@ enum SDCardModes { }; enum SDCardStates { + sd_waitirq_state = -2, /* emmc */ sd_inactive_state = -1, + sd_idle_state = 0, sd_ready_state = 1, sd_identification_state = 2, @@ -86,6 +88,9 @@ enum SDCardStates { sd_receivingdata_state = 6, sd_programming_state = 7, sd_disconnect_state = 8, + sd_bus_test_state = 9, /* emmc */ + sd_sleep_state = 10, /* emmc */ + sd_io_state = 15 /* sd */ }; #define SDMMC_CMD_MAX 64 @@ -205,13 +210,19 @@ static const char *sd_state_name(enum SDCardStates state) [sd_standby_state] = "standby", [sd_transfer_state] = "transfer", [sd_sendingdata_state] = "sendingdata", + [sd_bus_test_state] = "bus-test", [sd_receivingdata_state] = "receivingdata", [sd_programming_state] = "programming", [sd_disconnect_state] = "disconnect", + [sd_sleep_state] = "sleep", + [sd_io_state] = "i/o" }; if (state == sd_inactive_state) { return "inactive"; } + if (state == sd_waitirq_state) { + return "wait-irq"; + } assert(state < ARRAY_SIZE(state_name)); return state_name[state]; }