Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5198745imb; Thu, 7 Mar 2019 09:51:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxfnWEBuDwcIyIh8arYP3Eehi28P3ILZQsikT0qThMwceWZwnU1rZvvbJ5jN39DrilTitkI X-Received: by 2002:a62:484:: with SMTP id 126mr13861162pfe.91.1551981078925; Thu, 07 Mar 2019 09:51:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551981078; cv=none; d=google.com; s=arc-20160816; b=EF0ztd9kb2JTKxV2VrtO1W1qZV72j7ET8WM5BdeiRELf0L93rwufDIuhu09OdD8K7d jVi35wI/kvuAxKyabfbdkAcqbZs22UHEEoGFbJpzAuD6tLDrp0fkeUtl/hSrMbuxzg+1 cWjFBZhpSvNTFxg8jMiHE4hrSbG+y/icG+FAo3BcK1f4426yJDE91oBAKwbc+A7ro3kN mpZt3jg3Dd11GiIWvQ7g3opCI1Y804Uy/WmDNvMfONd01EQ+Zd5DtXOBKE5PanDIfs3L QCJiMiiZHynEx85Jo8wCBYpjvIxo/gp2wIA7850GUwhdvsy1RPydGWubhsMNr+CuY+xu QPrw== 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=nZoviCFVsTrCX9IAb32HfyhhfC36KNP7zZS1oreaM4w=; b=t9Pe7IGPbjXwRiO3ixk73WbU+CHZuRTLAAmEDyHZu8LGtUPSxaURfeXxDJXkMfG6zG xKcT/ZSeDB27i/d7XD6kkXCUYQatJrvatr0iEa9dYAeN1LEyK7V2oxLrTy8CXhIE5SxR S8X4zZNOvc32+zmDqhjdjMlp/fSdBy3LZ9spd/itKfZ8pK+8Jljfs3hvPFZzhDa2sbtF CifJ6xhgeMemtkCyGMRJXeaFJO75/8ooEwAwWfIHAFbeT/zXQ6SX6/VjSjTrZf1Y/aYm 3wEy7XlMjc+H172UjkertmZU8VTZxIjonqr1DRViiPcaxsumvOkl8I4sX/pr1y1Y0YbP bVNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=dsEIyU5H; 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 h12si4537161pll.332.2019.03.07.09.51.03; Thu, 07 Mar 2019 09:51:18 -0800 (PST) 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=dsEIyU5H; 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 S1727092AbfCGRum (ORCPT + 99 others); Thu, 7 Mar 2019 12:50:42 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:33427 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727131AbfCGRul (ORCPT ); Thu, 7 Mar 2019 12:50:41 -0500 Received: by mail-lf1-f68.google.com with SMTP id z23so12347987lfe.0 for ; Thu, 07 Mar 2019 09:50:40 -0800 (PST) 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=nZoviCFVsTrCX9IAb32HfyhhfC36KNP7zZS1oreaM4w=; b=dsEIyU5HeO9ZMz1GCrF7yggqbQtLDND6+HjB3ncGRNtiHMUWJZwmGnKgbZ8sIutHcR dskHBpHMPXa2sSYmZEnkX0gS96MiVZJiRTIdPlyWMMQU37mfsWhpqPqWcZhcLWE1PMLZ s1zprCq/IXOTT3hyPthhx1cUgeSpE4Qp4aiqemSZVn7Cg8L2RNM2pxx9HtP77T+C5EBC Q9nO9hSyonc4uEdkiEY7d5CKbhC+OCGAFmC5EgI29oh+Vg2jT4A/6Z5nzXq/XpBwXIvV IEKs6gz35mlMXED+kdBcuv6DXarPEhdZqdxWhIaPHTlItk1pYrQGxqbwcLpmSI8ZHAhp p9AA== 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=nZoviCFVsTrCX9IAb32HfyhhfC36KNP7zZS1oreaM4w=; b=Vl4RIFJqziMnYV41+tukZ91oDL8no9XYbchOJFMfXVAnOQRP4HrtYd/54ei6FPakiE LPSCdBvtQZ45uvzqYjyp5L752YqhrxMgptLklqilBdzm6w+nyeXQ/7DaoeTINVwY9U8C QJMYxthZYGTw1c12oZPGeytJJNBheBxMmOQ2IxsTBtYwnV9fzGwQ2TqhCIKGokjF6aoK kcTfFmaJ62iGBz4UCIqkKQBmTorzOohRUliMohAEBbuMct33OcdwqgEtEyleughGm5UG Zhr81fY+hkbs5BBUW/3bseEWCeScgqq80doYHFyTiYBCIc2I5drfWMLD8pYJgM4aI5Ws EtiQ== X-Gm-Message-State: APjAAAUs0qlBL6tjQ4Zs6swhwnvDiHXTFYokS6gox6Mn7Q0n9VIMbLCT JZMmkjUSiHq1ZZlznPQPtdtwaA== X-Received: by 2002:a19:4d08:: with SMTP id a8mr7725404lfb.14.1551981039808; Thu, 07 Mar 2019 09:50:39 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.80.179]) by smtp.gmail.com with ESMTPSA id z22sm958466lfb.66.2019.03.07.09.50.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Mar 2019 09:50:39 -0800 (PST) Subject: Re: [PATCH v8 1/2] spi: Add Renesas R-Car Gen3 RPC-IF SPI controller driver To: Mason Yang , broonie@kernel.org, marek.vasut@gmail.com, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, bbrezillon@kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Cc: juliensu@mxic.com.tw, Simon Horman , zhengxunli@mxic.com.tw References: <1548658158-5460-1-git-send-email-masonccyang@mxic.com.tw> <1548658158-5460-2-git-send-email-masonccyang@mxic.com.tw> From: Sergei Shtylyov Organization: Cogent Embedded Message-ID: <0c54ee2c-016a-bc8e-33ae-fbd04191cc49@cogentembedded.com> Date: Thu, 7 Mar 2019 20:50:37 +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: <1548658158-5460-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 01/28/2019 09:49 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..ea12017 > --- /dev/null > +++ b/drivers/spi/spi-renesas-rpc.c > @@ -0,0 +1,804 @@ [...] > +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)); > +} We clearly need runtime PM get/put() calls around this code. Otherwise, we're dependant on U-Boot leaving the clocks enabled... [...] MBR, Sergei