Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp1172931ybh; Sat, 3 Aug 2019 19:45:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwM4RFGJp0ZgysJW8Sbk8dUFVF+PGWK2U8CDYRCkHSe3lNMJJJF0O2B0NAdzKYOGKdIdwpR X-Received: by 2002:aa7:8d98:: with SMTP id i24mr67722295pfr.199.1564886745053; Sat, 03 Aug 2019 19:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564886745; cv=none; d=google.com; s=arc-20160816; b=MqmVGMB3bcf9t8vRSsQH1+mB6FQlUd2agOscVcPjdvpieWW9cI+Cp6S2ApdG/1AGoa Se3NZZ71suZmJLv2imHQHs1GUaLiq/c+JRrJ6lXaADnRjOdKDp4KWqS9q0YE9OPPzAAp g7/VIHaKWm1o3dRbLROPNAf1FLlPl0n9duNEkUtLz57HMXYqR8N7Bzba22ebY/n7+B58 R44Cmoh/jZ9G8I6Ju9QDcdOfwmgGXqhTXJkUR27vcJhKz8nQxXB4IBWdl0G7knSyh50d +A5xAY97ENHdZ8NyHIYmSq1/y9qoQ5YnaBwATmIfFVelGcafm4T0Q9PE/nzMK3d9PsVj QWrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=hpuTzhx1FVHJuZgr5jSuA0pIA55oDK7JUhCEyDcVxSE=; b=AaJNPmhS1TBzvvyOkYGYVe6SmBd4G9QIs4jCPF9VuMGo3v8Ymv8Jfn7Urge1J8eLlW Cqb2igQDWGF7PbHxaGaqsNQ+ZA3flOnh+FLQMdZLRBl1JGkqPCnGC4TR7P3Oj39hmV5L W1tqbrX5Tc68LWsXl1w6MxMrP4zD6iz9ZTQO3o5Est9OqqpW/mIDYp5CjnhKh9TWwgZV o+f8cDQPXZ0zjaiNZPJXa0cfGrDzGj0ZWXxC/kw58sDBFHtFY1psAnRA1F0gp4WfEGpZ vR0k8u+rts+h7OaQGEg3x6ky1Z7QdZKqDp7shmmv7hUCm3zolVJNHRi7PzFy5QBNjQK4 yTjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=wBmt0ywL; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x22si38612381pln.150.2019.08.03.19.45.29; Sat, 03 Aug 2019 19:45:45 -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=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=wBmt0ywL; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406922AbfHBUCw (ORCPT + 99 others); Fri, 2 Aug 2019 16:02:52 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:41363 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406874AbfHBUCw (ORCPT ); Fri, 2 Aug 2019 16:02:52 -0400 Received: by mail-lj1-f193.google.com with SMTP id d24so73938329ljg.8 for ; Fri, 02 Aug 2019 13:02:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=hpuTzhx1FVHJuZgr5jSuA0pIA55oDK7JUhCEyDcVxSE=; b=wBmt0ywLgJWYJj9xynw/KNxS4SjEr9t/KIEOPU24ufBNh19LovY3N7lJPm24nnqQ20 pIKJTS1vLifN8c/woH0Oci4IWjOAFLYr6r8eUw5pCEq8B2d/myDS1Bb7AA2ubg4f/pz8 I7z8m93YOo+xslV5nrBNuYZok8tVIdfNZ/RoU8whUspDiy6ovAEvzCTcGOue5S/0FdsR adfDiYkW8sCdw/qcymjvfpWxnxVQxJDB09Ht3CFphaHGDujMqpjiLwBL3d900USKyhQb gZVLgsa/d1BNdPl5fOJcmSV2+RnKYKaZpF/sozNkgPtVsLYfwF1VMTC6zjigDx83L5Ec wkyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=hpuTzhx1FVHJuZgr5jSuA0pIA55oDK7JUhCEyDcVxSE=; b=C66C5dKr72Ah4ac1mOkHj4P9FHG6PWcAd9n5tm16s/jzJHAGcjZl12+1bsMU4Ei84j oLamW1TPKFHqicOGrsX1B7407oVPxmjYKrrHB5xP9IiEB9rg+vrQ6jlW9dChghTO5kbC LvRFmTnwCZwvHKwcQgjS/udi3N2dfus4GOTnoFGr5af8sxH+NxJCefUKIrJY2OR15dWj TjK+U2HDbhUqwkCgYfxVZXPNZBNBZRQ8+ZfFFbKFLO8hXnq6AGmmnETyPeR0kwWfYH2n 56tf51kJ6qaRGW+Anhatuvpl7Phk2N8qXy+Wia4RhsOEon7xLiSVZfisbUDRA7ZrM6OX qC2Q== X-Gm-Message-State: APjAAAUyNjqus8euhAlMjBV4UtOGXE4R4hDAuBuly9c20LLbPA7UE+M9 oIocj6l3Nd45LaBriYyFFiNV5A== X-Received: by 2002:a2e:7a19:: with SMTP id v25mr1650866ljc.39.1564776170382; Fri, 02 Aug 2019 13:02:50 -0700 (PDT) Received: from wasted.cogentembedded.com ([2a00:1fa0:29d:bda0:a422:fe4d:8f49:44c4]) by smtp.gmail.com with ESMTPSA id j23sm13046148lfb.93.2019.08.02.13.02.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Aug 2019 13:02:49 -0700 (PDT) Subject: Re: [PATCH v16 1/2] spi: Add Renesas R-Car Gen3 RPC-IF SPI controller driver To: Mason Yang , broonie@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven , devicetree@vger.kernel.org Cc: juliensu@mxic.com.tw, Simon Horman , lee.jones@linaro.org, marek.vasut@gmail.com, miquel.raynal@bootlin.com References: <1564539258-16313-1-git-send-email-masonccyang@mxic.com.tw> <1564539258-16313-2-git-send-email-masonccyang@mxic.com.tw> From: Sergei Shtylyov Organization: Cogent Embedded Message-ID: <3d01957a-7318-274f-f3d5-6cd00850511b@cogentembedded.com> Date: Fri, 2 Aug 2019 23:02:48 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1564539258-16313-2-git-send-email-masonccyang@mxic.com.tw> Content-Type: text/plain; charset=utf-8 Content-Language: en-MW Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On 07/31/2019 05:14 AM, Mason Yang wrote: > Add a driver for Renesas R-Car Gen3 RPC-IF SPI controller. > > Signed-off-by: Mason Yang > Signed-off-by: Sergei Shtylyov [...] > diff --git a/drivers/spi/spi-renesas-rpc.c b/drivers/spi/spi-renesas-rpc.c > new file mode 100644 > index 0000000..648d14e > --- /dev/null > +++ b/drivers/spi/spi-renesas-rpc.c > @@ -0,0 +1,754 @@ [...] > +static void rpc_spi_hw_init(struct rpc_spi *rpc) > +{ > + // > + // NOTE: The 0x260 are undocumented bits, but they must be set. > + // RPC_PHYCNT_STRTIM is strobe timing adjustment bit, > + // 0x0 : the delay is biggest, > + // 0x1 : the delay is 2nd biggest, > + // On H3 ES1.x, the value should be 0, while on others, > + // the value should be 6. > + // > + regmap_write(rpc->regmap, RPC_PHYCNT, RPC_PHYCNT_CAL | > + RPC_PHYCNT_STRTIM(6) | 0x260); > + > + // > + // NOTE: The 0x1511144 are undocumented bits, but they must be set > + // for RPC_PHYOFFSET1. > + // The 0x31 are undocumented bits, but they must be set > + // for RPC_PHYOFFSET2. > + // > + regmap_write(rpc->regmap, RPC_PHYOFFSET1, RPC_PHYOFFSET1_DDRTMG(3) | > + 0x1511144); > + regmap_write(rpc->regmap, RPC_PHYOFFSET2, 0x31 | > + RPC_PHYOFFSET2_OCTTMG(4)); > + regmap_write(rpc->regmap, RPC_SSLDR, RPC_SSLDR_SPNDL(7) | > + RPC_SSLDR_SLNDL(7) | RPC_SSLDR_SCKDL(7)); > + regmap_write(rpc->regmap, RPC_CMNCR, RPC_CMNCR_MD | RPC_CMNCR_SFDE | > + RPC_CMNCR_MOIIO_HIZ | RPC_CMNCR_IOFV_HIZ | > + RPC_CMNCR_BSZ(0)); > +} [...] > +static int rpc_spi_io_xfer(struct rpc_spi *rpc, > + const void *tx_buf, void *rx_buf) > +{ [...] > +err_out: > + return reset_control_reset(rpc->rstc); Don't toy need to call rpc_spi_hw_init(( here? The reset would spoil the PHY/etc register setup otherwise... [...] MBR, Sergei