From patchwork Thu Jan 2 20:40:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Ivanov X-Patchwork-Id: 13924930 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 86C30E77188 for ; Thu, 2 Jan 2025 20:46: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HeT/C/SSbJIZtC2cQMnIGXsMju3vNCxxjxClBuI7DfA=; b=qgZ4aOCZfBudNmi+AZwsKUpnEZ XTXDuSunQrCVLUYy2sp89pprySsvFlY9gSLbXH7KtD85ViY8pMQ+jAglOn4/Qs28F+kknrrXPY2pL S1ZhEn0zQXIQE0pxEt/4Edmu1ylUG3d6CC0a+3GM7FqbVPlrZn07IB4UX/BcpJFCt8SMhAAjt9KhC MDG5x+af1TPWNo0cEJtYiCxDBc+7rptJ+sElWpgsDMrTTo4pJdu0+eGWtO5+cVB7gMTJJD3iC1EQC EtSAO1xdWm7loLYNMp7XrW8mtRHmo950moWb9UCnb2xBA9WeUCOaAxAmgUm8au441ftknwERGk0nT EARiS9hQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTS4l-0000000BQFQ-38fH; Thu, 02 Jan 2025 20:45:51 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTRzz-0000000BPR7-46fR for linux-arm-kernel@bombadil.infradead.org; Thu, 02 Jan 2025 20:40:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=HeT/C/SSbJIZtC2cQMnIGXsMju3vNCxxjxClBuI7DfA=; b=YBQ4dm9/xZyryc12t6wus43C0L 0e4ggou3AIWXQ2sVNSM6+DhsVmX5XLHYihzgKRuPg/xf1LIywDS8E6Vb24WIKyjEyDkigFM0QnZrA H9tH9P8ng9a0x4EcG0sUbMo5by+ki4Eb8X2X/am5kS7dv5HS0aMp73t42SEs9p0pKjKg+6Zc9beBB G+eDY5/DRMPeZ/DWE1VMrcScWK9/2WLSgzdB/k5YeD9XVMcLK7X0vEOfAHE7PqNsiOI42TzHDy2cX Zv2ad+SMKd5pcyH2IFfbcgHOsX36xt5eDb9EFBZnxyy8jxpJ54nVdtHsEQUXP82NJz2i+dT+Lo6Of AKmGVODw==; Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTRzw-00000008FIH-2oMF for linux-arm-kernel@lists.infradead.org; Thu, 02 Jan 2025 20:40:54 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-aa69107179cso1909615066b.0 for ; Thu, 02 Jan 2025 12:40:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735850450; x=1736455250; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HeT/C/SSbJIZtC2cQMnIGXsMju3vNCxxjxClBuI7DfA=; b=foP9JujOk+uVcvAAXAgYauxLSPajWWYWsECB2dTbs4aX4rSfwxqR+ni3A186/Fw6Gf WDIGbJxhTCuzqJP69beZggaf++0PkJk1GmQL7zHtVSu4g3CLywpZ+J4T3jAvo09FZL2r Gfp9bIGxsHX/dhrNN+IMKl49xmO5L6iYuQkmvLC390afzshvMxPHb1Jj3K26vomXctGj YITmll9WgofZUVdmPJp8+At/UZZOVq6975qq0QI71TYecHrA4bi1q88Ags8tUESOit+H pZyqbyF/3VZCYIYD5COCUvIi576UAMxY2CaIFCjVfH/P9pZ+beEZwHNqH9K1ganPXPeC 6DkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735850450; x=1736455250; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HeT/C/SSbJIZtC2cQMnIGXsMju3vNCxxjxClBuI7DfA=; b=rBh+jDoVvpHml1w952fluNIYU73J3tGvChZqo29D8JU9mpahJZwmcH2nVR0rS64aFm B7lfv+SwXf0G3OcM3a1QjYygOjC3SjxSUXxrwMROo7R2oP4elq+qmjHpoxUgQSgEeM7J yxiLolWE+CxGdbGQijrxeIsql4Wq7UE/H2RTVMHD20QNZ0vCVKXFmM566rs9d5ylM5Xy svmEQilJ37NFSEUehO17KclY+oluXEXK5/iNUNnXEAgM4YUnbOyultsmR18TRFfnfvQn 2CWjz6Gj6YKmps1p73Zt5CRsPydogDnK++IHV9itqwXQU4qqA3eyQCCd/xVSGHKC7ZR7 F/Ew== X-Forwarded-Encrypted: i=1; AJvYcCWzEBn/WcgCJiIep9/3yS9kUed1I5q9vawePEXvIerwf00Y2uumYWgz6ul9G1f2COjYh1mq0dqtJCZ0QLhSGZzX@lists.infradead.org X-Gm-Message-State: AOJu0YyC3Af3oUy3dGb3XthNcpuGbsCBokq+T8njpqliFDE7A5VlpEzl VWuIzjA0fEPuOfoKNL7zB+TXcYPusWpX3HCTIlfbkWJR3rJsZgoP X-Gm-Gg: ASbGncsrpbtWI9inDjr692h52GUq1z8MNh4LW35ZAVodvIu+KwCvvAuTO6NdX1nKpZg 0KAEhT7i0atDlYFOJZvSwTbjAwsTkKi3QFum+8+hEfPExU8c2smI6EoYsONZe3RXfvZ6Mpx1L4G 0qTjCOCUgqhzeMpqVdf/Q8A5Pwc3E3uvrCBELRiK8oKiYRmGzRrFfSwTjEzOnJJ39OWOmumCk+U hxHAbAK5Pp+3RExKzgL+IVPP1FB4GPKg1r2BuTBfl/MGiDwvSNl7Z+KUMJwWUTpADVUAuxOakA4 YhxEHRXW32Y= X-Google-Smtp-Source: AGHT+IE16m/qv6YyZuy2UxiPuwTI+1RflvGC9DGeTDQtRWhwSzHOwjXiBbrxlDMRXRN3Nn/1oFYnGQ== X-Received: by 2002:a17:907:3607:b0:aa6:88f5:5fef with SMTP id a640c23a62f3a-aac2c9948d6mr4725876966b.32.1735850449504; Thu, 02 Jan 2025 12:40:49 -0800 (PST) Received: from ivaylo-T580.. (85-118-76-61.mtel.net. [85.118.76.61]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0efe490asm1814251866b.98.2025.01.02.12.40.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 12:40:49 -0800 (PST) From: Ivaylo Ivanov To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Sam Protsenko Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 1/3] dt-bindings: soc: samsung: exynos-sysreg: add sysreg compatibles for exynos8895 Date: Thu, 2 Jan 2025 22:40:13 +0200 Message-ID: <20250102204015.222653-2-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250102204015.222653-1-ivo.ivanov.ivanov1@gmail.com> References: <20250102204015.222653-1-ivo.ivanov.ivanov1@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250102_204053_113235_794AFEB4 X-CRM114-Status: UNSURE ( 9.84 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Exynos8895 has four different SYSREG controllers, add dedicated compatibles for them to the documentation. They also require clocks. Signed-off-by: Ivaylo Ivanov Reviewed-by: Krzysztof Kozlowski --- .../bindings/soc/samsung/samsung,exynos-sysreg.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml index 3ca220582..a75aef240 100644 --- a/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml +++ b/Documentation/devicetree/bindings/soc/samsung/samsung,exynos-sysreg.yaml @@ -21,6 +21,10 @@ properties: - samsung,exynos3-sysreg - samsung,exynos4-sysreg - samsung,exynos5-sysreg + - samsung,exynos8895-fsys0-sysreg + - samsung,exynos8895-fsys1-sysreg + - samsung,exynos8895-peric0-sysreg + - samsung,exynos8895-peric1-sysreg - samsung,exynosautov920-peric0-sysreg - samsung,exynosautov920-peric1-sysreg - tesla,fsd-cam-sysreg @@ -79,6 +83,10 @@ allOf: - samsung,exynos850-cmgp-sysreg - samsung,exynos850-peri-sysreg - samsung,exynos850-sysreg + - samsung,exynos8895-fsys0-sysreg + - samsung,exynos8895-fsys1-sysreg + - samsung,exynos8895-peric0-sysreg + - samsung,exynos8895-peric1-sysreg then: required: - clocks From patchwork Thu Jan 2 20:40:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Ivanov X-Patchwork-Id: 13924924 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 5151CE77188 for ; Thu, 2 Jan 2025 20:43:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rmY76TFyzj2il9epOaYcMs/IMVJsV0h7xrRhDa5+gs4=; b=mAZe+uhRjeetE6kxnG4zVlVJNX s3Entm9faUd1hkvTHZndcvkMuZ9697vh+tVZrzipV4ADIA9EnvJtEQacqLQKzIQbtkiXYYFcTaNEF awXZVIuvxSsGMb+eKxB2rGikJI3o0sRRQZqILHVpV/bc3N7s5PjoulholSM71qUP9ipS5Pt2JVi95 WfGe8/KC7LtcGcB8ESYJcptEkTIuCENZqeed3zozoc6WTf4cpXWfhlb47pM64IehVZiT21tg0fW6w o2kdMM009CplG5DobBzGvHJd1Lb+wlZvlL7pQLmSX0qUHUniFBiECa0ZD9SJBzZPsM8l4mQ8anexE MysrOARw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTS2M-0000000BPtX-0oXi; Thu, 02 Jan 2025 20:43:22 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTRzx-0000000BPQC-005f for linux-arm-kernel@lists.infradead.org; Thu, 02 Jan 2025 20:40:54 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-aaef00ab172so1131678666b.3 for ; Thu, 02 Jan 2025 12:40:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735850451; x=1736455251; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rmY76TFyzj2il9epOaYcMs/IMVJsV0h7xrRhDa5+gs4=; b=U4g2/n6IXS/I21ie7HQKbPHm2C4HsiZBmIdohEHa7LltHBK1Coss8E6hDUvkgCZoJ4 M7lEYWBSTGst0lxBE7l2R2jMYjG/htJFyVYISgB1Sv3Yql6A7zv12RZBbKkVVlI+wYMN iS19JszzbBXL0BmTtbC3HOCe+MgPKT4d0JWllMX20NL9dbnBMZc6YghNaKGPsgDCtipp NJoaboGwgQPyUXfaGSEggkXS8hpr45YToys9P0Tqwowz7A/jbCupKEjGpSk+09yyLmfH wkCjStU9hcCuvaRZdZ6AA1R2JjF1+UIgzO0NpMMEqBcjJAaoGEsvIRey3iQI3oc9aNjo owMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735850451; x=1736455251; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rmY76TFyzj2il9epOaYcMs/IMVJsV0h7xrRhDa5+gs4=; b=JVa8LfcgM8IWIfl+sJPq88ra2ho1GaVmqGiC9K/F1HgxQs2F9FWo6jpr9pc3G6OGpi ey3nxE9tGq3uqBRh7D+yFPP0XhSl56DYlXOnnCeC5VHkaA6ylJHgXQv4BdPNmwkhuQhx Sy01Q+I+TP1o7KaepcYBO8h4QLcgPJayuli3ZT3MoyOO1NCWSwmy5gPYMXHG6cbOiZEH OFW2ioZwX9aYG8UyLL33+jaezUr7p7CIf5vIpmfxnbSTc02loe9P1A79BEOkcJLtIRaT agCAWBoFD/GDLIUR7iafkqjTAtayKibRk8E5Ytrr5xkrA7KvBojGZ6U0xaM6fc5fL5yR FavA== X-Forwarded-Encrypted: i=1; AJvYcCWBYpd2wCGTCf1xqSQJPtQHEqusBH05lHWN5KrrO51kyDYjLj9pLzbY1DI/+hI59vatxG1hHvrHnVqs74nUSrxn@lists.infradead.org X-Gm-Message-State: AOJu0Yxjbp2uj4GSGiJwKuQJl9pwTDIYkYUezbR6v75x9MIaf51BFgDw v3GuUalCvPUKsIi/0TEhAxThFpjdgQsc8+/qLRgO+H1EKDq21LVI X-Gm-Gg: ASbGncs4uDVRm9zblmhXfDUQEmN1uOzVyG8cy14V19e8OY7CJ17cwRzB7+0nX72WzIX 6PMxn8ifIyTcogq/rIhWvBw8JzhUxRkFhHqGoFKrnrZN0AiPKcq3/ibLjYtD++TX9CKPbIFA1q7 hONM2BfRcPwKBh+SuurKSZZJtJxp02TLc9NsQ1DpmDYdtbqnrbk96Cz45xKBXfk4uHCXeypDq2K AyttAphuneiC50g/E3xEWbcgSHwKGlerq5AWMSK7EyC5xZd+ohdxi+LgcrGjEEHN2eNeJwMQOmv eePnUTAr88w= X-Google-Smtp-Source: AGHT+IE5T9x2LokF/7UC1tURsDfuW1k26Innzw0G2AdhWMic7tozgkLbmExTBk9HOsPRH2vw7/EYyA== X-Received: by 2002:a05:6402:27d2:b0:5d0:c697:1f02 with SMTP id 4fb4d7f45d1cf-5d81ddc0609mr101355271a12.17.1735850450777; Thu, 02 Jan 2025 12:40:50 -0800 (PST) Received: from ivaylo-T580.. (85-118-76-61.mtel.net. [85.118.76.61]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0efe490asm1814251866b.98.2025.01.02.12.40.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 12:40:50 -0800 (PST) From: Ivaylo Ivanov To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Sam Protsenko Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 2/3] dt-bindings: soc: samsung: usi: add USIv1 and samsung,exynos8895-usi Date: Thu, 2 Jan 2025 22:40:14 +0200 Message-ID: <20250102204015.222653-3-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250102204015.222653-1-ivo.ivanov.ivanov1@gmail.com> References: <20250102204015.222653-1-ivo.ivanov.ivanov1@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250102_124053_045471_1126B5AF X-CRM114-Status: GOOD ( 15.13 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add constants for choosing USIv1 configuration mode in device tree. Those are further used in the USI driver to figure out which value to write into SW_CONF register. Modify the current USI IP-core bindings to include information about USIv1 and a compatible for exynos8895. Signed-off-by: Ivaylo Ivanov --- .../bindings/soc/samsung/exynos-usi.yaml | 22 ++++++++++++++----- include/dt-bindings/soc/samsung,exynos-usi.h | 8 +++++++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml b/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml index f80fcbc31..50db63a8a 100644 --- a/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml +++ b/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml @@ -11,11 +11,21 @@ maintainers: - Krzysztof Kozlowski description: | - USI IP-core provides selectable serial protocol (UART, SPI or High-Speed I2C). - USI shares almost all internal circuits within each protocol, so only one - protocol can be chosen at a time. USI is modeled as a node with zero or more - child nodes, each representing a serial sub-node device. The mode setting - selects which particular function will be used. + The USI IP-core provides configurable support for serial protocols, enabling + different serial communication modes depending on the version. + + In USIv1, configurations are available to enable either one or two protocols + simultaneously in select combinations - High-Speed I2C0, High-Speed + I2C1, SPI, UART, High-Speed I2C0 and I2C1 or both High-Speed + I2C1 and UART. + + In USIv2, only one protocol can be active at a time, either UART, SPI, or + High-Speed I2C. + + The USI core shares internal circuits across protocols, meaning only the + selected configuration is active at any given time. USI is modeled as a node + with zero or more child nodes, each representing a serial sub-node device. The + mode setting selects which particular function will be used. properties: $nodename: @@ -31,6 +41,7 @@ properties: - const: samsung,exynos850-usi - enum: - samsung,exynos850-usi + - samsung,exynos8895-usi reg: maxItems: 1 @@ -106,6 +117,7 @@ if: contains: enum: - samsung,exynos850-usi + - samsung,exynos8895-usi then: properties: diff --git a/include/dt-bindings/soc/samsung,exynos-usi.h b/include/dt-bindings/soc/samsung,exynos-usi.h index a01af169d..5fbeb426b 100644 --- a/include/dt-bindings/soc/samsung,exynos-usi.h +++ b/include/dt-bindings/soc/samsung,exynos-usi.h @@ -9,6 +9,14 @@ #ifndef __DT_BINDINGS_SAMSUNG_EXYNOS_USI_H #define __DT_BINDINGS_SAMSUNG_EXYNOS_USI_H +#define USI_V1_NONE 0 +#define USI_V1_I2C0 1 +#define USI_V1_I2C1 2 +#define USI_V1_I2C0_1 3 +#define USI_V1_SPI 4 +#define USI_V1_UART 5 +#define USI_V1_UART_I2C1 6 + #define USI_V2_NONE 0 #define USI_V2_UART 1 #define USI_V2_SPI 2 From patchwork Thu Jan 2 20:40:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Ivanov X-Patchwork-Id: 13924929 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 3CB1EE77188 for ; Thu, 2 Jan 2025 20:44:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+SWMDb5TwBTJZaeNs4VRkHzpMH/ioBBi8zegRfy/sYU=; b=IrLwMZwCAQaPMCRzcXy/LKVj45 oDIfA6hGvbmBfXCReRe/ZyuX3Hs4SXM0fhjtAcvdMaSbCGLGsSxFQd/jFpm4ycgqbQ0XqH512XCS5 +Bh8LQ9rkq0xA/4OLCk9bBJu/VmCR71SOsSHrGh44ZWUEL3hY2kvUwTokPjQfs+tp/cSb9Gp4gcrT ElT103SG1DzsUtqlyuHMco2caSHWOkoK9F+ikRV9I+JczdJFiFLgmY3FXhiGr5LGls2gTsvXoPPeG GhyQvhxvA8F1EfpsOGnyX5t+LmrU+8tJgZ29nPoS6I9I7WwjDJrjixW9I85j6vKsMKKKLiPgN2r0L dTj6GsAQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTS3Y-0000000BQ1F-3QKq; Thu, 02 Jan 2025 20:44:36 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTRzy-0000000BPQV-1kef for linux-arm-kernel@lists.infradead.org; Thu, 02 Jan 2025 20:40:55 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-aaf6b1a5f2bso530587566b.1 for ; Thu, 02 Jan 2025 12:40:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735850452; x=1736455252; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+SWMDb5TwBTJZaeNs4VRkHzpMH/ioBBi8zegRfy/sYU=; b=FYT89FDtHl5RyO9/HrqKSn8qDR/3oZo4q/S4b/0iiHg0y41/2XksRqknSpKTbtIpGE HOh29wAqe7QO/TDS7nYP8/LXrTXTywL2/1WXfqtF5IqZKUBNbygyYYzOSSFuY1AoodGr sPpGC3DkyR079G+Iuc9eNTUwpuzDGXxidHVQhHCDl7rPJvo6BuWLtXuhKtTtokmPzw0a 7c9csXbBSQCWU6AN1RJzZ0YC4HGNFDgXEgCk71CJBI+LWNtlOWxuID33VMAFbINBFc/E vYF1zfmpjAXmwVYKqqVE3xPZlM4QHKUG8unpS4gMRc87Eoq4OJmQZwwWbUtClPhxDUDQ Blfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735850452; x=1736455252; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+SWMDb5TwBTJZaeNs4VRkHzpMH/ioBBi8zegRfy/sYU=; b=I8tuyO7Nj/f65KyVkAFwyOR9UzClxA2kgPxQVvHjHRD/HOBqxrvgaXYDr8wpEiGcfX OREGlE4VSX2E+XzuFbzLqzYuhwfzK9Ye6rNuHmOFtDsShvwz4Y8M1MSwAfOGdc5cvrz+ jW7NaD20X2vpSreg7J2L2fjTfAsghLDFOVZsWHdNOeG7ym7ZGVQYYK4Xz2GyoLn1R4cl M01bm+TwRMvRqnfNGB/sF6fA+EWam9lK0bVT3a9a7C+MSp4lpSwaC1wjdVXhKIf8NtvR bJp9IjwpfKXAhuLc04lQ8nt7KDpHHhMF13q5hyR6R2DOAfvJUD150lNk4g6PmX34hWdW CZ2A== X-Forwarded-Encrypted: i=1; AJvYcCUDP2bSiLbKWIjFHZQyEHh/EwvXnMBFhh2BP8Ku9h2iUAjpnmQ8SRRplIRuqDGpoKXYFLtnrZewLLIr/fLnLucj@lists.infradead.org X-Gm-Message-State: AOJu0YyXt1OfppkencV7AP5kqLymRHyngCE/f45BVxXQJO25kfIN+iUn aiUOHqc2Ceq5E+E/4+G3aSt9EQYzNVpqNvy7RZpqmkD73n2NhAzb X-Gm-Gg: ASbGncv6QGCYQXMJ1Q+iZS+gzhR00TAln5KQTsaEPfy12ipuQmwIN7onBT5qNHSDRQ9 MPR+XAwF9vptJmI22JVHM9HpG3gzU7C5TLoIVqP06Ak4t4MjMijwZYrshsprmjERdVYDi9hqo5L PHXdvs9FJa7Z03K7NA92SZSFCxoGppTQsRnPfaUEO8yB5Fi6ADVlxvQDzqs4Hgn8+I3+VpjFmKC kPVMTmU2HDoTlzmzDF9r4vMYD5ZSFBDZnBoO8u8iTx6SSsBYLrbUY0po55sZ6ZJ2RxJ+C8xzTDg ZxvasFdLBi4= X-Google-Smtp-Source: AGHT+IG0vgfb4FgN57tXEfkHjnmpOfckgtD12j0nD5bwvPiabxtx4gUIJFAmIiVnbYZPp6OFyrGsUQ== X-Received: by 2002:a17:907:9482:b0:aa6:8096:2049 with SMTP id a640c23a62f3a-aac3350c059mr4142824666b.13.1735850452149; Thu, 02 Jan 2025 12:40:52 -0800 (PST) Received: from ivaylo-T580.. (85-118-76-61.mtel.net. [85.118.76.61]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0efe490asm1814251866b.98.2025.01.02.12.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 12:40:51 -0800 (PST) From: Ivaylo Ivanov To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Sam Protsenko Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 3/3] soc: samsung: usi: implement support for USIv1 Date: Thu, 2 Jan 2025 22:40:15 +0200 Message-ID: <20250102204015.222653-4-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250102204015.222653-1-ivo.ivanov.ivanov1@gmail.com> References: <20250102204015.222653-1-ivo.ivanov.ivanov1@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250102_124054_458463_1F23D257 X-CRM114-Status: GOOD ( 20.43 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org USIv1 IP-core is found on some ARM64 Exynos SoCs (like Exynos8895) and provides selectable serial protocols (one of: HSI2C0, HSI2C1, HSI2C0_1, SPI, UART, UART_HSI2C1). USIv1, unlike USIv2, doesn't have any known register map. Underlying protocols that it implements have no offset, like with Exynos850. Desired protocol can be chosen via SW_CONF register from System Register block of the same domain as USI. In order to select a particular protocol, the protocol has to be selected via the System Register. Unlike USIv2, there's no need for any setup before the given protocol becomes accessible. Modify the existing driver in order to allow USIv1 to probe and set its protocol. Signed-off-by: Ivaylo Ivanov --- drivers/soc/samsung/exynos-usi.c | 58 +++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/drivers/soc/samsung/exynos-usi.c b/drivers/soc/samsung/exynos-usi.c index 114352695..29c3770e3 100644 --- a/drivers/soc/samsung/exynos-usi.c +++ b/drivers/soc/samsung/exynos-usi.c @@ -16,6 +16,18 @@ #include +/* USIv1: System Register: SW_CONF register bits */ +#define USI_V1_SW_CONF_NONE 0x0 +#define USI_V1_SW_CONF_I2C0 0x1 +#define USI_V1_SW_CONF_I2C1 0x2 +#define USI_V1_SW_CONF_I2C0_1 0x3 +#define USI_V1_SW_CONF_SPI 0x4 +#define USI_V1_SW_CONF_UART 0x8 +#define USI_V1_SW_CONF_UART_I2C1 0xa +#define USI_V1_SW_CONF_MASK (USI_V1_SW_CONF_I2C0 | USI_V1_SW_CONF_I2C1 | \ + USI_V1_SW_CONF_I2C0_1 | USI_V1_SW_CONF_SPI | \ + USI_V1_SW_CONF_UART | USI_V1_SW_CONF_UART_I2C1) + /* USIv2: System Register: SW_CONF register bits */ #define USI_V2_SW_CONF_NONE 0x0 #define USI_V2_SW_CONF_UART BIT(0) @@ -34,7 +46,8 @@ #define USI_OPTION_CLKSTOP_ON BIT(2) enum exynos_usi_ver { - USI_VER2 = 2, + USI_VER1 = 1, + USI_VER2, }; struct exynos_usi_variant { @@ -66,6 +79,16 @@ struct exynos_usi_mode { unsigned int val; /* mode register value */ }; +static const struct exynos_usi_mode exynos_usi_v1_modes[] = { + [USI_V1_NONE] = { .name = "none", .val = USI_V1_SW_CONF_NONE }, + [USI_V1_I2C0] = { .name = "i2c0", .val = USI_V1_SW_CONF_I2C0 }, + [USI_V1_I2C1] = { .name = "i2c1", .val = USI_V1_SW_CONF_I2C1 }, + [USI_V1_I2C0_1] = { .name = "i2c0_1", .val = USI_V1_SW_CONF_I2C0_1 }, + [USI_V1_SPI] = { .name = "spi", .val = USI_V1_SW_CONF_SPI }, + [USI_V1_UART] = { .name = "uart", .val = USI_V1_SW_CONF_UART }, + [USI_V1_UART_I2C1] = { .name = "uart_i2c1", .val = USI_V1_SW_CONF_UART_I2C1 }, +}; + static const struct exynos_usi_mode exynos_usi_modes[] = { [USI_V2_NONE] = { .name = "none", .val = USI_V2_SW_CONF_NONE }, [USI_V2_UART] = { .name = "uart", .val = USI_V2_SW_CONF_UART }, @@ -83,11 +106,24 @@ static const struct exynos_usi_variant exynos850_usi_data = { .clk_names = exynos850_usi_clk_names, }; +static const struct exynos_usi_variant exynos8895_usi_data = { + .ver = USI_VER1, + .sw_conf_mask = USI_V1_SW_CONF_MASK, + .min_mode = USI_V1_NONE, + .max_mode = USI_V1_UART_I2C1, + .num_clks = ARRAY_SIZE(exynos850_usi_clk_names), + .clk_names = exynos850_usi_clk_names, +}; + static const struct of_device_id exynos_usi_dt_match[] = { { .compatible = "samsung,exynos850-usi", .data = &exynos850_usi_data, }, + { + .compatible = "samsung,exynos8895-usi", + .data = &exynos8895_usi_data, + }, { } /* sentinel */ }; MODULE_DEVICE_TABLE(of, exynos_usi_dt_match); @@ -105,18 +141,32 @@ static int exynos_usi_set_sw_conf(struct exynos_usi *usi, size_t mode) { unsigned int val; int ret; + const char *name; + usi->mode = mode; if (mode < usi->data->min_mode || mode > usi->data->max_mode) return -EINVAL; - val = exynos_usi_modes[mode].val; + switch (usi->data->ver) { + case USI_VER1: + val = exynos_usi_v1_modes[mode].val; + name = exynos_usi_v1_modes[usi->mode].name; + break; + case USI_VER2: + val = exynos_usi_modes[mode].val; + name = exynos_usi_modes[usi->mode].name; + break; + default: + return -EINVAL; + } + ret = regmap_update_bits(usi->sysreg, usi->sw_conf, usi->data->sw_conf_mask, val); + if (ret) return ret; - usi->mode = mode; - dev_dbg(usi->dev, "protocol: %s\n", exynos_usi_modes[usi->mode].name); + dev_dbg(usi->dev, "protocol: %s\n", name); return 0; }