Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2426518rwb; Fri, 11 Nov 2022 09:07:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf75qJ90x5QFgb9Ikov/NvpphExs9IBfPxZt0P7kapWoPNHUxK1J5qTcNbUP0nTJCpjuMah4 X-Received: by 2002:a17:90a:898f:b0:210:6c69:6345 with SMTP id v15-20020a17090a898f00b002106c696345mr2921113pjn.50.1668186472252; Fri, 11 Nov 2022 09:07:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668186472; cv=none; d=google.com; s=arc-20160816; b=h3Ecca55Q5mWS9NYta91L2Y6pEjd7a5H3QU54bGVePILNNuU4akxuIflB6rPQo6D+U THUPGeOOqclEa4B6B7BQpz81NbTPbDW4A4YtWsd7mHs8kSI0Cfsl2dkPdO53tptLtw5L gtZ1e5Cfa0r94E2If2YOthR6rY6wvng3F6BfKLx5A5vRl1pJFpaE6hXbmHmZeLBy2y8k rqr+smEMKS3vYcY8BF5Z9Z/eXGVlMo5erfoaronIUPp8WLKNwm7FPl39JOU90n9w4r2r jtcYe5n+uCzT+ud5698VFS8T7ZVUeZKPkVWSDnvYWISzEkjmjz2zZa9Cd0k54uPaz3Aa SfgQ== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=YiVXE+ZS4sudgVDEM+zJikAZejrE3JnP2czOR/7Jw3U=; b=gEAKKKgG77KkTkpBgIJxpGcopLfsyAa2VoMrdaAtKCtVDqIUCXz9yCDt1+ILI6Bxqv an3U8Ltz+zHYcqMY0ZExCNaginx13hC2Lfe7ZZDu4R1xJcM75p0tzLdiU4dQxjC1JeJP rM/c3WWNsu+q2PvNVvwIQDAMZ5J+A1ppKZPsnqHG6vlFD9pDpVKlaANKbmD+L9wU1JEM 51ryjdI3+1B3bS7AYD8djPf8OinJ1/suOQf+bqEN7MDjMScrQCn6ZtnkzTqP5EOGTHvr 48QZfaC9cIdply7RyLAZDOGSQz2JsG5InLuAHn+I9C2hMq1BWUH1ApsRaW1kINGN8CUp bfEw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y192-20020a638ac9000000b0046ec1ef0f69si2916490pgd.27.2022.11.11.09.07.39; Fri, 11 Nov 2022 09:07:52 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234250AbiKKQmX (ORCPT + 91 others); Fri, 11 Nov 2022 11:42:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234268AbiKKQmQ (ORCPT ); Fri, 11 Nov 2022 11:42:16 -0500 Received: from mx.socionext.com (mx.socionext.com [202.248.49.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BC2DC845C4; Fri, 11 Nov 2022 08:42:14 -0800 (PST) Received: from unknown (HELO kinkan2-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 12 Nov 2022 01:42:13 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by kinkan2-ex.css.socionext.com (Postfix) with ESMTP id 0DD232059027; Sat, 12 Nov 2022 01:42:13 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Sat, 12 Nov 2022 01:42:13 +0900 Received: from [10.212.158.220] (unknown [10.212.158.220]) by kinkan2.css.socionext.com (Postfix) with ESMTP id 6200EB62A4; Sat, 12 Nov 2022 01:42:12 +0900 (JST) Message-ID: <3200aea8-55df-9718-01ac-e15633e13de7@socionext.com> Date: Sat, 12 Nov 2022 01:42:12 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v2 5/5] arm64: dts: uniphier: Add NX1 SoC and boards support To: Krzysztof Kozlowski , 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> <36680a5e-7b0c-4d7e-f039-734e9304dc18@linaro.org> Content-Language: en-US From: Kunihiko Hayashi In-Reply-To: <36680a5e-7b0c-4d7e-f039-734e9304dc18@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 2022/11/11 23:40, Krzysztof Kozlowski wrote: > 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. This structure follow the existing UniPhier SoCs, so it is necessary to re-think the structure of all SoCs, not just this NX1 SoC. >> >> 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. In this same area, mode selector, clock selector, phy configuration etc, exist together in a mixed manner. There is a kind of design issues. From this point of view, I should separate the new devicetree once from this patch series, and it is necessary to consider syscon DT schema and related drivers for existing SoCs. >>>>>> + }; >>>>>> + }; >>>>>> + >>>>>> + 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. It takes more time to review existing structures, especially patch 1/5. Thank you, --- Best Regards Kunihiko Hayashi