From patchwork Thu Jan 9 09:03:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Ivanov X-Patchwork-Id: 13932227 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D35442147E4; Thu, 9 Jan 2025 09:04:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736413444; cv=none; b=IEAw2sVVc5C7ibJdTddB//lWBBSdTCIq2e1UUWGApAKuoT9JhAvVfuB77nq78CWp7+GAATizfnapYwKLi1UVqnmtQaheO/G4pKxX7EImCX8ssEzRjwInjwjAcRFPTE9rgq+DU+Z1ArdCmhvZffN5HNxZYUr+vOC91ay8SrgvU5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736413444; c=relaxed/simple; bh=xILKK43P/LIFgLwxGh1CuOmcQnxZi6EiysvJsh83kbw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pOcH5ibdwdRKug/H3ISvdgb9D51M5HxfL0tlTOTtoa1v0GJfVAVccQIMcBxI81NMOUuKEGumAkpR1qR6D4ckK+ea5nDFAIwK2y8BMCn586Ph12x2v6W8qt+X6aOPVjoZytQEGgvRV2hS3JSsQ8V68O0c15+5mFPFlUBs2O5/i+0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kREAT91X; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kREAT91X" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-436345cc17bso5350245e9.0; Thu, 09 Jan 2025 01:04:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736413441; x=1737018241; darn=vger.kernel.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=AATmeIywhPXpmS9/RGfjUbh+83T1nTe0P9ZqfpWyPjs=; b=kREAT91XolEv7ieAHHXR/bGhlVUrOXpwR7wlx7CWPp8Ghk3JjI4zJ+YYChJMLgiCii 8XrYBS1dsku7a4sGSFpNUBph+0eVosV4ss2h9nguAt5QbqWIZnBFqSlF4ZJHp0PVaNz1 96PIMybWKaj4w5lco45EhVsAGKkBk+bGPHu0mlXpZZQwjreuCz/n9RgnzcQiHA+Juymx 2gxe7yNRh15BVEcEK5hBHB+2NmJezUdLRklarX1gfCgFIGZmutxjFEeMGJR2dlwGGW4/ CfaYMZnh+8BfDV58pWB3vcVdJjnxhX9QUlugx7R0L+sWPy5rc18H1peLGydxXmfdmO3a 65zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736413441; x=1737018241; 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=AATmeIywhPXpmS9/RGfjUbh+83T1nTe0P9ZqfpWyPjs=; b=maSSQLIuh9X7C02PmpCrYtOpKFmr9WFToz/zf+31Pc/tKk1/9ptG89w7Aj2y3Eu1de U30rEmKYVnNzJNKyamK+70vCLoMItjVjm9CimnZm7SmQrmLMHswivES4wdxkDS89i5cz wg9PCrBbMkXskENLl8cvi8EhxyvYHqZSQhOt6nNzIuQc56i+UYUZgVzoA335/YMQzW2X E3D6rtiOUpdUIOGPhmMP8PalDsBu1LeubpWpRwsoc1v5lkCtIiie0NvLGWLTXFcHD0qx prsNWC5l8+VLqCsuTekr9RtkTxK+UnMKKc8NqBlgu8EVyupG0+VF9tcyz21jwMmQD8rE K7Qg== X-Forwarded-Encrypted: i=1; AJvYcCUtHDxr5vLkWpCcn7ssqsbnIgvrzRDXM0q1HDykJvFErCRZfbhRxIIt+gUFQGf+yghCTHkRgIjvtAOWt0+d3yiAF78=@vger.kernel.org, AJvYcCV/yvAoXvgw5ypL6JkmvTWyjy9+n6BCPK/kuSeOec9ZKchwW5ziR/5oELDFgNOHghFFXYn9bq3og6QbSVg=@vger.kernel.org X-Gm-Message-State: AOJu0YxoZlfpCk4SsQ1Ff70hwS0rYXZQYeMzOtNIUGXy24ZuBOr493MM CwkhKadj4ZBIOkRywnSldcgRdWYFziDXTdGvbknxNFNewrGnw+FP X-Gm-Gg: ASbGncunBB7MRMcb6x/UPIwo5zgP2uaYh6nqrdMY7w+r1VjWEWbNjyyb8+D6wFmnrn4 iU9wfIMdYFtGOj+oD8UwROIh30oxYqGMqPXz8lEYoelB0fGec9gt5vlycFvE0+Ez5cOXLGZk9dc 3HMHD9QKF3cXv5bAOD4pNEoXOA7cPVuNEoy6bIiQTroq7hoIdG/I/nB+3L7T+kzqvmgGg60H98L Qd/MhWso54XxlIlrwv2Pu+Sn5mizIZSGuVf1VK/54v/ekxtsNEhl83lwJLIiWyZ81EmJ8uM9aO2 fOPKEA6l8HlTDsx0T74= X-Google-Smtp-Source: AGHT+IGFcxivxoUtzo1x5HYX/6VWt8bW7xU3madFDp/wdFgOZ+AOfuU+UH/x3Sf7sd06GFipOX9rPQ== X-Received: by 2002:a05:6000:1f88:b0:38a:615c:8223 with SMTP id ffacd0b85a97d-38a872f69c7mr5075223f8f.10.1736413440930; Thu, 09 Jan 2025 01:04:00 -0800 (PST) Received: from ivaylo-T580.. (62-73-104-42.ip.btc-net.bg. [62.73.104.42]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4b80b2sm1196692f8f.80.2025.01.09.01.03.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 01:04:00 -0800 (PST) From: Ivaylo Ivanov To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Sam Protsenko , Peter Griffin Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 1/4] dt-bindings: soc: samsung: usi: add USIv1 and samsung,exynos8895-usi Date: Thu, 9 Jan 2025 11:03:22 +0200 Message-ID: <20250109090325.595475-2-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250109090325.595475-1-ivo.ivanov.ivanov1@gmail.com> References: <20250109090325.595475-1-ivo.ivanov.ivanov1@gmail.com> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add new constants for choosing the additional USIv1 configuration modes 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. In the original bindings commit, protocol mode definitions were named with the version of the supported USI (in this case, V2) with the idea of leaving enough room in the future for other versions of this block. This, however, is not how the modes should be modelled. The modes are not version specific and you should not be able to tell USI which version of a mode to use - that has to be handled in the driver - thus encoding this information in the binding is meaningless. Only one constant per mode is needed, so while we're at it, add new constants with the prefix USI_MODE and mark the old ones as depracated. Signed-off-by: Ivaylo Ivanov Reviewed-by: Krzysztof Kozlowski --- .../bindings/soc/samsung/exynos-usi.yaml | 99 ++++++++++++------- include/dt-bindings/soc/samsung,exynos-usi.h | 17 +++- 2 files changed, 79 insertions(+), 37 deletions(-) diff --git a/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml b/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml index 5b046932f..f711e23c0 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,7 @@ properties: samsung,mode: $ref: /schemas/types.yaml#/definitions/uint32 - enum: [0, 1, 2, 3] + enum: [0, 1, 2, 3, 4, 5, 6] description: Selects USI function (which serial protocol to use). Refer to for valid USI mode values. @@ -101,37 +112,59 @@ required: - samsung,sysreg - samsung,mode -if: - properties: - compatible: - contains: - enum: - - samsung,exynos850-usi +allOf: + - if: + properties: + compatible: + contains: + enum: + - samsung,exynos850-usi + + then: + properties: + reg: + maxItems: 1 + + clocks: + items: + - description: Bus (APB) clock + - description: Operating clock for UART/SPI/I2C protocol + + clock-names: + maxItems: 2 + + samsung,mode: + enum: [0, 1, 2, 3] + + required: + - reg + - clocks + - clock-names + + - if: + properties: + compatible: + contains: + enum: + - samsung,exynos8895-usi -then: - properties: - reg: - maxItems: 1 + then: + properties: + reg: false - clocks: - items: - - description: Bus (APB) clock - - description: Operating clock for UART/SPI/I2C protocol + clocks: + items: + - description: Bus (APB) clock + - description: Operating clock for UART/SPI protocol - clock-names: - maxItems: 2 + clock-names: + maxItems: 2 - required: - - reg - - clocks - - clock-names + samsung,clkreq-on: false -else: - properties: - reg: false - clocks: false - clock-names: false - samsung,clkreq-on: false + required: + - clocks + - clock-names additionalProperties: false @@ -144,7 +177,7 @@ examples: compatible = "samsung,exynos850-usi"; reg = <0x138200c0 0x20>; samsung,sysreg = <&sysreg_peri 0x1010>; - samsung,mode = ; + samsung,mode = ; samsung,clkreq-on; /* needed for UART mode */ #address-cells = <1>; #size-cells = <1>; diff --git a/include/dt-bindings/soc/samsung,exynos-usi.h b/include/dt-bindings/soc/samsung,exynos-usi.h index a01af169d..b46de214d 100644 --- a/include/dt-bindings/soc/samsung,exynos-usi.h +++ b/include/dt-bindings/soc/samsung,exynos-usi.h @@ -9,9 +9,18 @@ #ifndef __DT_BINDINGS_SAMSUNG_EXYNOS_USI_H #define __DT_BINDINGS_SAMSUNG_EXYNOS_USI_H -#define USI_V2_NONE 0 -#define USI_V2_UART 1 -#define USI_V2_SPI 2 -#define USI_V2_I2C 3 +#define USI_MODE_NONE 0 +#define USI_MODE_UART 1 +#define USI_MODE_SPI 2 +#define USI_MODE_I2C 3 +#define USI_MODE_I2C1 4 +#define USI_MODE_I2C0_1 5 +#define USI_MODE_UART_I2C1 6 + +/* Deprecated */ +#define USI_V2_NONE USI_MODE_NONE +#define USI_V2_UART USI_MODE_UART +#define USI_V2_SPI USI_MODE_SPI +#define USI_V2_I2C USI_MODE_I2C #endif /* __DT_BINDINGS_SAMSUNG_EXYNOS_USI_H */ From patchwork Thu Jan 9 09:03:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Ivanov X-Patchwork-Id: 13932228 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83C0B21507E; Thu, 9 Jan 2025 09:04:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736413446; cv=none; b=M4TK/+31gEv5T6hof9lg6SE9oTXQb75NMdisxb6HUiTyrQS6/WWwKElnDGIWhrVB1m9Z4+PmgJaFYHkfLok5wssG4+ZqPWxeR+eZ3D9HaoF59F5djLE13Q5pM/hDiUmaDED1MIWbvQMOHYGh2ltRehYJLdug8JESmnOEnYti3r4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736413446; c=relaxed/simple; bh=GS1jmQ4tHCWjOzhL4edbvh0LliB33FGIfeF8EGqZjcI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RjcBBNi67ttckvoCpJrKzcrTFBFiGpkH+svkEsfZiSFrgnVF2TKFpVrnhKO7kJ4d+Iir2Jx1ofE0TmENtaXmBx3swDmA2LegDLrYmMkMNxv3VJR4XdmL/dZ8DVLKFLkoIb72c1yntDSXzFKl8vsDQ53Ii5Id7fMTs+OtVIClR5o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iSLVmVBJ; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iSLVmVBJ" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-38633b5dbcfso638850f8f.2; Thu, 09 Jan 2025 01:04:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736413443; x=1737018243; darn=vger.kernel.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=pGvZ+f1Zyma1bBzTOIhQdIYYMP/e8EzANI82dsN3dLw=; b=iSLVmVBJkPYCqjvNg/QKCk6dcd8gGIQmlMWWfJpbrH5hxY0VMhvM+WTZv708/NwLz3 4tCpXR0zbBSoT0FogTDpcKLeejn442h4uBUW6p+hFsx5Uiggs1vbRS9CBe58Ttti3ArX JLgGcLDlg6w/MgM9qwf5jI1vlNG5K7Ytyc0f9C0bMv5FNqSUnceJ02ft89DSEO/c5cu0 3+QjUQeoglJxMBkkOQHmQEJqeO2wY++TkqY7e6f/JuzuG443kYLyC3nrCV+0zUBMa7x0 RXLoFSY2sKRz3XSye44+6LOHNOBJ9sJB3GktAoS+00Cec098+3M19J1oSJ6FBiV+60OQ MULQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736413443; x=1737018243; 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=pGvZ+f1Zyma1bBzTOIhQdIYYMP/e8EzANI82dsN3dLw=; b=chAHAq84nCdzTCYYffAh6NTGqziktGB5BnpQibBKMVJEFqdQvNg4kEqzIQrkrQIKb7 QnBtxYoWul/NL/VCiV9WuvDnQIZ0w7HmCKPILTMcXLLBKFEMA0hCJ5OXH1eNzBCg0mOf mPmCXPOs6PUE0OqJs3i7yAgYj7iXa6RI74txvX73f/4XtkDjw6NUfgQ9I3YXqK97uMov klXre+RJtiQOtkZCWnvg/muRz1Zwav4wBL3ewjR/sWc+4ZkV8OMH0R0RPc1DKP/YCUU8 gy5LImpsfcb0hVhTdzYD58m1cwGqp452o+jrLY2lt4XRntKTSNrKP35Pd6laWYqcngWI FTuQ== X-Forwarded-Encrypted: i=1; AJvYcCWAJAJZst9uRCl3NqBYSx2XCaea6w1H2XnmcWXBbiuZdfCjj4lK2NzwCF42vHop6Y96KhcwovUSyYHW+I7gGo6LobM=@vger.kernel.org, AJvYcCWzgrObvn2k2uVt0waTgX0TsbPM95tiFVlGKhH/VGvwwrCn7BD5KEbxOOfzI5FWYwYyJKJg0r28+h7xzXw=@vger.kernel.org X-Gm-Message-State: AOJu0Ywh0SU5VST0RfoTIKttQFWc9OWbwjwoVXrFfsOV7Pii9oI6z3+S fuVSn3p3KIM8HtdyV6/4QEUEfAzxuZTPz73msQvbo89Y8bTq3+SP/qAqzg== X-Gm-Gg: ASbGnctr3NcxYIKHi+aq0r/qtg0T67IbyMIW2J9UrNFWwHqTuhxsMnarfo6ghGqKysJ HKWPcT4rWl7cq/EcW3HyGgs/cPTZidQ0eJHiRQeHTXeexfWyquWk0Qn/kt9plFdr6HOKUnUf9zo 7mrJsu8EGCeGHUj6BcV+LbpocEgBshj/Rs0N5zDnOANoH/jegeNKLC2YMWZOcKQKR2huUhnAeIH KKC8rKSpZCyZeDmHfm7e45m0hBuxLYSoUnB+VygRigUmMoDD3IDDriVOFly4Y6q81S3TGRzmcl+ PHH0X9yhIe1hmAVrQdQ= X-Google-Smtp-Source: AGHT+IG+S1p+g9llpREUzQnFzEQznCPzgiIz8QVHak3a3fJsQBKY3XpKOsmNBaUFThwuDVvhWCgyDg== X-Received: by 2002:adf:9796:0:b0:38a:88f8:aabb with SMTP id ffacd0b85a97d-38a88f8acdbmr3467553f8f.55.1736413442625; Thu, 09 Jan 2025 01:04:02 -0800 (PST) Received: from ivaylo-T580.. (62-73-104-42.ip.btc-net.bg. [62.73.104.42]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4b80b2sm1196692f8f.80.2025.01.09.01.04.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 01:04:01 -0800 (PST) From: Ivaylo Ivanov To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Sam Protsenko , Peter Griffin Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 2/4] soc: samsung: usi: add a routine for unconfiguring the ip Date: Thu, 9 Jan 2025 11:03:23 +0200 Message-ID: <20250109090325.595475-3-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250109090325.595475-1-ivo.ivanov.ivanov1@gmail.com> References: <20250109090325.595475-1-ivo.ivanov.ivanov1@gmail.com> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add a devm_add_action_or_reset() routine for unconfiguring the USI IP block whenever the device gets removed. Signed-off-by: Ivaylo Ivanov --- drivers/soc/samsung/exynos-usi.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/soc/samsung/exynos-usi.c b/drivers/soc/samsung/exynos-usi.c index 114352695..4b84f481b 100644 --- a/drivers/soc/samsung/exynos-usi.c +++ b/drivers/soc/samsung/exynos-usi.c @@ -174,6 +174,23 @@ static int exynos_usi_configure(struct exynos_usi *usi) return 0; } +static void exynos_usi_unconfigure(void *data) +{ + struct exynos_usi *usi = data; + u32 val; + + /* Make sure that we've stopped providing the clock to USI IP */ + val = readl(usi->regs + USI_OPTION); + val &= ~USI_OPTION_CLKREQ_ON; + val |= ~USI_OPTION_CLKSTOP_ON; + writel(val, usi->regs + USI_OPTION); + + /* Set USI block state to reset */ + val = readl(usi->regs + USI_CON); + val |= USI_CON_RESET; + writel(val, usi->regs + USI_CON); +} + static int exynos_usi_parse_dt(struct device_node *np, struct exynos_usi *usi) { int ret; @@ -251,6 +268,10 @@ static int exynos_usi_probe(struct platform_device *pdev) return PTR_ERR(usi->regs); } + ret = devm_add_action_or_reset(&pdev->dev, exynos_usi_unconfigure, usi); + if (ret) + return ret; + ret = exynos_usi_configure(usi); if (ret) return ret; From patchwork Thu Jan 9 09:03:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Ivanov X-Patchwork-Id: 13932229 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75DB52153C4; Thu, 9 Jan 2025 09:04:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736413448; cv=none; b=E08KA/TcwKnvmPjaBbQwhIaiFxKh7FedVMvcotCkK6w5GZqVvDIy5xCWRUDFi35DmfLe1zu5qnSgB0LnJL4pKQc23Q0iNeXvUgoa+q2y+xk3o2FznKv3EKTBOlLZEq29WPUUpnYNgNw3oxg3++uuAxqO4fokr9P0yXH9PmFIepg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736413448; c=relaxed/simple; bh=OGpKO9Z7JdxXgcieDwF8szlH+cDJjkbPKu4fRSrlCPs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HYBKFxqxIF1SFghnkya7LOvY3aumNcwlhef5hU34yHW06IrZvg0x16rYereqY9jQU8XsiUAkyT268FM6PMY6PVlE6715p6WL6Uf+paN92NchRsQY/9RW/CkiOouQZzl6V5oZiIHpSsVZfUP1Kq8vKSjwD8Wgp3VlzXMEzDmKIu8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Zxoh/FDf; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Zxoh/FDf" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-385f07cd1a4so400762f8f.1; Thu, 09 Jan 2025 01:04:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736413445; x=1737018245; darn=vger.kernel.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=ZCpmmMifUuuJ9+tjCbBNOmX8W+9L1QauRjSWCr7/+E4=; b=Zxoh/FDfOb1TU47mGY73SVGrYjG5yh5x7FF2R/xeaMSjpHEnHsTnxMVsbbfAxsS7T7 DaidgrTtXHL17/EZRY2kM60iJK/LpoxJUFdMAK4Je5LUIlROLTpGh4FeF4KCEdPGXwrF gc9liCqdBVY0vmE5pImOP3VdWCIac0HtxXlcOK7tPHc+pYTVYge5VSjrgYybOJzn7awv Fong8Xm1wqt8uO/hqZZM2IfXK0k9re0fuzn+VZDUbHqCsRTtzN/rhB4JYqtCUvzAqHue or723jCbYndyiXH7t+mU6153sNP5jF4Z78mORXnn4Gqx/bKMFGWXuJqXwJVU1euId73i LYkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736413445; x=1737018245; 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=ZCpmmMifUuuJ9+tjCbBNOmX8W+9L1QauRjSWCr7/+E4=; b=iabOdckJRcMLkG+q19bN2hK2K2w1eD3Eqn8XguiBu/vdqfp/7ndQgMIf4ice9QXkvO roy5/XH1a1MBS1gAVXcF72VC8e2x29/Q3EKpxsOfeZ6jzeNxR4/E2lcBtqSCSjtnolYS bWfYn+Ds43bwDb5OEGH+oe483juiXdDQMN3YE7NDK5eft50lWaar2+pyFjp7NNCLOTU9 K/ft2vBTBNO3P7vEfrym/Sja0Ru1iSWgmx+qdO8mXjnuTKrfJDvPsp7Hr05WmrTyTw9f 2Ldi/7X7JdtCPzE07r+6+mcJGmla0eUKEHBcv5QgfDqHgAkJvdrml7LBMNH7MfW0fVA3 G7gQ== X-Forwarded-Encrypted: i=1; AJvYcCVbyr+fZ1WZTUJCHbA9/0/7xi31I+Jd+KgrZD5xsOmqAcyUAtPvE1pf1X+6QnxEEqp/nFk5IFNE9+QYSHw=@vger.kernel.org, AJvYcCX55wjn8WnoGvUDZHpnKwdvxY+iTNgU6c+jnjdC+A4+p+VxD7wKt91r9DdkFq78EQNKpLRrRejYN4+VrLhZH6G+4kA=@vger.kernel.org X-Gm-Message-State: AOJu0Yyxzb99J1+DUkPTd11MPdFT1kXOIZppSZDlzDMSAYF7OyAYykff Ch5HAY5yijHtGLh5OMZMcnDi3eN4j5KTowWHArr8r1cJH+LPjH3L X-Gm-Gg: ASbGncubjpzpPvr5WCu3XYYAlZl12zxOvPWKmW6y1/2MgvLH9R9m+FWhNGS5bFp1AOT tsfDPgF7fqeUqNOVaUvpOESwnRjv+yHN0cGRs3EDaIH+KgNmzjGdBq9mzuyFnKxRsPB+kYT6wee vWtbUf4tIKiC6JE3gFYNY0WGoO5aGchd/limqanQWvoBuYj8bcysVv6G+glVtS/5C1drG65MwTe fG/8cUf4mOHV6kYjoGy0Y60tuvHAaNVeW71ODGzNfDKGbeCesU1j+RQT1j5OXYkdPjIuIWXV85p YroFFWRBAe9rnSp+sNU= X-Google-Smtp-Source: AGHT+IEaR7svee5aX+rCiKsRbOx8w2O2GiuW0Y3cJUpXD1c0W5ZNdo+enti2VyZXNrnvGKRyED0uZw== X-Received: by 2002:a5d:6da2:0:b0:385:fc70:7f6 with SMTP id ffacd0b85a97d-38a872fadf3mr5135537f8f.7.1736413444389; Thu, 09 Jan 2025 01:04:04 -0800 (PST) Received: from ivaylo-T580.. (62-73-104-42.ip.btc-net.bg. [62.73.104.42]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4b80b2sm1196692f8f.80.2025.01.09.01.04.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 01:04:03 -0800 (PST) From: Ivaylo Ivanov To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Sam Protsenko , Peter Griffin Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 3/4] soc: samsung: usi: implement support for USIv1 and exynos8895 Date: Thu, 9 Jan 2025 11:03:24 +0200 Message-ID: <20250109090325.595475-4-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250109090325.595475-1-ivo.ivanov.ivanov1@gmail.com> References: <20250109090325.595475-1-ivo.ivanov.ivanov1@gmail.com> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 instances in Exynos8895 to probe and set their protocol. While we're at it, make use of the new mode constants in place of the old ones. Signed-off-by: Ivaylo Ivanov --- drivers/soc/samsung/exynos-usi.c | 71 ++++++++++++++++++++++++++------ 1 file changed, 58 insertions(+), 13 deletions(-) diff --git a/drivers/soc/samsung/exynos-usi.c b/drivers/soc/samsung/exynos-usi.c index 4b84f481b..8a56d6040 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 = 0, + USI_VER2, }; struct exynos_usi_variant { @@ -66,19 +79,39 @@ struct exynos_usi_mode { unsigned int val; /* mode register value */ }; -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 }, - [USI_V2_SPI] = { .name = "spi", .val = USI_V2_SW_CONF_SPI }, - [USI_V2_I2C] = { .name = "i2c", .val = USI_V2_SW_CONF_I2C }, +#define USI_MODES_MAX (USI_MODE_UART_I2C1 + 1) +static const struct exynos_usi_mode exynos_usi_modes[][USI_MODES_MAX] = { + [USI_VER1] = { + [USI_MODE_NONE] = { .name = "none", .val = USI_V1_SW_CONF_NONE }, + [USI_MODE_UART] = { .name = "uart", .val = USI_V1_SW_CONF_UART }, + [USI_MODE_SPI] = { .name = "spi", .val = USI_V1_SW_CONF_SPI }, + [USI_MODE_I2C] = { .name = "i2c", .val = USI_V1_SW_CONF_I2C0 }, + [USI_MODE_I2C1] = { .name = "i2c1", .val = USI_V1_SW_CONF_I2C1 }, + [USI_MODE_I2C0_1] = { .name = "i2c0_1", .val = USI_V1_SW_CONF_I2C0_1 }, + [USI_MODE_UART_I2C1] = { .name = "uart_i2c1", .val = USI_V1_SW_CONF_UART_I2C1 }, + }, [USI_VER2] = { + [USI_MODE_NONE] = { .name = "none", .val = USI_V2_SW_CONF_NONE }, + [USI_MODE_UART] = { .name = "uart", .val = USI_V2_SW_CONF_UART }, + [USI_MODE_SPI] = { .name = "spi", .val = USI_V2_SW_CONF_SPI }, + [USI_MODE_I2C] = { .name = "i2c", .val = USI_V2_SW_CONF_I2C }, + }, }; static const char * const exynos850_usi_clk_names[] = { "pclk", "ipclk" }; static const struct exynos_usi_variant exynos850_usi_data = { .ver = USI_VER2, .sw_conf_mask = USI_V2_SW_CONF_MASK, - .min_mode = USI_V2_NONE, - .max_mode = USI_V2_I2C, + .min_mode = USI_MODE_NONE, + .max_mode = USI_MODE_I2C, + .num_clks = ARRAY_SIZE(exynos850_usi_clk_names), + .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_MODE_NONE, + .max_mode = USI_MODE_UART_I2C1, .num_clks = ARRAY_SIZE(exynos850_usi_clk_names), .clk_names = exynos850_usi_clk_names, }; @@ -87,6 +120,9 @@ 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 */ }; @@ -109,14 +145,15 @@ static int exynos_usi_set_sw_conf(struct exynos_usi *usi, size_t mode) if (mode < usi->data->min_mode || mode > usi->data->max_mode) return -EINVAL; - val = exynos_usi_modes[mode].val; + val = exynos_usi_modes[usi->data->ver][mode].val; 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", + exynos_usi_modes[usi->data->ver][usi->mode].name); return 0; } @@ -168,10 +205,13 @@ static int exynos_usi_configure(struct exynos_usi *usi) if (ret) return ret; - if (usi->data->ver == USI_VER2) - return exynos_usi_enable(usi); + if (usi->data->ver == USI_VER1) + ret = clk_bulk_prepare_enable(usi->data->num_clks, + usi->clks); + else if (usi->data->ver == USI_VER2) + ret = exynos_usi_enable(usi); - return 0; + return ret; } static void exynos_usi_unconfigure(void *data) @@ -179,6 +219,11 @@ static void exynos_usi_unconfigure(void *data) struct exynos_usi *usi = data; u32 val; + if (usi->data->ver == USI_VER1) { + clk_bulk_disable_unprepare(usi->data->num_clks, usi->clks); + return; + } + /* Make sure that we've stopped providing the clock to USI IP */ val = readl(usi->regs + USI_OPTION); val &= ~USI_OPTION_CLKREQ_ON; From patchwork Thu Jan 9 09:03:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Ivanov X-Patchwork-Id: 13932230 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 891C42153D4; Thu, 9 Jan 2025 09:04:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736413449; cv=none; b=Qe6iuEjd/K3KtkiViwy50utt33L9PothSs/sJtTgWiGcW5zArDT6KiLBgEZXw9WlabiEGHgg+1I30nfQ1v8pLoynMKexPDKnBToWlhXbtb/coyoQJiw3Hm/HwGffoytsfdDGSYPmDqVU1QrY+ZsdHPKX/sJsoidDBEuPrqpwWpw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736413449; c=relaxed/simple; bh=747rBV4CrB3ncxxx0etCDFXxKa/DqQKjOWmnHOvE8Ac=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jH48SwuSG5P/jkF0C68scxE0miZKR5uN+S3ROHck5yvQTA6T1q/YL97V4O90mAe1A2V0KodA4Uklp0fGKP6x6EIt/aW4wPWw7K6agwNMBpzCzhjltOWdJDLXpOlc4IEMpuML9oj7tD+CcyGWfQviFtd5EBZ8ycSEtpRyBlACy5A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=M6fM/J7V; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M6fM/J7V" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-385e0e224cbso356951f8f.2; Thu, 09 Jan 2025 01:04:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736413446; x=1737018246; darn=vger.kernel.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=ZBre3tfK9eNw0D6ztWoJ2B8wDlLW7jzGaVQPJWiVrhc=; b=M6fM/J7Viw1sOOq2OmOfsQfmI7olOljbQrK8iYcSmCwIIPti02NMlBOiO7XrMCHWw7 8sHOXNJq8FKdcJIv6Yyi3GBxvPkkGrLZmTI+cpnRqTTPfHQ7pnCvvMj5cBmaERNVE/kV 2DJVrFocctVY/mFfQcTqDzpSPzyuZLNH0jguqriaV16l7pNFtWqqsrnwjS4N+ENSXkh3 MHY4Pb4IIfBJFKXoPjuHoToWYnav/TuRowJmJE1Xk8be02PZu1eWqV4VvMM4ofoBsw15 rMXPskT/CGZEsmp+oUo6WXwsRnfxlmmDVZJ8/akR4isc6hFQ83TmStt+LwQHaMhycnLa 8fJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736413446; x=1737018246; 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=ZBre3tfK9eNw0D6ztWoJ2B8wDlLW7jzGaVQPJWiVrhc=; b=C8cocACtO57P8EuvjkhN+O94tZg7GWsi0OqSO8U8qKPq+I1TUjkWdnfvPbRLtvKY5f OFxMpb3kSliYVlkjB6gl/psjhEF1IuB/FKna+AfvRwvzfAHDBBwcZsWxloGg/4I4BnaJ UGqLPn53vW9twbs8uDL+lhkKC3irwM4IL39xBe/wR9YGGTVZlhHn2kTTd224hocV4tph YmoUXBWsbSuoDcA+Lf53tuWxreJ+xbbNe6P9MbOTQQf5K0C1ra7wlntjXEscSpS3pCvi nF92DHhoAc+3JDBkF69QN+w3HYGEokEXdZZ13uoiWGOKoxS4tF3gWPpftsvXJSQTUqjw FfIA== X-Forwarded-Encrypted: i=1; AJvYcCUlZrySbwe90vqpcREJ7V4V0qlKRkriBMGGOj31nzx9JCyDYOkc66O8BTc7E2iVuC5/QhqwgT5otAONazQ=@vger.kernel.org, AJvYcCVIbBWImtTg7FYmwcY08SW4xukrKLbmF/wRx0MaxKwEb9st+3oNMzQNvitHTcXWXp60WDva1/nKDsxAXLRY426wmVE=@vger.kernel.org X-Gm-Message-State: AOJu0Yxq2Eux7xDeMbVm91kJf0Mq4McUfrUJfPVv20j0hs5dPcdmRKUH 0TNLqW2g7hYffeWTiESK8I2OT62FFIvMZCwb1P6vsmdpXIzGu2fbJD5+ig== X-Gm-Gg: ASbGnctbGwRsPxpl6SxQ6Rh9aaK2yVG3TX6P86f9e3vHBB6/IHYObt6qv/miTg7fF80 iUi2R7xq7eqpqKQ2Dmkt42mxTZ0AmVDapI+vXFpVbRRr7BG9z5zVDi+YpDNwBg5IiK/w0hMKD8a AFHMgzhs8Y/8jJqP4Ku4b/vfrZfMXuohm68P0f6+q5u9QBZUTn4ytVFqDwl+8zCQW+XqT2pTF8p DToI6ag77Z2P/YusVp9uM2gvBPtYfifzdDTOtUB7CsBsvEoyLXYAT7jfgMhVFjdPeyJMK956sZa N9Tt+KCQGsbWpgmk3ts= X-Google-Smtp-Source: AGHT+IGx574cDudtAcm0a67dcSm2ibn5dzaHhj/kf09L4ekpC1X5fqoTRc+FNu5M1rnroXGd/0Twiw== X-Received: by 2002:a5d:6d84:0:b0:385:e8ff:b9c9 with SMTP id ffacd0b85a97d-38a87308cbfmr4341559f8f.42.1736413445705; Thu, 09 Jan 2025 01:04:05 -0800 (PST) Received: from ivaylo-T580.. (62-73-104-42.ip.btc-net.bg. [62.73.104.42]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4b80b2sm1196692f8f.80.2025.01.09.01.04.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 01:04:05 -0800 (PST) From: Ivaylo Ivanov To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Sam Protsenko , Peter Griffin Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 4/4] arm64: dts: exynos: update all samsung,mode constants Date: Thu, 9 Jan 2025 11:03:25 +0200 Message-ID: <20250109090325.595475-5-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250109090325.595475-1-ivo.ivanov.ivanov1@gmail.com> References: <20250109090325.595475-1-ivo.ivanov.ivanov1@gmail.com> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Update all samsung,mode property values to account for renaming USI_V2 constants to USI_MODE in the bindings. Signed-off-by: Ivaylo Ivanov --- arch/arm64/boot/dts/exynos/exynos850.dtsi | 14 +++--- arch/arm64/boot/dts/exynos/exynosautov9.dtsi | 48 +++++++++---------- .../arm64/boot/dts/exynos/exynosautov920.dtsi | 2 +- .../boot/dts/exynos/google/gs101-oriole.dts | 4 +- arch/arm64/boot/dts/exynos/google/gs101.dtsi | 2 +- 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/arch/arm64/boot/dts/exynos/exynos850.dtsi b/arch/arm64/boot/dts/exynos/exynos850.dtsi index f1c8b4613..cb55015c8 100644 --- a/arch/arm64/boot/dts/exynos/exynos850.dtsi +++ b/arch/arm64/boot/dts/exynos/exynos850.dtsi @@ -651,7 +651,7 @@ usi_uart: usi@138200c0 { compatible = "samsung,exynos850-usi"; reg = <0x138200c0 0x20>; samsung,sysreg = <&sysreg_peri 0x1010>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -677,7 +677,7 @@ usi_hsi2c_0: usi@138a00c0 { compatible = "samsung,exynos850-usi"; reg = <0x138a00c0 0x20>; samsung,sysreg = <&sysreg_peri 0x1020>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -706,7 +706,7 @@ usi_hsi2c_1: usi@138b00c0 { compatible = "samsung,exynos850-usi"; reg = <0x138b00c0 0x20>; samsung,sysreg = <&sysreg_peri 0x1030>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -735,7 +735,7 @@ usi_hsi2c_2: usi@138c00c0 { compatible = "samsung,exynos850-usi"; reg = <0x138c00c0 0x20>; samsung,sysreg = <&sysreg_peri 0x1040>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -764,7 +764,7 @@ usi_spi_0: usi@139400c0 { compatible = "samsung,exynos850-usi"; reg = <0x139400c0 0x20>; samsung,sysreg = <&sysreg_peri 0x1050>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -796,7 +796,7 @@ usi_cmgp0: usi@11d000c0 { compatible = "samsung,exynos850-usi"; reg = <0x11d000c0 0x20>; samsung,sysreg = <&sysreg_cmgp 0x2000>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -855,7 +855,7 @@ usi_cmgp1: usi@11d200c0 { compatible = "samsung,exynos850-usi"; reg = <0x11d200c0 0x20>; samsung,sysreg = <&sysreg_cmgp 0x2010>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; diff --git a/arch/arm64/boot/dts/exynos/exynosautov9.dtsi b/arch/arm64/boot/dts/exynos/exynosautov9.dtsi index b36292a7d..66628cb32 100644 --- a/arch/arm64/boot/dts/exynos/exynosautov9.dtsi +++ b/arch/arm64/boot/dts/exynos/exynosautov9.dtsi @@ -442,7 +442,7 @@ usi_0: usi@103000c0 { "samsung,exynos850-usi"; reg = <0x103000c0 0x20>; samsung,sysreg = <&syscon_peric0 0x1000>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -505,7 +505,7 @@ usi_i2c_0: usi@103100c0 { "samsung,exynos850-usi"; reg = <0x103100c0 0x20>; samsung,sysreg = <&syscon_peric0 0x1004>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -534,7 +534,7 @@ usi_1: usi@103200c0 { "samsung,exynos850-usi"; reg = <0x103200c0 0x20>; samsung,sysreg = <&syscon_peric0 0x1008>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -597,7 +597,7 @@ usi_i2c_1: usi@103300c0 { "samsung,exynos850-usi"; reg = <0x103300c0 0x20>; samsung,sysreg = <&syscon_peric0 0x100c>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -626,7 +626,7 @@ usi_2: usi@103400c0 { "samsung,exynos850-usi"; reg = <0x103400c0 0x20>; samsung,sysreg = <&syscon_peric0 0x1010>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -689,7 +689,7 @@ usi_i2c_2: usi@103500c0 { "samsung,exynos850-usi"; reg = <0x103500c0 0x20>; samsung,sysreg = <&syscon_peric0 0x1014>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -718,7 +718,7 @@ usi_3: usi@103600c0 { "samsung,exynos850-usi"; reg = <0x103600c0 0x20>; samsung,sysreg = <&syscon_peric0 0x1018>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -781,7 +781,7 @@ usi_i2c_3: usi@103700c0 { "samsung,exynos850-usi"; reg = <0x103700c0 0x20>; samsung,sysreg = <&syscon_peric0 0x101c>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -810,7 +810,7 @@ usi_4: usi@103800c0 { "samsung,exynos850-usi"; reg = <0x103800c0 0x20>; samsung,sysreg = <&syscon_peric0 0x1020>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -873,7 +873,7 @@ usi_i2c_4: usi@103900c0 { "samsung,exynos850-usi"; reg = <0x103900c0 0x20>; samsung,sysreg = <&syscon_peric0 0x1024>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -902,7 +902,7 @@ usi_5: usi@103a00c0 { "samsung,exynos850-usi"; reg = <0x103a00c0 0x20>; samsung,sysreg = <&syscon_peric0 0x1028>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -965,7 +965,7 @@ usi_i2c_5: usi@103b00c0 { "samsung,exynos850-usi"; reg = <0x103b00c0 0x20>; samsung,sysreg = <&syscon_peric0 0x102c>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -994,7 +994,7 @@ usi_6: usi@109000c0 { "samsung,exynos850-usi"; reg = <0x109000c0 0x20>; samsung,sysreg = <&syscon_peric1 0x1000>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -1057,7 +1057,7 @@ usi_i2c_6: usi@109100c0 { "samsung,exynos850-usi"; reg = <0x109100c0 0x20>; samsung,sysreg = <&syscon_peric1 0x1004>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -1086,7 +1086,7 @@ usi_7: usi@109200c0 { "samsung,exynos850-usi"; reg = <0x109200c0 0x20>; samsung,sysreg = <&syscon_peric1 0x1008>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -1149,7 +1149,7 @@ usi_i2c_7: usi@109300c0 { "samsung,exynos850-usi"; reg = <0x109300c0 0x20>; samsung,sysreg = <&syscon_peric1 0x100c>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -1178,7 +1178,7 @@ usi_8: usi@109400c0 { "samsung,exynos850-usi"; reg = <0x109400c0 0x20>; samsung,sysreg = <&syscon_peric1 0x1010>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -1241,7 +1241,7 @@ usi_i2c_8: usi@109500c0 { "samsung,exynos850-usi"; reg = <0x109500c0 0x20>; samsung,sysreg = <&syscon_peric1 0x1014>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -1270,7 +1270,7 @@ usi_9: usi@109600c0 { "samsung,exynos850-usi"; reg = <0x109600c0 0x20>; samsung,sysreg = <&syscon_peric1 0x1018>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -1333,7 +1333,7 @@ usi_i2c_9: usi@109700c0 { "samsung,exynos850-usi"; reg = <0x109700c0 0x20>; samsung,sysreg = <&syscon_peric1 0x101c>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -1362,7 +1362,7 @@ usi_10: usi@109800c0 { "samsung,exynos850-usi"; reg = <0x109800c0 0x20>; samsung,sysreg = <&syscon_peric1 0x1020>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -1425,7 +1425,7 @@ usi_i2c_10: usi@109900c0 { "samsung,exynos850-usi"; reg = <0x109900c0 0x20>; samsung,sysreg = <&syscon_peric1 0x1024>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -1454,7 +1454,7 @@ usi_11: usi@109a00c0 { "samsung,exynos850-usi"; reg = <0x109a00c0 0x20>; samsung,sysreg = <&syscon_peric1 0x1028>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; @@ -1515,7 +1515,7 @@ usi_i2c_11: usi@109b00c0 { "samsung,exynos850-usi"; reg = <0x109b00c0 0x20>; samsung,sysreg = <&syscon_peric1 0x102c>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; diff --git a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi index c759134c9..6e9007518 100644 --- a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi +++ b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi @@ -223,7 +223,7 @@ usi_0: usi@108800c0 { "samsung,exynos850-usi"; reg = <0x108800c0 0x20>; samsung,sysreg = <&syscon_peric0 0x1000>; - samsung,mode = ; + samsung,mode = ; #address-cells = <1>; #size-cells = <1>; ranges; diff --git a/arch/arm64/boot/dts/exynos/google/gs101-oriole.dts b/arch/arm64/boot/dts/exynos/google/gs101-oriole.dts index 387fb779b..b73c152c7 100644 --- a/arch/arm64/boot/dts/exynos/google/gs101-oriole.dts +++ b/arch/arm64/boot/dts/exynos/google/gs101-oriole.dts @@ -161,12 +161,12 @@ &usi_uart { }; &usi8 { - samsung,mode = ; + samsung,mode = ; status = "okay"; }; &usi12 { - samsung,mode = ; + samsung,mode = ; status = "okay"; }; diff --git a/arch/arm64/boot/dts/exynos/google/gs101.dtsi b/arch/arm64/boot/dts/exynos/google/gs101.dtsi index 302c5beb2..473db46aa 100644 --- a/arch/arm64/boot/dts/exynos/google/gs101.dtsi +++ b/arch/arm64/boot/dts/exynos/google/gs101.dtsi @@ -825,7 +825,7 @@ usi_uart: usi@10a000c0 { <&cmu_peric0 CLK_GOUT_PERIC0_PERIC0_TOP1_IPCLK_0>; clock-names = "pclk", "ipclk"; samsung,sysreg = <&sysreg_peric0 0x1020>; - samsung,mode = ; + samsung,mode = ; status = "disabled"; serial_0: serial@10a00000 {