Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp724266ybg; Wed, 10 Jun 2020 11:59:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsOR1FdMRO2ixYr8B5GGIWrWz7VNKTti5cdyE8tb+ewDB6LT6B+YBQ+kvDqYEZpu3wevSQ X-Received: by 2002:a17:906:4a4b:: with SMTP id a11mr4718055ejv.486.1591815586936; Wed, 10 Jun 2020 11:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591815586; cv=none; d=google.com; s=arc-20160816; b=cS87T7XUpRBQjekHas0GNruSEz3zagREEdtKKnS+PPO2cRgiZnP0hvL35LSJ21mUaR bd3Y78dToUreIZTrFvIkGZ+3KqYV4AHY8KOjV11RO54uBy2/nnKTgPYvdF/lIBJTqh8t B/hY8DzRUGDDKaMWdGf2rhpGDVxDB1IRbBhM6QFndECn4qtEp8iS8Kb/p9LGnApjvadx HXeUTAAjjdtnPpJZl+3oe0HR9XTcfehqw23qnsIhhF41C5gqT2q3t9VvNxdFXK2Ksehm C+gFufIMM0EJf5Yt/ZkHCWC5LqWeZ0ht38oFfABFU8s6lfzUPQvFJdC4LG8LHtuFRiWH Bwig== 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=DOqlkCte3w7+QDLnrmM9G7Ahbcf+KRMbtMTdeKFUr+M=; b=mJX/K/ur40DkwNo0150tGAuW1M2OvbxczwWGiTSL95SAkXvvyCnFrAGfvSr+QAYalU r+BevXONKsd12cZEzbHypzLXk3R45D+j8PPcSwjn1Ia25r6mjvxb337A9d1fwrHeHT6y QiEfBaCDLpSucBPUxLiJBLW3snCGHqlWs6aSiK7pGA4yRVb6nwgCg4VnfnhEPwXu1MzE cB6Bx8nvmkVo7YFPVmXK7TZNwSiSSF4VSK579YPFMLnW7PokjtVK/bayBbOm23+cW/n+ OapDZlcCsJAF63E9VdN4kw1kp5oPKAj8BBIuZjutkw63r0SZUl89v8jJ/9plSTUeL9bb jqhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VKAC3CH1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id g18si524452ejp.594.2020.06.10.11.59.24; Wed, 10 Jun 2020 11:59:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VKAC3CH1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726886AbgFJQx6 (ORCPT + 99 others); Wed, 10 Jun 2020 12:53:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:33576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726517AbgFJQx6 (ORCPT ); Wed, 10 Jun 2020 12:53:58 -0400 Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com [209.85.161.42]) (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 4E0ED20734; Wed, 10 Jun 2020 16:53:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591808037; bh=5l99DsraoOPZV1OU1YHuYjZOzAMxH54iUhG8bur9rnM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=VKAC3CH1sASX4nfgzMqpFP+edv/gqOVS5WUTKjJX0NX4h3ac+MYrPZ6yhmNCna8Fu cCOVVrFS8zCmP9bLKmf948XY3+q1iIZeKKNz9AhKxOdwQpf1adSEWATaWuKuzTxCZx +e4Sc4bm7L5U3Fb0ONJhJLRXQaY2M2dAzaOm4+HU= Received: by mail-oo1-f42.google.com with SMTP id e12so639444oou.2; Wed, 10 Jun 2020 09:53:57 -0700 (PDT) X-Gm-Message-State: AOAM5312i7ipcBZKH5D8bs3bvX4cl423qsvIw9wyUpWT3N1+y48jMZDk Wr/ak3M9rkFrCN6FtjOj4eRQhmXJ4bJdBwfXWQ== X-Received: by 2002:a4a:6156:: with SMTP id u22mr2935115ooe.50.1591808036515; Wed, 10 Jun 2020 09:53:56 -0700 (PDT) MIME-Version: 1.0 References: <20200422222242.241699-1-pmalani@chromium.org> <20200511192800.GA28762@bogus> <20200511204635.GC136540@google.com> <20200512134154.GC2085641@kuha.fi.intel.com> <20200609235740.GA154315@google.com> <20200610153356.GC3213128@kuha.fi.intel.com> In-Reply-To: <20200610153356.GC3213128@kuha.fi.intel.com> From: Rob Herring Date: Wed, 10 Jun 2020 10:53:45 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] dt-bindings: chrome: Add cros-ec-typec mux props To: Heikki Krogerus Cc: Prashant Malani , "linux-kernel@vger.kernel.org" , Tim Wawrzynczak , Benson Leung , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Enric Balletbo i Serra , Guenter Roeck 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, Jun 10, 2020 at 9:34 AM Heikki Krogerus wrote: > > On Tue, Jun 09, 2020 at 04:57:40PM -0700, Prashant Malani wrote: > > Hi Rob, > > > > Thanks again for the comments and feedback. Kindly see responses inline: > > > > (Trimming unrelated text from thread): > > > > On Tue, Jun 09, 2020 at 02:30:11PM -0600, Rob Herring wrote: > > > On Fri, May 29, 2020 at 5:30 PM Prashant Malani wrote: > > > > > > > > Nodes truncated and unrelated fields omitted in the interest of brevity: > > > > > > > > // Chrome OS EC Type C Port Manager. > > > > typec { > > > > compatible = "google,cros-ec-typec"; > > > > #address-cells = <1>; > > > > #size-cells = <0>; > > > > > > > > connector@0 { > > > > compatible = "usb-c-connector"; > > > > reg = <0>; > > > > power-role = "dual"; > > > > data-role = "dual"; > > > > try-power-role = "source"; > > > > mode-switch = <&foo_mux>; > > > > // Other switches can point to the same mux. > > > > .... > > > > > > The connector is supposed to have 'ports' for USB2, USB3, and Aux > > > unless the parent is the USB controller. > > Understood; so, coupled with Heikki's explanation (see below for where > > I've pasted it), would it be something like so? (adding inline to the connector > > node definition): > > > > ports { > > #address-cells = <1>; > > #size-cells = <0>; > > > > port@0 { > > reg = <0>; > > usb_con_hs: endpoint { > > remote-endpoint = <&foo_usb_hs_controller>; > > }; > > }; > > > > port@1 { > > reg = <1>; > > usb_con0_ss: endpoint@0 { > > remote-endpoint = <&mode_mux_in>; > > }; > > }; > > > > port@2 { > > reg = <2>; > > usb_con_sbu: endpoint { > > remote-endpoint = <&foo_dp_aux>; > > }; > > }; > > }; > > The pins that can be reassigned can in practice go anywhere. We can't > group them in any way. What do we do for example when the two sideband > pins go to different locations? The sideband pins from the connector go to multiple places or the sideband signal from a controller go to multiple connectors? Either way, that's solved with multiple endpoints. In the former case, port@2 would have multiple endpoints with all the possible connections. The general model of the graph is each port is a separate data channel and multiple endpoints are either a mux or fanout depending on the data direction. > It looks like the OF graph for the USB Type-C connectors expects the > pins to be grouped like that, which is too bad, because unfortunately > it will not work. It would require that we have a separate port for > every pin that can be reassigned on the connector, and let's not even > consider that. I guess you are referring to the 4 SS signal pairs and that they could be 2 USB links, 1 USB link and 1-2 Alt mode links, or 4 Alt mode links. I think the grouping of SS signals is fine as I'd expect there's a single entity deciding the routing. That would be 'mux' node I think, but 'mux' is the wrong abstraction here. I guess we could have 4 muxes (1 for each signal), but I'd hope we don't need that level of detail in DT. I think we're in agreement on that. > We need higher level description of the connections for the USB Type-C > connectors. For example, a connector can be connected to this (or > these) DisplayPort(s), this USB 2.0 port, this USB 3.x port, this USB4 > port, etc. And this is the mux that handles the pins on this > connector, and these are the retimers, etc. etc. > > We also need a way to identify those connections, and relying on > something like fixed port node addresses, so indexes in practice, > feels really risky to me. A conflict may seem unlikely now, but we > seen those so many times in the past other things like GPIOs, IRQs, > etc. We really need to define string identifiers for these > connections. I assume for IRQs you are referring to cases where we have a variable number such as 'interrupts = <1 2 3>;' where 'interrupts = <1 3>' doesn't work because we can't describe interrupt 2 is not present? The graph binding doesn't suffer from that issue since we can easily omit port or endpoint nodes. Also, the numbering is specific to a compatible string. If we need different numbering, then we can do a new compatible. Rob