From patchwork Tue May 26 17:44:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1255 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 721043F1FD for ; Tue, 26 May 2020 19:45:11 +0200 (CEST) Received: by mail-il1-f197.google.com with SMTP id d8sf18343774ilo.1 for ; Tue, 26 May 2020 10:45:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1590515110; cv=pass; d=google.com; s=arc-20160816; b=dJaL/Q16KMeJ0oy9lL7Xyy0QjT57/O45eojZKOlz1IGKgmQStT+/9gGOprNmArvQpx 1vyk2qcswbnJGupDmRLErZYmJgZsn6U3hziFODPXQTp9Qpjdnb3egZ8HdoWg6BF9387z K+ZYS0TkK0dcyI8xSWs4ncmrdKNvRaA9pE+vWrgL3QDkQavU264/xiM6UKxQi1KUlghz /He9EXMVRiy+WERGHcktAf7zIQFiEF/2jI/THY6dVLpx0CuIj92OxAGx+bh2BcBNFVLv H2lEjy8GCfLFpta4oTwcBcT8BM+Tv/ByEmVXQeAqyR+wETybvnJC8/+ATtG+QGKLkCIZ GlQQ== 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=krdvmat3yTZzwmLUr3l/NvBblw0UiZIagbhmKZOFbuE=; b=Dbf28czdDO6DNWgrZbm1QfILL2tud6y5io26Rb0RArLMIlc+mr3jcD15ajbL3YuWkb IQafqkJ/WHWSVXnqOREbaNiaRo53UFqg9HQjWHXvOsvTO7AqHsBtNRpYzS+ujG02tqlt ikbXquFXDwQABBTA3shgCEzOMz6Ag7PBDwW4HT4ppJzd3oJIPALnJ8UIfj28uxAFcpwP QEMcNWO045/0mvYVMjavOgzK1Bxho12ZevfCItsQAkiyRXcSMQWawdmeWy/cLhNyeSwm s1Ysf3zQxjpELFnh+hW7Dji/+cyF2EvN/1iV6gSBgFh+ksOF3LQ6V9ppC2MvTs9b9ylu PN8A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Ozw8M8z4; 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=krdvmat3yTZzwmLUr3l/NvBblw0UiZIagbhmKZOFbuE=; b=K0GVmylrj9uLUOLCUOQ1ZgSQ2/sxcQC3rTN/BuzGu47b6F5F/NGBv2Dv1lprvEyxUL /JU51CfrJuHOjLWQTY3/MCjM6rHD+WdmxeeimxLyCtUGE/PtH0yLcmMhA170lByeq3/B raWwNMEW2cnd593dL2pcS/HDNUM5nnPUOhGYo= 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=krdvmat3yTZzwmLUr3l/NvBblw0UiZIagbhmKZOFbuE=; b=aZIo/O7A6Io9NgcyOsZzEWDSRxyCrZqqVJMxka1Loklvy4g7RI1NKYAvgC9/DMqB// M/RpYpdZMpSy3qGipsmOozVCOgldGE5LaL9mm6Py4nF0nuuZT72rJU/eKjBJUi+r61dM SeOrP4y+ZbXv1J556AFkwbIQEuEMQl2xdAc+Q3gTuQEQieKDAqqz6AyNwZj9NrLRGeoa hzErMkcsVA9C2mLg1jBe/Dl5L3cXQnvrgu350H8JU9lc+6cV8/2MEl4AW15QsjUE8rI1 50TSNA9FS+EyCXk9/PW0Awpbd9UBC2Me2ckjTzScF3obSyaUOJP8Lq4tjTLo5V7GLSQl beCg== X-Gm-Message-State: AOAM532xwZeh9FmCDmRgwHvUQxZXT3SVnwXP76YZwwtINGaK67zpILrW mLacYfiKoCT8kz1BFylbYvtBZOdR X-Google-Smtp-Source: ABdhPJzYHow58l33hr0PThd4XStNokgtlL54SDULVAT/d31AP3Iq8iQTnF6JOhN+oVUBryBMs5tZnQ== X-Received: by 2002:a6b:38c4:: with SMTP id f187mr10061601ioa.205.1590515109613; Tue, 26 May 2020 10:45:09 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a5d:990c:: with SMTP id x12ls1833479iol.6.gmail; Tue, 26 May 2020 10:45:09 -0700 (PDT) X-Received: by 2002:a5e:9705:: with SMTP id w5mr17578582ioj.86.1590515109190; Tue, 26 May 2020 10:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590515109; cv=none; d=google.com; s=arc-20160816; b=DJIw/4UJvXhERcvB3iM1hGkNyl8g372QLzszTgHdaOdnsPXqjSdRnR0Kmk+Y693bxa BlUB+4sVZBaD71fXxs6HooP5D13yGW2soqyR1ygiSIs8qQCNIqnl/CTte41++usqMHF5 H0yjoP8m/46sGqKX78xwJi5x1ZDg8f410g3Cgy8YYvMp9WZP9Y+WKRWYRDTbGR7r95gl xgCyQjVyGMmHhmheeOc6U1KY1kBdpQhWid9mwQ8XWC2rXdxhZ/CIM9PPnzCwAc6YnvdA R9ybIYTh7g/NyjWZvZYociwSQQ5ikKQvIebFzqy7hx0/RHwPm91um+5dz8Je7Eg3PZYk C6SA== 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=Ej3Pt4yqODqwNCUl0xOabo8u78qNjq/qmGMnUTHK7Wc=; b=RWxl/pDccf7sHDTrFRZ0R+c8NGBaR/uN2KjIaCF5wMCBCTLJ7XIAy1AzsBtguLdtpE P+l/eQwJ5pNIf6wpRT/X2NwlCB0gR69wjsRAYnO0DEdiuQ/QxBv2AoAUHWfJtK8AAq32 H+OpmMXUfmcI3XL9pLoXGNHM51GfWHKxd1OUfBJyK7Ot5bG9Tr0fUII97jXRpZ9kYz73 O9rWtVCLJPahoxiMjAUjRZ3CffbGlCb8qFTLTWXmbVOdrxs/YHmbFayiQ53ptf53477w vd/NIdd+vueGdUqzhawNVjqqk9kARvR3dd/8M6Z8HbJD9RQEgqyK9fnOfl1IR0HXWt/+ HI3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Ozw8M8z4; 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 o129sor289191iof.93.2020.05.26.10.45.09 for (Google Transport Security); Tue, 26 May 2020 10:45:09 -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:a63:741c:: with SMTP id p28mr33472pgc.33.1590515108798; Tue, 26 May 2020 10:45:08 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:34bf:6d2b:f49c:646b]) by smtp.gmail.com with ESMTPSA id x20sm136232pfc.211.2020.05.26.10.45.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 10:45:08 -0700 (PDT) From: Jagan Teki To: Simon Glass , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 01/14] spi: fsl_dspi: Drop nondm code Date: Tue, 26 May 2020 23:14:36 +0530 Message-Id: <20200526174444.262050-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200526174444.262050-1-jagan@amarulasolutions.com> References: <20200526174444.262050-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=Ozw8M8z4; 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: , Drop the nondm code from fsl_dspi.c since there is no board or any other code using it. Signed-off-by: Jagan Teki --- drivers/spi/fsl_dspi.c | 132 ----------------------------------------- 1 file changed, 132 deletions(-) diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c index 1cdb233110..78ad61ca37 100644 --- a/drivers/spi/fsl_dspi.c +++ b/drivers/spi/fsl_dspi.c @@ -100,13 +100,6 @@ struct fsl_dspi_priv { struct dspi *regs; }; -#ifndef CONFIG_DM_SPI -struct fsl_dspi { - struct spi_slave slave; - struct fsl_dspi_priv priv; -}; -#endif - __weak void cpu_dspi_port_conf(void) { } @@ -414,131 +407,7 @@ static int fsl_dspi_cfg_speed(struct fsl_dspi_priv *priv, uint speed) return 0; } -#ifndef CONFIG_DM_SPI -int spi_cs_is_valid(unsigned int bus, unsigned int cs) -{ - if (((cs >= 0) && (cs < 8)) && ((bus >= 0) && (bus < 8))) - return 1; - else - return 0; -} - -struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, - unsigned int max_hz, unsigned int mode) -{ - struct fsl_dspi *dspi; - uint mcr_cfg_val; - - dspi = spi_alloc_slave(struct fsl_dspi, bus, cs); - if (!dspi) - return NULL; - - cpu_dspi_port_conf(); - -#ifdef CONFIG_SYS_FSL_DSPI_BE - dspi->priv.flags |= DSPI_FLAG_REGMAP_ENDIAN_BIG; -#endif - - dspi->priv.regs = (struct dspi *)MMAP_DSPI; - -#ifdef CONFIG_M68K - dspi->priv.bus_clk = gd->bus_clk; -#else - dspi->priv.bus_clk = mxc_get_clock(MXC_DSPI_CLK); -#endif - dspi->priv.speed_hz = FSL_DSPI_DEFAULT_SCK_FREQ; - - /* default: all CS signals inactive state is high */ - mcr_cfg_val = DSPI_MCR_MSTR | DSPI_MCR_PCSIS_MASK | - DSPI_MCR_CRXF | DSPI_MCR_CTXF; - fsl_dspi_init_mcr(&dspi->priv, mcr_cfg_val); - - for (i = 0; i < FSL_DSPI_MAX_CHIPSELECT; i++) - dspi->priv.ctar_val[i] = DSPI_CTAR_DEFAULT_VALUE; - -#ifdef CONFIG_SYS_DSPI_CTAR0 - if (FSL_DSPI_MAX_CHIPSELECT > 0) - dspi->priv.ctar_val[0] = CONFIG_SYS_DSPI_CTAR0; -#endif -#ifdef CONFIG_SYS_DSPI_CTAR1 - if (FSL_DSPI_MAX_CHIPSELECT > 1) - dspi->priv.ctar_val[1] = CONFIG_SYS_DSPI_CTAR1; -#endif -#ifdef CONFIG_SYS_DSPI_CTAR2 - if (FSL_DSPI_MAX_CHIPSELECT > 2) - dspi->priv.ctar_val[2] = CONFIG_SYS_DSPI_CTAR2; -#endif -#ifdef CONFIG_SYS_DSPI_CTAR3 - if (FSL_DSPI_MAX_CHIPSELECT > 3) - dspi->priv.ctar_val[3] = CONFIG_SYS_DSPI_CTAR3; -#endif -#ifdef CONFIG_SYS_DSPI_CTAR4 - if (FSL_DSPI_MAX_CHIPSELECT > 4) - dspi->priv.ctar_val[4] = CONFIG_SYS_DSPI_CTAR4; -#endif -#ifdef CONFIG_SYS_DSPI_CTAR5 - if (FSL_DSPI_MAX_CHIPSELECT > 5) - dspi->priv.ctar_val[5] = CONFIG_SYS_DSPI_CTAR5; -#endif -#ifdef CONFIG_SYS_DSPI_CTAR6 - if (FSL_DSPI_MAX_CHIPSELECT > 6) - dspi->priv.ctar_val[6] = CONFIG_SYS_DSPI_CTAR6; -#endif -#ifdef CONFIG_SYS_DSPI_CTAR7 - if (FSL_DSPI_MAX_CHIPSELECT > 7) - dspi->priv.ctar_val[7] = CONFIG_SYS_DSPI_CTAR7; -#endif - fsl_dspi_cfg_speed(&dspi->priv, max_hz); - - /* configure transfer mode */ - fsl_dspi_cfg_ctar_mode(&dspi->priv, cs, mode); - - /* configure active state of CSX */ - fsl_dspi_cfg_cs_active_state(&dspi->priv, cs, mode); - - return &dspi->slave; -} - -void spi_free_slave(struct spi_slave *slave) -{ - free(slave); -} - -int spi_claim_bus(struct spi_slave *slave) -{ - uint sr_val; - struct fsl_dspi *dspi = (struct fsl_dspi *)slave; - - cpu_dspi_claim_bus(slave->bus, slave->cs); - - fsl_dspi_clr_fifo(&dspi->priv); - - /* check module TX and RX status */ - sr_val = dspi_read32(dspi->priv.flags, &dspi->priv.regs->sr); - if ((sr_val & DSPI_SR_TXRXS) != DSPI_SR_TXRXS) { - debug("DSPI RX/TX not ready!\n"); - return -EIO; - } - - return 0; -} - -void spi_release_bus(struct spi_slave *slave) -{ - struct fsl_dspi *dspi = (struct fsl_dspi *)slave; - - dspi_halt(&dspi->priv, 1); - cpu_dspi_release_bus(slave->bus.slave->cs); -} - -int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, - void *din, unsigned long flags) -{ - struct fsl_dspi *dspi = (struct fsl_dspi *)slave; - return dspi_xfer(&dspi->priv, slave->cs, bitlen, dout, din, flags); -} -#else static int fsl_dspi_child_pre_probe(struct udevice *dev) { struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev); @@ -745,4 +614,3 @@ U_BOOT_DRIVER(fsl_dspi) = { .child_pre_probe = fsl_dspi_child_pre_probe, .bind = fsl_dspi_bind, }; -#endif