Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6777055yba; Tue, 14 May 2019 13:30:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXKzTrtcFqzLYi/+gzIIcOhci1Ktujn9HTHhJwWdBFo8hv6QRonJe9L/2EDt2Vzh1rP/FP X-Received: by 2002:a62:4281:: with SMTP id h1mr42622927pfd.162.1557865848019; Tue, 14 May 2019 13:30:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557865848; cv=none; d=google.com; s=arc-20160816; b=EddeXBEfxdvthWVNuK+/MqWGsdRSLvDa+tuISY2De0thTiIMydCEUfRgohp/Ndx6se wd1Jb81GoB9t4+E4N/46u5g01T1mgXyScIwaFO6r7DyAPRx7H4Y18zMe24ISzrTiUTi3 B47zbBsOQqWRPOiXVi2Rp7QEqFF34508vaFooXUDtG/Hbx+LU5Cxd+FR1WZ0fX52phQn Pjk+FV1Kh8HjZw49XdDSO5ukW4QooWMLZzLlWV5qqELEM5BeV7OSl+kKB7fDoyC3Q9Dz b6YKq2sc6q+Oj9f3294E2T69epx0LszO6rDTLnk9HfnA9glhsf/eZmqs4iV31UuPlPNQ UdHg== 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=Cg+0pIxncJfvTs4tSoXl4GsGWbTnN63dbKG4EXKdY5I=; b=oAUGtsQb7qoXHyZ98vJX+ir6KXGe2bPnqDspvGtgHKYwMXySfvCqTlmh2bByjtIDRY qJYx9Z7BjyZV7tlf1msNfb+ExA0NP3aahTinllGtiO0ghUQjNbIFkI5Kka9rEIfy8ugK iAO7+2nKuCMQc9zcPfHBhg9JGeqD/g/1i/UbwutdntdRD3Xcp554dzeuLMxXRhjnFIDY UNvxA4o67gKgyZiglk84i74omjo9ysYI5f6+A9na12O8ANNoKizmBvceqvypIudOUKRy K87yZ2xBkdPqCYptHQm5X8wG9OvV1qAWzG24vly3BBvR8d/kIH0OzwPK5uj8PI1yKTR8 8iEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b="uXDDy/8g"; 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 x34si20796655pgl.179.2019.05.14.13.30.33; Tue, 14 May 2019 13:30:48 -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="uXDDy/8g"; 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 S1726565AbfENU1z (ORCPT + 99 others); Tue, 14 May 2019 16:27:55 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:42291 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726537AbfENU1z (ORCPT ); Tue, 14 May 2019 16:27:55 -0400 Received: by mail-lf1-f68.google.com with SMTP id y13so199189lfh.9 for ; Tue, 14 May 2019 13:27:53 -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=Cg+0pIxncJfvTs4tSoXl4GsGWbTnN63dbKG4EXKdY5I=; b=uXDDy/8gSW0jEorXj4eEKaiOvkegZ9DkXL+itl4xCKsGvVnDxiqb9TOYJ7uZwxQQ6f Z5zwbihzNlRL5hNx0YodjSJ1b0ibJ1+pIOHph2tL5/Jw0hYNo0axkDGfyiAlW8tpFsf+ Qiqpqp2Wq5e/kcKkbYo4NdSGqxA4Ajt8jDRBg1dlGf235oqdtzr9M52JXGW613NuIk6b lKvC63Gx6Scwn48rpDrpKQXCfc4Rv2+M/BQyi1KlwGKNNEXPgSC7s+vKIhLey+YZDOXi 6c8QKUx6VHUS5BiVOs8NNBzxwigbKmDaRpAdHoMUpvqpzaNSH+7hBGLJb6z0J/Z0hq0v ul0w== 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=Cg+0pIxncJfvTs4tSoXl4GsGWbTnN63dbKG4EXKdY5I=; b=JZt/G2z1C4TV5yapIzwgBpfss/Xpb6tZPIlyULYua98GKCMd3D7qWBl4Cv8jptik12 LmJBVH/K4e/HKfiHFKu/I4+yWxcxyNDAFQ8a8tMGQ5NBT4mwx65rMfeAhD6uYd+zOOb+ dsXVIwfrGLp6uFZ/rU6o2xtFd2xvu4nkM6OVVfFXX6Q6BoGmDQJ5LdvAqqVpn6i9PoPy kSOkGjeBT6UKJYFVmCqFRZgYq9gQy7IRVFRtRGW/u75q2oKdquYKNahjxQI0EkGvGe69 XgPqj1QNkZg2jUh1c/5mCby/XJlnkt4jt1AqCjrbF8NLUk5FQvkjFzkO3CX/G+jW7aZy H7og== X-Gm-Message-State: APjAAAXWQOTDOnrLA+4F6KuN0RG0Hn/E9e3NNrNj3R2INB12EBMnAhNe /SXREVnFufS9b+Bj0fjW7FHUaA== X-Received: by 2002:a05:6512:206:: with SMTP id a6mr18870241lfo.18.1557865672326; Tue, 14 May 2019 13:27:52 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.86.127]) by smtp.gmail.com with ESMTPSA id x29sm3942315lfg.58.2019.05.14.13.27.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2019 13:27:51 -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 References: <1556092536-17095-1-git-send-email-masonccyang@mxic.com.tw> <1556092536-17095-4-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: <44bc8f0a-cbdc-db4a-9a46-b8bae5cc37a2@cogentembedded.com> Date: Tue, 14 May 2019 23:27:50 +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/14/2019 12:46 PM, masonccyang@mxic.com.tw wrote: >>>> There's precedence for such constructs being an MFD: please see >>>> drivers/mfd/at91-usart.c, which registers a single MFD cell for > either >>>> serial or SPI. >> >> Thanks fir your example, Geert! :-) s/fir/for/, not the firtree season anymore. :-) >>> okay, many thanks for your information. >>> >>> How about to patch RPF-IF 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 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... > RPCD2 is derived from RPC and it's value is half of RPC, > i.e., RPC = 160MHz, RPCD2 = 80 MHz I know. >> And how about "power-domains", "resets" (seen in the example below), >> also what about #address-cells & #size-cells? >> >>> >>> Example: >> >> Could you please indent with 1 or 2 tabs where you used 8 or 16 > spaces? >> >>> - SPI mode: >>> >>> 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. >> arch/arm64/boot/dts/renesas/r8a77980.dtsi:1344.21-1359.5: Warning > (spi_bus_bridge): >> /soc/rpc@ee200000: node name for SPI buses should be 'spi' >> also defined at > arch/arm64/boot/dts/renesas/r8a77980-condor.dts:283.6-343.3 >> arch/arm64/boot/dts/renesas/r8a77980-condor.dtb: Warning (spi_bus_reg): >> Failed prerequisite 'spi_bus_bridge' >> >> >>> - 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. :-) >>> 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 = <1>; >>> >>> flash@0 { >>> compatible = "cfi-flash"; >> >> The working HF implementation has "cypress,hyperflash" before > "cfi-flash". >> >>> reg = <0 0x4000000>; >>> }; >>> }; >>> >>> --------------------------------------------------------------< >>> >>> Is it OK ? >> >> Yeah, seems good (assuming you fix the issues above). > > Patch new 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 > +- clock-names: should contain "rpc" > +- #address-cells: should be 1 > +- #size-cells: should be 0 Still nothing about the "oower-domains" and "resets" props... :-( > + > +Example: > +- SPI mode: > + > + rpc_if: 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>; [...] > =======================================================================< > > OK ? Yes, with the remaining issue fixed. > thanks & best regards, > Mason [...] MBR, Sergei