From nobody Fri Mar 29 01:11:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.41 as permitted sender) client-ip=209.85.218.41; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f41.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610476545; cv=none; d=zohomail.com; s=zohoarc; b=N4Ik59fNom2aY+gqSp7iVSlWKbgQuOvUyaCICSTa2coe84F1kREDFnqM5kx0XEUz0smZf4OljEKj+ifX6/vNPhiPPmy7nyvpMIJecwmOyZ0zZqn1+A6lGdouqXlnYD5cLSACt8xILPmzXBLVW7YDP8nfuQqBCsxLbPSR3CwcIXo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610476545; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RZVE/UnVAR8oa3ZhuHDdsTxvOv0WljPZECYmmW3fajI=; b=J6YUv12IoRNybkfd+m6ZRuNGvcYMyM1fn2EmC+iLkvARrFIVK13/AWesjRY2np+3ZVEV9/ZRNkgKoHxs0F6MAqpJEhmqeCMxXI74CGUYFjYxLqWucycxfXyymvLOVldAz/SerPARNScMoTNd7+LtVQFKiFpE+5iz3DKT9ceQbFs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by mx.zohomail.com with SMTPS id 1610476545057139.76015547348243; Tue, 12 Jan 2021 10:35:45 -0800 (PST) Received: by mail-ej1-f41.google.com with SMTP id lt17so4959973ejb.3 for ; Tue, 12 Jan 2021 10:35:44 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (190.red-83-57-173.dynamicip.rima-tde.net. [83.57.173.190]) by smtp.gmail.com with ESMTPSA id w17sm839127ejk.124.2021.01.12.10.35.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 10:35:42 -0800 (PST) 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=RZVE/UnVAR8oa3ZhuHDdsTxvOv0WljPZECYmmW3fajI=; b=Wms8QeQpxumW7CSLPWDKIvgbOB+oAf6n8Bvufw9QCT2PviPTndhs1RiHBq4D2uVm8O qHfP/tjTFWskh5eKabSiQzJcGIMxTx57Tngsj+ZePrDzYxrxfDDd1E9/eOxeFMKj4zNn zz17M1dL3bLL6XSi8yJBceKJGZZIU3RlHXeDyd+1P7SGc4uTau0CI6htE7kJZZgj8JGp WcF18GbccxvgiaLqFX2DYb9CA/qCQFEuGDqBVudocUmSzXai4Yo82ImACsizEq5WpEhr IN/j89MFWW+OJXjyq63bTHSnt6lh+lg1Vg7jdcBfYKjjOBQVTpsjtai528kb0ADt4V4i YytQ== 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=RZVE/UnVAR8oa3ZhuHDdsTxvOv0WljPZECYmmW3fajI=; b=iQkNpa975JQT2Kk48wis5YC3BXLLAo/dmLaGTH0NLR+WiArkwXiOhBivTfWJChD1oX CeKaFv7BClhOK5QzDdhUOCG8DE+dZpk7vCcB4hIxrb/0BgwH0CSuLikqy9sxfvAj4GsN J9jotZ79YB96W1rZ6R63dpGpxlJ8DN1ONQbNuQ7iDMoxp99i9Yqfd0DroB52PyjNHD8b HZBIBSNG3j0dNSncD54dDgdnQpU64Yj2KBcgfWw9x0OncHHYJ5dhGaUDXwFn6j5dbnSt 9gMg92ZchIQE67qepXwKI/GwjPHKLv3F0k8z8O/NZ5YhfeLSWZB+NCiwZzK8VlxbrryP xp5g== X-Gm-Message-State: AOAM530XX6KZlNduaRkqoXTPVy8DOtXBZdGzy3tSgnEAydlaKpX2Rfwf Ld9Ax0+mdmpl3sNjy9q7dAo= X-Google-Smtp-Source: ABdhPJz5oMQInJX8nXmHfJ5ctksM/LhaqxLrcwSJR9BQErSlE68VcG1bXYZ0wp0Iaht3fbFYOUGXvQ== X-Received: by 2002:a17:906:fb9b:: with SMTP id lr27mr110910ejb.175.1610476543295; Tue, 12 Jan 2021 10:35:43 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bin Meng , qemu-devel@nongnu.org, Bin Meng Cc: qemu-arm@nongnu.org, Jean-Christophe Dubois , Peter Maydell , Alistair Francis , Peter Chubb , Alistair Francis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH v6 01/11] hw/ssi: imx_spi: Use a macro for number of chip selects supported Date: Tue, 12 Jan 2021 19:35:19 +0100 Message-Id: <20210112183529.2011863-2-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210112183529.2011863-1-f4bug@amsat.org> References: <20210112183529.2011863-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) From: Bin Meng Avoid using a magic number (4) everywhere for the number of chip selects supported. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210112145526.31095-2-bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Juan Quintela --- include/hw/ssi/imx_spi.h | 5 ++++- hw/ssi/imx_spi.c | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/hw/ssi/imx_spi.h b/include/hw/ssi/imx_spi.h index b82b17f3643..eeaf49bbac3 100644 --- a/include/hw/ssi/imx_spi.h +++ b/include/hw/ssi/imx_spi.h @@ -77,6 +77,9 @@ =20 #define EXTRACT(value, name) extract32(value, name##_SHIFT, name##_LENGTH) =20 +/* number of chip selects supported */ +#define ECSPI_NUM_CS 4 + #define TYPE_IMX_SPI "imx.spi" OBJECT_DECLARE_SIMPLE_TYPE(IMXSPIState, IMX_SPI) =20 @@ -89,7 +92,7 @@ struct IMXSPIState { =20 qemu_irq irq; =20 - qemu_irq cs_lines[4]; + qemu_irq cs_lines[ECSPI_NUM_CS]; =20 SSIBus *bus; =20 diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c index d8885ae454e..e605049a213 100644 --- a/hw/ssi/imx_spi.c +++ b/hw/ssi/imx_spi.c @@ -361,7 +361,7 @@ static void imx_spi_write(void *opaque, hwaddr offset, = uint64_t value, =20 /* We are in master mode */ =20 - for (i =3D 0; i < 4; i++) { + for (i =3D 0; i < ECSPI_NUM_CS; i++) { qemu_set_irq(s->cs_lines[i], i =3D=3D imx_spi_selected_channel(s) ? 0 : 1); } @@ -424,7 +424,7 @@ static void imx_spi_realize(DeviceState *dev, Error **e= rrp) sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq); =20 - for (i =3D 0; i < 4; ++i) { + for (i =3D 0; i < ECSPI_NUM_CS; ++i) { sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->cs_lines[i]); } =20 --=20 2.26.2 From nobody Fri Mar 29 01:11:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.54 as permitted sender) client-ip=209.85.218.54; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f54.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610476550; cv=none; d=zohomail.com; s=zohoarc; b=ZtAgXjkuCZn49Um//a30QLaSuSt+FvzYcv2eeEmoZV3liYviMOvu32lH958r/gq3CB34Zm6Mh3t5gxCk9kiM2SV6gg3q+in6ooGWKhkrbICW/3v++NwqP6PJoEru4gNkKdNsSJiwRrNKBk4eudRTAgjNmAJv68Pxd46eSlkddCU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610476550; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZanZiJ3tTZSMBujs+F1bLNbZeY/v2F63RmtFKqnRXj4=; b=ciT+Qh5G37HftX81DPXzWdCPxPt6iYFuW4yxVsAINjv1H922EQvOEye+Xrh8mVpyWNMoygH/kPyi3yRIfIzeZbxQJz8V2Gg8f6cC49gM2JjxB0YycMpzThyg0iCr20iebmLtOgFyOvsIL6dKWv0C3waXZLhPdn5NuqNsjtA/ATs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by mx.zohomail.com with SMTPS id 1610476550616238.0912532256466; Tue, 12 Jan 2021 10:35:50 -0800 (PST) Received: by mail-ej1-f54.google.com with SMTP id t16so4872009ejf.13 for ; Tue, 12 Jan 2021 10:35:50 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (190.red-83-57-173.dynamicip.rima-tde.net. [83.57.173.190]) by smtp.gmail.com with ESMTPSA id qn4sm1510593ejb.50.2021.01.12.10.35.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 10:35:48 -0800 (PST) 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=ZanZiJ3tTZSMBujs+F1bLNbZeY/v2F63RmtFKqnRXj4=; b=dUoqNviw/pjbxVL7TjynR6A/+y579dM8g8u+tMtPz5fQKSBztKWEBI65tCRom+hNZg oijQ3NMQuMtbqnWixlyHuKiXVl7ctkHdWR3mkl4limigjVmNPQ1dP+o+vCm4AINfqTFM OwoYnNBXYUKlO+HrMvdwAjHpZz1Elkn8zMkJ6WAWlEGb7xdQFaNSgC7Yj8fbGVxxnnl1 TEc9ZK4FVs8xRxYBHwAfRR1q3CFBWXKrDDJzdfKJ/2lQjsewJ9pha7GJi43E94CnBcyx ZChaVjTEoUy0Ujb/AcUHZlQS/vcw78KtaeViYaaO4Nyi1xYxK+L4wjGlks+Gns47KNo+ nbNg== 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=ZanZiJ3tTZSMBujs+F1bLNbZeY/v2F63RmtFKqnRXj4=; b=aaA2gka/aL8uSPaatZbAhfSsFPhb7v2sCtKFLL3ZFSXhd+3SdDOVnfip45VZVUswcI /mtxYj2KkQDgNK8owz+teP0Ndxn79ndVfIerSbRpBhi0+ocXwQOnJDXhUse/d0tsviOT 1pYK0SOKDNVp+auCNR2JB1SjhHwZ6V2yH5UF+VhMa+L4eR3Zg9CQVVCd2pFku/eOu435 Vy5s9EIpAZVYeLSZS6JnZTZirRKDPKl+y/mlBu2SuVt3Kd0d3xEdHRs3N6Ih80KCIHdc 36FNSHQ4o0PUBwyFKOYDs6ki6VMhK7NjDt0MzwJ93Gw0qEAWameqQpMIsRFCBrplywGX 4ANw== X-Gm-Message-State: AOAM530dcP3UD6bLOC/vaNsNSW4P7SrjH1DYB+J9D9KCroTUXOPT0L7j vvtLuSvQbapN2YOwenvkbSI= X-Google-Smtp-Source: ABdhPJysWxc+TAlm+ctgH1Xuw3U+dIcY2JoBnCZcJOfWq19ss3KHzzKDrTCH6LUMvGYcbq/pkumZmw== X-Received: by 2002:a17:906:653:: with SMTP id t19mr138235ejb.44.1610476548916; Tue, 12 Jan 2021 10:35:48 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bin Meng , qemu-devel@nongnu.org, Bin Meng Cc: qemu-arm@nongnu.org, Jean-Christophe Dubois , Peter Maydell , Alistair Francis , Peter Chubb , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH v6 02/11] hw/ssi: imx_spi: Remove pointless variable initialization Date: Tue, 12 Jan 2021 19:35:20 +0100 Message-Id: <20210112183529.2011863-3-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210112183529.2011863-1-f4bug@amsat.org> References: <20210112183529.2011863-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) 'burst_length' is cleared in imx_spi_reset(), which is called after imx_spi_realize(). Remove the initialization to simplify. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Juan Quintela --- hw/ssi/imx_spi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c index e605049a213..40f72c36b61 100644 --- a/hw/ssi/imx_spi.c +++ b/hw/ssi/imx_spi.c @@ -428,8 +428,6 @@ static void imx_spi_realize(DeviceState *dev, Error **e= rrp) sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->cs_lines[i]); } =20 - s->burst_length =3D 0; - fifo32_create(&s->tx_fifo, ECSPI_FIFO_SIZE); fifo32_create(&s->rx_fifo, ECSPI_FIFO_SIZE); } --=20 2.26.2 From nobody Fri Mar 29 01:11:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.208.52 as permitted sender) client-ip=209.85.208.52; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ed1-f52.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610476561; cv=none; d=zohomail.com; s=zohoarc; b=NSBa7Dbl+vEQtOr9ebcSe3Egtj7nohWMspLXEZMPaa86Nru6Mg+YVcM9FtFubPavvai7lwgGV+8hK+pQVIoaq5cT2DKl/yYjO/3Ys3W+rRbBDlDz/GjXO+f1MLMhrgJ9jsj9d7S4A8a/RTpDt00C4Vnud5+Z+RVTpVB6WmfSr/M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610476561; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cIbTTFaWqBlw1RG7hwtN0wXtBq0CsVDSjfCtHIelito=; b=D5HpcGQX/WvXsgasWsVlYqvTzQRMIbbzJ+GSMrpuNhgRL0CqKSlW88EXZHWOy8XRa0RCskq4eQOQE3vhMxwHVJDiPV3M54Z2AYWv55h1sbpdVWI4Ix7+Qsnemf9ywKyt4GbJiwmxGlNRlqLCdPm2c9tU/K78dLear31C1owS7EE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) by mx.zohomail.com with SMTPS id 1610476561612457.42752293206934; Tue, 12 Jan 2021 10:36:01 -0800 (PST) Received: by mail-ed1-f52.google.com with SMTP id u19so3483327edx.2 for ; Tue, 12 Jan 2021 10:36:00 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (190.red-83-57-173.dynamicip.rima-tde.net. [83.57.173.190]) by smtp.gmail.com with ESMTPSA id x16sm1526282ejb.38.2021.01.12.10.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 10:35:59 -0800 (PST) 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=cIbTTFaWqBlw1RG7hwtN0wXtBq0CsVDSjfCtHIelito=; b=oa8ugs1bbQImjYGvzrrC9iWH7/IjBH8mPKKCZ8C05gGEOlFpRWPXcWH4bujSXJxR8L vfdcmn6vRw7g3PkYOqWmlzTbHMNuY1Ph7Irgfxri+atvvyZtQN/41RqW7jM5djB97iUw ir2MPcYNIOm8vAX8c5zUSTIwz5ikhwBjsvnKdgbCuC0y4NzD7nqrrEtLK84qtCfZ9Pyy d857Hx/cImqGReyN6V3IacfHN0VmVMQ+ng/9uFA/GNnDlGZU9qHodYNM8iiS86lZhSKa qFSarRoX10B9uNaB6TRZJbBqeVfKG70WV+My3vz1aGTACF3yp615ysOW/t8kmLyR+2WT c7/g== 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=cIbTTFaWqBlw1RG7hwtN0wXtBq0CsVDSjfCtHIelito=; b=mmFjpaOHNT5lqz4qcnAgvO2ROVlv4uRi/Za+a71tM9UZZoXqdDhPOB66U2BPSLdQDM suT89hAPOuKmCOnAuakW5HTMfHuMEjIgQvz286kCWVBUKkVPCThYexwd8KgEJYn30Z8B K+c5OyvX6HdU45ZQX4szpm11ATJwA0J8yyshhHgUU6rcbFOVgxFb8szKaFpUrE7VcS3i u/4ix3tBCq3Kz509+ueqBaSyF4tpO8m5d+UJEguEtgLAkfeWJW7DN+0VIesBcLX072nB p0si5kkpxV8dF93xy7T0sALohGPHcCqV5bWx82t13eLNfmGTPII9AbtiuXRg2QCQFYkb Jx9Q== X-Gm-Message-State: AOAM532ImF2lcZpOwzTetNFxBLdfIBp81BxYe1UQrfkJmiyvTrP7Qfpd wZa7eAK5mF4MnfturvYm/eY= X-Google-Smtp-Source: ABdhPJwXzxR76AAx/y9vRklqRXPWNY6DAT3STKdSWqBWNiTOJe5HoaMnC6gcmQVmIM/ugRNI5omFog== X-Received: by 2002:a50:f745:: with SMTP id j5mr384426edn.92.1610476559715; Tue, 12 Jan 2021 10:35:59 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bin Meng , qemu-devel@nongnu.org, Bin Meng Cc: qemu-arm@nongnu.org, Jean-Christophe Dubois , Peter Maydell , Alistair Francis , Peter Chubb , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH v6 03/11] hw/ssi: imx_spi: Convert some debug printf()s to trace events Date: Tue, 12 Jan 2021 19:35:21 +0100 Message-Id: <20210112183529.2011863-4-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210112183529.2011863-1-f4bug@amsat.org> References: <20210112183529.2011863-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) Convert some DPRINTF() to trace events. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Juan Quintela --- hw/ssi/imx_spi.c | 8 ++++---- hw/ssi/trace-events | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c index 40f72c36b61..35ab33c0511 100644 --- a/hw/ssi/imx_spi.c +++ b/hw/ssi/imx_spi.c @@ -14,6 +14,7 @@ #include "migration/vmstate.h" #include "qemu/log.h" #include "qemu/module.h" +#include "trace.h" =20 #ifndef DEBUG_IMX_SPI #define DEBUG_IMX_SPI 0 @@ -232,7 +233,7 @@ static void imx_spi_reset(DeviceState *dev) { IMXSPIState *s =3D IMX_SPI(dev); =20 - DPRINTF("\n"); + trace_imx_spi_reset(); =20 memset(s->regs, 0, sizeof(s->regs)); =20 @@ -290,7 +291,7 @@ static uint64_t imx_spi_read(void *opaque, hwaddr offse= t, unsigned size) break; } =20 - DPRINTF("reg[%s] =3D> 0x%" PRIx32 "\n", imx_spi_reg_name(index), value= ); + trace_imx_spi_read(index, imx_spi_reg_name(index), value); =20 imx_spi_update_irq(s); =20 @@ -310,8 +311,7 @@ static void imx_spi_write(void *opaque, hwaddr offset, = uint64_t value, return; } =20 - DPRINTF("reg[%s] <=3D 0x%" PRIx32 "\n", imx_spi_reg_name(index), - (uint32_t)value); + trace_imx_spi_write(index, imx_spi_reg_name(index), value); =20 change_mask =3D s->regs[index] ^ value; =20 diff --git a/hw/ssi/trace-events b/hw/ssi/trace-events index 612d3d6087a..20fcaf32df6 100644 --- a/hw/ssi/trace-events +++ b/hw/ssi/trace-events @@ -1,3 +1,5 @@ +# See docs/devel/tracing.txt for syntax documentation. + # aspeed_smc.c =20 aspeed_smc_flash_set_segment(int cs, uint64_t reg, uint64_t start, uint64_= t end) "CS%d segreg=3D0x%"PRIx64" [ 0x%"PRIx64" - 0x%"PRIx64" ]" @@ -10,6 +12,11 @@ aspeed_smc_dma_rw(const char *dir, uint32_t flash_addr, = uint32_t dram_addr, uint aspeed_smc_write(uint64_t addr, uint32_t size, uint64_t data) "@0x%" PRIx= 64 " size %u: 0x%" PRIx64 aspeed_smc_flash_select(int cs, const char *prefix) "CS%d %sselect" =20 +# imx_spi.c +imx_spi_reset(void) "" +imx_spi_read(uint32_t index, const char *name, uint32_t value) "index:%u (= %s) value:0x%08x" +imx_spi_write(uint32_t index, const char *name, uint32_t value) "index:%u = (%s) value:0x%08x" + # npcm7xx_fiu.c =20 npcm7xx_fiu_enter_reset(const char *id, int reset_type) "%s reset type: %d" --=20 2.26.2 From nobody Fri Mar 29 01:11:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.208.51 as permitted sender) client-ip=209.85.208.51; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ed1-f51.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610476567; cv=none; d=zohomail.com; s=zohoarc; b=m2yzZJpBAVhWN4b7LTqIUEzz+an0OAuF3cvE/xkyBq+u08cxNBUvc+dr1qBlC3P28xPEqufFPNInSBqu1yxNpsqLlbMDS14zlxcSK9xN1uPPXwnWak3v2g18bRZcpSwaI9b9/9FPCds/LaVU9SaTrNCgqdtOjfBc+7lO/TNuxMI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610476567; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=R0MM0ZvXm81S3gxFhlsST007qT204dpEehr2O4ofqxQ=; b=byvBuqPBJ0+vGWHHbNFodJowSgwCt5slnN8Fxs5MUO8DIP3tvTStcZhgY2KiUtW8LsWz48/0pj7MkuA+4tE1MnavR+NYeNutMds14wurCw/SLHGLMrEm41LrAmySL/sbxALOS98MsEpjjxseeXc5Nmquufak/G1g9kZEzG3K6RM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by mx.zohomail.com with SMTPS id 1610476567386556.8815182486809; Tue, 12 Jan 2021 10:36:07 -0800 (PST) Received: by mail-ed1-f51.google.com with SMTP id v26so3418097eds.13 for ; Tue, 12 Jan 2021 10:36:06 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (190.red-83-57-173.dynamicip.rima-tde.net. [83.57.173.190]) by smtp.gmail.com with ESMTPSA id bo20sm1862004edb.1.2021.01.12.10.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 10:36:04 -0800 (PST) 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=R0MM0ZvXm81S3gxFhlsST007qT204dpEehr2O4ofqxQ=; b=KjFZd81utKeR/XF08XMBeTVS9v7vUehzuq1k00/ZDOdHUVHbexNITTyQzD8t9rnSLI RU3252frLzqIYQB3voniiNW+NJfI7NA+68e3c+ZcpPtOaPF1ZIZmJnFc5EreipzHs0KN AS3PvI/ukfRcgkE9gWQrBOQxMVr0+QCOJq295MUREv8TEqcc8FeKat9gvYfYffg+jmW8 t/sBZJ6GcEvlTZlr2J34IO1VJ+OwAoxpGa2MKlHTfGy5nngPsbyBncpSzC/qZnm4BlUr 9fWVahkQ+b3s2mPXWn8Ck5TNSd8IP4euMjv8w47TNvIkKtPUTWWALx2fTOvk1jftc3TY tA8A== 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=R0MM0ZvXm81S3gxFhlsST007qT204dpEehr2O4ofqxQ=; b=JFc6+j5gb53K9/wy8GJLuiiTm91YcWt84+FiAaLVYDRTVShI8hoMciTbL/Ix0UpIZH H7c+m5eCJedL/WHL2i0UAo726NxL3lC/dtrWFWYrqKBwIfVN8HFzXi3lCmdUgS2AYlV8 RPL2Yb+5AaTiX6QXa+kiRd6dE4QshMj4qZuSsVzLj19B2m2m9GE1Zd6cwa730Jss1dc3 TLLejTZgq19gL3aYeYArlHrzISZ+MnCggtVleUxOd7bKftXggPta+VpWIkE0C7tPTysv Jba/ctWDlHoXMjIBxEaZWnEtLrj4+0kl4+TCVEM697WpxLup7NjuSNDa/kCyrxD8nWDp JP5A== X-Gm-Message-State: AOAM531BRNkTGMPSbsr+dpcc5Dklk5cd6E6SZsDS5pVZ2b5BpO6YCPZx rVFSVC7+7LAu2lR/JOKBr0g= X-Google-Smtp-Source: ABdhPJx3CqJDao2pbNTliZ/mlAU1Sgl2f2xIQ2UdeyLer7cPCC4f/IRYkdl/W7uAQA+9WD6KPU/pcA== X-Received: by 2002:a50:8a90:: with SMTP id j16mr364550edj.334.1610476565506; Tue, 12 Jan 2021 10:36:05 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bin Meng , qemu-devel@nongnu.org, Bin Meng Cc: qemu-arm@nongnu.org, Jean-Christophe Dubois , Peter Maydell , Alistair Francis , Peter Chubb , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH v6 04/11] hw/ssi: imx_spi: Reduce 'change_mask' variable scope Date: Tue, 12 Jan 2021 19:35:22 +0100 Message-Id: <20210112183529.2011863-5-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210112183529.2011863-1-f4bug@amsat.org> References: <20210112183529.2011863-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/ssi/imx_spi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c index 35ab33c0511..bcc535f2893 100644 --- a/hw/ssi/imx_spi.c +++ b/hw/ssi/imx_spi.c @@ -303,7 +303,6 @@ static void imx_spi_write(void *opaque, hwaddr offset, = uint64_t value, { IMXSPIState *s =3D opaque; uint32_t index =3D offset >> 2; - uint32_t change_mask; =20 if (index >=3D ECSPI_MAX) { qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Bad register at offset 0x%" @@ -313,7 +312,6 @@ static void imx_spi_write(void *opaque, hwaddr offset, = uint64_t value, =20 trace_imx_spi_write(index, imx_spi_reg_name(index), value); =20 - change_mask =3D s->regs[index] ^ value; =20 switch (index) { case ECSPI_RXDATA: @@ -357,6 +355,7 @@ static void imx_spi_write(void *opaque, hwaddr offset, = uint64_t value, } =20 if (imx_spi_channel_is_master(s)) { + uint32_t change_mask =3D s->regs[index] ^ value; int i; =20 /* We are in master mode */ --=20 2.26.2 From nobody Fri Mar 29 01:11:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.48 as permitted sender) client-ip=209.85.218.48; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f48.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610476572; cv=none; d=zohomail.com; s=zohoarc; b=H5lYPBwd/aXIT+3mloDcU3Hw/NhsnGRyAlktrYHg8vZt4Zi9F4WSG0tBu1S+SP+IFqVk50vJ9l1ZFSFx9jH4fX+AXyUmbwk6h6R2/G5dg1R9jjBYIob9+zUx6g/rCBdZbAUwEPxsYEQbY41jdOd+gnFZfJX6wPWfmqppDB11pBw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610476572; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sTf/aemsAO2NtfPs8v4zrOflI4yUb4IKKFkIlDtQdrA=; b=Ct7JnuRB+/oty47lMgN8t82pFgzIqUkeW273wsG7VJTt27QWoK4z+TTsidQli6lI5ZzNbFKlw6+M2OJrOgankAEHtOrhLj58CzXsUuiA6dEF4Lip1CA3ZHdJ3s9EBqktO+gxRN/JbTt1Cg3x0GA+gZhENRzQYJT9cni7K9IOhlo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by mx.zohomail.com with SMTPS id 1610476572910242.20792115808229; Tue, 12 Jan 2021 10:36:12 -0800 (PST) Received: by mail-ej1-f48.google.com with SMTP id ga15so4946583ejb.4 for ; Tue, 12 Jan 2021 10:36:12 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (190.red-83-57-173.dynamicip.rima-tde.net. [83.57.173.190]) by smtp.gmail.com with ESMTPSA id d8sm1823526edm.75.2021.01.12.10.36.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 10:36:10 -0800 (PST) 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=sTf/aemsAO2NtfPs8v4zrOflI4yUb4IKKFkIlDtQdrA=; b=nt3Sr93wmoNyIKcCz30xibARHh/Rs7H3fHH6D446KnXhwTyWIkulJq7KfkrYodKvru aXDJt50D9ItyavdSgWtYPl7yFpSNv2eF7V/MuiMFrZwZZkOPbndH9iryksotchCc+8F/ TOEbXjMKvj45tc74hvq5C1imH7Q9FJFvFzBTXtnFEgMk0TMOxXQGHQHDjOK6XvGEodVd 8BuSpizxXUtxillHfEMKT5BmMdhEmCGeoP0pVo0AMXBL+/vaqJy9gCJStJ9fgfODvBBk NgpIAB00M16eVPPiKuFDFGYCuPLCQx1t4945XaqZtfKyVMm4rBvnUmIX/+Zkfpo1Nwnc Kk3Q== 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=sTf/aemsAO2NtfPs8v4zrOflI4yUb4IKKFkIlDtQdrA=; b=soztoOInxgC31Ra++KK6teZquizbo4pkQajH+yCRMKoU4wSxlHWApgIzvYB9C3n5ij Iz/lo6SyH12mrDsq10QLceBK+5UK0hXYBRGAiNXbD/pT0cm9u6Z5aGoco2uyeMCGgkIp aY1nDHcTLdGh1GGI+W2pgHYX5sjRPBwOb0LgvWE2WSXEd3xYzUIjq2zkpQu9cU/8xGSQ 4a8rKdN3UK/SsXneS2965Z88WXumR86kHmUwUlDdpOVc3PkQAXdbXFeHp3gwGUiYlSrV jbPtLtS/tdVeCoJ00AwkjlLvzWqK45u/ma42xf0zERAb+33BxxYF01qVVtQ8GTfJurHd Q0JQ== X-Gm-Message-State: AOAM531qGsZveOjjhLNmVEsNa5fCFT7tKl68EDzHnrhHZWYbkX4BwjK8 1YG3BIrzAFVxY5Q6O9WgUro= X-Google-Smtp-Source: ABdhPJyTLFYq815QTQiMct9wfSoFn3sulj1+mU2xMypZG7hgK72rzLWTWoiZ7LNFLtGEt9U8PIJUPw== X-Received: by 2002:a17:907:206a:: with SMTP id qp10mr124370ejb.432.1610476571090; Tue, 12 Jan 2021 10:36:11 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bin Meng , qemu-devel@nongnu.org, Bin Meng Cc: qemu-arm@nongnu.org, Jean-Christophe Dubois , Peter Maydell , Alistair Francis , Peter Chubb , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH v6 05/11] hw/ssi: imx_spi: Rework imx_spi_reset() to keep CONREG register value Date: Tue, 12 Jan 2021 19:35:23 +0100 Message-Id: <20210112183529.2011863-6-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210112183529.2011863-1-f4bug@amsat.org> References: <20210112183529.2011863-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) When the block is disabled, all registers are reset with the exception of the ECSPI_CONREG. It is initialized to zero when the instance is created. Ref: i.MX 6DQ Applications Processor Reference Manual (IMX6DQRM), chapter 21.7.3: Control Register (ECSPIx_CONREG) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Juan Quintela --- hw/ssi/imx_spi.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c index bcc535f2893..96aecc8fa28 100644 --- a/hw/ssi/imx_spi.c +++ b/hw/ssi/imx_spi.c @@ -232,12 +232,23 @@ static void imx_spi_flush_txfifo(IMXSPIState *s) static void imx_spi_reset(DeviceState *dev) { IMXSPIState *s =3D IMX_SPI(dev); + unsigned i; =20 trace_imx_spi_reset(); =20 - memset(s->regs, 0, sizeof(s->regs)); - - s->regs[ECSPI_STATREG] =3D 0x00000003; + for (i =3D 0; i < ARRAY_SIZE(s->regs); i++) { + switch (i) { + case ECSPI_CONREG: + /* CONREG is not updated on reset */ + break; + case ECSPI_STATREG: + s->regs[i] =3D 0x00000003; + break; + default: + s->regs[i] =3D 0; + break; + } + } =20 imx_spi_rxfifo_reset(s); imx_spi_txfifo_reset(s); --=20 2.26.2 From nobody Fri Mar 29 01:11:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.208.48 as permitted sender) client-ip=209.85.208.48; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ed1-f48.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610476578; cv=none; d=zohomail.com; s=zohoarc; b=WOreI6XvYf1waGQ1lvDP9/SP79Illc9ewbA8qNCX62Bc4aKYDdzfQG5DhHbBFxi7WZK1qqOOwkxFnHEyEZdxg5k1AznzBzsYik/nZIRmp9daCBmnZ82Zf2ffupNZnmmwF5ntTcn/nUv3jvoCPMP/U5VUlV/EoL84VwzsU5AwGGg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610476578; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=s5mgKFMjtxL8UOIPFrajTKd7ASiN1mJ6g35FLNPKpAg=; b=fKNg+Yj+vimyOc1PQs3LG36eHzN2PAgtFvHrVKTA1UW55LpcvtWysKMGOsXVatGO2raYpN+/cVVtgdkVbJV9EDJuVI1W8wiITWIJnjzztFXUMKrSa6Kcwglm7mMjg0sT5wfSaFQHztimwSbrDNrb9ryE6daN1+NjwTNrJZuYN4A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by mx.zohomail.com with SMTPS id 1610476578612103.64089971197052; Tue, 12 Jan 2021 10:36:18 -0800 (PST) Received: by mail-ed1-f48.google.com with SMTP id h16so3453270edt.7 for ; Tue, 12 Jan 2021 10:36:18 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (190.red-83-57-173.dynamicip.rima-tde.net. [83.57.173.190]) by smtp.gmail.com with ESMTPSA id j9sm1801373eds.66.2021.01.12.10.36.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 10:36:16 -0800 (PST) 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=s5mgKFMjtxL8UOIPFrajTKd7ASiN1mJ6g35FLNPKpAg=; b=APEjyaBzm/Du1d/Ys5l2VuIvlSxTisLqbzBMDlXcYC/JYhgqGXvmketuAr9kV2yaK+ LUCSHVoMmdD8itt2tRm0Ws9w6PUvVszR6gFABsvuhAZ0NV3YJeK0VOKkwRA/YAQpInAn L8EgFn10Q7FP1TJzVIfU+j7OWy7k1IJF97B9sQOCSoCPDBDGQ7UuTHuky7avtHvEnI4J ZfvV/2Xk21tvefzXWJ3fI3Q5LJInvAs/h4z3x8Ii3XIQyuFcWA+05V0PI8HSzbROcTFu z7lo7G+7KNY6aiEM18l3OnvtU8gcX+Jth4Q8olBJvjMfWPsMavzd+t1nm6V2+sl8bq48 JW/Q== 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=s5mgKFMjtxL8UOIPFrajTKd7ASiN1mJ6g35FLNPKpAg=; b=TwNJcRQV6uifFjQAWGf96IPfgix/2wJ5Dy+h412ilaPuLTDYEbsMxA8qeT5komseue DUD+wSEGUKCRRHpsrHtWiYtWz/2p7ItM5LaNp3IHmrUBoLnvFNBGEgm4tH1TMzuTwWkp nwdmnVS+ddiI+Arl5bkSYtC0vYNHI7C7NW1b45Dk52xV47h4oZtYd0MW1wrmdxDFNCIJ BGj+l+rJsWmCEit5wVhgupmh22vlx15vrg6bsAnoCNr38kQ/y+kw5NhueLrxevgELA6B xPueFYtEvjWgaoQhYoZvGDQzyAKreYni9xOBOLixs3V2xgnO79EgEkXzhCTadt9GoQyp 6UsQ== X-Gm-Message-State: AOAM532UMYfH5eArHR4yExCgQNjxfdMO5IfKZ+HjHh45Iu0CHuDIszAv +yO1Qluvyr/LCUY4ecDKln8= X-Google-Smtp-Source: ABdhPJwkjhG+m1UD4DrA6ECTXBpnxlTrl3X3ceYmb4EKbWvuQJLDMsFTmrgQEqnuto2LXLKicYFZ5w== X-Received: by 2002:a50:d80c:: with SMTP id o12mr364538edj.338.1610476576862; Tue, 12 Jan 2021 10:36:16 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bin Meng , qemu-devel@nongnu.org, Bin Meng Cc: qemu-arm@nongnu.org, Jean-Christophe Dubois , Peter Maydell , Alistair Francis , Peter Chubb , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH v6 06/11] hw/ssi: imx_spi: Rework imx_spi_read() to handle block disabled Date: Tue, 12 Jan 2021 19:35:24 +0100 Message-Id: <20210112183529.2011863-7-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210112183529.2011863-1-f4bug@amsat.org> References: <20210112183529.2011863-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) When the block is disabled, it stay it is 'internal reset logic' (internal clocks are gated off). Reading any register returns its reset value. Only update this value if the device is enabled. Ref: i.MX 6DQ Applications Processor Reference Manual (IMX6DQRM), chapter 21.7.3: Control Register (ECSPIx_CONREG) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Juan Quintela --- hw/ssi/imx_spi.c | 60 +++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c index 96aecc8fa28..7ac9da0f1d2 100644 --- a/hw/ssi/imx_spi.c +++ b/hw/ssi/imx_spi.c @@ -270,42 +270,40 @@ static uint64_t imx_spi_read(void *opaque, hwaddr off= set, unsigned size) return 0; } =20 - switch (index) { - case ECSPI_RXDATA: - if (!imx_spi_is_enabled(s)) { - value =3D 0; - } else if (fifo32_is_empty(&s->rx_fifo)) { - /* value is undefined */ - value =3D 0xdeadbeef; - } else { - /* read from the RX FIFO */ - value =3D fifo32_pop(&s->rx_fifo); + value =3D s->regs[index]; + + if (imx_spi_is_enabled(s)) { + switch (index) { + case ECSPI_RXDATA: + if (fifo32_is_empty(&s->rx_fifo)) { + /* value is undefined */ + value =3D 0xdeadbeef; + } else { + /* read from the RX FIFO */ + value =3D fifo32_pop(&s->rx_fifo); + } + break; + case ECSPI_TXDATA: + qemu_log_mask(LOG_GUEST_ERROR, + "[%s]%s: Trying to read from TX FIFO\n", + TYPE_IMX_SPI, __func__); + + /* Reading from TXDATA gives 0 */ + break; + case ECSPI_MSGDATA: + qemu_log_mask(LOG_GUEST_ERROR, + "[%s]%s: Trying to read from MSG FIFO\n", + TYPE_IMX_SPI, __func__); + /* Reading from MSGDATA gives 0 */ + break; + default: + break; } =20 - break; - case ECSPI_TXDATA: - qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Trying to read from TX FIF= O\n", - TYPE_IMX_SPI, __func__); - - /* Reading from TXDATA gives 0 */ - - break; - case ECSPI_MSGDATA: - qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Trying to read from MSG FI= FO\n", - TYPE_IMX_SPI, __func__); - - /* Reading from MSGDATA gives 0 */ - - break; - default: - value =3D s->regs[index]; - break; + imx_spi_update_irq(s); } - trace_imx_spi_read(index, imx_spi_reg_name(index), value); =20 - imx_spi_update_irq(s); - return (uint64_t)value; } =20 --=20 2.26.2 From nobody Fri Mar 29 01:11:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.47 as permitted sender) client-ip=209.85.218.47; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f47.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610476584; cv=none; d=zohomail.com; s=zohoarc; b=Y3sKrWkasxbsTEVsWdty4tAc0liEc1nJ6JT6mZsCv0BA9nhcWX1KVf0V94JZ2A6tt7SrOjIK7v8OXhv4xKYrE4aAbQ+gVvoIytKZQDkLe+8jP7Utzq8r94CWgNX4c/kmDtYdUohPn1v5K11xWAB5DWiyLaXs3QHgefZJ6svHnfY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610476584; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UUrqq49b0H8vT1YH+cv+uaCjRkYF+aPQPM0uhg4pceE=; b=ZoThmknugmijMJe3OS6VFgTF9We3L2SiviHEFb28eTKOUyEx6APtsPgzU0qiwx69EECkc5h2n/KUCbRKagqTCM+tyhpZZI4x3t09SodC9zDQrSGZWTmKiak1Vfs/cRKn0lbNkC5YD5aCv118SI9FYls1ELSr+cTY+2zdAuIpxFg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by mx.zohomail.com with SMTPS id 1610476584337421.60148768963984; Tue, 12 Jan 2021 10:36:24 -0800 (PST) Received: by mail-ej1-f47.google.com with SMTP id g20so4969397ejb.1 for ; Tue, 12 Jan 2021 10:36:23 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (190.red-83-57-173.dynamicip.rima-tde.net. [83.57.173.190]) by smtp.gmail.com with ESMTPSA id r21sm1779423eds.91.2021.01.12.10.36.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 10:36:21 -0800 (PST) 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=UUrqq49b0H8vT1YH+cv+uaCjRkYF+aPQPM0uhg4pceE=; b=EJJMRxbbJxh8UJwD7/C898SYLP5gBXoO4/wgs1dvDaZnTWJuXj2ATH9mQEW4gy7pAW EsE4BG1osS3BWvEDnKmmVpsJlm5PkjrhCkD8pNTcHfG8MpleSoWlNBrG7/fYEuuOkayV p5CGVDXtiB/MWb0JF2hkkau8XqI7lTFAc+TyMJJ5Fwv2XPOR6Skpt3o41isDM7Xt2ztt Egkchq+1lLr1RLF+K7HD/ajsyudnSufvwgtHHm8CqrvXh+r8DgkZ0UdL46srdnOj49lg HHPsdVpRc3tNSz5doC4fHaFD51nIVYrlYbXMJEoM8kWt/Diroi3njSvErLYqO1/0y2iO kujg== 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=UUrqq49b0H8vT1YH+cv+uaCjRkYF+aPQPM0uhg4pceE=; b=kk0ixTsitQNrZgcvvG//eTSG6+PJ35pcNhyb5UzFW6hVLhyC7Rtc7hBLmZr5EHuipb PSGStc1BoG54V87v3QF4vJU09GiF7WSCK/DHMk9vaQERMf7yAXioCJJz0cbmpEAjXDu0 BBR6I66whNDZIsglSiuukQ5DjOsET5gTEIrwCfwpd+F6MYE+Su32FFJxaCGWMbkEdXpb jLe/D5jhQ0u80gz+MOT4ALZLsxh7QrSmK4TDOX9KnRUjCiNcSvUyZ0rmtO4FRgs1TQdl 2MWiYcf+7N8M4U1Kk6wnXp3dGc6ff7faPP9TC5ktdgo0bChEfDzg1AF2g+FwW+Oi7GA/ hAew== X-Gm-Message-State: AOAM5321QUQJZAHFX1t576QnH7Xq5ENnzbAor7msiH98H0kjHdC7dKBS P06vtbcuHpjs6eyYRIjzx/A= X-Google-Smtp-Source: ABdhPJznm2QYUQ6cpnSpv5X4F2y1tDvJrjYXJC9L5neUa8ZZ7s69gJ6ar8bMbCxEjjQ9D4bPIfPhWA== X-Received: by 2002:a17:906:878d:: with SMTP id za13mr98547ejb.395.1610476582574; Tue, 12 Jan 2021 10:36:22 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bin Meng , qemu-devel@nongnu.org, Bin Meng Cc: qemu-arm@nongnu.org, Jean-Christophe Dubois , Peter Maydell , Alistair Francis , Peter Chubb , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH v6 07/11] hw/ssi: imx_spi: Rework imx_spi_write() to handle block disabled Date: Tue, 12 Jan 2021 19:35:25 +0100 Message-Id: <20210112183529.2011863-8-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210112183529.2011863-1-f4bug@amsat.org> References: <20210112183529.2011863-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) When the block is disabled, only the ECSPI_CONREG register can be modified. Setting the EN bit enabled the device, clearing it "disables the block and resets the internal logic with the exception of the ECSPI_CONREG" register. Move the imx_spi_is_enabled() check earlier. Ref: i.MX 6DQ Applications Processor Reference Manual (IMX6DQRM), chapter 21.7.3: Control Register (ECSPIx_CONREG) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/ssi/imx_spi.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c index 7ac9da0f1d2..801daa5cbfa 100644 --- a/hw/ssi/imx_spi.c +++ b/hw/ssi/imx_spi.c @@ -321,6 +321,20 @@ static void imx_spi_write(void *opaque, hwaddr offset,= uint64_t value, =20 trace_imx_spi_write(index, imx_spi_reg_name(index), value); =20 + if (!imx_spi_is_enabled(s)) { + /* Block is disabled */ + if (index !=3D ECSPI_CONREG) { + /* Ignore access */ + return; + } + s->regs[ECSPI_CONREG] =3D value; + if (value & ECSPI_CONREG_EN) { + /* Keep disabled */ + return; + } + /* Enable the block */ + imx_spi_reset(DEVICE(s)); + } =20 switch (index) { case ECSPI_RXDATA: @@ -328,10 +342,7 @@ static void imx_spi_write(void *opaque, hwaddr offset,= uint64_t value, TYPE_IMX_SPI, __func__); break; case ECSPI_TXDATA: - if (!imx_spi_is_enabled(s)) { - /* Ignore writes if device is disabled */ - break; - } else if (fifo32_is_full(&s->tx_fifo)) { + if (fifo32_is_full(&s->tx_fifo)) { /* Ignore writes if queue is full */ break; } @@ -357,12 +368,6 @@ static void imx_spi_write(void *opaque, hwaddr offset,= uint64_t value, case ECSPI_CONREG: s->regs[ECSPI_CONREG] =3D value; =20 - if (!imx_spi_is_enabled(s)) { - /* device is disabled, so this is a reset */ - imx_spi_reset(DEVICE(s)); - return; - } - if (imx_spi_channel_is_master(s)) { uint32_t change_mask =3D s->regs[index] ^ value; int i; --=20 2.26.2 From nobody Fri Mar 29 01:11:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.46 as permitted sender) client-ip=209.85.218.46; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f46.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1610476590; cv=none; d=zohomail.com; s=zohoarc; b=D0B6LP1eOQhsrpoTFr/R6xP8MQw1hVBvRYNVeTp3l4ecmq81hvOz8XLRrQLr4vz2i2rREvClKAv6uQYIOorzabv7S1Evwu3bfIf2+L3z6t/rVCAt3sPR1YDg+rcgmtBnlSe7EOn0re2BT/vgAO3Rgktyc9Iv0vpLvXm986miXXM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610476590; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3oL8bC8x9VFwiA/xc6ZokDU2TIJ+D0ZdajpMhJAtRjE=; b=VZ6tj6VWFxLeM7Et4I/XMz0jEw1gSSUz7aBY7egVfZOkmzXjyKW/QqdAiupZ4sdF7qWnk/1AXwCasn0FnDqVbzL+AYpws2VpKMCbpnEd1d1aSd6doxb1fR9D0E49l4IodtgORzVbktXL7j2sRKzIiVBroI9d6SVLiB/rFU8aZqQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by mx.zohomail.com with SMTPS id 1610476590038907.3285838534424; Tue, 12 Jan 2021 10:36:30 -0800 (PST) Received: by mail-ej1-f46.google.com with SMTP id n26so4918655eju.6 for ; Tue, 12 Jan 2021 10:36:29 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (190.red-83-57-173.dynamicip.rima-tde.net. [83.57.173.190]) by smtp.gmail.com with ESMTPSA id k15sm1503481ejc.79.2021.01.12.10.36.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 10:36:27 -0800 (PST) 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=3oL8bC8x9VFwiA/xc6ZokDU2TIJ+D0ZdajpMhJAtRjE=; b=pzLiDzMgO2qqe2xY1cGknoalgMmhRxSV1G3RrQhEbCujzyXMOPbxqRLBBZh8ioK+QC JSOBJWrEv+/WfBDGtrj1o1uuMDav0IQXvK7K21u4+v2oY0ZivsHgnRik7wkYZsWRzazS AdWAY7UqPK2MnePUxrTKaZUP99Fhc1XAvhzraM52iOTf85rv9T2a0WlKugOgfoK2AGnO MEt/uV9mlP0iyoS0pLf/uf5qVldhU+eNCHg4khq7OuA6dddSVlDGrbm/pHqL3od20eY1 Dt4hKixGQrE9LYy/JTomthxBKyfCQ00mwDxYDtpU8NbRXfrNWuGkTYg4QfZriqo8VWXJ J6Lw== 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=3oL8bC8x9VFwiA/xc6ZokDU2TIJ+D0ZdajpMhJAtRjE=; b=m9yU3LWc4fntflhj3dUPrYETB6EuEFfyM5YsAkEi5pU4inKyhuFm8HZtdFRRwbnzUK pu8EUqpUNHdf68ZM9o3A8IHLhKzN8KAc7ZOcSzGtmFFynFxzpVQ2a86GqpVr8uoXdT++ NCc8MtlkR4VABMfB3VOSSY9XFAdrLt32Enz3fp1nCTdNIjebXZvOWlOxvIM3bnxbCa4V YY4VHglP0cfgGUx+40aOW+txWENoRYWeD4LCvcNgR9F4EO8NcUuzBn21ra/LRuFu8loI HsO+SYiyk4iw2MMw7fVASnHo8s2IMrZVzqBa3rzNOu+AAoQz8nhD6B44Wg/zQy4dyItC xQxA== X-Gm-Message-State: AOAM531wv83TnZNMEFOdALKgJIPaObfXRv/Vh4JBx1GbFpHbBNpeyZyd kB7Ts1gdEE0LNnBflC5nhLbmCjWpqYM= X-Google-Smtp-Source: ABdhPJzNVjPNHTWfdTDu4WsmxLITpifXl/wpM6+l3N1UEWB9deJNBPNSw+YabAM7dHGcuTVg3j30VQ== X-Received: by 2002:a17:906:90d6:: with SMTP id v22mr139279ejw.88.1610476588169; Tue, 12 Jan 2021 10:36:28 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bin Meng , qemu-devel@nongnu.org, Bin Meng Cc: qemu-arm@nongnu.org, Jean-Christophe Dubois , Peter Maydell , Alistair Francis , Peter Chubb , Xuzhou Cheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH v6 08/11] hw/ssi: imx_spi: Disable chip selects when controller is disabled Date: Tue, 12 Jan 2021 19:35:26 +0100 Message-Id: <20210112183529.2011863-9-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210112183529.2011863-1-f4bug@amsat.org> References: <20210112183529.2011863-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) From: Xuzhou Cheng When a write to ECSPI_CONREG register to disable the SPI controller, imx_spi_reset() is called to reset the controller, but chip select lines should have been disabled, otherwise the state machine of any devices (e.g.: SPI flashes) connected to the SPI master is stuck to its last state and responds incorrectly to any follow-up commands. Fixes: c906a3a01582 ("i.MX: Add the Freescale SPI Controller") Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210112145526.31095-4-bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/ssi/imx_spi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c index 801daa5cbfa..2f9e800dd3a 100644 --- a/hw/ssi/imx_spi.c +++ b/hw/ssi/imx_spi.c @@ -255,6 +255,10 @@ static void imx_spi_reset(DeviceState *dev) =20 imx_spi_update_irq(s); =20 + for (i =3D 0; i < ECSPI_NUM_CS; i++) { + qemu_set_irq(s->cs_lines[i], 1); + } + s->burst_length =3D 0; } =20 --=20 2.26.2 From nobody Fri Mar 29 01:11:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.49 as permitted sender) client-ip=209.85.218.49; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f49.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610476595; cv=none; d=zohomail.com; s=zohoarc; b=EaWF7vfWYiXueLfIxt8yaAkpgUv/NfkAWTcFkYl70uhcH1CMLoxLCGhgFcsEPE4uSWKol8pLY5z1SNCq1p5sZ9cmdacwP6JF8vrQ6BCNLgNIiqJ7RRvBCs3lkoGiBJdMi9cIyqx/th4Olx8kEBSYHEtpq49kjzTFcRikJ8nzaSg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610476595; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=URPw2976JZr7XRKyhMiAKOdcNTBQU8VnrnQ2GFeuE/U=; b=U7DIHvNgTGVXhE20rHk41KHvodOFHAwaXdnKS5gi/Qlvmpbb47yrieM+gMKbvwQ7hBfEW294XJAH5Jwhdr2d4Z5vUPTiCfSZSjp7I3QmoG6RSZsqvzSDKHwmkLHS85SyCCPPNB7dbNHEkiPCtuFyF5YG1fZVIamWwLZ9JDpBWa8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by mx.zohomail.com with SMTPS id 161047659587824.922185286575882; Tue, 12 Jan 2021 10:36:35 -0800 (PST) Received: by mail-ej1-f49.google.com with SMTP id lt17so4963148ejb.3 for ; Tue, 12 Jan 2021 10:36:35 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (190.red-83-57-173.dynamicip.rima-tde.net. [83.57.173.190]) by smtp.gmail.com with ESMTPSA id k2sm1516490ejp.6.2021.01.12.10.36.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 10:36:33 -0800 (PST) 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=URPw2976JZr7XRKyhMiAKOdcNTBQU8VnrnQ2GFeuE/U=; b=l20l7gwWIKPn32PIaaF39Dntbr9gVgUYcerX5b/rTYZA7TyEvIP8nd7HeayFeQK3ut uSpCBts9Krux9jifdRQf1QkakzQnlPS+kaCnIXyJD1M8islpFIJquKX+FaJzEbU13TrO WXb6rNpWZikweRuVb0O9R7GP2Sh5XUn98RmcBMHk8tpygi5E63ytZelumOVZsrCLx4F7 qR471FnxLEEhKy1b8mFjbll+c7yfIay1OmnLuxN8mQ9g5bJbOY7Yee06O1/3qonWxTIU YF053G4+farbNVdkrGKWKpatA1keGPDKMgZAC6GfkocEVaXfIKjdAAhgOtC6K4G2Tww1 2rZw== 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=URPw2976JZr7XRKyhMiAKOdcNTBQU8VnrnQ2GFeuE/U=; b=fHRQ6xC+WMDZofMPdiO/tlBYEIEH0qyOYvFkAZiPMx9iDiJcH+6gSm9g3QDxXHLE97 CV4B2VcmUc2SemMG/zMKFudizyMgdKxV6trR4kuCcf/nLpYiXKeUg775gY9LIMLX6V8Z gbtfXsPUe5p0PPJPK2dG6Ja3JB4RxMgPOeMVUQdmHHBhOBJpK8mXb6dpYYzdVVN2Pqkq omnSyWw+gTSqDJvVTbxaMsiY4FRr4p2cZHj53pLu7gqx5UGnh6YdljqvCFphtmTMQYCy pAmQq/6XdCsl/bcD4Pj8iyQLi0bKx6MovXFWLK/frEmw/fAsWrpPEw0s8sVwGGLqyjjt fsUA== X-Gm-Message-State: AOAM530UR7iV4MvLqdH4sZsBSp/qdvTscsCjS25ANeTXYY8+tXWpwmnO 0fLDFwyfRQ7ZKFW4UJTBPt4= X-Google-Smtp-Source: ABdhPJxVs7D+TeVRgmikig04ysNfEvpjXa9GxFu9bq1Fp9EL34h+nql5Lmf/X1Qb7jol/+mc9emwkg== X-Received: by 2002:a17:906:d8a1:: with SMTP id qc1mr125349ejb.294.1610476594097; Tue, 12 Jan 2021 10:36:34 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bin Meng , qemu-devel@nongnu.org, Bin Meng Cc: qemu-arm@nongnu.org, Jean-Christophe Dubois , Peter Maydell , Alistair Francis , Peter Chubb , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH v6 09/11] hw/ssi: imx_spi: Round up the burst length to be multiple of 8 Date: Tue, 12 Jan 2021 19:35:27 +0100 Message-Id: <20210112183529.2011863-10-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210112183529.2011863-1-f4bug@amsat.org> References: <20210112183529.2011863-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) From: Bin Meng Current implementation of the imx spi controller expects the burst length to be multiple of 8, which is the most common use case. In case the burst length is not what we expect, log it to give user a chance to notice it, and round it up to be multiple of 8. Signed-off-by: Bin Meng Message-Id: <20210112145526.31095-5-bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/ssi/imx_spi.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c index 2f9e800dd3a..638959daa08 100644 --- a/hw/ssi/imx_spi.c +++ b/hw/ssi/imx_spi.c @@ -129,7 +129,20 @@ static uint8_t imx_spi_selected_channel(IMXSPIState *s) =20 static uint32_t imx_spi_burst_length(IMXSPIState *s) { - return EXTRACT(s->regs[ECSPI_CONREG], ECSPI_CONREG_BURST_LENGTH) + 1; + uint32_t burst; + + burst =3D EXTRACT(s->regs[ECSPI_CONREG], ECSPI_CONREG_BURST_LENGTH) + = 1; + if (burst % 8) { + qemu_log_mask(LOG_UNIMP, + "[%s]%s: burst length (%d) not multiple of 8!\n", + TYPE_IMX_SPI, __func__, burst); + burst =3D ROUND_UP(burst, 8); + qemu_log_mask(LOG_UNIMP, + "[%s]%s: burst length rounded up to %d; this may not= work.\n", + TYPE_IMX_SPI, __func__, burst); + } + + return burst; } =20 static bool imx_spi_is_enabled(IMXSPIState *s) --=20 2.26.2 From nobody Fri Mar 29 01:11:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.208.46 as permitted sender) client-ip=209.85.208.46; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ed1-f46.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610476601; cv=none; d=zohomail.com; s=zohoarc; b=kWm1XdAqtbAcWM/a5lrnoDft69p1w3H/RV5t74ED+IXVE5hr0nR84Shg4ItA6bgTOMgbtGm5LbgSGnuYuPHi8b5D6GqK2Vwq6X8IBgi24VGHy2y5ziibsNSFLcnRtK6eO8qOErhoNm2aJ4pFf1IYfV8wAO3SWZnSSPunie8cHMI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610476601; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xLLdvkIJe1l73eWOGFy35bKaZgGosmrQIeGMAiRhIRc=; b=E3w7i7vJnlMP/w1CsILGwSrUQYenInQB9t39NtS5u7wOcqlZ7dFvANZzpMygZM7ykh/UVZlnvGO3JDkcgqZH1CkRdvCU26PrIpkCdjCbUsyNVqOxwnUXbqjkreGEEYG9mF0UkpWKB+jLVzxNv6y4v5bZX/s48PpHZtTpHMW1Qhs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by mx.zohomail.com with SMTPS id 161047660171679.41772546874665; Tue, 12 Jan 2021 10:36:41 -0800 (PST) Received: by mail-ed1-f46.google.com with SMTP id dk8so3488043edb.1 for ; Tue, 12 Jan 2021 10:36:41 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (190.red-83-57-173.dynamicip.rima-tde.net. [83.57.173.190]) by smtp.gmail.com with ESMTPSA id x20sm1517322ejv.66.2021.01.12.10.36.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 10:36:39 -0800 (PST) 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=xLLdvkIJe1l73eWOGFy35bKaZgGosmrQIeGMAiRhIRc=; b=GGdNkTjdD2SqUviwqnZEDqQkbcZq129V6FUHz6H1xgq8nZGAWREXGKd6RgQi5DoR3J pUGB0xdlbTctnsCfWeWpFuvl/7NFfHFOeVaHRVd5s322a7WN1zHZfMQmPJJjeJJLTFgA 74aZXkOrwvGpir5QiDW2Or2mLKmEloFYg/0z3KVMqXXhu3bZ/hO8mBlJp7LX/PAqTwLR awm6qogOKyv6w7up9vZ/VnOdX/hfex6EJEAuUMIG5b4IAPspKK3fD2V68VTSC4beSm4C nwBFDCIwtZTsfO0va8uwp76vkS8Ipwwm3V9pjZhwDGIM8K1JV6knoDDX1XJqveMDAXW3 4/Tw== 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=xLLdvkIJe1l73eWOGFy35bKaZgGosmrQIeGMAiRhIRc=; b=MaQKl0pNaYXgNrrWzqgWSGZqLtDCXwszKL+qFlWmANWDzyiC9/+fLPbrpYF7PL3opm JJBAcbE36FBPKDisCrZoxUlW3RJ7CP+w2MD3aMO0UkKpntLxhRaYsXpmbHvhdtb5fukb sObTp+uKDUYxZvVOdzBmXzFoYwm40TQoiubxEfHkMl24jz49Nl5ya9D2dG+tR/CirKfQ Amf1iw53T1I6UpsVRAlXLNJmTJv8mLmEuh0TiAYzZBH1XJ8ePtqBlpFe/02wLU8ZXkIi u4HXk8PZpjQuSiT4zfZOFjudCVYqpO0bbFREzhwXwe8pHtTz+cH725+IZ/gam0i/kZ+8 wOxg== X-Gm-Message-State: AOAM53258PYfAzo+JxYmhEecK+WIKnBPBmv0rU4GNXH5IsHITQERwgQM yZoS/E+cgqyvGivdEW4nUl4= X-Google-Smtp-Source: ABdhPJy9RrAi0h8sC/vPap5Yg4VTQNuty1PJc6i07aUmQo+7XHcYfVaZj/YxXT/KfMOdPgGpD0w36Q== X-Received: by 2002:a05:6402:31bb:: with SMTP id dj27mr356816edb.285.1610476599942; Tue, 12 Jan 2021 10:36:39 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bin Meng , qemu-devel@nongnu.org, Bin Meng Cc: qemu-arm@nongnu.org, Jean-Christophe Dubois , Peter Maydell , Alistair Francis , Peter Chubb , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH v6 10/11] hw/ssi: imx_spi: Correct the burst length > 32 bit transfer logic Date: Tue, 12 Jan 2021 19:35:28 +0100 Message-Id: <20210112183529.2011863-11-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210112183529.2011863-1-f4bug@amsat.org> References: <20210112183529.2011863-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) From: Bin Meng For the ECSPIx_CONREG register BURST_LENGTH field, the manual says: 0x020 A SPI burst contains the 1 LSB in first word and all 32 bits in secon= d word. 0x021 A SPI burst contains the 2 LSB in first word and all 32 bits in secon= d word. Current logic uses either s->burst_length or 32, whichever smaller, to determine how many bits it should read from the tx fifo each time. For example, for a 48 bit burst length, current logic transfers the first 32 bit from the first word in the tx fifo, followed by a 16 bit from the second word in the tx fifo, which is wrong. The correct logic should be: transfer the first 16 bit from the first word in the tx fifo, followed by a 32 bit from the second word in the tx fifo. With this change, SPI flash can be successfully probed by U-Boot on imx6 sabrelite board. =3D> sf probe SF: Detected sst25vf016b with page size 256 Bytes, erase size 4 KiB, tota= l 2 MiB Fixes: c906a3a01582 ("i.MX: Add the Freescale SPI Controller") Signed-off-by: Bin Meng Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210112145526.31095-6-bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/ssi/imx_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c index 638959daa08..c4e2d2e1c97 100644 --- a/hw/ssi/imx_spi.c +++ b/hw/ssi/imx_spi.c @@ -192,7 +192,7 @@ static void imx_spi_flush_txfifo(IMXSPIState *s) =20 DPRINTF("data tx:0x%08x\n", tx); =20 - tx_burst =3D MIN(s->burst_length, 32); + tx_burst =3D (s->burst_length % 32) ? : 32; =20 rx =3D 0; =20 --=20 2.26.2 From nobody Fri Mar 29 01:11:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.208.54 as permitted sender) client-ip=209.85.208.54; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ed1-f54.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610476607; cv=none; d=zohomail.com; s=zohoarc; b=YWcCbKykfMQij4A/cJBm/OJLIdhgO+M6SkaBr8h3gcSQI+YG29gZ9oGfBiND1xnyRBziOVn6kHxM7/Z3cffidmXFN1r9+tFZbjI5x/PkR7wLCPUVMfd+4GGghUiRws+RZyL4cW8UKG/I5eLAKEVIbe5nw9tpJgn/x2rH2SWF1GY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610476607; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4l0kq3wxIJBsGcT12cxU3gmDmz9IWzR6E0aRKmJTUjQ=; b=TD9uVcrsRskCSO/n7E7jnpCJjzaGCPLvQcwaAv/nt0PPLwb+cPMNScL5Uh39zsf/2Iya9dwm1eb3j/dJxG22UqruUFcOgLLH4b0t08ElfxDDPA2T7OgMKF3MEdhEsBUEkkQmOxxxxk5srx9xtTE/16oon+0cCq6yoIZ4FZM7Bao= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by mx.zohomail.com with SMTPS id 1610476607702815.3293446007675; Tue, 12 Jan 2021 10:36:47 -0800 (PST) Received: by mail-ed1-f54.google.com with SMTP id i24so3448969edj.8 for ; Tue, 12 Jan 2021 10:36:46 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (190.red-83-57-173.dynamicip.rima-tde.net. [83.57.173.190]) by smtp.gmail.com with ESMTPSA id k21sm1830660edq.26.2021.01.12.10.36.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 10:36:44 -0800 (PST) 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=4l0kq3wxIJBsGcT12cxU3gmDmz9IWzR6E0aRKmJTUjQ=; b=mFaV7NYmXIn6g4HptlIczJ+2QraPAoku178SziHN3Ki75DJqHBhEvxiMUFN9Db/nBx +hpOdBPj375NjffcD1HiIAs4TLsQpAJ3SS+TswKMivRx88KPUJ9KDomUrY4NOxyYm9OP kkT0DnHoxyD3eW1DWDNDV9rr0qpNuOs0BbiHOSJgWV1M5i1nla/YhnCt/7M4qY777ylt vsU4V9oZXrS4cp5QMIaaIVzk6ftBVMGoMDQO+lq/WvOTP6vZkFIK2a4TuYCpUwyNxT+p KueS7vkMS0OWpht6FpjzH2EztTtYqkHyle3ThJksYEMhKjsC0pu3vmRcOhN5IanM1qDq ooog== 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=4l0kq3wxIJBsGcT12cxU3gmDmz9IWzR6E0aRKmJTUjQ=; b=XfC/T5uF72a12/C32+UCh/sIroZtIQn1Ry3o6jb7NcGA/huofZb6/oGq6FVSKK69Cv dyKECUodUkGiu4L35D4RCFpVG0FsN0BzT/M+LZO7UiDqL2JnuSIxmQCkZc/HVAjWKL3x UIP4v4d/jJRnunswACbqUtsrObQrcki6RJOLkliwtJ4wKstW7jVUovOg6jX/YOLgjUuS 53jV1bw8bFnLV1L6ZT0CKsxwM1DNhyViRWkn+Rf4VHeDnCIuxoWSfEJKLr2Ed+pk4bmP SzHBdk3vz9dm/XVOPTJCx58ht915HaWDXrj0rdI3TwhbIIWIoBPTlXi27uFXt59m0QA1 DSLA== X-Gm-Message-State: AOAM531vMKbT/tLHfVYhjzU6E7Xe0nmBtGe8Wl7nWVs53Blz7qViyAwQ WqUbJfG4Dj3XeSxFh2e5AoY= X-Google-Smtp-Source: ABdhPJyJun8fhYKMg5tnrCY8tIgZG0kKJ/eXtJ11t71Z3aPw6nE1o0p+5vFfOBCZ9T7InoytwoVgVQ== X-Received: by 2002:a50:fe0e:: with SMTP id f14mr372860edt.159.1610476605633; Tue, 12 Jan 2021 10:36:45 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Bin Meng , qemu-devel@nongnu.org, Bin Meng Cc: qemu-arm@nongnu.org, Jean-Christophe Dubois , Peter Maydell , Alistair Francis , Peter Chubb , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH v6 11/11] hw/ssi: imx_spi: Correct tx and rx fifo endianness Date: Tue, 12 Jan 2021 19:35:29 +0100 Message-Id: <20210112183529.2011863-12-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210112183529.2011863-1-f4bug@amsat.org> References: <20210112183529.2011863-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) From: Bin Meng The endianness of data exchange between tx and rx fifo is incorrect. Earlier bytes are supposed to show up on MSB and later bytes on LSB, ie: in big endian. The manual does not explicitly say this, but the U-Boot and Linux driver codes have a swap on the data transferred to tx fifo and from rx fifo. With this change, U-Boot read from / write to SPI flash tests pass. =3D> sf test 1ff000 1000 SPI flash test: 0 erase: 0 ticks, 4096000 KiB/s 32768.000 Mbps 1 check: 3 ticks, 1333 KiB/s 10.664 Mbps 2 write: 235 ticks, 17 KiB/s 0.136 Mbps 3 read: 2 ticks, 2000 KiB/s 16.000 Mbps Test passed 0 erase: 0 ticks, 4096000 KiB/s 32768.000 Mbps 1 check: 3 ticks, 1333 KiB/s 10.664 Mbps 2 write: 235 ticks, 17 KiB/s 0.136 Mbps 3 read: 2 ticks, 2000 KiB/s 16.000 Mbps Fixes: c906a3a01582 ("i.MX: Add the Freescale SPI Controller") Signed-off-by: Bin Meng Message-Id: <20210112145526.31095-7-bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/ssi/imx_spi.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c index c4e2d2e1c97..38892698918 100644 --- a/hw/ssi/imx_spi.c +++ b/hw/ssi/imx_spi.c @@ -176,7 +176,6 @@ static void imx_spi_flush_txfifo(IMXSPIState *s) =20 while (!fifo32_is_empty(&s->tx_fifo)) { int tx_burst =3D 0; - int index =3D 0; =20 if (s->burst_length <=3D 0) { s->burst_length =3D imx_spi_burst_length(s); @@ -197,7 +196,7 @@ static void imx_spi_flush_txfifo(IMXSPIState *s) rx =3D 0; =20 while (tx_burst > 0) { - uint8_t byte =3D tx & 0xff; + uint8_t byte =3D tx >> (tx_burst - 8); =20 DPRINTF("writing 0x%02x\n", (uint32_t)byte); =20 @@ -206,13 +205,11 @@ static void imx_spi_flush_txfifo(IMXSPIState *s) =20 DPRINTF("0x%02x read\n", (uint32_t)byte); =20 - tx =3D tx >> 8; - rx |=3D (byte << (index * 8)); + rx =3D (rx << 8) | byte; =20 /* Remove 8 bits from the actual burst */ tx_burst -=3D 8; s->burst_length -=3D 8; - index++; } =20 DPRINTF("data rx:0x%08x\n", rx); --=20 2.26.2