From nobody Fri Dec 19 22:03:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.54 as permitted sender) client-ip=209.85.221.54; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f54.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1624544563; cv=none; d=zohomail.com; s=zohoarc; b=EL3gkppaqDJC3UvI5Ma6dDC2A1p7V7eqnGIRTurh4LDJIwWbXd0DEy3wqJz93QZy1zfNwfeJzW2bqxVQtsFSLlWa5JKEgkswEc0KspOMXfHQHVQXCs22qIEF9rzfbMRPotZ4zQ4zhdLtUN4UVGxAvzqpz9k8LqBlLSReJCA1tio= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624544563; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZYvuxt0NCh8Bn052rHsHuAYilMYeW5qZBoGZhPd54Lk=; b=X2XO9pXT03DH81iEM8K77s/sMpOi7zNuWZ8DwjVjFpJqv6dicjy0bM0Wtyjg6cXRNMT41zlQ4n8w5YXijsBeCxAy79/ZpoItXbt8ImL+tHGZ735UPK8FulVNkoUOmGSzPw3uZB0qEC6v+o/b9sg2BK9EACL3wvkmoy2V5mDdg+U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mx.zohomail.com with SMTPS id 1624544563849483.62109582418645; Thu, 24 Jun 2021 07:22:43 -0700 (PDT) Received: by mail-wr1-f54.google.com with SMTP id g7so2254277wri.7 for ; Thu, 24 Jun 2021 07:22:43 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id c21sm2942022wme.38.2021.06.24.07.22.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 07:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZYvuxt0NCh8Bn052rHsHuAYilMYeW5qZBoGZhPd54Lk=; b=skZ0/5UWRUEmo3J7TzGc/hC0AHrRKuifqYpEYYl+mkD5KsAzIwHWlWwnDm7LWCkMwI Pe1la39DWaewBK5wghXe0pIEKfhZXPKHka+QDFTsMYWzlf1fJ6l0iw9vXSh35v0WaNXB vQDO5bqL7ieyE210bJyV6oKjgxDbCEZJnJFdLw6butoRbSyAjKu8qvXyLwGPAbuQUVjX 8OVvGjao1Zs9Wc2+XYbQtSMORkF2GkPKyKofffkJMdmshaYmxddcknJmyielM5o2Gh6x mbpdHQZN8tuOvHdOi83oe9gr0C0sizO0TPlUeLPXvqOItLU0lr2UhM/pCUtZKj9SxlV3 G60g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ZYvuxt0NCh8Bn052rHsHuAYilMYeW5qZBoGZhPd54Lk=; b=osihOGsPwNVAB2wf5G3tDcbz8uSEdXaKIGRf1qAYWe3FF0OYZSFtAUaHhHm5Xon1kU NpoPJFqg4m7QCFcQ9EJ8CrSIqgWEtLtnpH1k+IxhVu+g25Atc3Eke4/l+bX4X3atoZ3l HlPPZZ16NMyQmiXAhYzo0pamlM/DY0zQ0rR1qUoYHq3ps0GYLqPprHXFZfW3TES7HH/A s9hmBE+mMZt0ESRXrMXjbn/ZnSusBGr6QF7k+w644CIjjIjYBqFn4MpO1uqpO9fcudug sSwO2uSpHlz8jjiWhJOHylWeXJUVbBCAvdvQ/H0z/cLhQncZLd5P36ZH5EsjjbOfKl7p /cxw== X-Gm-Message-State: AOAM531cprTqQrSHZhbLR479KqZmrc04ySASG0u1u2t2h8hLfcHUxUMi hjS4rUrsJTqy8RL3u7Nk0LM= X-Google-Smtp-Source: ABdhPJycTAx3L7vZcldgxhrMz4ec+gyuuZvY1whVcMOolmHdGuaVqCJ2HrCVt2/OOZniHWBqVG9ivg== X-Received: by 2002:a5d:680c:: with SMTP id w12mr4814139wru.142.1624544562084; Thu, 24 Jun 2021 07:22:42 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Andrew Jeffery , Bin Meng , Joel Stanley , qemu-block@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [RFC PATCH 06/10] hw/sd: Add sd_cmd_unimplemented() handler Date: Thu, 24 Jun 2021 16:22:05 +0200 Message-Id: <20210624142209.1193073-7-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210624142209.1193073-1-f4bug@amsat.org> References: <20210624142209.1193073-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/sd/sd.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 0215bdb3689..2647fd26566 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -973,6 +973,15 @@ static sd_rsp_type_t sd_cmd_illegal(SDState *sd, SDReq= uest req) return sd_illegal; } =20 +/* Commands that are recognised but not yet implemented. */ +static sd_rsp_type_t sd_cmd_unimplemented(SDState *sd, SDRequest req) +{ + qemu_log_mask(LOG_UNIMP, "%s: CMD%i not implemented\n", + sd->proto->name, req.cmd); + + return sd_illegal; +} + static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) { uint32_t rca =3D 0x0000; @@ -1522,9 +1531,6 @@ static sd_rsp_type_t sd_app_command(SDState *sd, =20 switch (req.cmd) { case 6: /* ACMD6: SET_BUS_WIDTH */ - if (sd->spi) { - goto unimplemented_spi_cmd; - } switch (sd->state) { case sd_transfer_state: sd->sd_status[0] &=3D 0x3f; @@ -1655,12 +1661,6 @@ static sd_rsp_type_t sd_app_command(SDState *sd, default: /* Fall back to standard commands. */ return sd_normal_command(sd, req); - - unimplemented_spi_cmd: - /* Commands that are recognised but not yet implemented in SPI mod= e. */ - qemu_log_mask(LOG_UNIMP, "SD: CMD%i not implemented in SPI mode\n", - req.cmd); - return sd_illegal; } =20 qemu_log_mask(LOG_GUEST_ERROR, "SD: ACMD%i in a wrong state\n", req.cm= d); @@ -2096,6 +2096,9 @@ static const SDProto sd_proto_spi =3D { [26] =3D sd_cmd_illegal, [52 ... 54] =3D sd_cmd_illegal, }, + .cmd =3D { + [6] =3D sd_cmd_unimplemented, + }, }; =20 static const SDProto sd_proto_sd =3D { --=20 2.31.1