Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp672458ybm; Wed, 22 May 2019 09:34:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqws44ANhCNXmc0hn9J9q7jxFEmqMvVqbH/0SgZHeb4nM7XBLvrqsoNt9vTw1hR2Gn9DMvcu X-Received: by 2002:a63:1a03:: with SMTP id a3mr92216144pga.412.1558542889406; Wed, 22 May 2019 09:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558542889; cv=none; d=google.com; s=arc-20160816; b=JLfRSJEJmoH1qzlB44vWSo1U9k7rLe3OFNPiTO2QP1ILVJ0q/4KpSZ9zwhr0dlYzkT AJAeJgJebAehV72VpHo+Mu3pWTl0wjlwag17oPt8M2RFLVtXVBcVGZEhMFSFYzNQNW7Y dbZS0/ZCW26Nit0r2PgWSCTQVZdasVct0ORzUiIyDMC63AwLLkb23kcfhx0S/MsGvgyw QfS8a4zJFZwPU01rBRQtoDDElwXkL5XyY20AI49kXX+rYl4NyJ67Gw1QWToyQb++cPe/ cSavhcUh4OR92tFdzimHTCHUgMCRTNudwrkoaW46PnwHt6UwLACl3h57dz4/UMumFpEg j9LQ== 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=qThinqX735sf8pV9gEurKexsu6v0KDCesOpmYS6C1nU=; b=jhl4UXcnhhVz1Kyx4EKE5qONtje90kUxB62f6+5wN68CGs2Ux+xToOrqfL6XgqZIgu Wy45PFj68dpnjmE2CF9gcZHwaDhkAc2Z58b9oMnvKusH4iJxv72eiwkET6EEsAb1nvxw w3+012SeTCs+Q7fJbra8+7cj7Fs973AsTPoRZ1c8gWYs/Qn/O/vssX9tgnLUELeJhZPf Ypt2U9NonH/s6TI+wK4fv0RobD8XWV9ysbUUGxX1Z3i3GOU676AxEzY4DAKEvtT5p+hT xvug5f1F7drWcpd73YfTCguk3YPrUETzVkg0c7uyJZbv6y5J76JvADsiim8rSko8hEqZ Z6vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=LfaGikSQ; 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 k62si26369343pgd.502.2019.05.22.09.34.33; Wed, 22 May 2019 09:34:49 -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=LfaGikSQ; 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 S1730007AbfEVQcK (ORCPT + 99 others); Wed, 22 May 2019 12:32:10 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:46100 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728527AbfEVQcK (ORCPT ); Wed, 22 May 2019 12:32:10 -0400 Received: by mail-lf1-f66.google.com with SMTP id l26so2154307lfh.13 for ; Wed, 22 May 2019 09:32:08 -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=qThinqX735sf8pV9gEurKexsu6v0KDCesOpmYS6C1nU=; b=LfaGikSQzkfp3MTtTD2riyljAlYtgygqiQ76isa3QiDIAdNTkg9Psw2gEp57lgcaC9 hXjQYzoyg9a+kq67pScg7J/emNvgOW+2y1jaoct/Ur1ocYSI/5NGNGEnCvBMlFnuc8qM lqKrn9Z35znXep5iHwzzV/gWqSWLC03boR0VrVXI/ZZAxTHijH+tSNR77NkL0BQmma0J UlJBJA2OYAQDSaD24DiicMLJe5rNn8y7PyzLUjbfBzxl+K90QZJntGOyARexDhDr8VY9 s5FIGIA2dcOxR+igryXgPdS8i7Ypz9fLC10KN/KPb79JvSeIzU9NX9xqEZI5E8OhqCPa 86lg== 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=qThinqX735sf8pV9gEurKexsu6v0KDCesOpmYS6C1nU=; b=DRuvem3zy33DyulEVYnp7ch15c0M/uJNGWwQ2GGd5T8zxaZYe/ZuV6XShwInLrE4co WWel7RXIg7bshv/7mFHSKhlI8g8ZeNp/45jEYkrx+wZojYulKC8IfAsvI7qgLk9+qbou ZhSSNnDhpX6HLwGPsoefc7vUW1lKXRch607waaiZVwVBVYcS4UA0SwmoT1Omt1oqMb3m sSEgPkE5gSlJ+MkpCS6bbRyk8++QvB5XWq9s/H2Fd2/ffgnoIkfpRCyliAQFLORCllp6 oUdaxNOxQfMJs1WqNXPJGW5qdYT5N691ECr8OSoT0W2t4t1DVDx4v9P3Em4goJd+6gUS pzww== X-Gm-Message-State: APjAAAWX2mHCsv9X9LLtT79eYWaym78ATUKbPER3OGryIk+iQF53TcaM chyH5CuQPeUNavlC5Z+afdC29w== X-Received: by 2002:ac2:4213:: with SMTP id y19mr35566420lfh.66.1558542727839; Wed, 22 May 2019 09:32:07 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.81.14]) by smtp.gmail.com with ESMTPSA id x16sm5367958lji.3.2019.05.22.09.32.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 09:32:07 -0700 (PDT) Subject: Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings To: masonccyang@mxic.com.tw, Geert Uytterhoeven , Lee Jones Cc: Boris Brezillon , Mark Brown , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Geert Uytterhoeven , Simon Horman , juliensu@mxic.com.tw, Linux Kernel Mailing List , Linux-Renesas , linux-spi , Marek Vasut , Mark Rutland , Rob Herring , zhengxunli@mxic.com.tw, Miquel Raynal References: <1556092536-17095-1-git-send-email-masonccyang@mxic.com.tw> <20190424212356.GA27103@bogus> <65853dc2-6f3c-1494-7e72-54877797cdd2@gmail.com> <20190507125730.GD29524@dell> <20190508061119.GB7627@dell> From: Sergei Shtylyov Organization: Cogent Embedded Message-ID: <5e718d9f-3aeb-c2ef-0723-400497b2b98f@cogentembedded.com> Date: Wed, 22 May 2019 19:32:05 +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: 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 On 05/20/2019 10:23 AM, masonccyang@mxic.com.tw wrote: >>>>> --------------------------------------------------------------> >>>>> >>>>> Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings >>>>> --------------------------------------------------------- >>>>> >>>>> RPC-IF supports both SPI NOR and HyperFlash (CFI-compliant flash) >>>>> >>>>> Required properties: >>>>> - compatible: should be an SoC-specific compatible value, followed > >>> by >>>>> "renesas,rcar-gen3-rpc" as a fallback. >>>>> supported SoC-specific values are: >>>>> "renesas,r8a77995-rpc" (R-Car D3) >>>>> - reg: should contain three register areas: >>>>> first for the base address of RPC-IF registers, >>>> >>>> I'd drop "the base address" here. >>> >>> okay. >>> >>>>> second for the direct mapping read mode and >>>>> third for the write buffer area. >>>>> - reg-names: should contain "regs", "dirmap" and "wbuf" >>>>> - clocks: should contain 1 entries for the module's clock >>>>> - clock-names: should contain "rpc" >>>> >>>> I suspect we'd need the RPC/RPCD2 clocks mentioned as well (not > sure >>> yet)... >>> >>> Need it ? >> >> You seem to call clk_get_rate() on the module clock, I doubt that's >> correct topologically... clk_set_rate(), sorry. > > I think it's correct but just like Geert mentioned that there is no any > patch > in drivers/clk/renesas/r8a77995-cpg-mssr.c adding RPC-related clocks. > > > I patched dt-bindings/clock/r8a77995-cpg-mssr.h for some simple testing > > -#define R8A77995_CLK_RPC 29 > -#define R8A77995_CLK_RPCD2 30 > +#define R8A77995_CLK_RPC 31 > +#define R8A77995_CLK_RPCD2 32 Hm, what does this do? > by clk_prepare_enable() & clk_disable_unprepare() with CPG_MOD 917 > on D3 draak board, it is working fine. >>>>> - SPI mode:git >>>>> >>>>> rpc: rpc-if@ee200000 { >>>> >>>> The node names should be generic, based on the device class. And in >>>> this >>>> case I'd like to use "spi@ee200000" as otherwise dtc keeps bitching like >>>> below: >>> >>> okay, patch to >>> >>> rpc_if: spi@<...> >> >> That, or just keep the node label. > > okay. > >>>>> - HF mode: >>>>> rpc: rpc-if@ee200000 { >>>> >>>> Again, spi@<...>. >>> >>> what about rpc_if: hf@<...> >> >> Can't change the node name, as it's declared in the .dtsi files, not *.dts >> ones. And "spi" works for the HF case as well -- no complaints from dtc. > :-) Maybe it's possible using the "name" prop, don't know... > okay, > > Patch DTS to > ===============================================================> > +Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings > +--------------------------------------------------------- > + > +RPC-IF supports both SPI NOR and HyperFlash (CFI-compliant flash) > + > +Required properties: > +- compatible: should be an SoC-specific compatible value, followed by > + "renesas,rcar-gen3-rpc" as a fallback. > + supported SoC-specific values are: > + "renesas,r8a77995-rpc" (R-Car > D3) > +- reg: should contain three register areas: > + first for RPC-IF registers, > + second for the direct mapping read mode and > + third for the write buffer area. > +- reg-names: should contain "regs", "dirmap" and "wbuf" > +- clocks: should contain 1 entries for the module's clock 1 entry (clock node phandle and specifier). > +- clock-names: should contain "rpc" > +- power-domains: should contain system-controller(sysc) for > power-domain-cell What's "power-domain-cell"? I know "#power-domain-cells". I'd like this to be "the power domain node's phandle and specifier". > +- resets: should contain clock pulse generator(cpg) for reset-cell, It's "#reset-cells" again. I'd like this to be "the reset node's phandle and specifier". > + power-domain-cell and clock-cell Why mntion clock-cell at all here? > +- #address-cells: should be 1 > +- #size-cells: should be 0 > + > +Example: > +- SPI mode: > + > + rpc: spi@ee200000 { > + compatible = "renesas,r8a77995-rpc", > "renesas,rcar-gen3-rpc"; > + reg = <0 0xee200000 0 0x200>, <0 > 0x08000000 0 0x4000000>, > + <0 0xee208000 0 0x100>; > + reg-names = "regs", "dirmap", "wbuf"; > + clocks = <&cpg CPG_MOD 917>; > + clock-names = "rpc"; > + power-domains = <&sysc > R8A77995_PD_ALWAYS_ON>; > + resets = <&cpg 917>; > + #address-cells = <1>; > + #size-cells = <0>; > + > + flash@0 { > + compatible = > "jedec,spi-nor"; > + reg = <0>; > + spi-max-frequency = > <40000000>; > + spi-tx-bus-width = <1>; > + spi-rx-bus-width = <1>; > + }; > + }; > + > +- HF mode: HyperFlash, please. > + rpc: spi@ee200000 { > + compatible = "renesas,r8a77995-rpc", > "renesas,rcar-gen3-rpc"; > + reg = <0 0xee200000 0 0x200>, <0 > 0x08000000 0 0x4000000>, > + <0 0xee208000 0 0x100>; > + reg-names = "regs", "dirmap", "wbuf"; > + clocks = <&cpg CPG_MOD 917>; > + clock-names = "rpc"; > + power-domains = <&sysc > R8A77995_PD_ALWAYS_ON>; > + resets = <&cpg 917>; > + #address-cells = <1>; > + #size-cells = <0>; And I don't think duplicating the same device node is a good idea... > + flash@0 { > + compatible = > "cypress,hyperflash", "cfi-flash"; > + reg = <0>; > + }; > + }; > ===============================================================< > > thanks & best regards, > Mason [...] MBR, Sergei