From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 181EBC4320E for ; Wed, 11 Aug 2021 03:43:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DD13160F46 for ; Wed, 11 Aug 2021 03:43:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232795AbhHKDoS (ORCPT ); Tue, 10 Aug 2021 23:44:18 -0400 Received: from pi.codeconstruct.com.au ([203.29.241.158]:40248 "EHLO codeconstruct.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232905AbhHKDoR (ORCPT ); Tue, 10 Aug 2021 23:44:17 -0400 Received: by codeconstruct.com.au (Postfix, from userid 10001) id A070B213C9; Wed, 11 Aug 2021 11:43:53 +0800 (AWST) From: Matt Johnston To: devicetree@vger.kernel.org Cc: Wolfram Sang , Jeremy Kerr , Matt Johnston Subject: [RFC PATCH v2 2/2] dt-bindings: net: mctp-i2c-generic: support muxes Date: Wed, 11 Aug 2021 11:43:45 +0800 Message-Id: <20210811034345.2424442-3-matt@codeconstruct.com.au> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210811034345.2424442-1-matt@codeconstruct.com.au> References: <20210811034345.2424442-1-matt@codeconstruct.com.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Allow a single mctp-i2c-generic controller node to specify multiple subordinate I2C mux busses that are attached. The 'bus-attach' property defines which I2C busses should provide an MCTP endpoint. This allows a hardware I2C controller at the top of a mux topology to handle incoming messages (as an I2C slave) for subordinate I2C mux busses. Otherwise I2C mux busses are not be able to act as an I2C slave which is required by the MCTP I2C transport. Signed-off-by: Matt Johnston --- .../bindings/net/mctp-i2c-generic.yaml | 53 +++++++++++++++++-- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/net/mctp-i2c-generic.yaml b/Documentation/devicetree/bindings/net/mctp-i2c-generic.yaml index 6092f7e8dc07..e4d742452078 100644 --- a/Documentation/devicetree/bindings/net/mctp-i2c-generic.yaml +++ b/Documentation/devicetree/bindings/net/mctp-i2c-generic.yaml @@ -10,11 +10,14 @@ maintainers: - Matt Johnston description: - The generic MCTP I2C binding defines an MCTP endpoint on an existing I2C - adapter. MCTP I2C is specified by DMTF DSP0237. + An mctp-i2c-generic controller defines an MCTP endpoint on an existing I2C + controller. MCTP I2C is specified by DMTF DSP0237. - An mctp-i2c-generic device must be attached to a hardware bus adapter - which supports slave functionality. + An mctp-i2c-generic controller must be attached to an I2C controller + which supports slave functionality. Subordinate busses in a mux topology + can be attached to the same mctp-i2c-generic controller with the bus-attach + property. These will be presented to the host system as separate MCTP I2C + instances. properties: compatible: @@ -26,6 +29,16 @@ properties: 7 bit I2C address of the endpoint. I2C_OWN_SLAVE_ADDRESS flag must be set (described in i2c.txt) + bus-attach: + $ref: "/schemas/types.yaml#/definitions/phandle-array" + description: | + List of phandles of I2C busses to attach to. All busses must + be in the same mux topology as the node's parent I2C controller. + + If no bus-attach property is specified then only the direct parent + I2C bus is attached. Otherwise to include a direct parent bus it + must be included in the bus-attach list if needed. + additionalProperties: false required: @@ -35,12 +48,42 @@ required: examples: - | #include - i2c { + + // simple attaching to a root adapter i2c0 + i2c0: i2cbus0 { + #address-cells = <1>; + #size-cells = <0>; + + mctp@50 { + compatible = "mctp-i2c"; + reg = <(0x50 | I2C_OWN_SLAVE_ADDRESS)>; + }; + }; + + // attaching to a root adapter i2c5 and a child mux bus i2c14 + i2c5: i2cbus5 { #address-cells = <1>; #size-cells = <0>; mctp@50 { compatible = "mctp-i2c"; reg = <(0x50 | I2C_OWN_SLAVE_ADDRESS)>; + attach-bus = <&i2c5 &i2c14>; }; }; + + i2cmux0 { + compatible = "i2c-mux"; + #address-cells = <1>; + #size-cells = <0>; + i2c-parent = <&i2c5>; + mux-controls = <&mux>; + + i2c14: i2c@0 { + reg = <0>; + }; + + i2c15: i2c@1 { + reg = <1>; + }; + }; -- 2.30.2