From patchwork Wed Mar 7 05:03:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 882404 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ibfPr/2p"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zx1kv7496z9sf2 for ; Wed, 7 Mar 2018 16:03:51 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id B1CC6C21F3D; Wed, 7 Mar 2018 05:03:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8663DC21DAF; Wed, 7 Mar 2018 05:03:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 93F5DC21CB6; Wed, 7 Mar 2018 05:03:43 +0000 (UTC) Received: from mail-pl0-f66.google.com (mail-pl0-f66.google.com [209.85.160.66]) by lists.denx.de (Postfix) with ESMTPS id EECFEC21BE5 for ; Wed, 7 Mar 2018 05:03:42 +0000 (UTC) Received: by mail-pl0-f66.google.com with SMTP id w22-v6so711650pll.2 for ; Tue, 06 Mar 2018 21:03:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=RRH2blpie2PqDqcG3s5eS8JTmpzWEdcvy+wfQAPx7wU=; b=ibfPr/2psiY24oTDqR8gRwzX7XXZ5aUMRnAIjPnX2xn2zpEwS6G91SMNnTyJ50XyqC +KNvlcyZ1EAAa2EC0nS2wt3czFVbkNk8GK+griFFRgw64oipMgmX9ZSElXRcUNZZmpDo 8s9zsYdEKbK0bH7GCFRvkzl00jvNTm+o7cEJIPvFWTuAC0rVmp47wrzmMI1VN2VKoTOg F3U5blZD7IPg2eJXdS+FH0nlL01auWX2pv+Prb5RluvT4uwOWgV+PjOMz78Gi7elugZw Z7Wk80lRXej12E5z4CQOb+UfENdgwLJpzoyRk9K0v6n9GUwQLdmUKLAzTw7gmrakCWNW uutw== 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; bh=RRH2blpie2PqDqcG3s5eS8JTmpzWEdcvy+wfQAPx7wU=; b=m3ksvF0kaEVSl/ZUZ8CVvY4nvarrVvp4Zqe4Reyp6k5Gb3hZEOsNLKtXc9WaR07fsY OP1Awc7XzfXQDR3lIZmI5vgsov4vyP6t1TowIPy95MVCPFKYvyNzc+q+Y5QntBQ/CE1q Zo4pK9KtNYYiO6mh7WArirp2hBKxLTQEnUjdzVf5d9XfFKL1T0FfkCcmLxqu4bDH4pBk B38b0ZxLCI3jIRCtf2VJ6DZFLRiCixOjbTDxeIguz6pz8fD27UzAN53C8ox5ag7b2Xfk SlAr3GIQy9/zB/e+ZE4GGZPLZU7kg3ZUddMg60Sxh33qZZXkJfP+rTcBv4BnHc/6ZdiE FgsQ== X-Gm-Message-State: APf1xPBO1bW1CPkVnHNYn/l8zyJIGkUYh4dQ/U0cmG792sNhCFX8FYjK yVvaC/amHsLZKrrPzEZgkbGWYy5J X-Google-Smtp-Source: AG47ELtTphT4v/VG4a6zNQ1l8zdh7LI8DDpJad7k3woSjZAqE7fTWwIqh6JbFuYyRGN7zK1b/kjMdg== X-Received: by 2002:a17:902:8349:: with SMTP id z9-v6mr18766768pln.163.1520399021484; Tue, 06 Mar 2018 21:03:41 -0800 (PST) Received: from localhost.localdomain ([115.97.185.211]) by smtp.gmail.com with ESMTPSA id t8sm27446393pgu.48.2018.03.06.21.03.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Mar 2018 21:03:40 -0800 (PST) From: Jagan Teki X-Google-Original-From: Jagan Teki To: Rick Chen Date: Wed, 7 Mar 2018 10:33:33 +0530 Message-Id: <20180307050333.4027-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.14.3 Cc: Tom Rini , u-boot@lists.denx.de Subject: [U-Boot] [PATCH] spi: atcspi200: Drop non-dm code X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Boards adp-ae3xx_defconfig, nx25-ae250_defconfig already enabled DM_SPI, so non-dm code make no use of it hence droped. Signed-off-by: Jagan Teki --- drivers/spi/Kconfig | 14 ++++---- drivers/spi/atcspi200_spi.c | 87 --------------------------------------------- 2 files changed, 7 insertions(+), 94 deletions(-) diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 56c337f664..2f231fc12b 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -23,6 +23,13 @@ config ALTERA_SPI IP core. Please find details on the "Embedded Peripherals IP User Guide" of Altera. +config ATCSPI200_SPI + bool "Andestech ATCSPI200 SPI driver" + help + Enable the Andestech ATCSPI200 SPI driver. This driver can be + used to access the SPI flash on AE3XX and AE250 platforms embedding + this Andestech IP core. + config ATH79_SPI bool "Atheros SPI driver" depends on ARCH_ATH79 @@ -239,13 +246,6 @@ config FSL_QSPI used to access the SPI NOR flash on platforms embedding this Freescale IP core. -config ATCSPI200_SPI - bool "Andestech ATCSPI200 SPI driver" - help - Enable the Andestech ATCSPI200 SPI driver. This driver can be - used to access the SPI flash on AE3XX and AE250 platforms embedding - this Andestech IP core. - config DAVINCI_SPI bool "Davinci & Keystone SPI driver" depends on ARCH_DAVINCI || ARCH_KEYSTONE diff --git a/drivers/spi/atcspi200_spi.c b/drivers/spi/atcspi200_spi.c index 5b2e9d6264..bc08914b9e 100644 --- a/drivers/spi/atcspi200_spi.c +++ b/drivers/spi/atcspi200_spi.c @@ -75,9 +75,6 @@ struct atcspi200_spi_regs { }; struct nds_spi_slave { -#ifndef CONFIG_DM_SPI - struct spi_slave slave; -#endif volatile struct atcspi200_spi_regs *regs; int to; unsigned int freq; @@ -286,89 +283,6 @@ static int __atcspi200_spi_xfer(struct nds_spi_slave *ns, return ret; } -#ifndef CONFIG_DM_SPI -#define to_nds_spi_slave(s) container_of(s, struct nds_spi_slave, slave) -struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, - unsigned int max_hz, unsigned int mode) -{ - struct nds_spi_slave *ns; - - if (!spi_cs_is_valid(bus, cs)) - return NULL; - - ns = spi_alloc_slave(struct nds_spi_slave, bus, cs); - if (!ns) - return NULL; - - switch (bus) { - case SPI0_BUS: - ns->regs = (struct atcspi200_spi_regs *)SPI0_BASE; - break; - - case SPI1_BUS: - ns->regs = (struct atcspi200_spi_regs *)SPI1_BASE; - break; - - default: - return NULL; - } - - ns->freq= max_hz; - ns->mode = mode; - ns->to = SPI_TIMEOUT; - ns->max_transfer_length = MAX_TRANSFER_LEN; - ns->slave.max_write_size = MAX_TRANSFER_LEN; - - return &ns->slave; -} - -void spi_free_slave(struct spi_slave *slave) -{ - struct nds_spi_slave *ns = to_nds_spi_slave(slave); - free(ns); -} - -void spi_init(void) -{ - /* do nothing */ -} - -int spi_claim_bus(struct spi_slave *slave) -{ - struct nds_spi_slave *ns = to_nds_spi_slave(slave); - return __atcspi200_spi_claim_bus(ns); -} - -void spi_release_bus(struct spi_slave *slave) -{ - struct nds_spi_slave *ns = to_nds_spi_slave(slave); - __atcspi200_spi_release_bus(ns); -} - -int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *data_out, - void *data_in, unsigned long flags) -{ - struct nds_spi_slave *ns = to_nds_spi_slave(slave); - return __atcspi200_spi_xfer(ns, bitlen, data_out, data_in, flags); -} - -int spi_cs_is_valid(unsigned int bus, unsigned int cs) -{ - return bus == 0 && cs < NSPI_MAX_CS_NUM; -} - -void spi_cs_activate(struct spi_slave *slave) -{ - struct nds_spi_slave *ns = to_nds_spi_slave(slave); - __atcspi200_spi_start(ns); -} - -void spi_cs_deactivate(struct spi_slave *slave) -{ - struct nds_spi_slave *ns = to_nds_spi_slave(slave); - __atcspi200_spi_stop(ns); -} -#else static int atcspi200_spi_set_speed(struct udevice *bus, uint max_hz) { struct nds_spi_slave *ns = dev_get_priv(bus); @@ -496,4 +410,3 @@ U_BOOT_DRIVER(atcspi200_spi) = { .priv_auto_alloc_size = sizeof(struct nds_spi_slave), .probe = atcspi200_spi_probe, }; -#endif