Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9599488imu; Wed, 5 Dec 2018 07:23:35 -0800 (PST) X-Google-Smtp-Source: AFSGD/VD6DqEtFGMHXzbwaMvMv9XKnzXd7oUF3BL7b/8Da51F26qedXj+RPwXj+felN0571LbR+1 X-Received: by 2002:a62:3241:: with SMTP id y62mr24758124pfy.178.1544023415338; Wed, 05 Dec 2018 07:23:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544023415; cv=none; d=google.com; s=arc-20160816; b=B8qk9ADnL9m33AbXCN6OIf3drn8AQiW6lVYbzrb/nUanYSEg+h9Urih+GWjU8JsXFn EVlFR4+SHSAbTmvxHs+67nDtjaThiLEJzz/ZcQiqehojuQMMDZ0GiBiu+ilqfG35JROp 4xC6DJgdCIpPdMMDu04s4EB6B6s0NWZcSPjMgHNLOzvRgsbxuoo/VCBEE3bx0wkQLAXm DIHkKLOMjqLm2gcLVJCJRH8xQUBGep7kSLbDTnaRKSnLz+IuQw+Yb7A/M+lnj4CvNVyQ aImnqGEUVnuRQL0bP0U3t/2NMUzHLUS08zRuZTQiXiqlyMtFjbjNL+mIUaLeLy7OcMuj 7HUA== 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 :in-reply-to:references:mime-version:dkim-signature; bh=4jDZ2UxzdOp26gDZmcOCSM6Jw6wB6Akz54qQpHhqw9g=; b=llNNlgWGqSC4TdFikKMDWbN+wV/uQNlmfFN0waCXvMFa9MCoZDlaN7PM3EPep7N+lk 5jvbg0Xrg0RuBlThOC+SKi0zhrkFcWfnPy7hLflRA3CExowKzL3Uq05dkiX48Gbemc5q VzfKgE0EJBv4HYj0alRQ7V/68UxVOYf1Su0FweHAn8tFaCFwMcbORPK96VlmaRfG8tYB K4nk8DoP4LgDuRLA7HqtEOYHXLWVto5m8ZHi0xAOtFj/1WaEi6ErkfdDGRZgBv2EAn1a ploEtpuP0KcegoHEMS2ha3Vy7qUe8zdTmnDm4T51EzQYHngmNNgcDEmIqu8kvRCpUEEF SPIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=smXnAKJ6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8si23346614pli.50.2018.12.05.07.23.16; Wed, 05 Dec 2018 07:23:35 -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=@kernel.org header.s=default header.b=smXnAKJ6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727690AbeLEPWj (ORCPT + 99 others); Wed, 5 Dec 2018 10:22:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:46586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727240AbeLEPWi (ORCPT ); Wed, 5 Dec 2018 10:22:38 -0500 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (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 6F9E320989; Wed, 5 Dec 2018 15:22:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544023357; bh=GzznUPgfk5LUI7gjpKiMHDtNRJypjB60JNdOnM0r65o=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=smXnAKJ6C78ol9KdicNRWRfvjaBZ93+0poTJac44VMqA0X/rqnK8GyUFe08/rEUiy 7hb+KoyjqGjm/LGfrFbA4eBhKdw2KwelVZhHqn/KAUKlpnddzd36Pqj47OH8ZBCMCV vXEictrQ11//Ocjm5IIkJ0lEXjnlmLNl15VFsGrI= Received: by mail-qt1-f178.google.com with SMTP id t13so22661782qtn.3; Wed, 05 Dec 2018 07:22:37 -0800 (PST) X-Gm-Message-State: AA+aEWbR84S35R2f/4ypbFWk/T8cw4cNpZnolu9K34bJPCD9K3e6gbiD eUex7BPcRhIEVdmdylro83QmrMk1fOIQ8RVp9Q== X-Received: by 2002:a0c:f212:: with SMTP id h18mr24530945qvk.106.1544023356597; Wed, 05 Dec 2018 07:22:36 -0800 (PST) MIME-Version: 1.0 References: <1542701330-23466-1-git-send-email-andrei.stefanescu@microchip.com> <1542701330-23466-2-git-send-email-andrei.stefanescu@microchip.com> <20181204232237.GA16883@bogus> <2600b55c-f8fd-ab82-6372-a75f22e382f8@microchip.com> In-Reply-To: <2600b55c-f8fd-ab82-6372-a75f22e382f8@microchip.com> From: Rob Herring Date: Wed, 5 Dec 2018 09:22:25 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/2] dt-bindings: gpio: add SAMA5D2 PIOBU support To: Andrei.Stefanescu@microchip.com Cc: Linus Walleij , Greg Kroah-Hartman , Nicolas Ferre , Mark Rutland , Ludovic Desroches , Cristian.Birsan@microchip.com, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" , devicetree@vger.kernel.org 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, Dec 5, 2018 at 5:06 AM wrote: > > Hello Rob, > > Thank you for your feedback. > > I will add a bit of context regarding the secumod. The > "atmel,sama5d2-secumod" > compatible string is not used for loading a driver. It is used by atmel > securam > driver (drivers/misc/sram.c) which has access to secumod's registers via: > > syscon_regmap_lookup_by_compatible("atmel,sama5d2-secumod") > > So the secumod exports multiple hardware functions, eg: the securam, the > PIOBU > pins which can be used as GPIO pins. Yes, I understand why you want to design it this way, but don't design your bindings around how 1 OS happens to currently work. > > My initial patch had the "microchip,sama5d2-piobu" compatible appended > to the > secumod's compatible e.g.: > > secumod@fc040000 { > compatible = "syscon", "microchip,sama5d2-piobu"; That doesn't look appended to me. The documentation says it should look like this: compatible = "atmel,sama5d2-secumod", "syscon"; > ... > > Taking into consideration Linus Walleij's advice I arrived to the current > version. I thought this was a good idea because it separates the secumod > node > from the GPIO controller node. Please notice that securam node is already > separated from secumod node (it is a separate node in the device tree). > > I have a few questions because I am not sure of the best approach: > > 1. Is it ok to have the GPIO controller as a child node? Is it a separate h/w block and do you have other child nodes that need their own resources in DT (interrupts, clocks, etc.)? If these aren't the case, then no you shouldn't. As it stands, you don't have any other child nodes, so no you shouldn't have a child node here. Just add to properties to the existing binding: secumod@fc040000 { compatible = "atmel,sama5d2-secumod", "syscon"; reg = <0xfc040000 0x100>; #gpio-cells = <2>; gpio-controller; }; Now perhaps you have 10 other functions in this block like pinctrl, clocks, phys, power domains, etc. Then child nodes would be warranted. But if that's the case, then please write a complete binding for the secumod block. > 2. I used simple-mfd because it was the only way I could think of in > order to > get the driver probed. Sounds like an OS problem that has little to do with the binding. In any case, if you change a binding which you have, then it needs to be documented. > 3. Should I add a register range? I thought that because the driver uses > syscon > it is not necessary to add the register range. Also, the register > range would > have been a subset of the secumod's register range. If it has one, then yes you should. If it doesn't then it is probably not a separate h/w block and shouldn't have a child node to begin with. Rob