Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2279469rwb; Fri, 11 Nov 2022 07:21:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf4+wg8GByaw/ZxwR0xnzqxhm+7O2CNw+dTWl6POaBTmtUTUmdM+TleOUXfNLXJxr4xs792t X-Received: by 2002:aa7:c603:0:b0:460:fab2:c31f with SMTP id h3-20020aa7c603000000b00460fab2c31fmr1906457edq.335.1668180092541; Fri, 11 Nov 2022 07:21:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668180092; cv=none; d=google.com; s=arc-20160816; b=bp2grv9p0dw1BS/47S7wGDD7szcuWRL0J79+maCL8vysJC+IMeqBT9d9QKIqzCPV3y 9ts1bIuwqMOqrgQGQbOuXKERjDY1sCLmjhEyjOn6nZxImC6R5d+bat3nRxr80pDFNv7b pIQ85c570fIQtW09uqGMyRSUXGfLtNsDnMe6QWJWjKlwEF5OOw3oeHnO7Bapj9bQLb5z oqnqNf8l/vlVXdXBXuguqC+7sfUOAgaTOVA94+SKzFmrrPTtI09PRSspKi0GHRUMA1Qf iHWHN025igS4FjFqVIWZeIy+McC469gCpVwYgMk5fiQAV44syMJBDIi71nbgtdYEAk0f m+DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Ps6+CrFrf1G8yxoOGed9ZXoVR3hjv0NG/3mQJo+Ut9Q=; b=YcfQrQGXmcl2e7r+triEYX7pqTh+OeIQVu2rfTXISL8HIoI5K5L4E0lLMB60IMPqni geOnJrjh1zaaZQP/k9Ghau9dVhI9C792dzTZALSYMfxNALPgXWdwz3HA/Jct0c17Tafy dQvxMpGYN/v1mZY+BV7FHlxPeyQz4UIKSNNyE1BLDnBeo5J8z+clNk4i8FCbrPJczVED hEqIEQ+4boEtej7kB/bH3CW1UtZnx46zM7LmeUhRrusCNt0xgXrzTxE/hlHyNwKmuctc rSrhfMNxirVo60Ii7bU01jqq0O9eu+nmaRwFOb/vykDb1mtELGrF7B9mNvoipJz1gIEG WQrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oGx3VkoP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lb17-20020a170907785100b007ae1e519db0si1667291ejc.220.2022.11.11.07.21.09; Fri, 11 Nov 2022 07:21:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oGx3VkoP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234716AbiKKOlr (ORCPT + 91 others); Fri, 11 Nov 2022 09:41:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234670AbiKKOkQ (ORCPT ); Fri, 11 Nov 2022 09:40:16 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27E8D657C3 for ; Fri, 11 Nov 2022 06:40:06 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id b3so8619746lfv.2 for ; Fri, 11 Nov 2022 06:40:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Ps6+CrFrf1G8yxoOGed9ZXoVR3hjv0NG/3mQJo+Ut9Q=; b=oGx3VkoPSO2ZKYabYiWWOTYN53Hpr4zaQMnkzolc249rz0cPeC88yNt1bYNVrAPS8r AIYiVqED1zrsePxKZtPycqKpNFePYaKpXnSxy7apkC0UMcNcV9kEAmATmWglnJ9JEOtJ 3AXJYOGv9d3kY1Nl65rE1djkxjc6pv3eWx3WdwMXLOBXxLfcJrtr4cGmIvi10Xehpk5K VLSvq/8EIoiY85GIPy77R273rffBqeBLLvAcayCqMI3BB7LMofgPHCOV0JfV6I8Stkuj fvyf8gQvjW1oPqSZigjRZ4+bezCnTO/Yw9d+ZehIDA/GLuF33PzcLyyOorc3e3VKo8uu vZbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ps6+CrFrf1G8yxoOGed9ZXoVR3hjv0NG/3mQJo+Ut9Q=; b=H/jB+FPavD5VI0AoL6wix0PgVPi9VlY7uWhmNeR1H52mBI6+2JdtTYCgR9zit+fIo+ 6ykYkoBCSnS+in9gn/E2qexrMrqLIbkevCwGZ+qzsYcBS+81hlxOFVY9GUmEoOiAGUC+ CG8fSGqSapBw/sX83OZKWG+4GA/5gvJ1CEIwWX+F/EUb9a4EigYEnzcyUdWYOptEXhvu F/mLNVC92Nc2Abgskw+4GG2Qhsb4Zrns5Wy1xCipZrtcCJG5gu1Ub5aF2Phj3o1zIdJM rCXUG1Y5pix7IQU0KCnD4u3uE40kz8K36FWU7e7qF2/J4YsJxBC2ojUlY2U6TUi8W/N6 jFtg== X-Gm-Message-State: ANoB5plYpgAx9gCm8/y3rBhwpuGOTXvxmZ2gPg+J/iDt7Rhyopxpb12m 5HDHIdZRJpvQr/NIjWzoA9Yjqw== X-Received: by 2002:a05:6512:3581:b0:4a8:41b8:5cb7 with SMTP id m1-20020a056512358100b004a841b85cb7mr777625lfr.61.1668177604331; Fri, 11 Nov 2022 06:40:04 -0800 (PST) Received: from [192.168.0.20] (088156142199.dynamic-2-waw-k-3-2-0.vectranet.pl. [88.156.142.199]) by smtp.gmail.com with ESMTPSA id q28-20020ac2515c000000b004a8f824466bsm358339lfd.188.2022.11.11.06.40.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Nov 2022 06:40:03 -0800 (PST) Message-ID: <36680a5e-7b0c-4d7e-f039-734e9304dc18@linaro.org> Date: Fri, 11 Nov 2022 15:40:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v2 5/5] arm64: dts: uniphier: Add NX1 SoC and boards support Content-Language: en-US To: Kunihiko Hayashi , Rob Herring , Krzysztof Kozlowski , Arnd Bergmann , Olof Johansson , Masami Hiramatsu Cc: soc@kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20221107103410.3443-1-hayashi.kunihiko@socionext.com> <20221107103410.3443-6-hayashi.kunihiko@socionext.com> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/11/2022 09:48, Kunihiko Hayashi wrote: > Hi Krzysztof, > > On 2022/11/09 0:11, Krzysztof Kozlowski wrote: >> On 08/11/2022 15:30, Kunihiko Hayashi wrote: >>> Hi Krzysztof, >>> >>> On 2022/11/08 20:13, Krzysztof Kozlowski wrote: >>>> On 07/11/2022 11:34, Kunihiko Hayashi wrote: >>>>> Initial version of devicetree sources for NX1 SoC and boards. >>>>> >>>>> NX1 SoC belongs to the UniPhier armv8 architecture platform, and is >>>>> designed for IoT and AI/ML application fields. >>>>> >>>> >>>>> + >>>>> + soc_glue: syscon@1f800000 { >>>>> + compatible = "socionext,uniphier-nx1-soc-glue", >>>>> + "simple-mfd", "syscon"; >>>>> + reg = <0x1f800000 0x2000>; >>>>> + >>>>> + pinctrl: pinctrl { >>>>> + compatible = "socionext,uniphier-nx1-pinctrl"; >>>> >>>> So instead of documenting the hardware precisily, you have one big bag >>>> for everything under simple-mfd. This is not how the SoC should be >>>> described in DTS. >>> >>> Sorry I don't understand. This is inherited from the previous >>> descriptions, >>> but is there some example to express DTS correctly about that? >> >> I think yes, although it actually depends what is this hardware. >> Generally speaking, do not use simple-mfd and syscon when these are not >> really simple devices. There are quite many in your DTS, which got my >> attention. Instead - have regular device with or without children. >> >> There is no real need to have this a simple-mfd with one children >> without any resources (no address space, no clocks, no interrupts, nothing). >> >> Why this syscon/mfd and pinctrl is not a regular, one device? > > The mfd/syscon.yaml says: > System controller node represents a register region containing a set > of miscellaneous registers. > > The "soc-glue" is exactly this, it contains various register functions > and might be referred to the drivers. > > For example in this NX1 dts, ethernet node points to "soc-glue" node. > > eth: ethernet@15000000 { > compatible = "socionext,uniphier-nx1-ave4"; > ... > socionext,syscon-phy-mode = <&soc_glue 0>; > }; > > Since such register region is not often systematically designed, > it is tough to cut out as specific memory region for "pinctrl". So your choice is instead use entire address space as pinctrl - as a child device without IO address space. That's also not a good solution. > > And more, the existing pinctrl driver uses of_get_parent() and > syscon_node_to_regmap(), so this change breaks compatibility. This is a new DTS, so what compatibility is broken? With old kernel? There was no compatibility with this Devicetree. Anyway using driver implementation as reason for specific hardware description (DTS) is also not correct. > >>>>> + }; >>>>> + }; >>>>> + >>>>> + soc-glue@1f900000 { >>>>> + compatible = "simple-mfd"; >>>> >>>> No, it is not allowed on its own. You need a specific compatible and >>>> bindings describing its children. >>> >>> I saw the definition of "simple-mfd" itself is only in mfd/mfd.txt. >>> >>> Currently there are only efuse devices as children, and this space means >>> nothing. I think it had better define the devices directly. >> >> You need to start describe the hardware. efuse is an efuse, not MFD. >> pinctrl is pinctrl not MFD + pinctrl. > > This region also has multiple functions, though, the efuse might be > cut out as specific region without "simple-mfd", unlike pinctrl. simple-mfd itself does not mean region has multiple functions, but that children do not depend on anything from the parent device. You over-use syscon and simple-mfd in multiple places. of course some of them will be reasonable, but now it does not. Best regards, Krzysztof