uboot-tools/qspi-t210-fix-claim_bus-and-clock-tap-delays.patch
2020-04-01 00:38:08 +01:00

454 lines
19 KiB
Diff

From patchwork Thu Mar 26 22:42:00 2020
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Tom Warren <tomcwarren3959@gmail.com>
X-Patchwork-Id: 1262404
X-Patchwork-Delegate: twarren@nvidia.com
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=fail (p=none dis=none) header.from=gmail.com
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))
(No client certificate requested)
by ozlabs.org (Postfix) with ESMTPS id 48pKkD6xnVz9sRR
for <incoming@patchwork.ozlabs.org>;
Fri, 27 Mar 2020 09:42:28 +1100 (AEDT)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id 798238183F;
Thu, 26 Mar 2020 23:42:13 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=fail (p=none dis=none) header.from=gmail.com
Authentication-Results: phobos.denx.de;
spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de
Received: by phobos.denx.de (Postfix, from userid 109)
id EAF4281834; Thu, 26 Mar 2020 23:42:07 +0100 (CET)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de
X-Spam-Level:
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,
DKIM_ADSP_CUSTOM_MED,
FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_NONE,
URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2
Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com
[216.228.121.64])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256
bits)) (No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id C0BED80199
for <u-boot@lists.denx.de>; Thu, 26 Mar 2020 23:42:03 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=fail (p=none dis=none) header.from=gmail.com
Authentication-Results: phobos.denx.de;
spf=fail smtp.mailfrom=tomcwarren3959@gmail.com
Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by
hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA)
id <B5e7d2f8c0000>; Thu, 26 Mar 2020 15:41:16 -0700
Received: from hqmail.nvidia.com ([172.20.161.6])
by hqpgpgate102.nvidia.com (PGP Universal service);
Thu, 26 Mar 2020 15:42:02 -0700
X-PGP-Universal: processed;
by hqpgpgate102.nvidia.com on Thu, 26 Mar 2020 15:42:02 -0700
Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL109.nvidia.com
(172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3;
Thu, 26 Mar 2020 22:42:01 +0000
Received: from rnnvemgw01.nvidia.com (10.128.109.123) by HQMAIL107.nvidia.com
(172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via
Frontend Transport; Thu, 26 Mar 2020 22:42:01 +0000
Received: from tom-lt2.nvidia.com (Not Verified[10.2.63.13]) by
rnnvemgw01.nvidia.com with Trustwave SEG (v7, 5, 8, 10121)
id <B5e7d2fb90000>; Thu, 26 Mar 2020 15:42:01 -0700
From: <tomcwarren3959@gmail.com>
To: <u-boot@lists.denx.de>
CC: <swarren@nvidia.com>, <treding@nvidia.com>, <jonathanh@nvidia.com>,
<twarren@nvidia.com>, <jagan@amarulasolutions.com>
Subject: [PATCH 1/3] qspi: t210: Fix claim_bus's use of the wrong bus/device
Date: Thu, 26 Mar 2020 15:42:00 -0700
Message-ID: <1585262522-6127-2-git-send-email-tomcwarren3959@gmail.com>
X-Mailer: git-send-email 1.8.2.1.610.g562af5b
In-Reply-To: <1585262522-6127-1-git-send-email-tomcwarren3959@gmail.com>
References: <1585262522-6127-1-git-send-email-tomcwarren3959@gmail.com>
MIME-Version: 1.0
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.30rc1
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.2 at phobos.denx.de
X-Virus-Status: Clean
From: Tom Warren <twarren@nvidia.com>
claim_bus() is passed a udevice *dev, which is the bus device's parent.
In this driver, claim_bus assumed it was the bus, which caused the
'priv' info pointer to be wrong, and periph_id was incorrect. This in
turn caused the periph clock call to assign the wrong clock (PLLM
instead of PLLP0), which caused a kernel warning. I only saw the 'bad'
periph_id when enabling DEBUG due to an assert. Not sure how QSPI was
working w/this errant clock, but it was moot as QSPI wasn't active
unless you probed it, and that wasn't happening until I posted a patch
to enable env save to QSPI for Nano (coming soon).
Signed-off-by: Tom Warren <twarren@nvidia.com>
---
Changes in v2:
- None
drivers/spi/tegra210_qspi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/tegra210_qspi.c b/drivers/spi/tegra210_qspi.c
index d82ecaa..2a77126 100644
--- a/drivers/spi/tegra210_qspi.c
+++ b/drivers/spi/tegra210_qspi.c
@@ -2,7 +2,8 @@
/*
* NVIDIA Tegra210 QSPI controller driver
*
- * (C) Copyright 2015 NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2015-2019 NVIDIA Corporation <www.nvidia.com>
+ *
*/
#include <common.h>
@@ -137,8 +138,9 @@ static int tegra210_qspi_probe(struct udevice *bus)
return 0;
}
-static int tegra210_qspi_claim_bus(struct udevice *bus)
+static int tegra210_qspi_claim_bus(struct udevice *dev)
{
+ struct udevice *bus = dev->parent;
struct tegra210_qspi_priv *priv = dev_get_priv(bus);
struct qspi_regs *regs = priv->regs;
From patchwork Thu Mar 26 22:42:01 2020
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Tom Warren <tomcwarren3959@gmail.com>
X-Patchwork-Id: 1262405
X-Patchwork-Delegate: twarren@nvidia.com
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=85.214.62.61;
helo=phobos.denx.de;
envelope-from=u-boot-bounces@lists.denx.de;
receiver=<UNKNOWN>)
Authentication-Results: ozlabs.org;
dmarc=fail (p=none dis=none) header.from=gmail.com
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 48pKkQ1xG5z9sRR
for <incoming@patchwork.ozlabs.org>;
Fri, 27 Mar 2020 09:42:38 +1100 (AEDT)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id 0EBF581883;
Thu, 26 Mar 2020 23:42:29 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=fail (p=none dis=none) header.from=gmail.com
Authentication-Results: phobos.denx.de;
spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de
Received: by phobos.denx.de (Postfix, from userid 109)
id 01CC481264; Thu, 26 Mar 2020 23:42:11 +0100 (CET)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de
X-Spam-Level:
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,
DKIM_ADSP_CUSTOM_MED,
FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_NONE,
URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2
Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com
[216.228.121.64])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256
bits)) (No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id 67EC881264
for <u-boot@lists.denx.de>; Thu, 26 Mar 2020 23:42:04 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=fail (p=none dis=none) header.from=gmail.com
Authentication-Results: phobos.denx.de;
spf=fail smtp.mailfrom=tomcwarren3959@gmail.com
Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by
hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA)
id <B5e7d2f8c0001>; Thu, 26 Mar 2020 15:41:16 -0700
Received: from hqmail.nvidia.com ([172.20.161.6])
by hqpgpgate102.nvidia.com (PGP Universal service);
Thu, 26 Mar 2020 15:42:02 -0700
X-PGP-Universal: processed;
by hqpgpgate102.nvidia.com on Thu, 26 Mar 2020 15:42:02 -0700
Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL107.nvidia.com
(172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3;
Thu, 26 Mar 2020 22:42:02 +0000
Received: from rnnvemgw01.nvidia.com (10.128.109.123) by HQMAIL109.nvidia.com
(172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via
Frontend Transport; Thu, 26 Mar 2020 22:42:02 +0000
Received: from tom-lt2.nvidia.com (Not Verified[10.2.63.13]) by
rnnvemgw01.nvidia.com with Trustwave SEG (v7, 5, 8, 10121)
id <B5e7d2fb90002>; Thu, 26 Mar 2020 15:42:02 -0700
From: <tomcwarren3959@gmail.com>
To: <u-boot@lists.denx.de>
CC: <swarren@nvidia.com>, <treding@nvidia.com>, <jonathanh@nvidia.com>,
<twarren@nvidia.com>, <jagan@amarulasolutions.com>
Subject: [PATCH 2/3] qspi: t210: Fix QSPI clock and tap delays
Date: Thu, 26 Mar 2020 15:42:01 -0700
Message-ID: <1585262522-6127-3-git-send-email-tomcwarren3959@gmail.com>
X-Mailer: git-send-email 1.8.2.1.610.g562af5b
In-Reply-To: <1585262522-6127-1-git-send-email-tomcwarren3959@gmail.com>
References: <1585262522-6127-1-git-send-email-tomcwarren3959@gmail.com>
MIME-Version: 1.0
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.30rc1
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.2 at phobos.denx.de
X-Virus-Status: Clean
From: Tom Warren <twarren@nvidia.com>
When claim_bus was setting the clock, it reset the QSPI controller,
which wipes out any tap delays set by previous bootloaders (nvtboot,
CBoot for example on Nano). Instead of doing that in claim_bus, which
gets called a lot, moved clock setting to probe(), and set tap delays
there, too. Also updated clock to 80MHz to match CBoot. Now QSPI env
save works reliably again.
Signed-off-by: Tom Warren <twarren@nvidia.com>
---
Changes in v2:
- None
drivers/spi/tegra210_qspi.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/spi/tegra210_qspi.c b/drivers/spi/tegra210_qspi.c
index 2a77126..4284ea9 100644
--- a/drivers/spi/tegra210_qspi.c
+++ b/drivers/spi/tegra210_qspi.c
@@ -42,10 +42,10 @@ DECLARE_GLOBAL_DATA_PTR;
#define QSPI_CMD1_BITLEN_SHIFT 0
/* COMMAND2 */
-#define QSPI_CMD2_TX_CLK_TAP_DELAY BIT(6)
-#define QSPI_CMD2_TX_CLK_TAP_DELAY_MASK GENMASK(11,6)
-#define QSPI_CMD2_RX_CLK_TAP_DELAY BIT(0)
-#define QSPI_CMD2_RX_CLK_TAP_DELAY_MASK GENMASK(5,0)
+#define QSPI_CMD2_TX_CLK_TAP_DELAY_SHIFT 10
+#define QSPI_CMD2_TX_CLK_TAP_DELAY_MASK GENMASK(14,10)
+#define QSPI_CMD2_RX_CLK_TAP_DELAY_SHIFT 0
+#define QSPI_CMD2_RX_CLK_TAP_DELAY_MASK GENMASK(7,0)
/* TRANSFER STATUS */
#define QSPI_XFER_STS_RDY BIT(30)
@@ -127,14 +127,22 @@ static int tegra210_qspi_probe(struct udevice *bus)
struct tegra210_qspi_priv *priv = dev_get_priv(bus);
priv->regs = (struct qspi_regs *)plat->base;
+ struct qspi_regs *regs = priv->regs;
priv->last_transaction_us = timer_get_us();
priv->freq = plat->frequency;
priv->periph_id = plat->periph_id;
+ debug("%s: Freq = %u, id = %d\n", __func__, priv->freq, priv->periph_id);
/* Change SPI clock to correct frequency, PLLP_OUT0 source */
clock_start_periph_pll(priv->periph_id, CLOCK_ID_PERIPH, priv->freq);
+ /* Set tap delays here, clock change above resets QSPI controller */
+ u32 reg = (0x09 << QSPI_CMD2_TX_CLK_TAP_DELAY_SHIFT) |
+ (0x0C << QSPI_CMD2_RX_CLK_TAP_DELAY_SHIFT);
+ writel(reg, &regs->command2);
+ debug("%s: COMMAND2 = %08x\n", __func__, readl(&regs->command2));
+
return 0;
}
@@ -144,9 +152,6 @@ static int tegra210_qspi_claim_bus(struct udevice *dev)
struct tegra210_qspi_priv *priv = dev_get_priv(bus);
struct qspi_regs *regs = priv->regs;
- /* Change SPI clock to correct frequency, PLLP_OUT0 source */
- clock_start_periph_pll(priv->periph_id, CLOCK_ID_PERIPH, priv->freq);
-
debug("%s: FIFO STATUS = %08x\n", __func__, readl(&regs->fifo_status));
/* Set master mode and sw controlled CS */
From patchwork Thu Mar 26 22:42:02 2020
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Tom Warren <tomcwarren3959@gmail.com>
X-Patchwork-Id: 1262406
X-Patchwork-Delegate: twarren@nvidia.com
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=fail (p=none dis=none) header.from=gmail.com
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))
(No client certificate requested)
by ozlabs.org (Postfix) with ESMTPS id 48pKkb4wzBz9sRR
for <incoming@patchwork.ozlabs.org>;
Fri, 27 Mar 2020 09:42:47 +1100 (AEDT)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id E6FEA818A0;
Thu, 26 Mar 2020 23:42:31 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=fail (p=none dis=none) header.from=gmail.com
Authentication-Results: phobos.denx.de;
spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de
Received: by phobos.denx.de (Postfix, from userid 109)
id 3084D81850; Thu, 26 Mar 2020 23:42:12 +0100 (CET)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de
X-Spam-Level:
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,
DKIM_ADSP_CUSTOM_MED,
FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_NONE,
URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2
Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com
[216.228.121.65])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256
bits)) (No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id 3A00781813
for <u-boot@lists.denx.de>; Thu, 26 Mar 2020 23:42:05 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=fail (p=none dis=none) header.from=gmail.com
Authentication-Results: phobos.denx.de;
spf=fail smtp.mailfrom=tomcwarren3959@gmail.com
Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by
hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA)
id <B5e7d2fae0000>; Thu, 26 Mar 2020 15:41:50 -0700
Received: from hqmail.nvidia.com ([172.20.161.6])
by hqpgpgate101.nvidia.com (PGP Universal service);
Thu, 26 Mar 2020 15:42:03 -0700
X-PGP-Universal: processed;
by hqpgpgate101.nvidia.com on Thu, 26 Mar 2020 15:42:03 -0700
Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL111.nvidia.com
(172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3;
Thu, 26 Mar 2020 22:42:03 +0000
Received: from rnnvemgw01.nvidia.com (10.128.109.123) by HQMAIL111.nvidia.com
(172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via
Frontend Transport; Thu, 26 Mar 2020 22:42:03 +0000
Received: from tom-lt2.nvidia.com (Not Verified[10.2.63.13]) by
rnnvemgw01.nvidia.com with Trustwave SEG (v7, 5, 8, 10121)
id <B5e7d2fba0000>; Thu, 26 Mar 2020 15:42:02 -0700
From: <tomcwarren3959@gmail.com>
To: <u-boot@lists.denx.de>
CC: <swarren@nvidia.com>, <treding@nvidia.com>, <jonathanh@nvidia.com>,
<twarren@nvidia.com>, <jagan@amarulasolutions.com>
Subject: [PATCH 3/3] qspi: t210: Use dev_read calls to get FDT data like
base, freq
Date: Thu, 26 Mar 2020 15:42:02 -0700
Message-ID: <1585262522-6127-4-git-send-email-tomcwarren3959@gmail.com>
X-Mailer: git-send-email 1.8.2.1.610.g562af5b
In-Reply-To: <1585262522-6127-1-git-send-email-tomcwarren3959@gmail.com>
References: <1585262522-6127-1-git-send-email-tomcwarren3959@gmail.com>
MIME-Version: 1.0
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.30rc1
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.2 at phobos.denx.de
X-Virus-Status: Clean
From: Tom Warren <twarren@nvidia.com>
This Tegra QSPI driver hadn't been brought up to date with how
DM drivers are fetching data from the FDT now, and was pulling
in bogus data for base, max freq, etc. Fixed ofdata_to_platdata
to work the same way it does in the tegra114 SPI driver, using
dev_read_ functions.
Signed-off-by: Tom Warren <twarren@nvidia.com>
---
Changes in v2:
- New
drivers/spi/tegra210_qspi.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/spi/tegra210_qspi.c b/drivers/spi/tegra210_qspi.c
index 4284ea9..466d572 100644
--- a/drivers/spi/tegra210_qspi.c
+++ b/drivers/spi/tegra210_qspi.c
@@ -2,7 +2,7 @@
/*
* NVIDIA Tegra210 QSPI controller driver
*
- * (C) Copyright 2015-2019 NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2015-2020 NVIDIA Corporation <www.nvidia.com>
*
*/
@@ -97,10 +97,8 @@ struct tegra210_qspi_priv {
static int tegra210_qspi_ofdata_to_platdata(struct udevice *bus)
{
struct tegra_spi_platdata *plat = bus->platdata;
- const void *blob = gd->fdt_blob;
- int node = dev_of_offset(bus);
- plat->base = devfdt_get_addr(bus);
+ plat->base = dev_read_addr(bus);
plat->periph_id = clock_decode_periph_id(bus);
if (plat->periph_id == PERIPH_ID_NONE) {
@@ -110,9 +108,9 @@ static int tegra210_qspi_ofdata_to_platdata(struct udevice *bus)
}
/* Use 500KHz as a suitable default */
- plat->frequency = fdtdec_get_int(blob, node, "spi-max-frequency",
+ plat->frequency = dev_read_u32_default(bus, "spi-max-frequency",
500000);
- plat->deactivate_delay_us = fdtdec_get_int(blob, node,
+ plat->deactivate_delay_us = dev_read_u32_default(bus,
"spi-deactivate-delay", 0);
debug("%s: base=%#08lx, periph_id=%d, max-frequency=%d, deactivate_delay=%d\n",
__func__, plat->base, plat->periph_id, plat->frequency,