From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756012AbcIFKc1 (ORCPT ); Tue, 6 Sep 2016 06:32:27 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:13403 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755659AbcIFKcU (ORCPT ); Tue, 6 Sep 2016 06:32:20 -0400 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Tue, 06 Sep 2016 03:27:32 -0700 Subject: Re: [PATCH v2 3/6] dt/bindings: Add bindings for Tegra GMI controller To: Mirza Krak , Rob Herring References: <1472045838-22628-1-git-send-email-mirza.krak@gmail.com> <1472045838-22628-4-git-send-email-mirza.krak@gmail.com> <20160830170636.GA8741@rob-hp-laptop> CC: Stephen Warren , Thierry Reding , Alexandre Courbot , , , Prashant Gaikwad , Michael Turquette , , , , , linux-kernel , , From: Jon Hunter Message-ID: Date: Tue, 6 Sep 2016 11:32:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.21.132.106] X-ClientProxiedBy: UKMAIL101.nvidia.com (10.26.138.13) To UKMAIL101.nvidia.com (10.26.138.13) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31/08/16 12:22, Mirza Krak wrote: > 2016-08-30 19:06 GMT+02:00 Rob Herring : ... >>> nvidia,snor-cs = <4>; >> >> NAK, no custom CS properties. Ok, so ... > gmi@70090000 { > compatible = "nvidia,tegra20-gmi"; > reg = <0x70009000 0x1000>; > #address-cells = <2>; > #size-cells = <1>; > clocks = <&tegra_car TEGRA20_CLK_NOR>; > clock-names = "gmi"; > resets = <&tegra_car 42>; > reset-names = "gmi"; > ranges = <4 0 0xd0000000 0xfffffff>; > > status = "okay"; > > bus@4,0 { > compatible = "simple-bus"; > #address-cells = <1>; > #size-cells = <1>; > ranges = <0 4 0 0x40000>; > > nvidia,snor-mux-mode; > nvidia,snor-adv-inv; > > can@0 { > reg = <0 0x100>; > ... > }; > > can@40000 { > reg = <0x40000 0x100>; > ... > }; > }; > }; > > Have I understood you correct? > > Also wanted to verify the example case where you only have on device > connected to one CS#, from what I see in other implementations it > seems OK to put the CS# in the reg property in that case. Is this > correct? > > Example with one SJA1000 CAN controller connected to the GMI bus > on CS4: > > gmi@70090000 { > compatible = "nvidia,tegra20-gmi"; > reg = <0x70009000 0x1000>; > #address-cells = <2>; > #size-cells = <1>; > clocks = <&tegra_car TEGRA20_CLK_NOR>; > clock-names = "gmi"; > resets = <&tegra_car 42>; > reset-names = "gmi"; > ranges = <4 0 0xd0000000 0xfffffff>; > > status = "okay"; > > can@4,0 { > reg = <4 0 0x100>; > nvidia,snor-mux-mode; > nvidia,snor-adv-inv; > ... > }; > }; > > Jon, to be able to handle both cases in the driver we would first > attempt to decode the CS# from the ranges property, and fallback to > reg property if no ranges are defined. Does that sound reasonable? Given the above examples that may be supported, is there a better/simpler way to extract the CS# than what Mirza is proposing? For example, from the node-name unit-address? Cheers Jon -- nvpublic