Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3696082rwb; Sun, 9 Oct 2022 09:24:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7jIxmq5sWteB3FW/+P9ixbFHbQ/0Kl+DLxbEZa/v42JHvXraGKbmsOuBcffVBeKHuEp3AH X-Received: by 2002:a17:907:75dc:b0:783:9c71:5e20 with SMTP id jl28-20020a17090775dc00b007839c715e20mr11548815ejc.125.1665332659192; Sun, 09 Oct 2022 09:24:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665332659; cv=none; d=google.com; s=arc-20160816; b=ph9af3O11XJI2U92sPrw47MeTVI+lvyNm614FfEMpPER/rI8HqtH1Y6k/+ILvVsEtI xP7bnjcIjdWNTAFYAKBOLVf3cN1f7Q5sf9o0fkN+lkIeSpCfiENfz6/ZnY0FE/CTuZwh Vmj9pW1OZQ4cqRzVS7oI6XdofMs0sBMx1yP8enlYtWCIxGeKuAHxSh069lK40feimdeh NG17CcPtN3iepJ+Ez0qb5aTFUBLlDqpf0X/Iyn0SAm/z4t77vwh8HLmlX8moOub5/qCi KO0GBR6TYFMpbuEzJXzScifRmSm2CMEzT35T9Dt4edSZtplVGCdMAxacSLBqXtgaDqbT hwNA== 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=MPuV4OxPJUlg/BenC0+lIzHK/2HLlqgu9oU374zZOXM=; b=bfS+vJ+L4tztSoZVlvsdEjCYmWhK7iaNimkzgDACXVuLq8K7zKzZWjW2LETZzgD9QL VmDn15rLPmJsps8LX6Jf98+XRXiZsqBuEupVC2CugmP4eQIYaSno8f94XnAuEn1FEvol wzunF3jiB4IOPmiPJ3ODFMs9K9lIDjEBBFTOhiHPpcX8cMC9f5CI/RD/cB8hVFGIXIgW qoYHe9tRXtGrQzGTVceHu9NENt6oHOABkvCmGY64JBMUxifJB3LKgWSROemtVL8DUykO jLB10xRtuean61G1fGWarhvGKYnlEoTjuPn/PvJdcDmIb5ZqR8bd+BPAeQ0XMr8KBYiD /BMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n2X21I8k; 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 xf13-20020a17090731cd00b00788361f96a2si7293120ejb.776.2022.10.09.09.23.49; Sun, 09 Oct 2022 09:24:19 -0700 (PDT) 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=n2X21I8k; 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 S229950AbiJIQPQ (ORCPT + 99 others); Sun, 9 Oct 2022 12:15:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229822AbiJIQPN (ORCPT ); Sun, 9 Oct 2022 12:15:13 -0400 Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C489824F13 for ; Sun, 9 Oct 2022 09:15:11 -0700 (PDT) Received: by mail-qk1-x735.google.com with SMTP id i3so5562972qkl.3 for ; Sun, 09 Oct 2022 09:15:11 -0700 (PDT) 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=MPuV4OxPJUlg/BenC0+lIzHK/2HLlqgu9oU374zZOXM=; b=n2X21I8kPzZAtcmp9X3n+Y4+1f2hEhVp45W/+u+SfiSdDPIrzPdo8tKmumjC006hiT /6bRekPOhFejZksOhvlv7REfPJ4mEQv2vE92tMNeTv7mt9fMONiH0w/oHnfRbTZNBfn9 mmjUcZESuTCJftjhq8q2Sst1x9QV8E1LSlFLZMJkCjiL+LgguiMUKYBoVEiswWm07+hP Q7+j+IZI9XBRpBu/vg4BK022bmgS9LLsyEBKPKavUtXyqDod0KDs9aDgvFBzP6VG3IQd n2PKsPSvatShT2BXAtvyLTrSicR5UtQ9U+Wrsjl0Y2/AhqsfldKiu4nZ2yHrRwOeYYWl aPow== 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=MPuV4OxPJUlg/BenC0+lIzHK/2HLlqgu9oU374zZOXM=; b=DiqPgYx7qybyOGZd5nZcn2P9FQM7z74MHKZMs69f52tun0Hd6Pqn8mmB+EUK6EDXOt VKSTsHEMDXIpnkGAh0ufowE4Kr9hjMW7rn3+/pHlbUe+oEe59647Qnuzl0ZxF9ChbPBs 3LzMi0xY6S/hPoBBxgMD+61OUyjRsOegZ6xhZZk6Kh/qs/8l1VGFaYvgUHgMAqWQxPAt q4jWu4RPWAgZ+ZijeCD5M2X0Y/by9hWj68SuYLJhA1XgXHT44+Syapg+qG1aru50IxbQ QXIaEOmw3gKwR/VXrIKiMsfp2wPo2YuxgVXSGXDoVClKi/H5EERvd0S7B9OO7oNYDXC4 I3IA== X-Gm-Message-State: ACrzQf3R5PPmeuMZ2Ye/IBjBD9J/isgDdEdBunOlWhQcuNLgNsxF1bRx dDZTAMTupoUySR+pkNiipe/Ctg== X-Received: by 2002:a05:620a:6082:b0:6cf:f086:a70f with SMTP id dx2-20020a05620a608200b006cff086a70fmr10131303qkb.324.1665332110933; Sun, 09 Oct 2022 09:15:10 -0700 (PDT) Received: from [192.168.1.57] (cpe-72-225-192-120.nyc.res.rr.com. [72.225.192.120]) by smtp.gmail.com with ESMTPSA id bn35-20020a05620a2ae300b006ce60296f97sm7531742qkb.68.2022.10.09.09.15.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 Oct 2022 09:15:10 -0700 (PDT) Message-ID: Date: Sun, 9 Oct 2022 12:14:22 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH v3 net-next 12/14] dt-bindings: net: dsa: ocelot: add ocelot-ext documentation Content-Language: en-US To: Vladimir Oltean Cc: Colin Foster , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, Russell King , Linus Walleij , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Lee Jones , Krzysztof Kozlowski , Rob Herring , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Florian Fainelli , Vivien Didelot , Andrew Lunn References: <20220926002928.2744638-1-colin.foster@in-advantage.com> <20220926002928.2744638-13-colin.foster@in-advantage.com> <455e31be-dc87-39b3-c7fe-22384959c556@linaro.org> <28b4d9f9-f41a-deca-aa61-26fb65dcc873@linaro.org> <20221008000014.vs2m3vei5la2r2nd@skbuf> From: Krzysztof Kozlowski In-Reply-To: <20221008000014.vs2m3vei5la2r2nd@skbuf> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.0 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 08/10/2022 02:00, Vladimir Oltean wrote: > On Wed, Oct 05, 2022 at 06:09:59PM +0200, Krzysztof Kozlowski wrote: >>>> I don't understand how your answer relates to "reg=<0 0>;". How is it >>>> going to become 0x71010000 if there is no other reg/ranges set in parent >>>> nodes. The node has only one IO address, but you say the switch has 20 >>>> addresses... >>>> >>>> Are we talking about same hardware? >>> >>> Yes. The switch driver for both the VSC7512 and VSC7514 use up to ~20 regmaps >>> depending on what capabilities it is to have. In the 7514 they are all >>> memory-mapped from the device tree. While the 7512 does need these >>> regmaps, they are managed by the MFD, not the device tree. So there >>> isn't a _need_ for them to be here, since at the end of the day they're >>> ignored. >>> >>> The "reg=<0 0>;" was my attempt to indicate that they are ignored, but I >>> understand that isn't desired. So moving forward I'll add all the >>> regmaps back into the device tree. >> >> You need to describe the hardware. If hardware has IO address space, how >> does it matter that some driver needs or needs not something? > > What do you mean by IO address space exactly? It is a SPI device with registers. > Does that constitute an IO address space to you? By IO I meant MMIO (or similar) which resides in reg (thus in unit address). The SPI devices have only chip-select as reg, AFAIR. > > The driver need matters because you don't usually see DT nodes of SPI, > I2C, MDIO devices describing the address space of their registers, and > having child nodes with unit addresses in that address space. Only when > those devices are so complex that the need arises to identify smaller > building blocks is when you will end up needing that. And this is an > implementation detail which shapes how the dt-bindings will look like. So probably I misunderstood here. If this is I2C or SPI device, then of course reg and unit address do not represent registers. > >> You mentioned that address space is mapped to regmaps. Regmap is Linux >> specific implementation detail, so this does not answer at all about >> hardware. >> >> On the other hand, if your DTS design requires this is a child of >> something else and by itself it does not have address space, it would be >> understandable to skip unit address entirely... but so far it is still >> confusing, especially that you use arguments related to implementation >> to justify the DTS. > > If Colin skips the unit address entirely, then how could he distinguish > between the otherwise identical MDIO controllers mdio@7107009c and > mdio@710700c0 from Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml? > The ethernet-switch node added here is on the same hierarchical level > with the MDIO controller nodes, so it must have a unit address just like > them. So what is @710700c0? It's not chip-select, but MMIO or some other bus (specific to the device), right? The mscc,ocelot.yaml has a soc@0 SPI device. Children of soc@0 use unit addresses/reg meaningful for that soc@0. > > But I don't support Colin's choice of "reg=<0 0>;" either. A choice must > be made between 2 options: > - mapping all 20 regions of the SPI address space into "reg" values > - mapping a single region from the smallest until the largest address of > those 20, and hope nothing overlaps with some other peripheral, or > worse, that this region will never need to be expanded to the left. Yeah, at least to my limited knowledge of this hardware. > What information do you need to provide some best practices that can be > applied here and are more useful than "you need to describe the > hardware"? Describe the hardware properties in terms of it fit in to the whole system - so some inputs (clocks, GPIOs), outputs (interrupts), characteristics of a device (e.g. clock provider -> clock cells) and properties configuring hardware per specific implementation. But mostly this argument "describe hardware" should be understood like: do not describe software (Linux drivers) and software policies (driver choices)... > Verilog/VHDL is what the hardware description that's > independent of software implementation is, good luck parsing that. Best regards, Krzysztof