From patchwork Wed Aug 5 13:07:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 1341229 X-Patchwork-Delegate: sr@denx.de Return-Path: 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=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=PILpRoa/; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BMBk83f4Zz9sPB for ; Wed, 5 Aug 2020 23:07:44 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 263D981B65; Wed, 5 Aug 2020 15:07:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1596632860; bh=+ffNEmJ0VTzR3lwnG4K9l+0K2lhCWxqSL+V6uuzWiQI=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=PILpRoa/Ea4Enc68/ekRYVrlkXhYVjkADymPTqejHbDl10FbGJtqad5sfIJAyJzch 3gIpc7hvMhl9jdoZzIubcsDfIx7KTdmbgzrzFd5Xc2PCFf2n+HNVtYxEvIMlPIYA3s kFioJwKDmfI3U7AoKhjutpqn7fTDDHZsyIsHQuQZcY7rCPuGgd/eS6StNWpw7djaux 12BIQ4q6REViH2Afwojq25lp27jyuw9f7Ck0seyAmGCz5LUJ1k4txej8b/QkLM0d2W KGWQxLxjR0zaGaZDNoA0KBM32hbwngnqoVSR7vGJLDdD7ogIVxK63Vtb1hmpo5OE1G Qp4m2rBVVFvLQ== Received: by phobos.denx.de (Postfix, from userid 109) id 21E8B812FE; Wed, 5 Aug 2020 15:07:39 +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=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mx2.mailbox.org (mx2.mailbox.org [80.241.60.215]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 93753812FE for ; Wed, 5 Aug 2020 15:07:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=sr@denx.de Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 2A299A19A1; Wed, 5 Aug 2020 15:07:36 +0200 (CEST) Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter04.heinlein-hosting.de (spamfilter04.heinlein-hosting.de [80.241.56.122]) (amavisd-new, port 10030) with ESMTP id PxoLSAyro_F0; Wed, 5 Aug 2020 15:07:31 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Cc: Aaron Williams , Suneel Garapati , Chandrakala Chavva , Jagan Teki Subject: [PATCH] spi: octeon_spi: Use a fixed 100MHz input clock on Octeon TX2 Date: Wed, 5 Aug 2020 15:07:30 +0200 Message-Id: <20200805130730.871608-1-sr@denx.de> MIME-Version: 1.0 X-MBO-SPAM-Probability: 0 X-Rspamd-Score: 0.02 / 15.00 / 15.00 X-Rspamd-Queue-Id: 95D94181E X-Rspamd-UID: c8e19c X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Octeon TX2 sets the TB100_EN bit in the config register. We need to use a fixed 100MHz clock for this as well to work properly. Signed-off-by: Stefan Roese Cc: Aaron Williams Cc: Suneel Garapati Cc: Chandrakala Chavva Cc: Jagan Teki --- drivers/spi/octeon_spi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/spi/octeon_spi.c b/drivers/spi/octeon_spi.c index 83fe6330a1..7e88e5580f 100644 --- a/drivers/spi/octeon_spi.c +++ b/drivers/spi/octeon_spi.c @@ -519,7 +519,10 @@ static int octeon_spi_set_speed(struct udevice *bus, uint max_hz) if (max_hz > OCTEON_SPI_MAX_CLOCK_HZ) max_hz = OCTEON_SPI_MAX_CLOCK_HZ; - clk_rate = clk_get_rate(&priv->clk); + if (device_is_compatible(bus, "cavium,thunderx-spi")) + clk_rate = 100000000; + else + clk_rate = clk_get_rate(&priv->clk); if (IS_ERR_VALUE(clk_rate)) return -EINVAL;