Message ID | 20201016225755.302659-2-seanga2@gmail.com |
---|---|
State | Accepted |
Commit | caf110798ccca5d1fe7e75ae73397212262b9ee9 |
Delegated to: | Jagannadha Sutradharudu Teki |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=MAR+KSuM; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CChQv74RKz9sS8 for <incoming@patchwork.ozlabs.org>; Sat, 17 Oct 2020 09:58:47 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DA93B82400; Sat, 17 Oct 2020 00:58:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MAR+KSuM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BFEB282369; Sat, 17 Oct 2020 00:58:21 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2F26382304 for <u-boot@lists.denx.de>; Sat, 17 Oct 2020 00:58:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-io1-xd44.google.com with SMTP id k25so5902572ioh.7 for <u-boot@lists.denx.de>; Fri, 16 Oct 2020 15:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=f1Cba1H4jjzLMCz5DGa4ThpWhHwLq8Uk6w5ZcgSFQQM=; b=MAR+KSuMwHgaDQIINGOHI3Hf6U7lrB4b9zq96yWIqBhkqtb+2REN/BYluhfXQAOAbV uAcZPwsze5MFMqm3Ua8zNweoYV0lr8M0hWI/nrKGoRsm4MSznrFWQg1ESMXJBnACvE5h OaU4yZ/mpG0tLzt9uHol0jKJLa89EXRe9q1C2k3roVr8ShmOnoTcmoEpOgKQSXjIH1Lp ICiJtFCm3RvCZBlaSwXTtzwWuTGruYUIqheNq2ayj8z4xdM+04NAxqtE8AcJhT0GuPY/ bfd9IPLequYG+yJbnfUrXpDQvrsFcMpvAcunp/66vxUWwi+Izg2mb0Zk6M8rPFPpK3W1 hpng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=f1Cba1H4jjzLMCz5DGa4ThpWhHwLq8Uk6w5ZcgSFQQM=; b=StIQHGNFfqzm6sJY37HsMVmcf39eeLK/sgXbhkJ97lNUUAKqUUJQaxKrjAAz593DcZ 1VwbwMN7ykQuO01I4MhbzIp2LsSuj6PdOnNdlE+ai0NNVWc2YJTusJufY6/vAmcGxZ+v VpbbPmT3lq/4FakhWZOhKVG+Z8QPFQ8zVTHXpbsYqEG5j7VyuZDpbM2EOnF+4XwxzdSW GdjjJRpVRVGYk6zgPpffRow7BwqiVGjT7OsKZTxmsMd9J2txXamkHB+4Wp58Dovw/bRa 2LXiB17DqmIBqVQbaZYgaFNEERf0SjoaIqj1galahVnRQhsOMCf4K1HPhBQntTS/DX26 lgXQ== X-Gm-Message-State: AOAM530baTXLDaSHfG78psaYwUZjUV0glqQVx2SWIVGCZ14mPDH80F+A 4U8Pf+N12F/9Am8VgF45G33XU8tqihf5mTz6 X-Google-Smtp-Source: ABdhPJzuQycwqpi+FgrAPoP3QuCl67KNcjgIAg3vp82KgML4njj/ouKezu8olXnVF9k70G3hoSWM7Q== X-Received: by 2002:a5e:d606:: with SMTP id w6mr4165430iom.67.1602889097855; Fri, 16 Oct 2020 15:58:17 -0700 (PDT) Received: from godwin.fios-router.home (pool-108-51-35-162.washdc.fios.verizon.net. [108.51.35.162]) by smtp.gmail.com with ESMTPSA id 12sm3117558ioz.33.2020.10.16.15.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Oct 2020 15:58:17 -0700 (PDT) From: Sean Anderson <seanga2@gmail.com> To: u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Cc: Jagan Teki <jagan@amarulasolutions.com>, Marek Vasut <marex@denx.de>, Heinrich Schuchardt <xypron.glpk@gmx.de>, Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>, Horatiu Vultur <horatiu.vultur@microchip.com>, Sean Anderson <seanga2@gmail.com> Subject: [PATCH v4 01/13] spi: dw: Fix driving MOSI low while recieving Date: Fri, 16 Oct 2020 18:57:43 -0400 Message-Id: <20201016225755.302659-2-seanga2@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016225755.302659-1-seanga2@gmail.com> References: <20201016225755.302659-1-seanga2@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean |
Series |
riscv: Add SPI support for Kendryte K210
|
expand
|
diff --git a/drivers/spi/designware_spi.c b/drivers/spi/designware_spi.c index 2559aac2e9..74372171aa 100644 --- a/drivers/spi/designware_spi.c +++ b/drivers/spi/designware_spi.c @@ -322,7 +322,7 @@ static inline u32 rx_max(struct dw_spi_priv *priv) static void dw_writer(struct dw_spi_priv *priv) { u32 max = tx_max(priv); - u16 txw = 0; + u16 txw = 0xFFFF; while (max--) { /* Set the tx word if the transfer's original "tx" is not null */
The resting state of MOSI is high when nothing is driving it. If we drive it low while recieving, it looks like we are transmitting 0x00 instead of transmitting nothing. This can confuse slaves (like SD cards) which allow new commands to be sent over MOSI while they are returning data over MISO. The return of MOSI from 0 to 1 at the end of recieving a byte can look like a start bit and a transmission bit to an SD card. This will cause the card to become out-of-sync with the SPI device, as it thinks the device has already started transmitting two bytes of a new command. The mmc-spi driver will not detect the R1 response from the SD card, since it is sent too early, and offset by two bits. This patch fixes transfer errors when using SD cards with dw spi. Signed-off-by: Sean Anderson <seanga2@gmail.com> --- Changes in v4: - New drivers/spi/designware_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)