Received: by 10.223.148.5 with SMTP id 5csp6710406wrq; Wed, 17 Jan 2018 18:00:37 -0800 (PST) X-Google-Smtp-Source: ACJfBosax8qEcwhGyQNWDm85TSdAcbo1BhocX7+SY/mGuKHdx9rtUnJ2brbi+N/Rb+9NIt6SxICt X-Received: by 10.84.235.202 with SMTP id m10mr28565024plt.351.1516240837816; Wed, 17 Jan 2018 18:00:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516240837; cv=none; d=google.com; s=arc-20160816; b=e0W+60zP//VbTe9jqV3MPZMz6Xl1IpQcAsYJdPe7jQ+5JqCOysgn059E7x1u8GZBMs 4PHX/Ta1I64TOFf5ZPwk6equJ3fuQRC4VxnSp3NErAESOvt35i9jNjGZhX33J7DO8XEh ipcwicETGSmEOIuQe2+GY3nxhUzPx4k6dKFK2sA6PH/7L0orilVmzj56kptojYVpARnk AJsyqEeDlK1ss1t2WUQ7nHN0okR+mSnTYeUacPcroQaUAYgIdrdgvgVmLXABQhlPl5qq tY2JS/xrPba/JEO9lWmv75Rxoh6ZhYThjCXPMEoNpVnRP3taFIeLRUHegJ7/m8X00WYB oEMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dmarc-filter :arc-authentication-results; bh=war2RmzJPaKOxcUwpMchVQhL7XFN0XKcDgubwTyLQFA=; b=e9C35+Vjk+77OcfnKhg7OvURSuERYp9Yk1zd3E8tePccvfAWdcryKDXuVkMaBGYAg/ T1ix7VFx3n+OXmIQxNSyrcX40OUTSd0O3q9a7KA7ErclpfdDKLdCZmJ7QLFVR2/6iv7C BqZ8rpiHAEApbvFS+tNXZWXFVj+g5kz/AqguwdchHvAS+eEdsT7+JIxScZ8LZzCwztch ULLJ3oykvkjVQcLqNih60GuwV8RPtl2g0gsYuPjTWTMlmPg3nc9yyLg7jplT9XbNCOw1 LnMJkjZp8vsK3ky3vvn0c9M1HAw79Pk5rE7rHP6murFnQHSeuT7BmXVASS4S9xK3rLTa APgg== ARC-Authentication-Results: i=1; mx.google.com; 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 d81si5608484pfm.320.2018.01.17.18.00.23; Wed, 17 Jan 2018 18:00:37 -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; 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 S1752955AbeARB7c (ORCPT + 99 others); Wed, 17 Jan 2018 20:59:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:52042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752100AbeARB7a (ORCPT ); Wed, 17 Jan 2018 20:59:30 -0500 Received: from mail-qt0-f182.google.com (mail-qt0-f182.google.com [209.85.216.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 02A132177B; Thu, 18 Jan 2018 01:59:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02A132177B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=robh@kernel.org Received: by mail-qt0-f182.google.com with SMTP id e2so26658435qti.0; Wed, 17 Jan 2018 17:59:29 -0800 (PST) X-Gm-Message-State: AKwxytcTCvNDRXVZpvG435z86m8nZOLKpvvAKLKKxbTTj2Fc4Lt/qXNp p9EB9Zjs6ll8ftX7x8iPMXsL9qRRbSYBDQ/PDQ== X-Received: by 10.200.0.18 with SMTP id a18mr14336310qtg.162.1516240769135; Wed, 17 Jan 2018 17:59:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.130.36 with HTTP; Wed, 17 Jan 2018 17:59:08 -0800 (PST) In-Reply-To: References: <20171228212954.2922-1-malat@debian.org> <20171228212954.2922-2-malat@debian.org> <20180103200211.u56tqesyumsofoff@rob-hp-laptop> From: Rob Herring Date: Wed, 17 Jan 2018 19:59:08 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/2] nvmem: add driver for JZ4780 efuse To: PrasannaKumar Muralidharan Cc: Mathieu Malaterre , Marcin Nowakowski , Greg Kroah-Hartman , Zubair.Kakakhel@mips.com, Srinivas Kandagatla , Mark Rutland , Ralf Baechle , open list , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux-MIPS Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 17, 2018 at 11:31 AM, PrasannaKumar Muralidharan wrote: > Hi Rob, > > On 11 January 2018 at 20:38, Rob Herring wrote: >> On Sat, Jan 6, 2018 at 6:43 AM, PrasannaKumar Muralidharan >> wrote: >>> Hi Rob, >>> >>> On 4 January 2018 at 01:32, Rob Herring wrote: >>>> On Thu, Dec 28, 2017 at 10:29:52PM +0100, Mathieu Malaterre wrote: >>>>> From: PrasannaKumar Muralidharan [...] >>>>> + nemc: nemc@13410000 { >>>>> + compatible = "ingenic,jz4780-nemc"; >>>>> + reg = <0x13410000 0x10000>; >>>>> + #address-cells = <2>; >>>>> + #size-cells = <1>; >>>>> + ranges = <1 0 0x1b000000 0x1000000 >>>>> + 2 0 0x1a000000 0x1000000 >>>>> + 3 0 0x19000000 0x1000000 >>>>> + 4 0 0x18000000 0x1000000 >>>>> + 5 0 0x17000000 0x1000000 >>>>> + 6 0 0x16000000 0x1000000>; >>>>> + >>>>> + clocks = <&cgu JZ4780_CLK_NEMC>; >>>>> + >>>>> + status = "disabled"; >>>>> + }; >>>>> >>>>> - clocks = <&cgu JZ4780_CLK_NEMC>; >>>>> + efuse: efuse@134100d0 { >>>>> + compatible = "ingenic,jz4780-efuse"; >>>>> + reg = <0x134100d0 0xff>; >>>> >>>> You are creating an overlapping region here with nemc above. Don't do >>>> that. >>> >>> Should "reg = <0x13410000 0x10000>;" be used instead? >> >> No, that still overlaps with nemc. What's in registers 0x00-0xcf and >> 0x1d0-0xffff? Either get rid of this node altogether and make the >> driver for nemc also instantiate the efuse driver (DT is not the only >> way to instantiate drivers), or create sub-nodes under nemc for each >> distinct h/w block in the 13410000-13420000 address space. > > My idea was not to change nemc driver. > > By "create sub-nodes under nemc" do you mean something like below? Yes. > nemc: nemc@13410000 { > compatible = "ingenic,jz4780-nemc"; > reg = <0x13410000 0x10000>; > <...> > status = "disabled"; Though having disabled here is strange. We'd normally ignore all the child nodes. > > efuse: efuse@134101d0 { > compatible = "ingenic,jz4780-efuse"; > reg = <0x134100d0 0xff>; > } > } > > Will this instantiate efuse driver? I do not know how to do that with > sub-node. I will explore more on this. The nemc driver just needs to call of_platform_default_populate. >> Or a third option is make nemc reg: >> >> reg = <0x13410000 0xd0>, <0x134101d0 0xfe30>; >> >> But I suspect that is wrong and you probably have some other function in there. >> >> Rob > > If the efuse block were to use a different base register address (that > does not overlap with nemc register range) in future SoC how the node > should be? Using nemc to instantiate efuse won't be the best choice if > that happens. Then you will have a different compatible for nemc (because it is different) and then the driver should skip the above step. Rob