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 E8E87CCA47C for ; Wed, 29 Jun 2022 11:09:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229828AbiF2LJI (ORCPT ); Wed, 29 Jun 2022 07:09:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbiF2LJH (ORCPT ); Wed, 29 Jun 2022 07:09:07 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 719EC366AC for ; Wed, 29 Jun 2022 04:09:05 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id fi2so31800670ejb.9 for ; Wed, 29 Jun 2022 04:09:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=foG60lhNannT8P9dwW6kOYADdXZ/flWXxg5inptG7Kk=; b=fOqmOi1CSnXz7riHqPSZPrFn2IWlV4hfw0pYjQPy5LkPoB3mqXKSLx2Nc1qRyI+pT3 ijTo0bflkgH6otLqB34F1P4BviJwWuPt0NcEMGguEEwqwYvfWwl1H8VTBvl2Vyy7wNVn 0rX6JnCqrwZFKl9kxgOZnDETW8QeqEUCgAwkDJY3V1yQzXxf41HlH5bSPvD3ux0yFoZ5 ZPjiOG8erfdIwHve8fhCGBPLQ19LqDjR/8j2qCx/rK0wQYbnnlrJhmkXdjIWPftZERTZ 5htviNG37n6y6bhmbWk+GqOHbCKRYY54eVuiyPcQgit0vFaOgifBZY0Zzo091U5LUugs hE+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=foG60lhNannT8P9dwW6kOYADdXZ/flWXxg5inptG7Kk=; b=o5p5hRyYeVMOB76HD7YR4w7cCRhiL4R6XZ+8igowdBRgj7Jti90Mp9oPMKRm1FuoGT wUs/3NZLpPfyNZI8UTF/dBG0ZFPzp3O3iAFA1piyoPWu8cs+9YRWmbSyzgX5/3AAsBdt XI8XKQmgGtXlu5B1M4u+YDXKKQJk6SCqu5oBBiJw1sohhUQoUHzW5WHEJ9c14rUT9feg iR1cx3V8HEOXuBYbwkGLt/T77aQAChwxN2BGUx/2fqisIqlOultIcvnferJkhvc/8QAi 1f71HdrDX198pyKLn+WVpFxmJrGT9ibtS+/YQguXC+/iTUP81VXxeZfY7+f6VHv/SK6S 1hrQ== X-Gm-Message-State: AJIora8SlgyJQNi6JuIxk8Vzb4ucv/DpgFDBkOkQBeTCeFRWYVKf+2bf sSkzRf2g9bIFwQuqek0SDmrEgA== X-Google-Smtp-Source: AGRyM1tAc75CObf54+Dn1EXYo9rv7I8KdZ7F32RpNsq1ifASqeuEyIi397CtnC3Ibo8I2EE97xCsdw== X-Received: by 2002:a17:907:3dac:b0:722:e6ab:8d9 with SMTP id he44-20020a1709073dac00b00722e6ab08d9mr3076325ejc.20.1656500943955; Wed, 29 Jun 2022 04:09:03 -0700 (PDT) Received: from [192.168.0.184] (xdsl-188-155-176-92.adslplus.ch. [188.155.176.92]) by smtp.gmail.com with ESMTPSA id a23-20020aa7d757000000b00437df2444f5sm174712eds.11.2022.06.29.04.09.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Jun 2022 04:09:03 -0700 (PDT) Message-ID: Date: Wed, 29 Jun 2022 13:09:02 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 2/3] arm64: dts: exynosautov9: add exynosautov9-usi.dtsi Content-Language: en-US To: Chanho Park , 'Krzysztof Kozlowski' , 'Rob Herring' Cc: 'Alim Akhtar' , 'Sam Protsenko' , 'Jaewon Kim' , devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20220629015650.138527-1-chanho61.park@samsung.com> <20220629015650.138527-3-chanho61.park@samsung.com> <025601d88b9d$332049b0$9960dd10$@samsung.com> From: Krzysztof Kozlowski In-Reply-To: <025601d88b9d$332049b0$9960dd10$@samsung.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 29/06/2022 11:47, Chanho Park wrote: >> On 29/06/2022 03:56, Chanho Park wrote: >>> Universal Serial Interface (USI) supports three types of serial >>> interface such as Universal Asynchronous Receiver and Transmitter >>> (UART), Serial Peripheral Interface (SPI), and Inter-Integrated Circuit >> (I2C). >>> Each protocols can be working independently and configured as one of >>> those using external configuration inputs. >>> Exynos Auto v9 SoC support 12 USIs. When a USI uses two pins such as >>> i2c and 3 wire uarts(RX/TX only), we can use remain two pins as i2c mode. >>> So, we can define one USI node that includes serial/spi and hsi2c. >>> usi_i2c nodes can be used only for i2c mode. >>> >>> We can have below combinations for one USI. >>> 1) The usi node is used either 4 pin uart or 4 pin spi -> No usi_i2c >>> can be used >>> 2) The usi node is used 2 pin uart(RX/TX) and i2c(SDA/SCL) -> usi_i2c >>> should be enabled to use the latter i2c >>> 3) The usi node is used i2c(SDA/SCL) and i2c(SDA/SCL) -> usi_i2c >>> should be enabled to use the latter i2c >>> >>> By default, all USIs are initially set to uart mode by below setting. >>> samsung,mode = ; >>> You can change it either USI_V2_SPI or USI_V2_I2C. >>> >>> Signed-off-by: Chanho Park >>> --- >>> .../boot/dts/exynos/exynosautov9-usi.dtsi | 1127 +++++++++++++++++ >>> 1 file changed, 1127 insertions(+) >>> create mode 100644 arch/arm64/boot/dts/exynos/exynosautov9-usi.dtsi >> >> Put all this directly in exynosautov9.dtsi, because this is not a re- >> usable piece among different DTSI. > > Okay. I'll move them in the exynosautov9.dtsi. I thought they're too long to put in the exynosautov9.dtsi and I also found a similar case such as exynos5433-bus.dtsi and exynos5433-tmu.dtsi. Indeed we did like that... The tmu maybe was meant to be re-used, although it references specific clusters. But the split of bus I don't understand - it does not help. I don't think it improved readability. > >> >>> >>> diff --git a/arch/arm64/boot/dts/exynos/exynosautov9-usi.dtsi >>> b/arch/arm64/boot/dts/exynos/exynosautov9-usi.dtsi >>> new file mode 100644 >>> index 000000000000..0e4c6332770b >>> --- /dev/null >>> +++ b/arch/arm64/boot/dts/exynos/exynosautov9-usi.dtsi >>> @@ -0,0 +1,1127 @@ >>> +// SPDX-License-Identifier: GPL-2.0 >>> +/* >>> + * Samsung's ExynosAutov9 SoC USI device tree source >>> + * >>> + * Copyright (c) 2022 Samsung Electronics Co., Ltd. >>> + * >>> + * Samsung's ExynosAutov9 SoC USI(Universal Serial Interface, >>> +uart/spi/i2c) >>> + * are listed as device tree nodes in this file. >>> + */ >>> + >>> +/* PERIC0 USIs */ >>> +&soc { >>> + syscon_peric0: syscon@10220000 { >>> + compatible = "samsung,exynosautov9-sysreg", "syscon"; >>> + reg = <0x10220000 0x2000>; >>> + }; >>> + >>> + usi_0: usi@103000c0 { >>> + compatible = "samsung,exynos850-usi"; >> >> We should start adding dedicated compatible, so: >> "samsung,exynosautov9-usi", "samsung,exynos850-usi" > > So, I need to add the compatible to the Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml, right? > > - samsung,exynos850-usi # for USIv2 (Exynos850, ExynosAutoV9) > > To be> > - samsung,exynos850-usi > - samsung,exynosautov9-usi compatible: oneOf: - items: - const: samsung,exynosautov9-usi - const: samsung,exynos850-usi - enum: - samsung,exynos850-usi # for USIv2 (Exynos850, ExynosAutoV9) > >> >>> + reg = <0x103000c0 0x20>; >>> + samsung,sysreg = <&syscon_peric0 0x1000>; >>> + samsung,mode = ; >>> + #address-cells = <1>; >>> + #size-cells = <1>; >>> + ranges; >>> + clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_0>, >>> + <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_0>; >>> + clock-names = "pclk", "ipclk"; >>> + status = "disabled"; >>> + >>> + /* USI: UART */ >> >> Skip the comments, they are obvious from device node name. Long time ago I >> was not advocating this, but I see it's benefits - much easier to >> introduce changes to DTS or binding in case of some differences. Eh, I think my reply got mixed up. The last sentence was about compatible, so it should be: We should start adding dedicated compatible, so: "samsung,exynosautov9-usi", "samsung,exynos850-usi". Long time ago I was not advocating this, but I see it's benefits - much easier to introduce changes to DTS or binding in case of some differences. and here only about the comment. > I'll drop them. Yes, please. > >> >>> + serial_0: serial@10300000 { >>> + compatible = "samsung,exynos850-uart"; >> >> Here as well. > > I'll add "samsung,exynosautov9-uart" to the yaml file. > >> Best regards, Krzysztof 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 2E910C43334 for ; Wed, 29 Jun 2022 11:28:59 +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:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=G0AlnSqi1921mHbBqnK9xNUcEhW+Mocvzb7tPQD53zI=; b=YkJ30cD+j7U+MD gbNeEI9SYbIrHq62OtGUlLC/78es0rFlInZ8+ce+8+UUKsbSsnm/6MYBUAlZXyUkCx+vYawAhfVfC swGhu+1lf42jONHbE2zwFMPdiim7NUCW1Dv7lghe5P5/eWQcG2m11uwyUuznjOkRd69YWZueITJEr fpnsjX6t4w2z8GTHiTpN1bcJ6ZBMU/Zcf8nGd/FlCZvu/vMUpENmoGb0yG543Iny7bKrhxE6kUVbs +dykY0g0S2ova7a3RFYArL27Emim1iQWDzh3eFAqlv2/MQT74lcBemQa2WiENYozZVLGgZj2yDl2B xygJZ87uZ/JvrXp56p8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6Vr8-00BPs4-7z; Wed, 29 Jun 2022 11:27:39 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6VZB-00BHJY-Hr for linux-arm-kernel@lists.infradead.org; Wed, 29 Jun 2022 11:09:07 +0000 Received: by mail-ej1-x62e.google.com with SMTP id g26so31829973ejb.5 for ; Wed, 29 Jun 2022 04:09:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=foG60lhNannT8P9dwW6kOYADdXZ/flWXxg5inptG7Kk=; b=fOqmOi1CSnXz7riHqPSZPrFn2IWlV4hfw0pYjQPy5LkPoB3mqXKSLx2Nc1qRyI+pT3 ijTo0bflkgH6otLqB34F1P4BviJwWuPt0NcEMGguEEwqwYvfWwl1H8VTBvl2Vyy7wNVn 0rX6JnCqrwZFKl9kxgOZnDETW8QeqEUCgAwkDJY3V1yQzXxf41HlH5bSPvD3ux0yFoZ5 ZPjiOG8erfdIwHve8fhCGBPLQ19LqDjR/8j2qCx/rK0wQYbnnlrJhmkXdjIWPftZERTZ 5htviNG37n6y6bhmbWk+GqOHbCKRYY54eVuiyPcQgit0vFaOgifBZY0Zzo091U5LUugs hE+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=foG60lhNannT8P9dwW6kOYADdXZ/flWXxg5inptG7Kk=; b=jQRgPwZGYMEnO0epD/iZQBeVpJgt07LSw12JP0yCkU5mX9szJillG2oCE0IfJlq8vt KCvSbAmXJ7k8hpjzgHw1H8pFDvmqmJx0wOiaCvsuFpCctSyCxW25YQFPbLs+WIiAL4Fh bO9pG2C3nLi4SEK16m7k/BPd6DVGssFGG6Fs7m1YVfq+iOrZ2mzYgaAcMi0BrsnNodp4 ToGzaFVv+TrJGS//2c6dkrg5Ti0zbHfrfRL5O2+YSsHQaNZ6BUBACPfSAg/gYyg4GhLG WjYKJV+6krFH7b+pKqbzn29uJq3Nuy+NQlqHx6sctKgYgFD2SdOBNRGgPoDt3hCCcgxx jFDg== X-Gm-Message-State: AJIora+3JWz2QOjmd1UYuimbjVPRl4nVkQ8MSqH++48qyF2tT+Z8IPcR 9JLs21mWeByb6aap2HJZpZUGbw== X-Google-Smtp-Source: AGRyM1tAc75CObf54+Dn1EXYo9rv7I8KdZ7F32RpNsq1ifASqeuEyIi397CtnC3Ibo8I2EE97xCsdw== X-Received: by 2002:a17:907:3dac:b0:722:e6ab:8d9 with SMTP id he44-20020a1709073dac00b00722e6ab08d9mr3076325ejc.20.1656500943955; Wed, 29 Jun 2022 04:09:03 -0700 (PDT) Received: from [192.168.0.184] (xdsl-188-155-176-92.adslplus.ch. [188.155.176.92]) by smtp.gmail.com with ESMTPSA id a23-20020aa7d757000000b00437df2444f5sm174712eds.11.2022.06.29.04.09.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Jun 2022 04:09:03 -0700 (PDT) Message-ID: Date: Wed, 29 Jun 2022 13:09:02 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 2/3] arm64: dts: exynosautov9: add exynosautov9-usi.dtsi Content-Language: en-US To: Chanho Park , 'Krzysztof Kozlowski' , 'Rob Herring' Cc: 'Alim Akhtar' , 'Sam Protsenko' , 'Jaewon Kim' , devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20220629015650.138527-1-chanho61.park@samsung.com> <20220629015650.138527-3-chanho61.park@samsung.com> <025601d88b9d$332049b0$9960dd10$@samsung.com> From: Krzysztof Kozlowski In-Reply-To: <025601d88b9d$332049b0$9960dd10$@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220629_040905_721623_B6888F25 X-CRM114-Status: GOOD ( 22.17 ) 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 29/06/2022 11:47, Chanho Park wrote: >> On 29/06/2022 03:56, Chanho Park wrote: >>> Universal Serial Interface (USI) supports three types of serial >>> interface such as Universal Asynchronous Receiver and Transmitter >>> (UART), Serial Peripheral Interface (SPI), and Inter-Integrated Circuit >> (I2C). >>> Each protocols can be working independently and configured as one of >>> those using external configuration inputs. >>> Exynos Auto v9 SoC support 12 USIs. When a USI uses two pins such as >>> i2c and 3 wire uarts(RX/TX only), we can use remain two pins as i2c mode. >>> So, we can define one USI node that includes serial/spi and hsi2c. >>> usi_i2c nodes can be used only for i2c mode. >>> >>> We can have below combinations for one USI. >>> 1) The usi node is used either 4 pin uart or 4 pin spi -> No usi_i2c >>> can be used >>> 2) The usi node is used 2 pin uart(RX/TX) and i2c(SDA/SCL) -> usi_i2c >>> should be enabled to use the latter i2c >>> 3) The usi node is used i2c(SDA/SCL) and i2c(SDA/SCL) -> usi_i2c >>> should be enabled to use the latter i2c >>> >>> By default, all USIs are initially set to uart mode by below setting. >>> samsung,mode = ; >>> You can change it either USI_V2_SPI or USI_V2_I2C. >>> >>> Signed-off-by: Chanho Park >>> --- >>> .../boot/dts/exynos/exynosautov9-usi.dtsi | 1127 +++++++++++++++++ >>> 1 file changed, 1127 insertions(+) >>> create mode 100644 arch/arm64/boot/dts/exynos/exynosautov9-usi.dtsi >> >> Put all this directly in exynosautov9.dtsi, because this is not a re- >> usable piece among different DTSI. > > Okay. I'll move them in the exynosautov9.dtsi. I thought they're too long to put in the exynosautov9.dtsi and I also found a similar case such as exynos5433-bus.dtsi and exynos5433-tmu.dtsi. Indeed we did like that... The tmu maybe was meant to be re-used, although it references specific clusters. But the split of bus I don't understand - it does not help. I don't think it improved readability. > >> >>> >>> diff --git a/arch/arm64/boot/dts/exynos/exynosautov9-usi.dtsi >>> b/arch/arm64/boot/dts/exynos/exynosautov9-usi.dtsi >>> new file mode 100644 >>> index 000000000000..0e4c6332770b >>> --- /dev/null >>> +++ b/arch/arm64/boot/dts/exynos/exynosautov9-usi.dtsi >>> @@ -0,0 +1,1127 @@ >>> +// SPDX-License-Identifier: GPL-2.0 >>> +/* >>> + * Samsung's ExynosAutov9 SoC USI device tree source >>> + * >>> + * Copyright (c) 2022 Samsung Electronics Co., Ltd. >>> + * >>> + * Samsung's ExynosAutov9 SoC USI(Universal Serial Interface, >>> +uart/spi/i2c) >>> + * are listed as device tree nodes in this file. >>> + */ >>> + >>> +/* PERIC0 USIs */ >>> +&soc { >>> + syscon_peric0: syscon@10220000 { >>> + compatible = "samsung,exynosautov9-sysreg", "syscon"; >>> + reg = <0x10220000 0x2000>; >>> + }; >>> + >>> + usi_0: usi@103000c0 { >>> + compatible = "samsung,exynos850-usi"; >> >> We should start adding dedicated compatible, so: >> "samsung,exynosautov9-usi", "samsung,exynos850-usi" > > So, I need to add the compatible to the Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml, right? > > - samsung,exynos850-usi # for USIv2 (Exynos850, ExynosAutoV9) > > To be> > - samsung,exynos850-usi > - samsung,exynosautov9-usi compatible: oneOf: - items: - const: samsung,exynosautov9-usi - const: samsung,exynos850-usi - enum: - samsung,exynos850-usi # for USIv2 (Exynos850, ExynosAutoV9) > >> >>> + reg = <0x103000c0 0x20>; >>> + samsung,sysreg = <&syscon_peric0 0x1000>; >>> + samsung,mode = ; >>> + #address-cells = <1>; >>> + #size-cells = <1>; >>> + ranges; >>> + clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_0>, >>> + <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_0>; >>> + clock-names = "pclk", "ipclk"; >>> + status = "disabled"; >>> + >>> + /* USI: UART */ >> >> Skip the comments, they are obvious from device node name. Long time ago I >> was not advocating this, but I see it's benefits - much easier to >> introduce changes to DTS or binding in case of some differences. Eh, I think my reply got mixed up. The last sentence was about compatible, so it should be: We should start adding dedicated compatible, so: "samsung,exynosautov9-usi", "samsung,exynos850-usi". Long time ago I was not advocating this, but I see it's benefits - much easier to introduce changes to DTS or binding in case of some differences. and here only about the comment. > I'll drop them. Yes, please. > >> >>> + serial_0: serial@10300000 { >>> + compatible = "samsung,exynos850-uart"; >> >> Here as well. > > I'll add "samsung,exynosautov9-uart" to the yaml file. > >> Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel