From patchwork Tue May 17 08:41:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 573444 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1f0e:0:0:0:0 with SMTP id hs14csp200355mab; Tue, 17 May 2022 01:42:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHJwDYQcW4tpQHdulZn1ThBXBYNPzzXIdRZJGgfcEqxT9AEVa8/PAFh5xrXumq86cOkP+6 X-Received: by 2002:a17:907:c2a:b0:6f4:4b49:9cfb with SMTP id ga42-20020a1709070c2a00b006f44b499cfbmr18253739ejc.697.1652776920886; Tue, 17 May 2022 01:42:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652776920; cv=none; d=google.com; s=arc-20160816; b=qY7xntDVynjHStSVnyOBtmTzw57Bq/wYte9/85poOHR+GVnYwDoloV4s7WxaYa9+t3 sprPXiW+GNuagFeOKPUKmx27Lwh/jSPtzHt6bQiodk6D3UsuqMhS5CGU+IL9QjcIgSjF puThxpNFtdyUFH4xUkyZBYq5jz8oFS6aV7iQI/eX5Z5e1CVM/a8x0hc8HJRaAWbU4SnV dGiDeIFKK3q7z7Qusl0+v+rukjDkPBSLVs6MWlgkzT67E5AaEpxZ2LBnPqxvyRw8rCEH QvgFz59kzAMhsPIsrVOLmK+Yk8B0rWt8Z7kI+jPuOL0tYpGs8cGfnqlgAQ9bCwECw9Rr HnLQ== 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:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=ftRS6sABEF18umKxouEcDVZmKQT8KqlcdX0YAWKIioo=; b=mijMWPg4bFOxXJ1MNdg/yycTtfHesTwR0pkNqArzxcUapq4hR91hF2UoOY/l9BnyVC 8s6MnvxsoKSQ9P1Q3fjUSVfjOVgsLuBjVpcgc1ayk+uaq5Ed5I9/gHa5OWGekbiQ8o1K iKCAOyDtApPeZXJ8NOsGymPUesgrPxBRdJEZKgVrH/J2NQWrvGfRSmzLzJMaqF/t7D0P EDysMObfU7MmCPTiLaB/bnBTQuILzbS53ZSjnffqigJdE2jAz7toeAzU2gsMrrUBEfEH xSwfI9Nfvtbx+QFU+LNlF2lHVExHud8mMn8AARw98KWZZTcc2oP1Z2m1/inT7SrXH3+6 16Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y9gNtb93; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id pw11-20020a17090720ab00b006df76385bf9si1733479ejb.153.2022.05.17.01.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 01:42:00 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y9gNtb93; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D38D684251; Tue, 17 May 2022 10:41:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="y9gNtb93"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1400684251; Tue, 17 May 2022 10:41:37 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) (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 4D73B803C8 for ; Tue, 17 May 2022 10:41:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pf1-x436.google.com with SMTP id a11so16305526pff.1 for ; Tue, 17 May 2022 01:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ftRS6sABEF18umKxouEcDVZmKQT8KqlcdX0YAWKIioo=; b=y9gNtb93YTf+xwb3duHUVtQv59q1BbgmM49gC9yv/huA4349FxNJ7WCvEXfPWrQfah kNJN/XTpl1wzmDoW5ZdlLKIpyDrDNRXE01KzYlsLOuJOAuF1ift7YMXmaio2vOjcyykt yeHJw+7btNdNRZc7dKKvTnSlK2uQ/hF361qqRHa49KdV40XBIgbDx+x6uVOxH6QfivS7 A2lb47bNMqkjIXqagcC+cBz8v1QnKShnfMOU9hWVrdb3fbRWcL+H89Geb7a7J8rBfohy /NSidRmGGEtHu3M0S7SRxhjDV0+owfVs90ZH1P6iNZaUI5wOhCkOgSTp5NUXg8GEsU7m cQpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ftRS6sABEF18umKxouEcDVZmKQT8KqlcdX0YAWKIioo=; b=h1GddLz+6IB5XdNC/y6j9SZqIDrrghlMwcjxwEsFWoCNSZsd+vUk29EmjHbT+eu+1L PAlWxQBmxk2vsr0AekzSMoDd25skQf4O1lrkjBJoPFgF75JMH8lJRjIf/DE5b8MhXFG6 EYexpiQz7JJ94GvIr9OsLPvmGDbPYDFJA1/QShpHqOV8IrpccfB4xKTD4RaUADJtwk5Q FYBmmbsI/9fGH9Vo2p7ATR1wKTUA7D6h6gybzgtVvlilYxVgrzHk22K2FAsWB6VN+5t5 +WHjQ0D+hanpVxLSnNhII73Ln/3ErfgOj4k2R803opKMxGpYL5qlh6Oq7YyYa/6gRWG1 CqfQ== X-Gm-Message-State: AOAM531Mt8wfeiK5vrpEl9IVsahk046cBqaWtBxiBNc3hXN/wKn2uaWV 2jK98y4VcIP507di9rpEjyg9narPkAfjJw== X-Received: by 2002:a05:6a00:10d0:b0:4f7:5af4:47b6 with SMTP id d16-20020a056a0010d000b004f75af447b6mr21453162pfu.6.1652776890559; Tue, 17 May 2022 01:41:30 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id s200-20020a632cd1000000b003f5912ba179sm741569pgs.58.2022.05.17.01.41.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 01:41:30 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Jassi Brar , Satoru Okamoto , Masahisa Kojima , Jagan Teki Subject: [PATCH 2/4] spi: synquacer: wait until slave is deselected Date: Tue, 17 May 2022 17:41:37 +0900 Message-Id: <20220517084139.6986-3-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220517084139.6986-1-masahisa.kojima@linaro.org> References: <20220517084139.6986-1-masahisa.kojima@linaro.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean synquacer_cs_set() function does not wait the chip select is deasserted when the driver sets the DMSTOP to deselect the slave. This commit checks the Slave Select Released(SRS) bit to wait until the slave is deselected. Signed-off-by: Masahisa Kojima Signed-off-by: Satoru Okamoto Acked-by: Jassi Brar --- drivers/spi/spi-synquacer.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/spi/spi-synquacer.c b/drivers/spi/spi-synquacer.c index 62f85f0335..f1422cf893 100644 --- a/drivers/spi/spi-synquacer.c +++ b/drivers/spi/spi-synquacer.c @@ -46,7 +46,9 @@ #define RXE 0x24 #define RXC 0x28 #define TFLETE 4 +#define TSSRS 6 #define RFMTE 5 +#define RSSRS 6 #define FAULTF 0x2c #define FAULTC 0x30 @@ -170,6 +172,11 @@ static void synquacer_cs_set(struct synquacer_spi_priv *priv, bool active) priv->rx_words = 16; read_fifo(priv); } + + /* wait until slave is deselected */ + while (!(readl(priv->base + TXF) & BIT(TSSRS)) || + !(readl(priv->base + RXF) & BIT(RSSRS))) + ; } }