From patchwork Wed Feb 13 03:23:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Martin X-Patchwork-Id: 220044 X-Patchwork-Delegate: twarren@nvidia.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 8857B2C0099 for ; Wed, 13 Feb 2013 16:52:21 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0C0DA4A18A; Wed, 13 Feb 2013 06:52:17 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5a3USB8VvtrL; Wed, 13 Feb 2013 06:52:16 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 88FD94A141; Wed, 13 Feb 2013 06:51:57 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 451FB4A11E for ; Wed, 13 Feb 2013 06:51:55 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i9uKg3PlNfPg for ; Wed, 13 Feb 2013 06:51:54 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from hqemgate04.nvidia.com (hqemgate04.nvidia.com [216.228.121.35]) by theia.denx.de (Postfix) with ESMTPS id DC8054A131 for ; Wed, 13 Feb 2013 06:51:50 +0100 (CET) Received: from hqnvupgp05.nvidia.com (Not Verified[216.228.121.13]) by hqemgate04.nvidia.com id ; Tue, 12 Feb 2013 21:51:36 -0800 Received: from hqemhub01.nvidia.com ([172.20.150.30]) by hqnvupgp05.nvidia.com (PGP Universal service); Tue, 12 Feb 2013 21:51:45 -0800 X-PGP-Universal: processed; by hqnvupgp05.nvidia.com on Tue, 12 Feb 2013 21:51:45 -0800 Received: from badger.nvidia.com (172.20.144.16) by hqemhub01.nvidia.com (172.20.150.30) with Microsoft SMTP Server id 8.3.297.1; Tue, 12 Feb 2013 19:23:48 -0800 From: Allen Martin To: , , Date: Tue, 12 Feb 2013 19:23:09 -0800 Message-ID: <1360725802-5518-3-git-send-email-amartin@nvidia.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360725802-5518-1-git-send-email-amartin@nvidia.com> References: <1360725802-5518-1-git-send-email-amartin@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 02/14] tegra: spi: remove non fdt support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Remove non fdt support from tegra20 and tegra30 SPI drivers in preparation of new common fdt based SPI driver front end. Signed-off-by: Allen Martin --- drivers/spi/tegra20_spi.c | 12 ++++-------- drivers/spi/tegra30_spi.c | 29 ----------------------------- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/drivers/spi/tegra20_spi.c b/drivers/spi/tegra20_spi.c index 8cc3e5d..9e5de68 100644 --- a/drivers/spi/tegra20_spi.c +++ b/drivers/spi/tegra20_spi.c @@ -68,6 +68,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, unsigned int max_hz, unsigned int mode) { struct tegra_spi_slave *spi; + int node; if (!spi_cs_is_valid(bus, cs)) { printf("SPI error: unsupported bus %d / chip select %d\n", @@ -88,9 +89,9 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, } spi->slave.bus = bus; spi->slave.cs = cs; -#ifdef CONFIG_OF_CONTROL - int node = fdtdec_next_compatible(gd->fdt_blob, 0, - COMPAT_NVIDIA_TEGRA20_SFLASH); + + node = fdtdec_next_compatible(gd->fdt_blob, 0, + COMPAT_NVIDIA_TEGRA20_SFLASH); if (node < 0) { debug("%s: cannot locate sflash node\n", __func__); return NULL; @@ -115,11 +116,6 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, debug("%s: could not decode periph id\n", __func__); return NULL; } -#else - spi->regs = (struct spi_tegra *)NV_PA_SPI_BASE; - spi->freq = TEGRA_SPI_MAX_FREQ; - spi->periph_id = PERIPH_ID_SPI1; -#endif if (max_hz < spi->freq) { debug("%s: limiting frequency from %u to %u\n", __func__, spi->freq, max_hz); diff --git a/drivers/spi/tegra30_spi.c b/drivers/spi/tegra30_spi.c index b475090..2d788e6 100644 --- a/drivers/spi/tegra30_spi.c +++ b/drivers/spi/tegra30_spi.c @@ -116,7 +116,6 @@ void spi_init(void) { struct tegra_spi_ctrl *ctrl; int i; -#ifdef CONFIG_OF_CONTROL int node = 0; int count; int node_list[CONFIG_TEGRA_SLINK_CTRLS]; @@ -152,34 +151,6 @@ void spi_init(void) debug("%s: found controller at %p, freq = %u, periph_id = %d\n", __func__, ctrl->regs, ctrl->freq, ctrl->periph_id); } -#else - for (i = 0; i < CONFIG_TEGRA_SLINK_CTRLS; i++) { - ctrl = &spi_ctrls[i]; - u32 base_regs[] = { - NV_PA_SLINK1_BASE, - NV_PA_SLINK2_BASE, - NV_PA_SLINK3_BASE, - NV_PA_SLINK4_BASE, - NV_PA_SLINK5_BASE, - NV_PA_SLINK6_BASE, - }; - int periph_ids[] = { - PERIPH_ID_SBC1, - PERIPH_ID_SBC2, - PERIPH_ID_SBC3, - PERIPH_ID_SBC4, - PERIPH_ID_SBC5, - PERIPH_ID_SBC6, - }; - ctrl->regs = (struct slink_tegra *)base_regs[i]; - ctrl->freq = TEGRA_SPI_MAX_FREQ; - ctrl->periph_id = periph_ids[i]; - ctrl->valid = 1; - - debug("%s: found controller at %p, freq = %u, periph_id = %d\n", - __func__, ctrl->regs, ctrl->freq, ctrl->periph_id); - } -#endif } int spi_claim_bus(struct spi_slave *slave)