From patchwork Tue May 26 08:04:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1252 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 592EE3F08B for ; Tue, 26 May 2020 10:05:05 +0200 (CEST) Received: by mail-pj1-f70.google.com with SMTP id j70sf1924261pje.1 for ; Tue, 26 May 2020 01:05:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1590480304; cv=pass; d=google.com; s=arc-20160816; b=FWDSiPhinxiUBKltDPR5uF1vO1Xab5W8Be4gnkwHRYSahCoxr5jjKTdfJEmZMGnxEs 1k56JN3IBRnqnmRvTZ51CE2U1tuQydvhLyN4uhsyYpqSRpfz/mlYidajlqlSJARmZXm6 RHdhDdNohYI7GFluJDkZQH28OIrM9qTPm+Y7MnUncEIfq3Ks9dv6ovbxE8VDkhVekvJj hE2nAaW5Bk7gFAt89BYrDa+8f9z5YJTw7mGTUw9cNmJDDNK86VhWSDnMjcWixRLyvuMq oHFJV/wQOVKubd2HxWbgwdMocbHoGmBSTSipI4/jbaISfTtE3hTDIbfbsYGds4hUu1JJ E7uA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=dvd56sPlL16CdVVfd0SENnhiO5wPl9LLYIc2Jx5gNu8=; b=JnICv+7NJWxEcD18kASNvsokqAWH/0vmMTkx5HBWad2vJ+3rlxxRV7uXQUF1CiMHr2 E/XX06Qz/6NPP7zdqI42GsBRtpvnXjQiOokooHk5bBdHA1aTITkapZEK4C7AEaJkjboI 4gy/F89LAERg+wOg62zbn+gHfzW8ZWurEJTIHkufstCYgdfQwdMvseH6+WZ4vhMM0+YM aCT7pZclC3qkaB6bI99Ar65o4JMpNhHY2pVsGo48WlOGgUUphb9zwc4ZJ3F8qeORvFJE qjt5jqbcb5+96qjDgP85olb2hx2Dymz1kbk2fbbgnZCdYxayVb79ZDaZU9Ba6IgYZaD3 haTw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=VUenlMb7; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=dvd56sPlL16CdVVfd0SENnhiO5wPl9LLYIc2Jx5gNu8=; b=W4suZPneOh3RcB5jo/xJQG6cmo5iHz5RZVpdfGwAx49RqnOGW4Dx9nBfxQUpgGaWtc E6X15NIoEmDVg+d1ukvQAv7K0msyog4fWwS2sbv2h1LxQMcp/qR2POm7dSEWP2CubFqE MiNZCfPV+BemUY+aXSWkAroID9XCU+LrK8KJ8= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=dvd56sPlL16CdVVfd0SENnhiO5wPl9LLYIc2Jx5gNu8=; b=gV8Mh2M/CJjRKFyQpT+vdb+kYsv6PB+Z6Ie75fv2gmnkJoLEJ2cf6Ksq1iNEqwlivy n1dO3SGWzpghBWYD3kjUuByYnRi8KR0EkDzn7BpRviYOZMgy9/7AMEmw5oa0C56Ce9xo Bd/LhFIXmUVcRY0sY3DRnj5vllr9/Dki8X6RQ0LjqspIItMSBd7ZBYK0cTCr/iI0j50O P5qtrCdKxKkD1Sm5xKM3bbsYsxl4ljTZOBJ9IkZWSvAA0C3nOig5SXsmLqT4/IyJmU8i /FB6zM/NH9SgwKH6y4on5hr/iSMDgeoreYAMVULlv6bgvFlACsJzj4bMXroI6kik3uMf 5viA== X-Gm-Message-State: AOAM531f4bu2zzWMOiaZvYthG82zQOJC17+pvDgS8o+01ZlMgy2Dc6G8 KjaVYMQYxJqkBzc8TwdC8rBv+Mz6 X-Google-Smtp-Source: ABdhPJydpcjXsDSHBBue3SMlsUHF6y7152h2xYSliyTMi1Mzkzv0s9qRjgIA5uIk9gRXs1+ZBZXuOA== X-Received: by 2002:a63:4d4e:: with SMTP id n14mr28536096pgl.93.1590480304114; Tue, 26 May 2020 01:05:04 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:7604:: with SMTP id s4ls5674171pjk.1.gmail; Tue, 26 May 2020 01:05:03 -0700 (PDT) X-Received: by 2002:a17:90a:33ad:: with SMTP id n42mr24046258pjb.168.1590480303637; Tue, 26 May 2020 01:05:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590480303; cv=none; d=google.com; s=arc-20160816; b=ZvJful4+7CunOOBXZWc2ocbkE01TWxzJdOZZIdYJPbwJWrlMQ+cyrwp+AMWzuuKVpo OjYa2X5xArRcN2nHxhBFyndzULP2aKk5dFQDkRFfO6ecMxIvTlvX+AU6UKbk7SbvRH+H 05rA6oR9yLLpGBSO1bWrA50DPVsXiOPPSR5x35tdr2kIE6+5+tctisDMY+w92L6A8DAv C08vE2gDt9lDOT7yINnbCn5peTsnes//xk0GdiwpIFF/sK86sLscvjSW8WcIW4IrjI0i HQAJskisbThSt9V7hJ1Z5fye6RswvQ7sTIfhtfI5iSv+RWYfMWFoJUIk3pPAwIfvCtL5 pvKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=qrVghBB7JSxjIZSUyBjK84ALd6P4pQQ3oC3TbjFk5YU=; b=LzqssCLhrFgVYfFuwIDff3bHbpXQ9PVJojPY8Wpst6Poxhgi4hz81ttEUUSjz3CJlk k7Cgwo+VmPZ448eYTvUk0vYskpQEH+IGFVwWrmtoiNKeAeFSeXIn5wnDbi2k691L7LLl DPeUf632AkDO6zOG8p1J/Ep/JbFLW6Eyuo17x1upXed1asn26wxzDHnmDr+8HX71LTxk w8wakFvSNG0X0cqWAZdRp34LRpxcLbR+efoVHDJ/QKyN8BY5664eWC8ilGMsyr9kdQ1x w90iVmdyyltOdMAda7rhNGDSi2DVGnyidE/Hb1pbO2PQWG/S609guFhaIUZTITW6iM0U Ompg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=VUenlMb7; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id h7sor7488803plk.47.2020.05.26.01.05.03 for (Google Transport Security); Tue, 26 May 2020 01:05:03 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:7448:: with SMTP id e8mr30965333plt.161.1590480303237; Tue, 26 May 2020 01:05:03 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:3:4404:74c7:87fd]) by smtp.gmail.com with ESMTPSA id d8sm14560782pfq.123.2020.05.26.01.05.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 01:05:02 -0700 (PDT) From: Jagan Teki To: Simon Glass , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 8/9] spi: Zap SOFT_SPI (non-dm) Date: Tue, 26 May 2020 13:34:29 +0530 Message-Id: <20200526080430.118262-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200526080430.118262-1-jagan@amarulasolutions.com> References: <20200526080430.118262-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=VUenlMb7; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , - Deadline for DM migration already passed by months. - Sent couple of zap patches and - No response on dm conversation hence removed the driver. Signed-off-by: Jagan Teki Reviewed-by: Simon Glass --- drivers/spi/Kconfig | 13 ++- drivers/spi/Makefile | 1 - drivers/spi/soft_spi_legacy.c | 168 ---------------------------------- 3 files changed, 6 insertions(+), 176 deletions(-) delete mode 100644 drivers/spi/soft_spi_legacy.c diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 46a7b9e9d3..09b9cb17d8 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -292,6 +292,12 @@ config SPI_SIFIVE The SiFive SPI controller driver is found on various SiFive SoCs. +config SOFT_SPI + bool "Soft SPI driver" + help + Enable Soft SPI driver. This driver is to use GPIO simulate + the SPI protocol. + config SPI_SUNXI bool "Allwinner SoC SPI controllers" default ARCH_SUNXI @@ -397,13 +403,6 @@ config ZYNQMP_GQSPI endif # if DM_SPI -config SOFT_SPI - bool "Soft SPI driver" - depends on DM_SPI || (DEPRECATED && !DM_SPI) - help - Enable Soft SPI driver. This driver is to use GPIO simulate - the SPI protocol. - config FSL_ESPI bool "Freescale eSPI driver" imply SPI_FLASH_BAR diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile index 342776404a..54881a7412 100644 --- a/drivers/spi/Makefile +++ b/drivers/spi/Makefile @@ -13,7 +13,6 @@ obj-$(CONFIG_TI_QSPI) += ti_qspi.o else obj-y += spi.o obj-$(CONFIG_SPI_MEM) += spi-mem-nodm.o -obj-$(CONFIG_SOFT_SPI) += soft_spi_legacy.o endif obj-$(CONFIG_ALTERA_SPI) += altera_spi.o diff --git a/drivers/spi/soft_spi_legacy.c b/drivers/spi/soft_spi_legacy.c deleted file mode 100644 index cc5ab5f991..0000000000 --- a/drivers/spi/soft_spi_legacy.c +++ /dev/null @@ -1,168 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2002 - * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com. - * - * Influenced by code from: - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. - */ - -#include -#include - -#include - -/*----------------------------------------------------------------------- - * Definitions - */ - -#ifdef DEBUG_SPI -#define PRINTD(fmt,args...) printf (fmt ,##args) -#else -#define PRINTD(fmt,args...) -#endif - -struct soft_spi_slave { - struct spi_slave slave; - unsigned int mode; -}; - -static inline struct soft_spi_slave *to_soft_spi(struct spi_slave *slave) -{ - return container_of(slave, struct soft_spi_slave, slave); -} - -/*=====================================================================*/ -/* Public Functions */ -/*=====================================================================*/ - -struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, - unsigned int max_hz, unsigned int mode) -{ - struct soft_spi_slave *ss; - - if (!spi_cs_is_valid(bus, cs)) - return NULL; - - ss = spi_alloc_slave(struct soft_spi_slave, bus, cs); - if (!ss) - return NULL; - - ss->mode = mode; - - /* TODO: Use max_hz to limit the SCK rate */ - - return &ss->slave; -} - -void spi_free_slave(struct spi_slave *slave) -{ - struct soft_spi_slave *ss = to_soft_spi(slave); - - free(ss); -} - -int spi_claim_bus(struct spi_slave *slave) -{ -#ifdef CONFIG_SYS_IMMR - volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR; -#endif - struct soft_spi_slave *ss = to_soft_spi(slave); - - /* - * Make sure the SPI clock is in idle state as defined for - * this slave. - */ - if (ss->mode & SPI_CPOL) - SPI_SCL(1); - else - SPI_SCL(0); - - return 0; -} - -void spi_release_bus(struct spi_slave *slave) -{ - /* Nothing to do */ -} - -/*----------------------------------------------------------------------- - * SPI transfer - * - * This writes "bitlen" bits out the SPI MOSI port and simultaneously clocks - * "bitlen" bits in the SPI MISO port. That's just the way SPI works. - * - * The source of the outgoing bits is the "dout" parameter and the - * destination of the input bits is the "din" parameter. Note that "dout" - * and "din" can point to the same memory location, in which case the - * input data overwrites the output data (since both are buffered by - * temporary variables, this is OK). - */ -int spi_xfer(struct spi_slave *slave, unsigned int bitlen, - const void *dout, void *din, unsigned long flags) -{ -#ifdef CONFIG_SYS_IMMR - volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR; -#endif - struct soft_spi_slave *ss = to_soft_spi(slave); - uchar tmpdin = 0; - uchar tmpdout = 0; - const u8 *txd = dout; - u8 *rxd = din; - int cpol = ss->mode & SPI_CPOL; - int cpha = ss->mode & SPI_CPHA; - unsigned int j; - - PRINTD("spi_xfer: slave %u:%u dout %08X din %08X bitlen %u\n", - slave->bus, slave->cs, *(uint *)txd, *(uint *)rxd, bitlen); - - if (flags & SPI_XFER_BEGIN) - spi_cs_activate(slave); - - for(j = 0; j < bitlen; j++) { - /* - * Check if it is time to work on a new byte. - */ - if ((j % 8) == 0) { - if (txd) - tmpdout = *txd++; - else - tmpdout = 0; - if(j != 0) { - if (rxd) - *rxd++ = tmpdin; - } - tmpdin = 0; - } - - if (!cpha) - SPI_SCL(!cpol); - SPI_SDA(tmpdout & 0x80); - SPI_DELAY; - if (cpha) - SPI_SCL(!cpol); - else - SPI_SCL(cpol); - tmpdin <<= 1; - tmpdin |= SPI_READ; - tmpdout <<= 1; - SPI_DELAY; - if (cpha) - SPI_SCL(cpol); - } - /* - * If the number of bits isn't a multiple of 8, shift the last - * bits over to left-justify them. Then store the last byte - * read in. - */ - if (rxd) { - if ((bitlen % 8) != 0) - tmpdin <<= 8 - (bitlen % 8); - *rxd++ = tmpdin; - } - - if (flags & SPI_XFER_END) - spi_cs_deactivate(slave); - - return(0); -}