Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3043411ybt; Mon, 29 Jun 2020 13:45:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxU4T+8bByr9N9mxFZlkoWwRtxf1Dhx1uX1NEFXpO0Q4ZyaHESi1R0M6w0nkNtNyqp2DEpX X-Received: by 2002:aa7:d50d:: with SMTP id y13mr19436863edq.230.1593463528962; Mon, 29 Jun 2020 13:45:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593463528; cv=none; d=google.com; s=arc-20160816; b=qKAuFlN9z580FlSQVmq97ISK7b6Ly1HBSbiC64E8hXT/XwE0WniVSHqsiDmTvYyyWR 5Zrz4NaXRP0g9sXz639lcQgsLIH23/KUx/Mp+H1pu5rFqEq4MG75MPr/+hXCjVQKutlj 3hd4SsTL9bsP+0bAek413EfCRloEU6j3Y2LD72nibAZLo12r5bZ91GmKlegPfXMeHjt2 FfKFxDgdeDHwpKjZlBk4+VJCtkJV8QAJsxZvBlnDxW/Imql3U9Fu9gtiivJXAdYGqD+U kxEyq+yRcftezeJhRSs2OLRpHLtIhOY4msPUVrEh3qDyjg2dkq+ubjlNIwlgXLynURNA n08A== 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=8jpkMMCZ9Vq0NvRazLzzXPiv8xnbPqfCWhE/+a83M64=; b=CcowIs/3ckPiz5mNnfw82MWuDLjJsarZvZ59Y0T1yXMxgRsdsJc8afxiRP5zeIYaA9 Kwu/jK6qmOkAJ3buLeFLZAQ4zzE8EojtSe04xR7dC6PTfWYZkon2mitbDyR4LcCJDoSL 3H9zs/uR4fwtgps+GvcnpZUY/7lwsWIWir508asI1wkC+SVDRPaIX7mcA/iVy6Bmxe/z b4Oy1vk4dBNRIjfW3t/8PdEXOiAuSJ1oiXshtCuFdDE0Qx1raOuCry+6jLlXHjIKh4nl 9dQ16l0ZTLjmxc3VT1F5PEs/DuCYarQ9+q80hdGrYRwu3XxO2Hhls3Dt5uBuX5VPA4EJ EUWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EJevnq1Q; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h17si346390ejd.655.2020.06.29.13.45.06; Mon, 29 Jun 2020 13:45:28 -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=@chromium.org header.s=google header.b=EJevnq1Q; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389629AbgF2UmD (ORCPT + 99 others); Mon, 29 Jun 2020 16:42:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389625AbgF2UmB (ORCPT ); Mon, 29 Jun 2020 16:42:01 -0400 Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35EE8C03E979 for ; Mon, 29 Jun 2020 13:42:01 -0700 (PDT) Received: by mail-qk1-x731.google.com with SMTP id e11so16614868qkm.3 for ; Mon, 29 Jun 2020 13:42:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8jpkMMCZ9Vq0NvRazLzzXPiv8xnbPqfCWhE/+a83M64=; b=EJevnq1Qm1fMrGg9QqwoGUo74xXnWz+OPLe22wYa8z9X7/EESR/StW4NBOVZUvfATX AHN4aZzjhhGvyeJsncj0H3Q3U/a7FxJYRBUijeZOnNB1p4Tp3HUxx0EbjmjSmr9TIjP0 7/n3h2c0RV8GVI6qG0UNAxaWURnlnXhz3fM7E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8jpkMMCZ9Vq0NvRazLzzXPiv8xnbPqfCWhE/+a83M64=; b=UWz38DBSbog1IyshznUjGcpg1Xeun6oSTWG7X4tG8wMPwa30yjN9HeVHYhFmWTlT7L jJp/XYcmcVYbGIA41nn+mdFYS4Dylkzrgy9Y4E1MkFXEkXud68v6QmotmLiezQvRknZ6 HhBh204WhKHv+JytuJ8F4W/r/tlZl3GcqUFg3BTFjHsZfzZgM8b5vvH6JAYDawHnhKUw gFbQ7ev0ysIU8vJu0GnU6Y4pNvGQNSfB1AWDvaUtQmbrsvX1iPyVUFHr0O+XAeZ6qquS oamzAFR5l5ZSsswOq6m4P9C1iXOjRUJzrTXcl/B9fM0ofkjcMTPtlH+jp0RHQX6KC7J/ Ii4Q== X-Gm-Message-State: AOAM533lRR3qTutkGSfWjlUIHHltY0rJt0ffQy4qPkPLoHDiKsHXgLX1 y2v/gQ6VVN6/K1R6NBV4kGehfr5OAblTcIdAOZPmlA== X-Received: by 2002:a37:b341:: with SMTP id c62mr16343321qkf.128.1593463320086; Mon, 29 Jun 2020 13:42:00 -0700 (PDT) MIME-Version: 1.0 References: <20200511204635.GC136540@google.com> <20200512134154.GC2085641@kuha.fi.intel.com> <20200609235740.GA154315@google.com> <20200610153356.GC3213128@kuha.fi.intel.com> In-Reply-To: From: Prashant Malani Date: Mon, 29 Jun 2020 13:41:48 -0700 Message-ID: Subject: Re: [PATCH 1/2] dt-bindings: chrome: Add cros-ec-typec mux props To: Rob Herring Cc: Heikki Krogerus , "linux-kernel@vger.kernel.org" , Tim Wawrzynczak , Benson Leung , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Enric Balletbo i Serra , Guenter Roeck , Rajmohan Mani 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 Hi Rob, Just following up on this. Would the below example align better with OF graph requirements? Example begins at , but in summary: - port@1 (Superspeed) of usb-c-connector will have 3 endpoints (0 = goes to mode switch, 1 = goes to orientation switch, 2 = goes to data role switch) - port@2 (SBU) of usb-c-connector will have 2 endpoints (0 = goes to mode switch, 1 = goes to orientation switch) -These end points can go through arbitrarily long paths (including retimers) as long as they end up at the following devices: a. device with compatible string "typec-mode-switch" for endpoint 0. b. device with compatible string "typec-orientation-switch" for endpoint 1. c. device with compatible string "typec-data-role-switch" for endpoint 2. - Connector class framework will perform the traversal from usb-c-connector port endpoints to the "*-switch" devices. Best regards, On Fri, Jun 12, 2020 at 10:34 AM Prashant Malani wrote: > > Hi Rob, > > Thanks as always for your help in reviewing this proposal! > > Kindly see inline > > (Trimming text); > On Thu, Jun 11, 2020 at 02:00:47PM -0600, Rob Herring wrote: > > On Wed, Jun 10, 2020 at 11:49 AM Prashant Malani wrote: > > > > > > Hi Rob, > > > > > > On Wed, Jun 10, 2020 at 9:53 AM Rob Herring wrote: > > > > > > > > > On Tue, Jun 09, 2020 at 04:57:40PM -0700, Prashant Malani wrote: > > > > > > I think the updated example handles this grouping (port@1 going to a > > > "SS mux") although as you said it should probably be a group of muxes, > > > but I think the example illustrates the point. Is that assessment > > > correct? > > > > Yes, but let's stop calling it a mux. It's a "USB Type C signal routing blob". > > Ack. > > Let's go with "-switch" ? That's what the connector class uses and it > conveys the meaning (unless that is a reserved keyword in DT). > > > > > > Would this block the addition of the "*-switch" properties? IIUC the > > > two are related but not dependent on each other. > > > > > > The *-switch properties are phandles which the Type C connector class > > > framework expects (and uses to get handles to those switches). > > > These would point to the "mux" or "group of mux" abstractions as noted earlier. > > > > You don't need them though. Walk the graph. You get the connector > > port@1 remote endpoint and then get its parent. > > > > I see; would it be something along the lines of this? (DT example > follows; search for "example_end" to jump to bottom): > > > > connector@0 { > compatible = "usb-c-connector"; > reg = <0>; > power-role = "dual"; > data-role = "dual"; > try-power-role = "source"; > .... > 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>; > #address-cells = <1>; > #size-cells = <0>; > > usb_con0_ss_mode: endpoint@0 { > reg = <0> > remote-endpoint = <&mode_switch_ss_in>; > }; > > usb_con0_ss_orientation: endpoint@1 { > reg = <1> > remote-endpoint = <&orientation_switch_ss_in>; > }; > > usb_con0_ss_data_role: endpoint@2 { > reg = <2> > remote-endpoint = <&data_role_switch_in>; > }; > }; > > port@2 { > reg = <2>; > #address-cells = <1>; > #size-cells = <0>; > usb_con0_sbu_mode: endpoint@0 { > reg = <0> > remote-endpoint = <&mode_switch_sbu_in>; > }; > usb_con0_sbu_orientation: endpoint@1 { > reg = <1> > remote-endpoint = <&orientation_switch_sbu_in>; > }; > }; > }; > }; > > mode_switch { > compatible = "typec-mode-switch"; > mux-controls = <&mode_mux_controller>; > mux-control-names = "mode"; > #address-cells = <1>; > #size-cells = <0>; > > port@0 { > reg = <0>; > mode_switch_ss_in: endpoint { > remote-endpoint = <&usb_con0_ss_mode> > }; > }; > > port@1 { > reg = <1>; > mode_switch_out_usb3: endpoint { > remote-endpoint = <&usb3_0_ep> > }; > }; > > port@2 { > reg = <2>; > mode_switch_out_dp: endpoint { > remote-endpoint = <&dp0_out_ep> > }; > }; > > port@3 { > reg = <3>; > mode_switch_sbu_in: endpoint { > remote-endpoint = <&usb_con0_sbu_mode> > }; > }; > // ... other ports similarly defined. > }; > > orientation_switch { > compatible = "typec-orientation-switch"; > mux-controls = <&orientation_mux_controller>; > mux-control-names = "orientation"; > #address-cells = <1>; > #size-cells = <0>; > > port@0 { > reg = <0>; > orientation_switch_ss_in: endpoint { > remote-endpoint = <&usb_con0_ss_orientation> > }; > }; > > port@1 > reg = <1>; > orientation_switch_sbu_in: endpoint { > remote-endpoint = <&usb_con0_sbu_orientation> > }; > }; > // ... other ports similarly defined. > }; > > data_role_switch { > compatible = "typec-data-role-switch"; > mux-controls = <&data_role_switch_controller>; > mux-control-names = "data_role"; > > port { > data_role_switch_in: endpoint { > remote-endpoint = <&usb_con0_ss_data_role> > }; > }; > }; > > > > Would this be conformant to OF graph and usb-connector bindings > requirements? We'll certainly send out a format PATCH/RFC series for > this, but I was hoping to gauge whether we're thinking along the right lines. > > So, in effect this would mean: > - New bindings(and compatible strings) to be added for: > typec-{orientation,data-role,mode}-switch. > - Handling in Type C connector class to parse switches from OF graph. > - Handling in Type C connector class for distinct switches for port@1 > (SS lines) and port@2 (SBU lines). > > The only thing I'm confused about is how we can define these switch > remote-endpoint bindings in usb-connector.yaml; the port can have an > remote-endpoint, but can we specify what the parent of the remote-endpoint > should have as a compatible string? Or do we not need to? > > Best regards, > > -Prashant >