Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp20617ybh; Tue, 17 Mar 2020 17:18:25 -0700 (PDT) X-Google-Smtp-Source: ADFU+vspjywt1+ytE53+Ytogv/aX7/CPZit59KS5mlQJDaf1fV7RcI94meb6CMSOaeXR9VRl9MNt X-Received: by 2002:aca:4287:: with SMTP id p129mr1182816oia.168.1584490705777; Tue, 17 Mar 2020 17:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584490705; cv=none; d=google.com; s=arc-20160816; b=qJevxlHaEwp84cOOFZUaxb0XTZrlT1nOdLZrv+OJXzWpAR8pJnaAC0umQkwo6LXxS5 CnTaZH9TdBQuiC0dJGM7mmedOjNyotCl6BlWTWZgeJzf3h8pDLTjP5TqyLYfrtwC1nub k3CjO6oDnLZmB1rwRLfve1iMXbkd9STqfj8P0unfPYPLPOdaJEMsYKCCE8IzCVdhlr2T oZJKlW7vDgKfPRHxkZgYKdnAccZ4xlsUm1z5MtLdzC9UqOLkruibCsOmvv6EbV9foRit xc5Emb/3vWVC6narVv4yChrTBt5uMX4LB2igSXN8EX7XP2VwITdNHeffJNXO3UsUKpr/ RI+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=e8zpgtiG0w2opJ4PQ2uuwoYe8iOMFJzU+1DygKuJLws=; b=jJpOuSPutLVv5MxUyHmnnN1T9b+g0giQxrx4UinVAYN7KJvLHi8lR1vU/SrN+zGw+l 2ODfz3V4gxGBMHKzrUOmjbmVdpC6iwKFP3117VRCnaG+VIjmcZDDC7vMsNr9Bq2Di3Ds GUiEKpDgNvRrmkZYQnl69iCo7HCr+xNHQlaA6V9bHuLtRidXgFBO8zSwGlPT2A9jn7Oi VutKh5k5xsATQFTjpdr5vRFJMTDekpkylEGvr3UrpP8mRTVmQt59ivzZ6JlVPhfzG5cK aMtgxLlnZ/7TA0/ntRIAk1pzJAhRy0wmZltIzQnYA8vH61CsSmwxWLnOYIePBWVwpSw7 n5ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rvaJFHhG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r23si2469617otq.255.2020.03.17.17.18.05; Tue, 17 Mar 2020 17:18:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rvaJFHhG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727408AbgCRARc (ORCPT + 99 others); Tue, 17 Mar 2020 20:17:32 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:43521 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727339AbgCRARW (ORCPT ); Tue, 17 Mar 2020 20:17:22 -0400 Received: by mail-wr1-f65.google.com with SMTP id b2so21867548wrj.10; Tue, 17 Mar 2020 17:17:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=e8zpgtiG0w2opJ4PQ2uuwoYe8iOMFJzU+1DygKuJLws=; b=rvaJFHhGMAYFRsIhjMw3stPetGwHRLpuYoUup/pPcFMokhLv76eYrYuwsxXW82AThE Le7LTysiWqmJV5kGluDvnnSKUBhd3sUtY+sPsJKA/paMBl6Z/JhCqmG9gxcr5xVBe+QD OuqkjG9wCwe1YP9C0mpklSkUqMCmrIfDI33QF4wpadkrSveq/vZ8e8bSIFdIXQt7/dGZ ne5GEPP+l5lDukbrA6KAf++aoZFflGFAiyFa+j4wBHjaTcYxBUf8x+UbEJuHxET2UPSS awFjJXp1+075Xfx+l9T782jG0ZqrvDwIY1q65EnYEHYLau6P2gKXS00H/sWCTF3Vk9YE q9Uw== 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; bh=e8zpgtiG0w2opJ4PQ2uuwoYe8iOMFJzU+1DygKuJLws=; b=P99Kb+MwHzB5xbH3ZA8rFUWkV+mWORLSmemHJtpMHZOFRHzhO6HL/T1lybbsHp1fdB WPjhdt7Re0bIAhQyaYpsL8BFATx9DiWul5WbwWxJZAmZM20lgVRwuRNyx2CfcyblTijo OMA5HCgQzw30y1Ytzd6w5a7Us4aFgTe657QeBzeIEGaHiCsXpTPF1/fVTAtLSn6oQUM7 dV3GTkcTYIw6DAKsKQOSfCLYgJ6z2wJ0Fm+4gL8BCbNSGlTBBYrZx4w1o6A+9DRHzjbU 0f3jSO9HyCFli7HE/3RTaP2Q8P/FDwiwbAQNuiZWgBrayTbtRZsOSgRl7CaPDeP1759v XMFA== X-Gm-Message-State: ANhLgQ1JrOEum8KPoCEGhZ2W4ADXKlGQEonReVpteRSZFiLd1L4Oc+XJ 8cIII/w68No1BhmTEmVxDAQ= X-Received: by 2002:adf:dfc6:: with SMTP id q6mr1508818wrn.375.1584490640603; Tue, 17 Mar 2020 17:17:20 -0700 (PDT) Received: from localhost.localdomain ([79.115.60.40]) by smtp.gmail.com with ESMTPSA id i6sm6584600wru.40.2020.03.17.17.17.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2020 17:17:19 -0700 (PDT) From: Vladimir Oltean To: broonie@kernel.org Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, shawnguo@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, eha@deif.com, angelo@sysam.it, andrew.smirnov@gmail.com, gustavo@embeddedor.com, weic@nvidia.com, mhosny@nvidia.com, michael@walle.cc, peng.ma@nxp.com Subject: [PATCH v5 10/12] spi: spi-fsl-dspi: Add support for LS1028A Date: Wed, 18 Mar 2020 02:16:01 +0200 Message-Id: <20200318001603.9650-11-olteanv@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200318001603.9650-1-olteanv@gmail.com> References: <20200318001603.9650-1-olteanv@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vladimir Oltean This is similar to the DSPI instantiation on LS1028A, except that: - The A-011218 erratum has been fixed, so DMA works - The endianness is different, which has implications on XSPI mode Some benchmarking with the following command: spidev_test --device /dev/spidev2.0 --bpw 8 --size 256 --cpha --iter 10000000 --speed 20000000 shows that in DMA mode, it can achieve around 2400 kbps, and in XSPI mode, the same command goes up to 4700 kbps. This is somewhat to be expected, since the DMA buffer size is extremely small at 8 bytes, the winner becomes whomever can prepare the buffers for transmission quicker, and DMA mode has higher overhead there. So XSPI FIFO mode has been chosen as the operating mode for this chip. Signed-off-by: Vladimir Oltean --- Changes in v5: None. Changes in v4: None. Changes in v3: Removed the dma_bufsize variable (obsoleted by 03/12). Changes in v2: Switch to DSPI_XSPI_MODE. drivers/spi/spi-fsl-dspi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 5873752a091e..50e41f66a2d7 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -124,6 +124,7 @@ struct fsl_dspi_devtype_data { enum { LS1021A, LS1012A, + LS1028A, LS1043A, LS1046A, LS2080A, @@ -151,6 +152,11 @@ static const struct fsl_dspi_devtype_data devtype_data[] = { .max_clock_factor = 8, .fifo_size = 16, }, + [LS1028A] = { + .trans_mode = DSPI_XSPI_MODE, + .max_clock_factor = 8, + .fifo_size = 4, + }, [LS1043A] = { /* Has A-011218 DMA erratum */ .trans_mode = DSPI_XSPI_MODE, @@ -1050,6 +1056,9 @@ static const struct of_device_id fsl_dspi_dt_ids[] = { }, { .compatible = "fsl,ls1012a-dspi", .data = &devtype_data[LS1012A], + }, { + .compatible = "fsl,ls1028a-dspi", + .data = &devtype_data[LS1028A], }, { .compatible = "fsl,ls1043a-dspi", .data = &devtype_data[LS1043A], -- 2.17.1