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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5151C4332F for ; Fri, 26 Nov 2021 22:50:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231462AbhKZWxO (ORCPT ); Fri, 26 Nov 2021 17:53:14 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:54208 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239549AbhKZWvO (ORCPT ); Fri, 26 Nov 2021 17:51:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:To:From:Date:From:Sender:Reply-To:Subject:Date: Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=L0jL/JDF3mZatKYXvhswt5OjSKQ39TiN08Rrl5nIFCs=; b=Gf9nbyq4kEILLJ1Qbhs6/h/5X6 gnDTUoaqg+UO/tWYpMbIuDN1c0V8Z8AgbeyH2dwvusnYmjPfeDWNVhIB1Yw4XzY5wKpOW/T87T8Rl IXcv4m+5lqjsNIHKRLYw+Bl2f+aefYRc6GAuIWTvsKjEPSaK7RebWrb27BZuBpoCz990=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mqk0Z-00EjZD-N8; Fri, 26 Nov 2021 23:47:55 +0100 Date: Fri, 26 Nov 2021 23:47:55 +0100 From: Andrew Lunn To: wsa@kernel.org, broonie@kernel.org, robh+dt@kernel.org, linux-i2c@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Patrice Chotard Subject: Re: [RFC] sti: Conflict in node name for an IP supporting both I2C and SPI Message-ID: References: <20211125210428.GA27075@gnbcxl0045.gnb.st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211125210428.GA27075@gnbcxl0045.gnb.st.com> Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org On Thu, Nov 25, 2021 at 10:04:28PM +0100, Alain Volmat wrote: > Hello, > > in the STi platform [1], the I2C and SPI controllers are handled by the > same IP, which can be configured in either one or the other mode. > This leads to warnings during the DT build and I was wondering if you could > give me some hints about how such situation should be handled since this > concern DT warnings but also bindings and YAML. > > In the SoC DT (dtsi), for each IP, there are 2 entries: > > One for the I2C mode (implemented by the driver i2c/busses/i2c-st.c) > i2c@9840000 { > compatible = "st,comms-ssc4-i2c"; > interrupts = ; > reg = <0x9840000 0x110>; > clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>; > clock-names = "ssc"; > clock-frequency = <400000>; > pinctrl-names = "default"; > pinctrl-0 = <&pinctrl_i2c0_default>; > #address-cells = <1>; > #size-cells = <0>; > > status = "disabled"; > }; > > One for the SPI mode (implemented by the driver spi/spi-st-ssc4.c) > spi@9840000 { > compatible = "st,comms-ssc4-spi"; > reg = <0x9840000 0x110>; > interrupts = ; > clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>; > clock-names = "ssc"; > pinctrl-0 = <&pinctrl_spi0_default>; > pinctrl-names = "default"; > #address-cells = <1>; > #size-cells = <0>; > > status = "disabled"; > }; > > So basically, there are 2 nodes, one for each mode, and enabling one or the > other mode is done within the board DT. > Since the address is the same, this obviously leads to warning during the build > of the DT. > > arch/arm/boot/dts/stih407-family.dtsi:363.15-376.5: Warning (unique_unit_address): /soc/i2c@9840000: duplicate unit-address (also used in node /soc/spi@9840000) How about making the compiler look at the status value. So long as only zero or one is enabled, it should not be an issue. If you have two or more nodes enabled for an address, then you want a warning or error. Andrew 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4757BC433EF for ; Fri, 26 Nov 2021 22:50:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vlREt3snM+vAHGtoRLrCYLh7y9HDunkXgVywk+SdNLo=; b=KSNlHhHfQ1oCVE JmRwrSMA++ALL7rsOu6KaMtVQk0eAQvVldFLlMVykot17o399YkjBbRasrHtpwIlpA4UQ/lIHsr9y cLvmidbMzvCjkf1idvOB/tSx1YnrIsE3TQvJaY3zUDUimgy4LJePj2kxCyJ/elYb+HgT3FyyKhe/s m1TS0dfzpt2TNq0NHu4ve46OvgNsJCV+BF+vQjQ5lo6dMlM1+gXKSzZHN4+k7wLcS7ruO3uvLpqAN AlRqf6VT9PArzys7ZvzRlj4MaJ+D2xjVkJCV2Y4jYTKn4AzuCOtHH/jXsb40PRlsHuUHH82T0aQ27 3KKmtTorou/iGEmcfXKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqk0q-00Bvan-4e; Fri, 26 Nov 2021 22:48:12 +0000 Received: from vps0.lunn.ch ([185.16.172.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqk0k-00BvaT-QB for linux-arm-kernel@lists.infradead.org; Fri, 26 Nov 2021 22:48:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:To:From:Date:From:Sender:Reply-To:Subject:Date: Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=L0jL/JDF3mZatKYXvhswt5OjSKQ39TiN08Rrl5nIFCs=; b=Gf9nbyq4kEILLJ1Qbhs6/h/5X6 gnDTUoaqg+UO/tWYpMbIuDN1c0V8Z8AgbeyH2dwvusnYmjPfeDWNVhIB1Yw4XzY5wKpOW/T87T8Rl IXcv4m+5lqjsNIHKRLYw+Bl2f+aefYRc6GAuIWTvsKjEPSaK7RebWrb27BZuBpoCz990=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mqk0Z-00EjZD-N8; Fri, 26 Nov 2021 23:47:55 +0100 Date: Fri, 26 Nov 2021 23:47:55 +0100 From: Andrew Lunn To: wsa@kernel.org, broonie@kernel.org, robh+dt@kernel.org, linux-i2c@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Patrice Chotard Subject: Re: [RFC] sti: Conflict in node name for an IP supporting both I2C and SPI Message-ID: References: <20211125210428.GA27075@gnbcxl0045.gnb.st.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211125210428.GA27075@gnbcxl0045.gnb.st.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211126_144806_881171_72FD8515 X-CRM114-Status: GOOD ( 17.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 25, 2021 at 10:04:28PM +0100, Alain Volmat wrote: > Hello, > > in the STi platform [1], the I2C and SPI controllers are handled by the > same IP, which can be configured in either one or the other mode. > This leads to warnings during the DT build and I was wondering if you could > give me some hints about how such situation should be handled since this > concern DT warnings but also bindings and YAML. > > In the SoC DT (dtsi), for each IP, there are 2 entries: > > One for the I2C mode (implemented by the driver i2c/busses/i2c-st.c) > i2c@9840000 { > compatible = "st,comms-ssc4-i2c"; > interrupts = ; > reg = <0x9840000 0x110>; > clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>; > clock-names = "ssc"; > clock-frequency = <400000>; > pinctrl-names = "default"; > pinctrl-0 = <&pinctrl_i2c0_default>; > #address-cells = <1>; > #size-cells = <0>; > > status = "disabled"; > }; > > One for the SPI mode (implemented by the driver spi/spi-st-ssc4.c) > spi@9840000 { > compatible = "st,comms-ssc4-spi"; > reg = <0x9840000 0x110>; > interrupts = ; > clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>; > clock-names = "ssc"; > pinctrl-0 = <&pinctrl_spi0_default>; > pinctrl-names = "default"; > #address-cells = <1>; > #size-cells = <0>; > > status = "disabled"; > }; > > So basically, there are 2 nodes, one for each mode, and enabling one or the > other mode is done within the board DT. > Since the address is the same, this obviously leads to warning during the build > of the DT. > > arch/arm/boot/dts/stih407-family.dtsi:363.15-376.5: Warning (unique_unit_address): /soc/i2c@9840000: duplicate unit-address (also used in node /soc/spi@9840000) How about making the compiler look at the status value. So long as only zero or one is enabled, it should not be an issue. If you have two or more nodes enabled for an address, then you want a warning or error. Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel