From patchwork Sat Jan 4 16:29: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: 13926290 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 0BDE9E77188 for ; Sat, 4 Jan 2025 16:31:54 +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=tSlNtFCEnirtv+C3yQQNe5++1QvQ4uNDEpVQcIjAKhs=; b=DNs83l2/4nov6hH30jc6PU1HBB cMYh2Mokg2LFp/LW/EyyGxynD5GhQnQ+86dn3IPcAbhdbuFvyk4u8VHDjhps0yUOqMz1/+v9/Ly2z HxYe2ylk0PDX7Mwoty/r9+/yCrUU4IxwSyxpR1++U+6qIl1WIBEDVGCz+zzb7uKbuPEoErAaXphxK 2TORQj4uCZ3u9t5RM3WaQWPpH0sC041GMQkgKZ9MuT4o9qW/xvKYzh7ZOVSPxFsKhDt2zrmBKQwZ0 bA31OOLko6n8MjDKctOVJVnNmzQKaQJZRztYPNiGBVI5lBU8EmdpCx9Grvveryt/kP089wY6Yf/ge oR6qh8Ww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tU73u-0000000FH6v-3RYT; Sat, 04 Jan 2025 16:31:42 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tU71d-0000000FGq4-3jSS for linux-arm-kernel@lists.infradead.org; Sat, 04 Jan 2025 16:29:22 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-43625c4a50dso89674605e9.0 for ; Sat, 04 Jan 2025 08:29:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736008160; x=1736612960; 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=tSlNtFCEnirtv+C3yQQNe5++1QvQ4uNDEpVQcIjAKhs=; b=dTHaOFCxrNjWEzjgv4A4HY0FcYEDyFKz8K0OjOApMbnMPDoZJXdWpMMLp84vVjJLfA 6PVyJuDpd8hCsUQXHV+dK/HkTOOamlz/rqaoJcFfehzruuQTaGe3WmAWDxz2NmoYRZwV EvPJ3u7Q9wUCBPmAkGw20f2tNAJc9AUyG+q8euMPfi1J34RBpIiVWu4r0JrCsB+14ZEO G9ElSCQnBTH/idKrFCIHbWPMo5yvFiIs4FwfeFUPSl1SQrXw/6OYiTXPwfCIRlS3AwMc IZ3GD0jh32hwsBDRFYwg4oZ75fCknpoXNKWZyUwrP1QzVoFLm05v7VA7xYuv+8/btvF0 3n4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736008160; x=1736612960; 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=tSlNtFCEnirtv+C3yQQNe5++1QvQ4uNDEpVQcIjAKhs=; b=Vee9eo/QYQuXqER6piMH9+kKQFN7wQMKBWnPH3ADIn5WKXzgK9K0JPoojc1gEdBLWT n9WPLrfgnY0F7yw+sVv+qtQzpEAzMn69TUTgP+w0x6BD3ixY4vHg1eu9GlmSDayx95bT Xa4VpnGxbs5eomMUOPnI3hZmQUT9wqt02m79xIb0k6I0mxKUTBBAQQFcbwUd9CD4312Z kNJjQlqLw8k6aQMPTtk7fhlmLH2IRgvCsgKD7O69WIZyGZNNSor2zd59pOljjqPUkfIM DNNvke0zWWDNRG9fIzZ3234CI/bGxAustnBeZtBgteeiN5hFh64UTqluJctZaLv4aE6b S+2g== X-Forwarded-Encrypted: i=1; AJvYcCVBRgRjFy1IgAkV/1DhGolUT9T8rZ42ec3kX7sqIWbMgd1eD3Q9IwrxIzG4brZ9zbG2IfFXUAbgVLecYQiz8kKW@lists.infradead.org X-Gm-Message-State: AOJu0YzsOXLVRtUHrQNLowV/KgDapgOAv4fRgL8X8Ktb8qFqGWKqTOo4 +UCcbDjPx23jAU4iDij1opoTViO3NtxFkn3YpgUyPH15UcGhKN+/ X-Gm-Gg: ASbGncsf6l+NRbVDhKgjhGi25lINrWuVD2PG7vm+AKzkl1wu8ZfaJ0HGbZ0+duN8F87 Cjx2sLg2rWpp1j+D2EznFrICBbDEa6g+rWdCjLoTULhxCOEyTesPnZvfiVQ8j4HFWA8r9oxP3O0 Kwvcaqhr+RXBcoVZEwGqKxtqcxWDzD+M+dteMxQSVMgLQvJp4osjzjvS7Pjhf8AaELhdLG2tdID eplX3VZmu8ctY8EcZyjofqdbGAGr2kOaIUViXryj7InwEsQ4Ni82Zv0aSxS5j26S9hOD8U= X-Google-Smtp-Source: AGHT+IH9lA4rF0WDY1qh8cdz6wgrOJ5I2spF26AUuuTbh/HX9dlF9UotV63FVNTpwKfmfiezduNw5g== X-Received: by 2002:a7b:cb93:0:b0:434:f270:a4f0 with SMTP id 5b1f17b1804b1-43668b49981mr400164535e9.21.1736008159960; Sat, 04 Jan 2025 08:29:19 -0800 (PST) Received: from ivaylo-T580.. ([94.131.202.183]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4366127c4fcsm522807895e9.29.2025.01.04.08.29.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jan 2025 08:29:18 -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 v2 1/3] dt-bindings: soc: samsung: exynos-sysreg: add sysreg compatibles for exynos8895 Date: Sat, 4 Jan 2025 18:29:13 +0200 Message-ID: <20250104162915.332005-2-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250104162915.332005-1-ivo.ivanov.ivanov1@gmail.com> References: <20250104162915.332005-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-20250104_082921_924186_C8DCF38F X-CRM114-Status: UNSURE ( 9.58 ) 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 Sat Jan 4 16:29: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: 13926291 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 0934BE77188 for ; Sat, 4 Jan 2025 16:33:05 +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=ZfGLfZYLKNWeiwn293mIzstgMi7rArSmekfdXqxMqP8=; b=VKXJ9vpxgdBHq6S0t9t3Jx5S2p S+KNQe5OzhfGCImlPyTeh/bKTZjlNYuEyc+gv7qkMyeF/rvYq5MiKYKvd8aBoeuTWpJYZhllH2d+H rqW8tHFWEx1e9cCO8eVTMPoGEI3LyJDBpz6JBxZk4ItfayxggOrQaXReyvpVoG6vXWJUDlBAuPzXY ZhKg5LxIK3C5W6EFWUWZTYFahhSU9BV79upzUZp0sWW4mX9qzZL7r7bI2CgMfB6lIqA8pUNJQQMrP TBlfNHFVeIE+3qzTkjAZrmVGKKme5VJBUmRhUAtwJ7m0oSxn7zlYLMEqXkfd7TnHyvdMLvYxZzWRw 3dVFD6ew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tU753-0000000FHD8-1uAX; Sat, 04 Jan 2025 16:32:53 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tU71f-0000000FGqO-2c5e for linux-arm-kernel@lists.infradead.org; Sat, 04 Jan 2025 16:29:24 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43623f0c574so89566485e9.2 for ; Sat, 04 Jan 2025 08:29:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736008162; x=1736612962; 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=ZfGLfZYLKNWeiwn293mIzstgMi7rArSmekfdXqxMqP8=; b=HoPhaqz1ACA45BAPdVz9ORPRyE8L8SL2kzby79TmdlCSFwhW93WcMBvrf4wagdD6QE gE1qRh2NWULR5nqNtgLg9yENjEehbusDKRsTwq8Pg71C0Ui4XDKhhJMDys2ZtDBwfsgY kNbNyYNsN/oK/juQO4vgMmK5Bae28KrOmaSdLhwYGQ5GAyRHKmV+f/DKpBhHyiXiK9bc 5PfFWM0b5aKL61HspwKGj7Urlz+9inTkkMDKZJ29BaWy4o7dIugE0NtLjh7l8qimVrBU 22ywfZJcbgre9dHZ9js//kWxOa4PtihPWGIN2iGbjwoIoYHKBDwzcm1VJdwA5f0sFztA pWpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736008162; x=1736612962; 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=ZfGLfZYLKNWeiwn293mIzstgMi7rArSmekfdXqxMqP8=; b=ALdEREhIc0xGwmGv6vtCcdsffYI7o3mkbC4yF71DvI2uaB/kyr+BubgDr0B7ChShGF OJb3dXwLKbpHq/qrCHxVles/LunlbZzzpUaLXNJVVjbPAoWkwFICqSrDeuOyGwsImqbP Qt0FEDhYgHxciZ4eo+XZsk7HYy9jSt1eq+aK+s9uAS7tuv64pV9q0hkIllLBHkabvN51 WmG21b4f/4NnSRMLmb9bv7d0EA5nq1kndprMxR28MbF/7Q9UZBnm0cx9GUircay+9ZVQ feMxbonGivKFcJMCEHvKTpts2Ry4yKT8PnIuUuZw6zfVx9WVEExgAj4/ZtKspb7T5Yj3 33MA== X-Forwarded-Encrypted: i=1; AJvYcCUD9YPUc65KZbp4KImAqXX4KPnI0w4lCC1gSPdouaF7ETm8TT8Ceue+ReoRmhPPcvxM3FSnnbrVDS3XxjB2e4zx@lists.infradead.org X-Gm-Message-State: AOJu0YxaqA4Lydahj4qa5XoNAGPhPt4Fe+KFMH0jY32jDL2D1e10DpvH vXBg0gKlYF8dzw7d23e3djqlmxmUmcre4pPouYZxYzaGOqSKKaxy49SjNQ== X-Gm-Gg: ASbGncsTeXzw9uo7cK5IvYm+t9g5yrzkqGJh4ZzI7ZpB1AONv/3PDeXtqPaL/WWkDDD 2/CR7FpGhNb3oadtb1o+W6SVjrhFDXSTbjPtDdZNIdbJMMD2VJk4hA3o12VNzsy362OBqZc5thi Y3wW5K4ivp2rjau62mYm9oXuvrHzML1vTYqQHeKYOYKMyGysw69DffnxBJsLMmLiEwbq4NuPfb5 q5By2nTZT1yh3/e/DX9ThEWdQiwXskX3BPU/1Iv231jAr5tPsHf7SYQHryrPRsYX3Aaj88= X-Google-Smtp-Source: AGHT+IH07GBjjt9BqWjOYTGsRV1i6VjGwkhH7oHXvw9cMBRKIIt1LWtpsbwakdr5+eFk7uWUpTXDmQ== X-Received: by 2002:a05:600c:4f94:b0:434:f953:efb with SMTP id 5b1f17b1804b1-43668b785d2mr394969645e9.32.1736008161587; Sat, 04 Jan 2025 08:29:21 -0800 (PST) Received: from ivaylo-T580.. ([94.131.202.183]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4366127c4fcsm522807895e9.29.2025.01.04.08.29.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jan 2025 08:29:20 -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 v2 2/3] dt-bindings: soc: samsung: usi: add USIv1 and samsung,exynos8895-usi Date: Sat, 4 Jan 2025 18:29:14 +0200 Message-ID: <20250104162915.332005-3-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250104162915.332005-1-ivo.ivanov.ivanov1@gmail.com> References: <20250104162915.332005-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-20250104_082923_661108_4FA21742 X-CRM114-Status: GOOD ( 16.21 ) 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 | 55 +++++++++++++++---- include/dt-bindings/soc/samsung,exynos-usi.h | 7 +++ 2 files changed, 50 insertions(+), 12 deletions(-) diff --git a/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml b/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml index 5b046932f..6e32daa45 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 @@ -64,7 +75,6 @@ properties: samsung,mode: $ref: /schemas/types.yaml#/definitions/uint32 - enum: [0, 1, 2, 3] description: Selects USI function (which serial protocol to use). Refer to for valid USI mode values. @@ -101,18 +111,42 @@ required: - samsung,sysreg - samsung,mode +allOf: + - if: + properties: + compatible: + contains: + enum: + - samsung,exynos850-usi + then: + properties: + reg: + maxItems: 1 + + samsung,mode: + enum: [0, 1, 2, 3] + + required: + - reg + + else: + properties: + reg: false + samsung,clkreq-on: false + + samsung,mode: + enum: [4, 5, 6, 7, 8, 9, 10] + if: properties: compatible: contains: enum: - samsung,exynos850-usi + - samsung,exynos8895-usi then: properties: - reg: - maxItems: 1 - clocks: items: - description: Bus (APB) clock @@ -122,16 +156,13 @@ then: maxItems: 2 required: - - reg - clocks - clock-names else: properties: - reg: false clocks: false clock-names: false - samsung,clkreq-on: false additionalProperties: false diff --git a/include/dt-bindings/soc/samsung,exynos-usi.h b/include/dt-bindings/soc/samsung,exynos-usi.h index a01af169d..4c077c9a8 100644 --- a/include/dt-bindings/soc/samsung,exynos-usi.h +++ b/include/dt-bindings/soc/samsung,exynos-usi.h @@ -13,5 +13,12 @@ #define USI_V2_UART 1 #define USI_V2_SPI 2 #define USI_V2_I2C 3 +#define USI_V1_NONE 4 +#define USI_V1_I2C0 5 +#define USI_V1_I2C1 6 +#define USI_V1_I2C0_1 7 +#define USI_V1_SPI 8 +#define USI_V1_UART 9 +#define USI_V1_UART_I2C1 10 #endif /* __DT_BINDINGS_SAMSUNG_EXYNOS_USI_H */ From patchwork Sat Jan 4 16:29: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: 13926297 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 52F28E77188 for ; Sat, 4 Jan 2025 16:34:14 +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=dmwJdSWcH80KR9c9ophGs9zgU8sQ51fKGw8dpXKN/Fw=; b=TBCoYf+Z3XvdPrQG++P2tuO0Zp nlBaUbI+3LMr997YoZ32ObSivdLbdg+fIeyTdzjblv4CU9XRArwhjAqdIuMyvr7IusJKBDyKCFRqY /ZcuX11yjpVwSSnu/o5UbrmLVDc4DVp01NEfHfM2iOLIcp0N/VmC/Zc+nQiJef0jnswvruvW+QIPB 4GFS1K12VVJi29m6sKpj0Fg+eBM/rkl+vVI5rEybFUArkbltaYGJ1CK1tZXwvsFAw/yab2yR6HIYc 3I3AdZThlJ1mWcVOjCgJsjeEDLkG6REGaf5g8iBRD8A5nzVnKcqCkWZgOMZ31BYYhQqRKtU6rqazB pia5AHww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tU76C-0000000FHIV-0Qxk; Sat, 04 Jan 2025 16:34:04 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tU71g-0000000FGqg-3PLI for linux-arm-kernel@lists.infradead.org; Sat, 04 Jan 2025 16:29:25 +0000 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-38632b8ae71so9235935f8f.0 for ; Sat, 04 Jan 2025 08:29:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736008163; x=1736612963; 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=dmwJdSWcH80KR9c9ophGs9zgU8sQ51fKGw8dpXKN/Fw=; b=mO7oLyXzRf96iUCsixZkTT07sjOuFlOijDDufre/Pdb/wk796Yaw76o0ON5OGVfedz Q+C9cxBFrVf5F7EDUIrL2oR2BpllI6i5cgP/G7MSSmuz+ES2Vjtu+Qg0mgieStIyEb8g PSrOu+c6cMAhvOeNfpZb3TrFj6xOmFfkOyghGBD9qFZhEaiLK7wqWAG0xmK2SxQdEwiD X4E2aXhiGwZb2qx/FUKM8l4LmiwbJ4JPGOusgRVt2WCGXukUBfQM1rPpvIYf1qSZHjZR uk7nlchnfv0cCezXeGr0yn7YeTOzRwslpFRRU/lHrFE3OGANwSpQZxMIo3QhWkA4Z0EV 1pow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736008163; x=1736612963; 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=dmwJdSWcH80KR9c9ophGs9zgU8sQ51fKGw8dpXKN/Fw=; b=RsxuTGPgabZKthaQsRygSNGrsvgH/AlwfMO7aIjEcMncl9HjxCcPf5riSCL0OINxlR 3DR2/pf69GqbboTky3YOtAKJb6+36vM8azACCbADSsgCuCKqEiDPnFoSescBa6MADQJw GZIQJQImpqer+06nxAe54cE5fGZ1a036IlL2n8p2DwZLnSrX0Y/OfiX5wZQkWG8EdxLd aN2bzhYK8ULfoLwaC9WN0trzIKM0+W59lQXetM/Ij4idylfnTvj92eF9AqvjA6uATuO2 rd1tZclDOx6hhR600bX32sm8ZEmNOCwN6suzU9acQIJNrkrnpfM/fTI0c6EC8KBo1krv ejzg== X-Forwarded-Encrypted: i=1; AJvYcCXKC4yri5VzFj3bAGt0b+vmENGlYjoHTV/PLM86M8a2prIuetpQIl2Orr8wUI73wlVwMYWMnHb60OaaArDyze8J@lists.infradead.org X-Gm-Message-State: AOJu0YwJr7Rq3JI6oTq0TTLObkNwwdJh0pUt2jg6FNIA3zJCeLPdiE8O 1tcm1oLquDa+uK9fqtTm7aYwY9G/RnioGtgN5aMjORJVljOFtw01 X-Gm-Gg: ASbGncvi7WqI8T98NoXhx/0BaCmUu0iEjwWg+itdApnNtcS2ZDtKwZl7pdSEfzrs2In z9n7YSGhlyAWYHGyBlKR6Gq8BIgEkP54rbgdJrPnAQLFxy67X+0B9Y+8wEl6YHigIIo28chfD7d M906vqD+ObIpV78RSggGk5RGMVD0vq5SRP7QGaCp/CcWrZ/58UW3BmvoMn58113wigDtO2CTEte T1VpvwaN6dZetiNWCxJPzudSf85eeIf+oYIGw0lCoZsK/sU90U1izEiUwY7/72YX4WjxXE= X-Google-Smtp-Source: AGHT+IF04mnEX9YaKH4594VC9VtYs+3GhiR+7PJ1S6ap8REf6mYZMEBFBnoifIGMwao8P0+yM/FY2w== X-Received: by 2002:a5d:5f51:0:b0:385:dedb:a12f with SMTP id ffacd0b85a97d-38a221e27a4mr43531508f8f.6.1736008162851; Sat, 04 Jan 2025 08:29:22 -0800 (PST) Received: from ivaylo-T580.. ([94.131.202.183]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4366127c4fcsm522807895e9.29.2025.01.04.08.29.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jan 2025 08:29:22 -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 v2 3/3] soc: samsung: usi: implement support for USIv1 Date: Sat, 4 Jan 2025 18:29:15 +0200 Message-ID: <20250104162915.332005-4-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250104162915.332005-1-ivo.ivanov.ivanov1@gmail.com> References: <20250104162915.332005-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-20250104_082924_849390_397D9C2F X-CRM114-Status: GOOD ( 19.29 ) 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 apart from enabling the APB clock and the protocol operating clock. 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 | 42 +++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/drivers/soc/samsung/exynos-usi.c b/drivers/soc/samsung/exynos-usi.c index 114352695..e57d2c274 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 { @@ -71,6 +84,13 @@ static const struct exynos_usi_mode exynos_usi_modes[] = { [USI_V2_UART] = { .name = "uart", .val = USI_V2_SW_CONF_UART }, [USI_V2_SPI] = { .name = "spi", .val = USI_V2_SW_CONF_SPI }, [USI_V2_I2C] = { .name = "i2c", .val = USI_V2_SW_CONF_I2C }, + [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 char * const exynos850_usi_clk_names[] = { "pclk", "ipclk" }; @@ -83,11 +103,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); @@ -169,9 +202,12 @@ static int exynos_usi_configure(struct exynos_usi *usi) return ret; if (usi->data->ver == USI_VER2) - return exynos_usi_enable(usi); + ret = exynos_usi_enable(usi); + else + ret = clk_bulk_prepare_enable(usi->data->num_clks, + usi->clks); - return 0; + return ret; } static int exynos_usi_parse_dt(struct device_node *np, struct exynos_usi *usi)