From nobody Mon Feb 9 13:04:04 2026 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 76E8636CA78 for ; Thu, 30 Oct 2025 17:55:31 +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=1761846934; cv=none; b=VXyMGUsuCHnRkn0GunXHijVHKq/WSMZNgBiM7jn5ZpeL+z+ND7Zv0sFn/cTgSA418GW9TnRMoWOGnRMkBT0pLWtvyOYqg7JGjHrwZg5NhtY+88nPYGfr9xk2KAZAqSofBYJCF2XcCAGQLTYsAKEyJHwysKRlBp8AIv03MHuwZFk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846934; c=relaxed/simple; bh=3z2mhzRxyfQNv1R0hi7ZTnOWImB9S2k6FugjQXRhwUY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Jc9oUiElHKkNQH7sy6ZFmRIqc127UtSvW6w4U5rjA3/9/rlwgYYbOOUwpRHgr4ZE2nwgvqw7xs4OpC/nUeeXFeEiqnavygrDM3vi/FOVesH42W5MKqWI2EXBxte6PdOECxtPWuh5tpw/doBJhBHqUiQP8PguUe4vMTDxBakNjLI= 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=GUoK0DHw; 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="GUoK0DHw" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-426fc536b5dso901133f8f.3 for ; Thu, 30 Oct 2025 10:55:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761846929; x=1762451729; 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=m8YnOhLYa4+B1Ekt7MbimeIIDg/J8LnZDYbx9DRe05Y=; b=GUoK0DHwVAUvfYncsyPHQ72jouRM6y4QLN89pB/okT/41amSnBd+vsfTFaw8vbp/gV QCxmrN1Tj67ZnkHnXfXzfju2lPdWJFXhyJKaAsoCJmGXqlAa6hwK30H9mf3wovxQDyEM QSrl0oVmomV8DWZgmsDSHSIFZ+u1s9uLXZiyEi4Ai1JiwjfoSR7hveCuKCU31d/dEJMR TjPZjqQDo9UH60X5fFZ+o6cHQ9u8VGB5zSsfKvFhadggIBuck1qIpmTRYWNfn0PG54ED CoxtcI9TY2Gt6lXSN607U+UsyO/wdJR5S/jbYcmGEjSwx9Uxgls/sdWNAAtPUtjsSndp LO0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761846929; x=1762451729; 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=m8YnOhLYa4+B1Ekt7MbimeIIDg/J8LnZDYbx9DRe05Y=; b=sffiJst20iQH23YxE5o+s1f14do+4w3WeA3exJlSoXh/Zkw0midvUdBUnrRAAECP+Q xrFIjAMPizZETzNu7saKRm0O2WIrxk17kdetoWDmfb9IYGCeh61os7K9yxtsVYhDxtvM tz2RPh1UswbQrWqMhx46+Epn7rc/bcYp+5/ka39zIsLUrYWY4US2w9MoMj7Bg9ziN9D/ NB5cKAZn0UW7KfOtkYXaCKzDu6TMD9H8LXrpCrhT9uATlHzcZLXEZ5L9ji5j/J7SbutB 3dM2JQhlWDc2mh4Y0XGqzRFUYPyPcdxGxW2Bl7TdZ+NKa0aP3/lQU3XdMk/Ep5CGueBO tLCw== X-Forwarded-Encrypted: i=1; AJvYcCXJzAMM62nh08bAU2yqZUVUiS7NgKyAnKLT1g2mTqUBnPppDzlY8B9S0UTmpWW7QirYP43JtOV81cIV0h0=@vger.kernel.org X-Gm-Message-State: AOJu0YwtGu5gVxI/fYHeKX+GyiZ8rUeE/LgIcIZfBnCvPrwqEMfx3e8s 1vmLW+eYUkzwzdkNLBRzv7oyO/B3ZUQcw61N2Nppz/cpJ4ORASpVXL9JCLX0L7km X-Gm-Gg: ASbGncvtEH8j9Y+xR57KzxZriVNe4VogC8FwcivHhbcvqBeaP0icUYEiYIAndD2GjYZ s9cZg+4DUndF8D7JDGi49fWfjOA2KRfgDlvpa7DvLYFr1LPwTbqIualQU2hFzM/g2jiN+kcMwGu JV7YXaJs4d3gnT/Vkqa9u22K1q2g9KlGeDhZOTjxOIAQpWxIf75yC1sfgU/HFgWMyxXoLI7tgwB Ecm7elqS5vIlAgEdej+bpVh3YxgWtaAQ8Q1hm9a5jNP/6nlQuIz7EiPYfqAyi5DuPWkIsXw92xV bZk2GwGZQXeWwa5Fl/DXU6oBnYHHHMw9PQlXbQkpALATeH8MuF2CndRDIGJDaZPAc+rYyAm5PKn pEurWhuisAh/RZIMyJFijxYtoSdSr3TRA6m2NdIYZ9cXmkTiDRsVZUF5wlJ+3EC56w1Pjal5ewF 3Faxk2tsqT+pUK8mquzoyIWD8xcqpk8i7b8HdBnEi70VpFUVlLDpSI4q6dPrl/ X-Google-Smtp-Source: AGHT+IFwc9rIFO7apqC3XmXhkXUpx2h1S3c6wGBMHk4QlRiJ5KyIleWF8cbqLDTxKoIV//tw2zW3AQ== X-Received: by 2002:a5d:5846:0:b0:3fb:9950:b9eb with SMTP id ffacd0b85a97d-429bd683f6cmr459520f8f.28.1761846929243; Thu, 30 Oct 2025 10:55:29 -0700 (PDT) Received: from biju.lan (host86-162-200-138.range86-162.btcentralplus.com. [86.162.200.138]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429952de5f9sm33384041f8f.38.2025.10.30.10.55.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:55:29 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm Cc: Biju Das , Lad Prabhakar , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Biju Das Subject: [PATCH v2 01/13] dt-bindings: serial: renesas,rsci: Document RZ/G3E support Date: Thu, 30 Oct 2025 17:55:05 +0000 Message-ID: <20251030175526.607006-2-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> References: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Add documentation for the serial communication interface (RSCI) found on the Renesas RZ/G3E (R9A09G047) SoC. The RSCI IP on this SoC is identical to that on the RZ/T2H (R9A09G077) SoC, but it has a 32-stage FIFO compared to 16 on RZ/T2H. It supports both FIFO and non-FIFO mode operation. RZ/G3E has 6 clocks(5 module clocks + 1 external clock) compared to 3 clocks (2 module clocks + 1 external clock) on RZ/T2H, and it has multiple resets. Signed-off-by: Biju Das --- v1->v2: * Updated commit message * Added resets:false for non RZ/G3E SoCs. --- .../bindings/serial/renesas,rsci.yaml | 85 ++++++++++++++++--- 1 file changed, 74 insertions(+), 11 deletions(-) diff --git a/Documentation/devicetree/bindings/serial/renesas,rsci.yaml b/D= ocumentation/devicetree/bindings/serial/renesas,rsci.yaml index 6b1f827a335b..1c2ed4cd58fd 100644 --- a/Documentation/devicetree/bindings/serial/renesas,rsci.yaml +++ b/Documentation/devicetree/bindings/serial/renesas,rsci.yaml @@ -10,17 +10,16 @@ maintainers: - Geert Uytterhoeven - Lad Prabhakar =20 -allOf: - - $ref: serial.yaml# - properties: compatible: oneOf: - - items: - - const: renesas,r9a09g087-rsci # RZ/N2H - - const: renesas,r9a09g077-rsci # RZ/T2H + - enum: + - renesas,r9a09g047-rsci # RZ/G3E non FIFO mode + - renesas,r9a09g047-rscif # RZ/G3E FIFO mode + - renesas,r9a09g077-rsci # RZ/T2H =20 - items: + - const: renesas,r9a09g087-rsci # RZ/N2H - const: renesas,r9a09g077-rsci # RZ/T2H =20 reg: @@ -42,14 +41,40 @@ properties: =20 clocks: minItems: 2 - maxItems: 3 + maxItems: 6 =20 clock-names: - minItems: 2 + oneOf: + - items: + - const: operation + - const: bus + - items: + - const: operation + - const: bus + - const: sck # optional external clock input + - items: + - const: bus + - const: tclk + - const: tclk_div64 + - const: tclk_div16 + - const: tclk_div4 + - items: + - const: bus + - const: tclk + - const: tclk_div64 + - const: tclk_div16 + - const: tclk_div4 + - const: sck # optional external clock input + + resets: + items: + - description: Input for resetting the APB clock + - description: Input for resetting TCLK + + reset-names: items: - - const: operation - - const: bus - - const: sck # optional external clock input + - const: presetn + - const: tresetn =20 power-domains: maxItems: 1 @@ -62,6 +87,44 @@ required: - clock-names - power-domains =20 +allOf: + - $ref: serial.yaml# + + - if: + properties: + compatible: + contains: + const: renesas,r9a09g077-rsci + then: + properties: + clocks: + maxItems: 3 + + clock-names: + maxItems: 3 + + - if: + properties: + compatible: + contains: + enum: + - renesas,r9a09g047-rsci + - renesas,r9a09g047-rscif + then: + properties: + clocks: + minItems: 5 + + clock-names: + minItems: 5 + + required: + - resets + - reset-names + else: + properties: + resets: false + unevaluatedProperties: false =20 examples: --=20 2.43.0 From nobody Mon Feb 9 13:04:04 2026 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 AE6D936CA8F for ; Thu, 30 Oct 2025 17:55:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846934; cv=none; b=ltLCqtXLNu/RiBemw85+M+uukNgfue4mc5WWppGcZE4V8WcfebGe725rCv4TGoWWfUVI8HCFHnEiZ/hHX66xS2QijwBgU4OQpyZCXxswKfVAtHTXGFNrOQOzxy1DVJWLZdacNDEXJMml/89tJ4YPvYSBax8wT/zw0uuMvDZvBkA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846934; c=relaxed/simple; bh=CGCGb9V5eBipiJiyKGzWDh8EBRU+yWeR3nCYNAfd3C0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dM5N6fFFI+hwCJu4Hw/L2Z3hn+XRSYu1yyShAn+uCNqv58PFgPYCkOwhaXfrkOCSBqXe1Dtc4cn6Ihki0pqt5vuW/1S3jGERk8B/jDJQR9kd/g40iqP6jcr7FvqbFxdhppy58Qi9nYcIdLUw+l3C14WH0cfnvu4LCjahuvO5vY4= 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=llu4AxCb; arc=none smtp.client-ip=209.85.221.41 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="llu4AxCb" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-429babfccd9so780683f8f.0 for ; Thu, 30 Oct 2025 10:55:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761846930; x=1762451730; 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=yttjZeqTXK9cHrnm5+lJ6shcRMBRq57/tMzXtPds7Io=; b=llu4AxCbYEFeFmperq2HYGcElsxZtbHyCqW0L5UMacOds+BzpLFfE4RaM9nkFnlafC Y5dbIK8ueAplhvdOH2i1GZ5vKwa25+YQiWMmKClCg85yeRVGmfXhe+leyIyi4dOucgEb tRsMsgdQYAgpb4MW2eZZq7TaKNG/YraYHkzJBOivurrCtyiunJlirRb3a0kJT0q+/unf c25eCHAyf391GeUKNcIUpt9NNUUeFJnaY2jn8oA+qDoGA5nsFZXzyazAFa3JNhFC+XgX VMEL2EL89IAl8NhQ3wRS1bpZn/RpTUQEe24TnsLSIKnoKOVJNowktykzuKcAJZmN4JTA mY6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761846930; x=1762451730; 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=yttjZeqTXK9cHrnm5+lJ6shcRMBRq57/tMzXtPds7Io=; b=Wo8uyxoNDH13oyj9byY3LFAPiPl+Vj4qgAzawOA8O9nF5Zo7womLxalgaWA3zbrHm9 BGmIDmT42u3jXKiw5IhA4vgpIuIAcPPqyGY90w1VIdasUfSgdKl1azE+DnsvldvXwRJ/ jaWo8xGsW0g477hRJ0us8kYSjTvPofDmYxitR7JKYvA41mcznMYH+br6KCz5ed+fFU98 EhhHHv3lB42yyahAPn49ah/qTxe7dIWzMpxUWpGokLu6WoSdw0/6JPk1I+/bdWlOg6S8 D6kpvze0s6wo9osNRqS2qbJ3ph1sBvl9KysLKwnpEs0zfR2xKojzbM3Xo8uWLZmyMViu fVFQ== X-Forwarded-Encrypted: i=1; AJvYcCU7D9k6pwRtvK+FN53gZqyLo6L3yyTdwxqREIh/prAF5oFA2UjqmK+wcAKXHNIPnHje955RiEILoSS7d7w=@vger.kernel.org X-Gm-Message-State: AOJu0YybdKhTzoU7pdbXwdPTy2ft5v1+wedqoTj28PPnEwcf5MRcF9FQ 1eQMLzPh/DC8q4vjatRhpdv9Y3ooSRUZX7315gi4ge+/Zk4DeXWiWiED X-Gm-Gg: ASbGncs3rvTmW3A2E1K+uFv8z0qtPUt+HOFqmwUw8oRaoarqL+8ByEUu6cPph/vOGzT doOR5cM1g/fVD70fHwi3loqKKI/dEED48RzVtFsYjyLqK6TGJw/QIR1rynWa0TCLgBIs0HBxOyA y7du5+1sBUlaCp79eFU7pJi4RvuH/ed4A6sfO09JgcJzzG5gEzPyKhXfDjZlShFGK2v/quoNtAA Bn2yLPNq6azSyIB05IrO0KJ7rt5fuICE+7o/Dp6j4ByykewuSEUwdd02CZyINbG+ar1B6e82+XR qdcFWQ8ncCy+tLvVjDY+2ck6YB7Arb9yiHNHZAluxFLg/6SmY03gMty4K3YYYjOMT6Cc2d5sAOE PThe+LBHCB1vOEtwiJitRCybhkjE/8ekGcsnrozIqpLHzu9hIr6Q0eENJsuTUf/6/9I/E7m5kNR Zik5OsYVxxiCkOJFXfT03bC7kRWZ/FTVsFLxYBx6TvMXLknwcRWPN25J36WodKeq0f6drM95o= X-Google-Smtp-Source: AGHT+IGYIITVqCReHtNAX7+uLzQsVs5gAndiYBJ77Fh5G2SnarCvdls7gc0J2+Oyf01J33C9+PqrNg== X-Received: by 2002:a05:6000:24c2:b0:427:6c4:f165 with SMTP id ffacd0b85a97d-429bd6aa1c5mr412181f8f.35.1761846929744; Thu, 30 Oct 2025 10:55:29 -0700 (PDT) Received: from biju.lan (host86-162-200-138.range86-162.btcentralplus.com. [86.162.200.138]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429952de5f9sm33384041f8f.38.2025.10.30.10.55.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:55:29 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Greg Kroah-Hartman , Jiri Slaby Cc: Biju Das , Wolfram Sang , Lad Prabhakar , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 02/13] serial: rsci: Drop rsci_clear_CFC() Date: Thu, 30 Oct 2025 17:55:06 +0000 Message-ID: <20251030175526.607006-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> References: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Drop rsci_clear_CFC() by reusing rsci_clear_SCxSR() as the contents of both functions are the same. Signed-off-by: Biju Das --- v1->v2: * No change. --- drivers/tty/serial/rsci.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/tty/serial/rsci.c b/drivers/tty/serial/rsci.c index 3e1f4b3c4e59..504361ed5ecc 100644 --- a/drivers/tty/serial/rsci.c +++ b/drivers/tty/serial/rsci.c @@ -199,11 +199,6 @@ static unsigned int rsci_get_mctrl(struct uart_port *p= ort) return 0; } =20 -static void rsci_clear_CFC(struct uart_port *port, unsigned int mask) -{ - rsci_serial_out(port, CFCLR, mask); -} - static void rsci_start_tx(struct uart_port *port) { struct sci_port *sp =3D to_sci_port(port); @@ -275,7 +270,7 @@ static void rsci_transmit_chars(struct uart_port *port) break; } =20 - rsci_clear_CFC(port, CFCLR_TDREC); + rsci_clear_SCxSR(port, CFCLR_TDREC); rsci_serial_out(port, TDR, c); =20 port->icount.tx++; --=20 2.43.0 From nobody Mon Feb 9 13:04:04 2026 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 2040836CA7E for ; Thu, 30 Oct 2025 17:55:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846935; cv=none; b=DT6FOXyxTm6pXjXgPR8EoKVg5ovE9/l0KaySGfu4r3hw8Saua+nbfoslq6eEU27FitpQgOIRPavyy3s8JLm0bs+HG48QY8U8Pey0jkDEqIf2eyhDvhpPsdMXS+HXjzRlncnFKoObwTxYmukrfAqt16vAD7BlshUUYCKvd4j7t+8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846935; c=relaxed/simple; bh=6rJaHYLudOTTm3QmqB48Nxc1YcoHdZeo58CPf1gncKQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fWaFTfVnzKPhFm8C/7Ly0m1heS4KTP6+XOhuIs9XamyRD5eeu10pQsXz/4BN0l8dnKZfKRt+L7a/qtH4MSWjwHMPwebt8IZVevAT68eppr+y/WPf5Q3MlWcviO6/AvrpTizI/Q75jnYZjkBvRH50L7GJ1pGWLH28eu5lABVdnaA= 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=PrMMf0Xg; arc=none smtp.client-ip=209.85.128.54 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="PrMMf0Xg" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-475d9de970eso9671295e9.1 for ; Thu, 30 Oct 2025 10:55:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761846930; x=1762451730; 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=E5RyjODeDGquD2fp8h4Ys0a9AjmkuXgJEKfRWxOkPhw=; b=PrMMf0XgSq1B0JXI4C70oCTj2Maqfp1aTPQyE4PfRxWdqt4RZSlYefFUdv8axPHcp1 STUeFTfHz9GPVUjrC/5SHapO9lE02LoIsSbcamqAERyWb6Jta/HSzxqwpFbIqkspa301 Qs4NdYB/PALTNM4Fylw/ORaandhlO9QN+9KGjy2+7mqGPwulG5FfCBpBBvKlYA8YQY+O tj8yisso6DiZySXDG82ICckzbG2Ne/lFWHThEG6ebrTQxIS9TpfKil/+Zt0UI1g4bU86 VHO81rtR3k6k5Qd0LPeEmYjFktQwxT9EgtM+6Vsbm30b4TOlWyUdbL61BbaqB7aNNEiN 0qXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761846930; x=1762451730; 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=E5RyjODeDGquD2fp8h4Ys0a9AjmkuXgJEKfRWxOkPhw=; b=ZIJnBIYbRI/2hIS7EAF6wlXg7vtH/8Py+3PBZ8wcK7THcDByKbwrg/BFi0lMWiSPFC D/8x4+cWmeiu1VTtbfq5M8uy16WuQai+CIs9bW0EL5tzw90ESvXW9TGJAfGwm8EAfXer 7dqFwCert55tVc996l6ZqGBHRuv7mGOOtscsLQPgzG3bwZXWPpiare6kACz8zUvERwuQ yFWBl0T9cmRMSOZmr017aE7YCVyOkRfW6teVZTF0KePSbroS/UXdNUvMR/G2HUwSxSSP l2+E/us8N5WZXBVFwcDkBLGvtAjhtTgGyXbp3zoFjqGAu+4WlfIPnCBeRLyrqq7ko7XB am8A== X-Forwarded-Encrypted: i=1; AJvYcCV2UqvkRtzAEPyOiSxnYlWbpuh3rCF3UdB3i/dnx/+yhvsa9qC2hC2X/qFBEiKF92PfE7oYohutf0l5dYM=@vger.kernel.org X-Gm-Message-State: AOJu0YwFNKrALntXjhwIn518pHWzsWz++eZSa7vtwZDBXTd7ZuzXdWU5 uo1Hqq/Cg5Pxo69xjHfrm634GrByX4WE2dX4qelFswB3Aa1SJqDsKM03TjqT9wQ0 X-Gm-Gg: ASbGncu1NZE20haKQHAug7+PSocDpEYvK+ch/5GhJUQw5Xh9/5vD7o9IXmVrOyaFwWf u56NkHvDWEmdRfK6+V/uXrNEetqMZQBe3RfGxNOv9XACwgp8kj9sPnp3sP50cqOgQ2MPnFmvf9e rk9V0VbgEM6vmc9F2HBCmU8Rh8MDPtcesFR9KCEop4CZcGtaZfHna0/jkd2NHEIeNefQezoosx0 /P0qLb4Uk0nNV8ofl5eiajTXfeCjC5o8OubuFx2JlyvwVugQK1bbEyYxKzESv0/yeO5jE0arS8/ mgPqgpCx4oseUK85wVG01X8b5RIjrwV/878SZRxJSIMYv7wKIn6JA1cs8bHqq1y3rY1WS34FT24 801Vm0WeJNVJUGgZ8JAmDuuQDzkZx3UIQL3wtC6ASA2WbgwhUrn+19DFmYtqAs7Fs2cwl+x3tqG 2gbu75seggdReYYJNFZho/gmK/10RGTJlTJQQG4O9YMn1atsNTXzdPAtAZpzbRfqhVxJYmRYc= X-Google-Smtp-Source: AGHT+IFBi0hqrqgDBukpX7UuHHLxHjT0GA2iPHi9vZvzYJkR6850zvm4U+rMbHpm3ZqwPaCKtK5CeA== X-Received: by 2002:a05:600c:64c5:b0:46d:996b:828c with SMTP id 5b1f17b1804b1-477307c1fd3mr5174305e9.10.1761846930304; Thu, 30 Oct 2025 10:55:30 -0700 (PDT) Received: from biju.lan (host86-162-200-138.range86-162.btcentralplus.com. [86.162.200.138]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429952de5f9sm33384041f8f.38.2025.10.30.10.55.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:55:30 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Greg Kroah-Hartman , Jiri Slaby Cc: Biju Das , Wolfram Sang , Lad Prabhakar , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 03/13] serial: sh-sci: Drop extra lines Date: Thu, 30 Oct 2025 17:55:07 +0000 Message-ID: <20251030175526.607006-4-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> References: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Shorten the number lines in sci_init_clocks() by fitting the error messages within an 100-character length limit. Signed-off-by: Biju Das --- v1->v2: * Updated commit message 80-character->100-character. * Increased line limit for error messages to 100-column limit. --- drivers/tty/serial/sh-sci.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index b33894d0273b..e9345f898224 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -3008,11 +3008,8 @@ static int sci_init_clocks(struct sci_port *sci_port= , struct device *dev) return PTR_ERR(clk); =20 if (!clk && sci_port->type =3D=3D SCI_PORT_RSCI && - (i =3D=3D SCI_FCK || i =3D=3D SCI_BRG_INT)) { - return dev_err_probe(dev, -ENODEV, - "failed to get %s\n", - name); - } + (i =3D=3D SCI_FCK || i =3D=3D SCI_BRG_INT)) + return dev_err_probe(dev, -ENODEV, "failed to get %s\n", name); =20 if (!clk && i =3D=3D SCI_FCK) { /* @@ -3022,16 +3019,14 @@ static int sci_init_clocks(struct sci_port *sci_por= t, struct device *dev) */ clk =3D devm_clk_get(dev, "peripheral_clk"); if (IS_ERR(clk)) - return dev_err_probe(dev, PTR_ERR(clk), - "failed to get %s\n", + return dev_err_probe(dev, PTR_ERR(clk), "failed to get %s\n", name); } =20 if (!clk) dev_dbg(dev, "failed to get %s\n", name); else - dev_dbg(dev, "clk %s is %pC rate %lu\n", name, - clk, clk_get_rate(clk)); + dev_dbg(dev, "clk %s is %pC rate %lu\n", name, clk, clk_get_rate(clk)); sci_port->clks[i] =3D clk; } return 0; --=20 2.43.0 From nobody Mon Feb 9 13:04:04 2026 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 B8C6436CA95 for ; Thu, 30 Oct 2025 17:55:32 +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=1761846935; cv=none; b=fhhs92jhB2DehjHT5qG1SqboCi/6qPduXtILXn9rys4d9LZhcjyRiA7Iu1iV7/RpMoh4YwTyJOTEHsErSLYyhsEDiLon7LNLVfYvNO6Edf9XZyS3Q8JVPdQdfZNsByVXQzS5imcXOufj25iI0Sv4biX9O0iTegmbxoCqjLmyUSM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846935; c=relaxed/simple; bh=KXgzGd6gNo09gi0VZSrUZARuDuGxlTCFI7gHi/TqNjw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YnsM2GnS7K6DMq9IFXG9J6wNZRMjyWWnkylGh+70qnR27A39xDITOtW0TeW2B6p9u7xAuNvTfRQydOGx36lSOOs1Usx5SXRdI11SB/3i6eWMbldG7K4trUApnFP2Sey5HB532IIIzKWjeA0udRGlwiQpNXPjmGhym7EBtXrZIlI= 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=JJxsvXJy; 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="JJxsvXJy" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-42557c5cedcso888061f8f.0 for ; Thu, 30 Oct 2025 10:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761846931; x=1762451731; 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=NV2npGkfv500PmnI9y9LBiyb4UX94aZHfGA0F6aPZeM=; b=JJxsvXJy8xGyi60rXx7saWafLF4CUHIy0MhtDrZxYJWXUbS3oekbNu01FzAOzQld47 FMX7j4GMcj90L07+YyRQ4kGHznI6/O0lj8a+lA3muhDCHTMR07QvVdOkkAAaI7ebMKkn F80hlCO8RufaMl9A9UEpyzEGlWmwacZNhbqzm8NxBcoOOEdfl1WHOqgaNtiMuD9HrgQ3 o7CsC4ckQ7Dm2SZu0mohcdpJt9AtwYmxxppYM+Byfb8Gl2Yg+WKn8ZeC2F4SKCjapOnB An5Oni7TdMwpFxD+blL1yqigB+OoCZWRjQmIvr0qo0AmseCr8XY05chIbSrAPQaRRiXq 1a0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761846931; x=1762451731; 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=NV2npGkfv500PmnI9y9LBiyb4UX94aZHfGA0F6aPZeM=; b=EsERi2bgNKcODxaUPUw+bz3K1j5hXT4U2gXB5El48fpqTKaoHtOrIzqGlfe1+X4B2H A9Da/ExUfas3t3ABhV4WCrONjp4LrZpyxaL3ca6dtk4H0eWefc8SfRmMQfHw9OWAIW4X x08urHiCFExNWRq/5vD1u7D8ZbGkTFNVjwQL/ChYIcerUwyMxuKw97eSoSEM0NPLeBT6 qQ+R+z3BDYrFoMURDOOQkG5AXFB3h6XXK5kyHuR9VgYw+r+Zvo/3iye6xjw6D4CUhm2l oMJacjDpByo/BiGdiMwUX5C77PGPEwm2HsCyEaxit56zkF6QSnJ3IiZLmxNvhsxvdQB9 P29A== X-Forwarded-Encrypted: i=1; AJvYcCV/BKYj4Zv084Mron5cCwvlkUaypgyxON+tioeE7cjgS6zmERd4xtPHkQRvHcG84x12YVsvk8m+vi/hunY=@vger.kernel.org X-Gm-Message-State: AOJu0YysI0h64kUTl30XzgFLEDtT5iFWdL7uSFFSlhB2DOwPru+6Ty4o GsWWSkjnoRW5n3je7BxL8Ag3vQ02dGd7XYUX9a6rJXoHbUZR6GNrDeHE X-Gm-Gg: ASbGncvBM1IGfHFq9nlJ6N5fr0hn4SCqMbfIUCrNPc3UfNt5N8c8vLBlBdPPWYPMlt7 Yz1DbPHGMQCRFyN2lozWEmkGRJ9gtM0UltfMsQi/lXp0CkvS3dCl5SjoWNgUZ0TskWTEWA/rdxW QcjUO7K08XmckTX8wopg2pkHDG6f2ngJVWf5Snv2AwlSEIvyfwsYii1U1iWatLzRMaverfThERL ecFbrjuCyc5qtbNk1O0npDfF9iFTkHE1KQ7dGMlh3dvMm/SVRbnUZTotYyKjBk4250gCraHOu+U Xey08ONPs8exkErBF0DHJPuxM3GRHqPpLvZvORflHUVHRR7S/2SPZaKkC+m79MPRhs5K1Ws8Ifc TenHpKFUxchdgFNhUyUOm9/42ahCMLoF0WDAnddqfjrSVz9OqJEAnsKL36dFAsNDZE7NyYYwPy4 dVqldWXIi9r8eD8hLcVPon+cjbo4OxxegIhJ/ZqiTne1HWttaUw0n4/Pjr6WqA+gJR+kdL5QE= X-Google-Smtp-Source: AGHT+IHMkjvLfmwalDhCBBe8OAxHC/LlNBETUVjK4U+fGTxaXOKW/TVcRRYQUO/q05YhnrUanlIZGQ== X-Received: by 2002:a05:6000:2306:b0:427:5eb:d82d with SMTP id ffacd0b85a97d-429bd68d047mr428378f8f.17.1761846930766; Thu, 30 Oct 2025 10:55:30 -0700 (PDT) Received: from biju.lan (host86-162-200-138.range86-162.btcentralplus.com. [86.162.200.138]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429952de5f9sm33384041f8f.38.2025.10.30.10.55.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:55:30 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Greg Kroah-Hartman , Jiri Slaby Cc: Biju Das , Wolfram Sang , Lad Prabhakar , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 04/13] serial: rsci: Drop unused macro DCR Date: Thu, 30 Oct 2025 17:55:08 +0000 Message-ID: <20251030175526.607006-5-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> References: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Drop unused macro DCR and its bit definition. Signed-off-by: Biju Das --- v1->v2: * No change. --- drivers/tty/serial/rsci.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/tty/serial/rsci.c b/drivers/tty/serial/rsci.c index 504361ed5ecc..470b5701cd67 100644 --- a/drivers/tty/serial/rsci.c +++ b/drivers/tty/serial/rsci.c @@ -24,7 +24,6 @@ MODULE_IMPORT_NS("SH_SCI"); #define CCR3 0x14 #define CCR4 0x18 #define FCR 0x24 -#define DCR 0x30 #define CSR 0x48 #define FRSR 0x50 #define FTSR 0x54 @@ -119,8 +118,6 @@ MODULE_IMPORT_NS("SH_SCI"); /* FFCLR (FIFO Flag CLear Register) */ #define FFCLR_DRC BIT(0) /* DR Clear */ =20 -#define DCR_DEPOL BIT(0) - static u32 rsci_serial_in(struct uart_port *p, int offset) { return readl(p->membase + offset); --=20 2.43.0 From nobody Mon Feb 9 13:04:04 2026 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 8797E36CA98 for ; Thu, 30 Oct 2025 17:55:33 +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=1761846936; cv=none; b=Hn1YrSu/MOZ5NGv3HEv7LokhYcRBG6GYxgSUxxlDdopik1B6OWpkyV0RJaAmsw2eGKRaaVv8GQQQ9Q4OFACAl/awnWH/S8KA4v62G1yDCoj+QDVn5eGTlz5rb27mJ28f7IBRhAfzdyO/h5ktm3zMz4fxGJYRGUuZw2zq7jcqdBU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846936; c=relaxed/simple; bh=9jcJ345rfMMIxdlmZfAg0y+exXpCpE0R+jvegxv2zm4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ewOt+NYKnNjIqILYfTSuOtX4LLzgn0tv0i7OQRDlEWuPMo8hic2RvDe44fuWW+h5m312owluQo3Ei94TKHQnIyiYngRcv/2PSPUjp5u5g2fraKu3NBMiuACq4j32xrSHA7IYR/o9dAbvPhKK74dfdnfHXCEK4q7LCBCdLsiJ70o= 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=J82MttpW; 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="J82MttpW" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-3ee64bc6b85so1298436f8f.3 for ; Thu, 30 Oct 2025 10:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761846931; x=1762451731; 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=GbIsB+JA33Gj1io+1AAFvPQwYHrrul7tUKhFdp8JQ+s=; b=J82MttpWIRLzbNEEfH+3Ncrsg/jYUIIN1lQ9nT3qpprSyfwFZTx+k292qSqPOp0GRc BNmSaBB/F5m3Cb4K83iM2sAVIfjfN5+ofA+IPFv2CuSQlTzy2IV7sLV4W2Zm9Hwsai0x XmHQhD4zkjKv7FLeStCGweTQp4ynd6ZJvJHVJTIqRrC5jN5YOiQTWHJmakoBFJX9iQyG 5b8GCp1sm4Wz5+A31X5yZqFW4v9nJvILLctnkZBTeR1ibpFO4DCiLnNB0nmTA+3Qbs74 llsdnhZoFd0CYI30Wi08BmbQL7bzSPJxAeBTSmJCmM3kcMNkV4vKwxU/9Sj0n+4wiYpY qQ2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761846931; x=1762451731; 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=GbIsB+JA33Gj1io+1AAFvPQwYHrrul7tUKhFdp8JQ+s=; b=r9Bf+DPVfuxVVmZD5p2vXWgFVXznL+xL6yh2dlr7+wDYX82G3tWckiUfusDuSgAlWS y7yye/2zj71v2TWyzMNLCihCnJBxwBDj6HlRHs9msLEqk+xH+frQEU3SC4AvNSCfazLb xpu2ZCzzJ2tkyPwzX81kT2smVX99xtOhNhhtNi38uOCCySnaWRYbl7hBjmCt9AnsXqJf V6LcIWdQagNsbZm85WD+Zwn5cJTuS10U1KSKOQIOE/ryvzuNujIiUkXhJXvVa5aHbRjj opGDQ2CbaN94M+CpSM5f3MioJYF4hkeF4APEDMobIlcqLadACWJlXFHfbKRxfZaEBfFt s3Zw== X-Forwarded-Encrypted: i=1; AJvYcCW/gya1dNvyacbi/a+IjOdile4iL4f276kT4sZ9qhnQL7Voz03mmqqah+YEN1hV3bhIxpapMo9J6uzCf70=@vger.kernel.org X-Gm-Message-State: AOJu0YxkAQ0MJJLrunpJL7HgScHRPq+piXKWS/PKggNZMecNQe4r3S5c n37zYVs7x4EsLq1chGiDezJMpGZS4gNYql6CO8nF9sxytIkI/wjGLGLk X-Gm-Gg: ASbGncvOQfjj8O0Zdk/7KzmltB8WjJglts4EHejVtDWoMK6ImyGNYT55+w+wMbSpnxG CDIHceEV6j/ZwdeBDkA0ZgclHJ8kVCJBr9tmOX9HD9TskFUhkbKzIp72K1WWfuWDaBOcjpMEywX eEyNfo+fgNAJjzl1VNUecUuH9ft4vpp3IBJgbvK74K9f2B7tLRIs13UfmPCUTzcjRFgO/nHW0eE 4WL9P6Pik3MZkumx/DoPByTwszwzxm6ltB94jDEYNhemVkIaAdrxexFL/PbNY12EUyoL4s/GzQI 2fVODEZ8uSoUSDI1vqVQuqRe8oFm9BP1K1FW3XPo9DKZwlU+BaMEFw02577z3MZ40CTubi6j4hO LCchS4FZtKyn5gpm3laarygNLqFiLw2yqlOJDUDLgeOgaLIt2tEvxgrnME4afAMJIWz6r7pEuom /QKMDdJZkHiieqjxpiikf3Ldd4HuWLUeR1ktFlXpaAWRFFR8uTZ9s1Gd4j7K/I8iauuRxuEr4= X-Google-Smtp-Source: AGHT+IEF2L0p91EN9iLwnGMihS3zlarLJMg1F5IRe+iNrL7LAp7ExKgFdBKaDNHl4ZjJyQD8OKHXaQ== X-Received: by 2002:a05:6000:25c2:b0:429:b718:167c with SMTP id ffacd0b85a97d-429bd68847fmr429373f8f.28.1761846931270; Thu, 30 Oct 2025 10:55:31 -0700 (PDT) Received: from biju.lan (host86-162-200-138.range86-162.btcentralplus.com. [86.162.200.138]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429952de5f9sm33384041f8f.38.2025.10.30.10.55.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:55:31 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Greg Kroah-Hartman , Jiri Slaby Cc: Biju Das , Wolfram Sang , Lad Prabhakar , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 05/13] serial: rsci: Drop unused TDR register Date: Thu, 30 Oct 2025 17:55:09 +0000 Message-ID: <20251030175526.607006-6-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> References: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Drop the unused TDR register-related macros. Signed-off-by: Biju Das --- v1->v2: * No change. --- drivers/tty/serial/rsci.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/tty/serial/rsci.c b/drivers/tty/serial/rsci.c index 470b5701cd67..ade5ee479e99 100644 --- a/drivers/tty/serial/rsci.c +++ b/drivers/tty/serial/rsci.c @@ -35,12 +35,6 @@ MODULE_IMPORT_NS("SH_SCI"); #define RDR_FPER BIT(11) /* FIFO Parity Error */ #define RDR_RDAT_MSK GENMASK(8, 0) =20 -/* TDR (Transmit Data Register) */ -#define TDR_MPBT BIT(9) /* Multiprocessor Transfer */ -#define TDR_TDAT_9BIT_LSHIFT 0 -#define TDR_TDAT_9BIT_VAL 0x1FF -#define TDR_TDAT_9BIT_MSK (TDR_TDAT_9BIT_VAL << TDR_TDAT_9BIT_LSHIFT) - /* CCR0 (Common Control Register 0) */ #define CCR0_SSE BIT(24) /* SSn# Pin Function Enable */ #define CCR0_TEIE BIT(21) /* Transmit End Interrupt Enable */ --=20 2.43.0 From nobody Mon Feb 9 13:04:04 2026 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 411E736CDE5 for ; Thu, 30 Oct 2025 17:55:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846936; cv=none; b=ubw6uzeFXNM/iw3GaYPGGe2mzfWr9dnOZsK6eELi6mbRBhaG6DsKObqCQyafa7nYOyG00B8IgBDqsqflbFm+KDRXUh6nz8rNo79Xn2QxljSQ1QIbh3MRo71uZ1RcsRN1asFJSNbyNW6olL1KLcLYdUmWxX+WErz+NpT3sdG3X/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846936; c=relaxed/simple; bh=h/WB+hR/anHyT+SzoBQFwmDv8A8kpm7m3RVwaDTL2qk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KD5xUk8niLrfvQ3AZa8AAJx1h4zXVlNEz8nHxupsRr7sH9Fno4PiBfTqKWZt8JwR0oXpZKumlVpElQkiO2MFrO1ZiR806NxvLNLuZtHCbQVi0X7tKfuMMqsN2k1YE7xuf2np/RR0tzS5pWra7U7EtJcQTCVaneB6ZQf+pqy26xs= 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=XR9NB8fi; arc=none smtp.client-ip=209.85.221.54 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="XR9NB8fi" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-3f0ae439b56so844726f8f.3 for ; Thu, 30 Oct 2025 10:55:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761846932; x=1762451732; 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=fpqM7R8t1LjT1e31UVuLTSZ7tEVjNoHsGLOYlh8Q1Lk=; b=XR9NB8fi7Ziaui3V5/Wqg92z4H6KHvGsDgot4efrfCicu4b6E9JG1GunqqicPpbytQ DBUDXRK58bzGbLWo+u51FfhthD7497PQP7KznEHsxfpeQZ2/iSdQAjkqQNScZpjrX6wa oUcmFGGNxhQeu3w2n5Zh1wrpcDl8OR0Hz17wmo0jdxG5br8CMWU21e1CyVaxTE/RYnIb b+SJnM0aO9D1LGztZ4TcBlGmagL5Z5suBfCQIOu2Jk+90Mwr4ZJ6zdH8u++q9rE18OIH T73s4BmFauPBN5nf5kczm7A+DG33vS32inm9lKDZnD1jgWvKIADflChcN0NJqZL4VduA nJXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761846932; x=1762451732; 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=fpqM7R8t1LjT1e31UVuLTSZ7tEVjNoHsGLOYlh8Q1Lk=; b=eXF8SjjmyoHKvn/ouVGWEHeTQ+lY5pODuIZQgdW8M1gCssEBAUy98rNDNYz57Z74V9 p5oXfGsAO4ufwddYsqxUcDrp7Sk7qOY67tRLQ0bzywjy01VisoA1a/qp+3lKs2u+2WjA oqbNkq+/sd/OVSb13s3xKxvB+XwhlqWttLHJuXq21BrOp7VjP3WeriEF+bC40j83PKGU TS6YE7vRr5zVaDvUofsvetFZ+W16Rll4ikLBh4oDBXu+Rhs9KXFhGSUvR+jxKdqujQgG OScjoNymBL46A+07ILXK6HY6twW+0meOdO7PMtlDnN9dAf81+AIgMl0ThpixUtThfxHb Z06Q== X-Forwarded-Encrypted: i=1; AJvYcCWa3oq8fmxMA5W2G22NzuUj05+8oV72rFG3UaAp1/6szjEi2Vh1v5KAP9v5JoUaDtKA6HiPiCO6DJWhBNI=@vger.kernel.org X-Gm-Message-State: AOJu0Ywl+hPX0O7YBuITIRKUDxq2iaMMe+YvHyXSOYMdlO8DwzNUDs+T oZsgdS9yKddjjnvabpMFHQxnAQaKmk9Rh/aEvas9Q4qmPt4QxHZBzoS/ X-Gm-Gg: ASbGncsrjaY1bht3bbhUEz2L72PRF/7wx6LnYFryHOnlH+3jnC32ORTc4kamu33na8n ZTtbeyMAOqMfPfcmvZ5zyTePDcdJRKRhi0G+a1+v7xNLJIPe9W1ZhVPfv8T7GxBc4U2KrRLetSi mUQaXQ3rOdP2KzvTJkYjQZ472TCoXbMsrk+e6tKUZTfLCXu0rm70xFTzQ48mPHtNTfIBHYdVVlz cgWB9+ApRydDwnocKsSy1qwnTqZcOb3a78axwK/HM68ZeCVQQawOlX4+WgpsbUASVa7pAlXLN2R xRjGG1VqbA56qmIIPaZrpLGgkPoh/NXNbBcY0z6fBWklBZtppmqZDadOOOc7yJmZ7ueVNe7fXwp 4c54Kqva9p8tJSReNPNta4gvXcgicJybd/TJznAXXaKxqEjeFD5MYA07f7VQScuuDNhiOhJRvXA PMH2wBYwELf357BhLtShujHrcmJPAmzK7yh5kCxTLGAASAvek48C+v/n6+3MQvdUfi3MzWLfw= X-Google-Smtp-Source: AGHT+IFB4CtW/QHwxBewuQQ+kfNYXHph8zhhcP0AJhTDvVbB8Po9WDTizjGc7lFwCMRyRyZ8mFCw8Q== X-Received: by 2002:a05:6000:24c3:b0:3e8:ee5d:f31e with SMTP id ffacd0b85a97d-429bd68376cmr479687f8f.25.1761846931811; Thu, 30 Oct 2025 10:55:31 -0700 (PDT) Received: from biju.lan (host86-162-200-138.range86-162.btcentralplus.com. [86.162.200.138]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429952de5f9sm33384041f8f.38.2025.10.30.10.55.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:55:31 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Greg Kroah-Hartman , Jiri Slaby Cc: Biju Das , Wolfram Sang , Lad Prabhakar , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 06/13] serial: sh-sci: Use devm_reset_control_array_get_exclusive() Date: Thu, 30 Oct 2025 17:55:10 +0000 Message-ID: <20251030175526.607006-7-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> References: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Replace devm_*_get_exclusive()->devm_*_array_get_exclusive() to support existing SoCs along with RZ/G3E as RZ/G3E has 2 resets. Signed-off-by: Biju Das --- v1->v2: * No change. --- drivers/tty/serial/sh-sci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index e9345f898224..d07424caeeab 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -3533,7 +3533,7 @@ static struct plat_sci_port *sci_parse_dt(struct plat= form_device *pdev, =20 data =3D of_device_get_match_data(&pdev->dev); =20 - rstc =3D devm_reset_control_get_optional_exclusive(&pdev->dev, NULL); + rstc =3D devm_reset_control_array_get_optional_exclusive(&pdev->dev); if (IS_ERR(rstc)) return ERR_PTR(dev_err_probe(&pdev->dev, PTR_ERR(rstc), "failed to get reset ctrl\n")); --=20 2.43.0 From nobody Mon Feb 9 13:04:04 2026 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.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 3FF6C36CDE4 for ; Thu, 30 Oct 2025 17:55:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846937; cv=none; b=Fh4KYCId+qm9B2q8zi/UyxMZ+6wWnOfgiJbTYNBwkodi1RuQsSpvgTn/S3EvT/T2I9V08aYShAG2+e7PFUC4Q/lgrCDlW0BY2Enh7qnJYTY+8zls3wK34yy8Q0gTDJTEBHbc17yz2goXd81Ivtxf3q/CGlfGyVjIjLN7SXtHScw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846937; c=relaxed/simple; bh=hRGcrf757tBUlPVJghD36FxXRGKWF+Ddzd5vihoN5uc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KD4+vwdDpQpllms95k3y84rjEQozoOHqcrxmGW+XjVnmnr8EP1jdOnS7Or+BHp0Gy4vSY5TKx4feHhx89is95t0doQ7hi5RGMVzZSNrzKV1ywsbDktCbIttE/nK3EfEWI80wR1Jipmz733zurgtGvH4LTRCG7qvZiDNVwvA9jR8= 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=JGe/LOP6; arc=none smtp.client-ip=209.85.128.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="JGe/LOP6" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-47114a40161so15220345e9.3 for ; Thu, 30 Oct 2025 10:55:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761846932; x=1762451732; 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=7uqGmMoi1PPAQaFicRlny+AD/MJGroEdg5O4X9kuPbw=; b=JGe/LOP6kP0kR3YkY8Zb3tovTrvToZP561qYcPgDTZTAhjepk14eHemg5Yf1+lX4hc B6kXOVgC770FUX+5EnJhk/tYMqMh7QaN2KD1spjLFmyWj39Lm2vsbdAF1RcpeNSMm+4x Xr4enHaO5Fdxcl/hh/iMjfEOI2qDUE4TGc7CqepFDBejhlPBdxoz1Qh0GdXyFAoWcVvM RJrkMmGyVU2WKyyUjzb8YrKyyPbl5BS9a6+ZiEJvZh9ClX2hX1zme6GV1WYi3jo5HL4V QIlaaAZp5BELY7hS9AtYQ4GBSRH1r3cn07pTn2pVkiVHhrebYnnD2oFDLaNwnPhYYWWe 0ODw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761846932; x=1762451732; 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=7uqGmMoi1PPAQaFicRlny+AD/MJGroEdg5O4X9kuPbw=; b=ZbzBh8WPmv9W2765nshphebX7gevY6qngIF9d+5CeIObRq+ubAo3SEnAiJRhJRZXQH kqko6Sskcy2oypP1B4iHffIbRFlVaue5faNOLwszV4K3B8EKS5bRu0XnhDEs/Jb1fA8y hIvXbDJF7b4ktQSEM0s8p0P0VCLR15GVqcuTtQWtjK+D6MzpT/6eBkYXwpgZxDnT8Ru3 VF1hZ4/n1AnEKe75qr9sAMDwA1VFITNktL4fGyJBMqs0i4O1m7l8rpPoCfraXq5wFbLX 30NTUkB4M1M8ktT1xJ1TuQhBKpgwO3ELnyG1ye/NtCzdtOZOkVqjjz8ZiIxCVz5/VtlX d+9A== X-Forwarded-Encrypted: i=1; AJvYcCVyk2VZaEzbQFMADexr7WIPigWfp4l7O5n142wUqqMGhPLuuiB1bg+n4Qy5udQQP7jWqRs77h7l0YLPxH8=@vger.kernel.org X-Gm-Message-State: AOJu0YyTSMFsMDXcTCUb/Na6L3pdKkgLMJW4613Y6uramnvvZcRgm1WY +CE6pS2VENgU/9cL0AcjFJDF/i9zS8onIihbvYgcumqpQVCSJ603++DY X-Gm-Gg: ASbGncuNpcEjeAhYsmYLCjhxegMZ6+H3G1crXP+g5nKKMPZ3UCC5lc1z/FdhpZbQKQR beuAm2Kk4gkOXXBcsJ6xUxNBjUVK/drlNpWak99943RqFbu+gg2VMRIDIizAp9WL0bQueY/y2g8 5Nl5XRgMrBkfrQMu6c19p5/D4FdXNve6jblCPRd9hmClQ7nDbK3xaaFt4JLhS1IXv1QkzpTO151 xFRxZrmTOHB88sBVjb3g9DP68s/oKsZyy2dFBGLElfW1oyQ54xZXrhmMsOIRrGp3ACMfDDBokh5 sWAFSzGNOi90rXzOStc5Ye3ILWD2U90CCfglnJ7orljpLIcEcPGxUauD+rUBVYz4KBoH5v7Qi3P NVxYZbUFss6fW+/zFR4AjKqUFpDahC7cvH5hpVcGAx5INw15NhZWyCcexu0YpKdIDJvP/K53h62 sBuV4ivDj1vazTf4Id7ek8goA9fTR75JjEV9J+vX7+rcBohushqRSihKTulVgd X-Google-Smtp-Source: AGHT+IHhalSgP2kmhosVrLIAl+xUpJ8DATCni255mO2cl/2W+LygbY8oRYqgCijoqXjlLsSWAJ/x0Q== X-Received: by 2002:a05:600c:3e17:b0:46e:4b79:551 with SMTP id 5b1f17b1804b1-477308aec8amr6285475e9.31.1761846932213; Thu, 30 Oct 2025 10:55:32 -0700 (PDT) Received: from biju.lan (host86-162-200-138.range86-162.btcentralplus.com. [86.162.200.138]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429952de5f9sm33384041f8f.38.2025.10.30.10.55.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:55:32 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Greg Kroah-Hartman , Jiri Slaby Cc: Biju Das , Wolfram Sang , Lad Prabhakar , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 07/13] serial: sh-sci: Add RSCI_PORT_{SCI,SCIF} port IDs Date: Thu, 30 Oct 2025 17:55:11 +0000 Message-ID: <20251030175526.607006-8-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> References: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das RZ/G3E RSCI tx/rx supports both FIFO and non-FIFO mode. It has 32-stage FIFO. Add RSCI_PORT_SCI port ID for non-FIFO mode and RSCI_PORT_SCIF port ID for FIFO mode. Update the rx_trigger for both these modes. Signed-off-by: Biju Das --- v1->v2: * No change. --- drivers/tty/serial/sh-sci-common.h | 2 ++ drivers/tty/serial/sh-sci.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drivers/tty/serial/sh-sci-common.h b/drivers/tty/serial/sh-sci= -common.h index bcdb41ddc15d..ef1d94ae8b5c 100644 --- a/drivers/tty/serial/sh-sci-common.h +++ b/drivers/tty/serial/sh-sci-common.h @@ -8,6 +8,8 @@ /* Private port IDs */ enum SCI_PORT_TYPE { SCI_PORT_RSCI =3D BIT(7) | 0, + RSCI_PORT_SCI =3D BIT(7) | 1, + RSCI_PORT_SCIF =3D BIT(7) | 2, }; =20 enum SCI_CLKS { diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index d07424caeeab..6f396e1151d8 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -3149,6 +3149,9 @@ static int sci_init_single(struct platform_device *de= v, case SCI_PORT_RSCI: sci_port->rx_trigger =3D 15; break; + case RSCI_PORT_SCIF: + sci_port->rx_trigger =3D 32; + break; default: sci_port->rx_trigger =3D 1; break; --=20 2.43.0 From nobody Mon Feb 9 13:04:04 2026 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 1E10936C250 for ; Thu, 30 Oct 2025 17:55:34 +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=1761846937; cv=none; b=RAn1hVs5DQyhb/Yj98JTQxJXsTJFFM0gi2BUFgZujrR5Fc6F1Vv6jIiJLQ/8W2lHt2NWW6xrEn5LnN8xWr82vm2+cpzo2A3CTijgIWSf+wx7+MuvPkbDZYnEXp59CHbBkL31E4ER0DPWw+WgugPetDNP5R19wyOLWwpBG8SaDpI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846937; c=relaxed/simple; bh=vO9lAruIFRWwmcjhkElTrINqAF4ZFqyjtlRL6JeFb7M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JDufky94TTs2OjG7S+wZ/YeS0/wDH1382oJBOwcuv12edmNeuFpJFuj+Pz0CLLhHVXy8wNhHb038kAdpW3wr1ok414wIG9v9X7aHjZX1S+B/3tYKmN+Dao2cNwTE5YLnc77z9875WctZD8kvGkkLtydpO2ucav3LzWLIIW6xlm8= 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=DfWj3pH6; 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="DfWj3pH6" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-3ece0e4c5faso1408971f8f.1 for ; Thu, 30 Oct 2025 10:55:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761846933; x=1762451733; 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=VWj+7xNpysOeYb6zB5ArYmBB0QA2bqcJvV4UM5jfotc=; b=DfWj3pH6gJatdsT5V21tGVLpmbkoptpWV8J5GgmVMAKaP7SV3J7Z4HSS+ma+ayDxwm YM/s8zT09gC0IxSmbuR71sx2udzUzAWWaqQS4PSsa8F+w9rEGXr8U8np1W3jCtVQfGx7 sSdSIrngsl9r4I2XYMvk6HqrzQCGDFgmeOvDlWUC6mgM20+noF3bKvcehFxFWFjy1eZI sr6pDNrhj8xC51nbBUCOjNnI3GRNTfA12IgPl6s/5YVPl0Ta2hWD2k6uAPaDMVl2zigC Iwx1aR0011i5mZ1G8qklIkuUQjFQmBC7TokydxDBDyoT2Hrfeqke7rgxmFtk45q23x3x N7lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761846933; x=1762451733; 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=VWj+7xNpysOeYb6zB5ArYmBB0QA2bqcJvV4UM5jfotc=; b=TbkQlADjrikB2OWNOhCJIkOrMR+lOMcKKJ6huu3QH1BT/1U51RlHVVPJatI2PdRnaE 0aeKPP/CJNcKoB05lk1vSifyJA36s+pYz2VjJqJGYpCfLwZ7IsNSDXtQez9NS02KElFo 7UXOPv2Vi2NRy2FjdSHD0OubPNf3IZaGypSOdfea42L4WAcaPM2YjmsRelp0nxrGmySc ps4SxeCXEztSr42nY752iU7JjdLkzqqMm4KxSViV8PgozVnFhdxY2zHXf4j4OBMlHsFr MRqIT4cvivcKdersmkvL//BV4xLodFKGq8obrf59MpJozDSmY+pVV9uQIl+mttn762b0 noKA== X-Forwarded-Encrypted: i=1; AJvYcCVY1xsa4vY+tv/cb5j7PjT6D36DojXTuNO786p9Y9/dChBcynTNiRwdGei6gQp0n+ZombeRKjTnmpt+UC4=@vger.kernel.org X-Gm-Message-State: AOJu0YyjA0ItKCdUkEy7DiBimzMct/q0SgOjyi7LAjg3/yfquX9zEQkf SOOBNrNtS3EORos5z1gGVy5m6ir9UxQ9Be3D2cG1CwcWGBzb2VDDw6vn X-Gm-Gg: ASbGncvPK1WZqHej98MvOSNX7i7S3fmtjVQFTUzJRBQzcarBGsTyRNgcY0zcdl38U6t h1V1/gKBHll3QrkmysZrlZzAGzGUcwvucX4yoeePD9QZK/qcyyui+8DENi4YVTCRAvDzBlAMYjj 2DOPOxwo945ArjcHKHek+HzzCEH2rXHBaVNqeRNU5nxSv54jCBl4FmuKQJ6P7d+RCrHtc+wNB5S ji0+Nc2hUPOdxdfpgzXn+oro480a9IraKhG6GCxHla7Z2BP/qsIJewn0OPILmYZsxCHwWcA2qul d1sLglvp4FrjQLTwnZygcUMu7h8h/wjEo4SP/eB/j9S7rWRRQEdP7eVYGocNtbhQn+/MN7WCZpq XWuBLiNgttoy1zmoh+bPWohqMJRW72zEJmv3v4RQWM3tGfi00fmbGelus4WaHroBI6eTxqD1UyZ 1ISwx8yeXh5VIbfBVTgjJHojtfFMm3lwCk59v7ggEso/LyA1urisfi9kE1O3IzafKvFonu4yE= X-Google-Smtp-Source: AGHT+IHQFsWv2WZtyuikDXDSZcQC16eMKnf/MSqZRjYeCi+/xS7a8yMFYJt3MbTFP4GQ55NBuKaNJQ== X-Received: by 2002:a5d:5d11:0:b0:427:7ad:cdac with SMTP id ffacd0b85a97d-429bd682c6dmr534666f8f.20.1761846932711; Thu, 30 Oct 2025 10:55:32 -0700 (PDT) Received: from biju.lan (host86-162-200-138.range86-162.btcentralplus.com. [86.162.200.138]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429952de5f9sm33384041f8f.38.2025.10.30.10.55.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:55:32 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Greg Kroah-Hartman , Jiri Slaby Cc: Biju Das , Wolfram Sang , Lad Prabhakar , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 08/13] serial: sh-sci: Add sci_is_rsci_type() Date: Thu, 30 Oct 2025 17:55:12 +0000 Message-ID: <20251030175526.607006-9-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> References: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Add sci_is_rsci_type() for RSCI port type. This will simplify the code when the support added for RSCI_PORT_{SCI,SCIF} private PORT type. Signed-off-by: Biju Das --- v1->v2: * No change. --- drivers/tty/serial/sh-sci.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 6f396e1151d8..7cc2b622e270 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1008,6 +1008,11 @@ static int sci_handle_errors(struct uart_port *port) return copied; } =20 +static bool sci_is_rsci_type(u8 type) +{ + return (type =3D=3D SCI_PORT_RSCI || type =3D=3D RSCI_PORT_SCI || type = =3D=3D RSCI_PORT_SCIF); +} + static int sci_handle_fifo_overrun(struct uart_port *port) { struct tty_port *tport =3D &port->state->port; @@ -1016,7 +1021,7 @@ static int sci_handle_fifo_overrun(struct uart_port *= port) int copied =3D 0; u32 status; =20 - if (s->type !=3D SCI_PORT_RSCI) { + if (!sci_is_rsci_type(s->type)) { reg =3D sci_getreg(port, s->params->overrun_reg); if (!reg->size) return 0; @@ -1024,7 +1029,7 @@ static int sci_handle_fifo_overrun(struct uart_port *= port) =20 status =3D s->ops->read_reg(port, s->params->overrun_reg); if (status & s->params->overrun_mask) { - if (s->type =3D=3D SCI_PORT_RSCI) { + if (sci_is_rsci_type(s->type)) { s->ops->clear_SCxSR(port, s->params->param_bits->overrun_clr); } else { status &=3D ~s->params->overrun_mask; @@ -1837,7 +1842,7 @@ static irqreturn_t sci_tx_end_interrupt(int irq, void= *ptr) unsigned long flags; u32 ctrl; =20 - if (s->type !=3D PORT_SCI && s->type !=3D SCI_PORT_RSCI) + if (s->type !=3D PORT_SCI && !sci_is_rsci_type(s->type)) return sci_tx_interrupt(irq, ptr); =20 uart_port_lock_irqsave(port, &flags); @@ -3112,7 +3117,7 @@ static int sci_init_single(struct platform_device *de= v, * The fourth interrupt on SCI and RSCI port is transmit end interrupt, so * shuffle the interrupts. */ - if (p->type =3D=3D PORT_SCI || p->type =3D=3D SCI_PORT_RSCI) + if (p->type =3D=3D PORT_SCI || sci_is_rsci_type(p->type)) swap(sci_port->irqs[SCIx_BRI_IRQ], sci_port->irqs[SCIx_TEI_IRQ]); =20 /* The SCI generates several interrupts. They can be muxed together or --=20 2.43.0 From nobody Mon Feb 9 13:04:04 2026 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 4FB5436CDF7 for ; Thu, 30 Oct 2025 17:55:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846938; cv=none; b=gmsKUjGXNtRaDhbx6Sx0b7gAeVPXrrptFZtxkoEBrKO/Aoo+lDDmAcq7NkneiUMO29x02r2u5hjFT7eBA4kd0kBd+fRzKyGuyJl03SiPdpYw5icJeZrXjoFkOWypUFRlt162YJlS2HKSiqIX/NaNSDbYDkQlIbMz3YtcxjQNKwE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846938; c=relaxed/simple; bh=HUpnC1htM18fOjkA4XpHL5QRou+4yn4bYa0B4lXoOyg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S1ILu1TAl0dEVe+LPKAIVSzPNE4sBhL9zetuvvTZINYJIc0iCkJ9xWh/KiuoqXAjgJ5vlVi5zNCDIpoLIzSavElFmyN9w1PDSIoVqvP4xssZ/n2s1akpA069W5WH3CCbnxnRQ3uFSV4oO8Mzy13Cjdu7H75sEb4aP2+sNFu+xbU= 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=YjoMLTIx; arc=none smtp.client-ip=209.85.221.52 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="YjoMLTIx" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-429a0d1c31aso939278f8f.1 for ; Thu, 30 Oct 2025 10:55:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761846933; x=1762451733; 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=aEUFPuIhsavAXgb0AC7F4BVlpWod4yVZ6DEuITlOuu0=; b=YjoMLTIxKin+/GWOhbVfyK4bQIQ+l/X64jHnWln8KmJpjXDCtsz4i7rEMQN9xg+8yS knrX88QyPBfEoSuewqVkUUnXBHIOTeCUbE4Ysh7Fcm0wfEOCq0Tb311xPCsKoncOIaIR xKukIjZNbrqzV67CmJY3EDdf0oczljYrFSSnciPFL4GzuIYRKWaDLbvK7xvlAGCorbyz oUVcmnbb+HxdpS03aBz/wuBurylhXqskyR61bru6f7vp+I/VngyI4YXD/nhFTscrBIo9 hZaZk2Mc4jb8iy413u6YClfBowwAu5DZ19duY82DYsyuO4nmhmQ2bnYCgtZxkZ4CPrlp XN0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761846933; x=1762451733; 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=aEUFPuIhsavAXgb0AC7F4BVlpWod4yVZ6DEuITlOuu0=; b=QEgpqNen2BqTAV2K+ecpD6iISaX9VFPIKK8RUHjL7TuRZKouc+rRDqicJcYHS0v+uW xKbx6yPww4wYB3KFeAKa5hos5hwYj3zP39OLjz3cd60waBFcepj+cirYtd30xiAIhKrs +cE0GkBWecg6qiA+/CPuXj+CprURkjfSR7sHbF6QJSGfT8BMEYOjyXI06b5PCentXG+4 M0aP7y4ChmOOEnGN8up7i9nNOha4PsvoWTkdBE9aEyt0Ar4B6lVNVyy6kFrvGH4upui7 z5n9lKohiUsWvGfH9KXKm4Cz3CQbwLZIbjZ3bs1Yd6b/VV3af8VzvQaTjro6+sVrsVmk 214Q== X-Forwarded-Encrypted: i=1; AJvYcCXjPLstcpLiN1qw+MG9Pm0UdCC0lvXIwGoTbgVkJZZNhgI4DRvUytDyRuhX6wBrKYbhZN5n7hU1yZ+4NZ0=@vger.kernel.org X-Gm-Message-State: AOJu0YymMmleHb8mmbiyhs+XYbgpjQ6ncXtQ0sD9oG+q37oDmdEJMIf9 nWn90SAW8lz/zcPcX7I/5i2v0WjPKYpXWZjIk88/bfo4X57VVW6afV0X X-Gm-Gg: ASbGncvrfYAmP0Xa8xV+i/mcGYIeFEymd3/jcqavgQZ/IkfjQZFPALloodSAM4GQcBg dVjCxk7qZk2Zgd3eOu96eDx9tLHHp50X9Nhb5ywGD5ZPk4XBszYvL/SbhvA5kchMBHE0MF2BYOG Z/9MkYtD6W4vp57TMn2wpsn2yyjqJdnRc2v/vOzsvnHrh6eLckfhcNMIQfm0I0FxPI8mvm4sD6W n6ams8u8e+Um9MKhGLAZ/A6Z9xDj28WfAXGUo6tVKfq2bYb0gYjBU+lth9GTOa9pdvFIYBBVz7J e2612fYXRcaqc9OwR4h8VSkj1huwfuHdp/kJPwedyVbgj0DB5L957JgsBEVpLun75QSRON3ThDc uQjBJzzRaQ1/Xyp2ZTB2eowu0Ywsyy0EXh3VZ5gWIAe5Wm4mb3CjJPnHw3lsO1Afqhj3UGb6Zrm S4h/WPj0XcAz1dt5AHwprj3RrlIgC+XGv+mKtfx/82LAo81tPcRnWieMgiT+Ya X-Google-Smtp-Source: AGHT+IFlRpzCZJwVLyz4vd+bbM0VhDvQFIr7m66Xdde7XxC4dW/e2SY7oK12bgM2QVykMekDGxO43g== X-Received: by 2002:a05:6000:2308:b0:401:c55d:2d20 with SMTP id ffacd0b85a97d-429b4c8b48fmr3544505f8f.26.1761846933193; Thu, 30 Oct 2025 10:55:33 -0700 (PDT) Received: from biju.lan (host86-162-200-138.range86-162.btcentralplus.com. [86.162.200.138]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429952de5f9sm33384041f8f.38.2025.10.30.10.55.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:55:33 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Greg Kroah-Hartman , Jiri Slaby Cc: Biju Das , Wolfram Sang , Lad Prabhakar , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 09/13] serial: sh-sci: Add support for RZ/G3E RSCI clks Date: Thu, 30 Oct 2025 17:55:13 +0000 Message-ID: <20251030175526.607006-10-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> References: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das RZ/G3E RSCI has 6 clocks (5 module clocks + 1 external clock). Add support for the module clocks. Signed-off-by: Biju Das --- v1->v2: * Updated commit description. --- drivers/tty/serial/sh-sci-common.h | 3 +++ drivers/tty/serial/sh-sci.c | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/drivers/tty/serial/sh-sci-common.h b/drivers/tty/serial/sh-sci= -common.h index ef1d94ae8b5c..f730ff9add60 100644 --- a/drivers/tty/serial/sh-sci-common.h +++ b/drivers/tty/serial/sh-sci-common.h @@ -17,6 +17,9 @@ enum SCI_CLKS { SCI_SCK, /* Optional External Clock */ SCI_BRG_INT, /* Optional BRG Internal Clock Source */ SCI_SCIF_CLK, /* Optional BRG External Clock Source */ + SCI_FCK_DIV64, /* Optional Functional Clock frequency-divided by 64 */ + SCI_FCK_DIV16, /* Optional Functional Clock frequency-divided by 16 */ + SCI_FCK_DIV4, /* Optional Functional Clock frequency-divided by 4 */ SCI_NUM_CLKS }; =20 diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 7cc2b622e270..67eba7feea9f 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -2994,6 +2994,9 @@ static int sci_init_clocks(struct sci_port *sci_port,= struct device *dev) [SCI_SCK] =3D "sck", [SCI_BRG_INT] =3D "brg_int", [SCI_SCIF_CLK] =3D "scif_clk", + [SCI_FCK_DIV64] =3D "tclk_div64", + [SCI_FCK_DIV16] =3D "tclk_div16", + [SCI_FCK_DIV4] =3D "tclk_div4", }; struct clk *clk; unsigned int i; @@ -3003,6 +3006,9 @@ static int sci_init_clocks(struct sci_port *sci_port,= struct device *dev) } else if (sci_port->type =3D=3D SCI_PORT_RSCI) { clk_names[SCI_FCK] =3D "operation"; clk_names[SCI_BRG_INT] =3D "bus"; + } else if (sci_port->type =3D=3D RSCI_PORT_SCI || sci_port->type =3D=3D R= SCI_PORT_SCIF) { + clk_names[SCI_FCK] =3D "tclk"; + clk_names[SCI_BRG_INT] =3D "bus"; } =20 for (i =3D 0; i < SCI_NUM_CLKS; i++) { @@ -3016,6 +3022,12 @@ static int sci_init_clocks(struct sci_port *sci_port= , struct device *dev) (i =3D=3D SCI_FCK || i =3D=3D SCI_BRG_INT)) return dev_err_probe(dev, -ENODEV, "failed to get %s\n", name); =20 + if (!clk && (sci_port->type =3D=3D RSCI_PORT_SCI || + sci_port->type =3D=3D RSCI_PORT_SCIF) && + (i =3D=3D SCI_FCK || i =3D=3D SCI_BRG_INT || i =3D=3D SCI_FCK_DIV64 = || + i =3D=3D SCI_FCK_DIV16 || i =3D=3D SCI_FCK_DIV4)) + return dev_err_probe(dev, -ENODEV, "failed to get %s\n", name); + if (!clk && i =3D=3D SCI_FCK) { /* * Not all SH platforms declare a clock lookup entry --=20 2.43.0 From nobody Mon Feb 9 13:04:04 2026 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 8F2E136CE0B for ; Thu, 30 Oct 2025 17:55:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846939; cv=none; b=ZSDrerjsknPzRKiUY2fYsFTkD69Vww3Swz4hONj9K+IxCR0Rh5yHBM6XWZjyKRnsgJy7UHT7JmNLfJHz+Qt+y1GCdEpRiT4zwGTa1lSrilPz9KkDZjTnZTSxKJl0AgM5/FVUV7IQhBWMT8rGh/2OXOZpnNCHcMDFXUKHGnbSnDk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846939; c=relaxed/simple; bh=FUUpdN5VqPaa0AglNAM37NGlXaHlU8F1s0H5S0bhfxo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kX5AF79VJ0XGtjc2P+G5bfKsrSUAV0BWEo/kV4JoTFveMp7XPA0+AVsgZ2p9bIMPBjKGf78JV2HHIlbXrsmk06JWMHD7aHydzDnFaBjJ699C9Tf+TtscQApV54Ff/tu5Sh0d7W1K0f2MfWwAOVTa406Y3HCkXFbaSxvWTAkupzc= 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=VLeuDtXN; arc=none smtp.client-ip=209.85.221.52 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="VLeuDtXN" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-3ee15b5435bso1069212f8f.0 for ; Thu, 30 Oct 2025 10:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761846934; x=1762451734; 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=qx09GhYIQEqgtyHYb9x3QHdYCDiDGK8KkivjnJ7GUsM=; b=VLeuDtXN2KJFSg2RW2rvkZQMu13Rlp4GFEPNaVhqFtPZJv5CFNG+OYknmQOhhFDKyz 8mx0tYDWG2jdrt83B+JeRMCv+A8Q601logzyaGpMUfW/XFrrNm4TfZLLjjUQHoK2b1l4 YA0IiQWL4DaS6SmOgDo/nwP8i/t+1bGNsacIkF8y3OF1ZzT83AysrcEHfn5vWvT6B4nX rlSBFyda8jBKk5bRqDJ/Cjzbq2rNK1/ruwr/T1GnRJAeTxX2KX8c5jG0Pg8GAaePiqm4 UrZaCSFL53wYn06Z30kKFtWuI2iZTxv1saN8emR/hk9wsAoedb+gxm2chfbKgGsxX2jb lIIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761846934; x=1762451734; 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=qx09GhYIQEqgtyHYb9x3QHdYCDiDGK8KkivjnJ7GUsM=; b=k2KnkprG3p32zftDdFwpO1xE9/QdJce2p9rDWpWijbTHZKZMdoAGCrhAk0OUSnF+cb vnDCDsBBpDI2mVZw7lJUGJq0MbQv0AtFX7VAp0EtfsdL8weZrPt+AUsUsXQylPTnHSNH GrFSLAi2aemr5mC6U+sn0n/gTx+jVmGkVhAbw+8B9/wdCXbrADVEGnIwX0GzPuLTC6EC 2vWO9DHnnA3AGXT1cSvN3APi+Z4uJmAxHDYyb+mCJcINrSWKG35QbIneSRpUhjz4isfT DybiIlHyBwex7Tso6qnNKaRAn5dGEjmsDiiY9OfOYJGKG3GTqfNUNALRBjZ1HmJBjQiY rnjA== X-Forwarded-Encrypted: i=1; AJvYcCWxeqqiPBdHb9maLzgDchoFJdzl63KgPM5nUunXA9HOLYfpNDAymTRzcUh+2+kLKyKSosKWs9sNbJ1puyU=@vger.kernel.org X-Gm-Message-State: AOJu0YyBAQh7Tv4KhoJsQFMLZr93cX7PRIu8ZU7w1tjiv4cXcfl6wzF1 lv5KopJhqC3iBw9r+mPifpx2fvXTRbVLsyfumo6NgpAGgHnfe+guB+il X-Gm-Gg: ASbGnctykdmQeAzB09scsuK8gbV1chxtRekdneWk/ozbvcefvDbBDxtu0DPSNk7vqpn 9zbYhmTb9S+RVF72cOWHxTqNT5ubbQ7iuRbpJhZQwgB9uKheuAGmRsHLay4bGzvQ1C7LXjrE7pD 9AjC22nyqPYDWAUFw3+Ld2i5X4SeY5aIKBCw8s+y3Dd61gMpenkhMx3ODvlzSFSJ/K5xMljgqlf YJvl6evp6uP4In0Q6rODYaAoNjfTq756GzhHe1u3cL8n1RVoUBmYbrdsbIi132xeu7BvR3agSqn 10Y4NMZdnUNj8R1XF3TMRIyQXC5CJaJFRTXG1kCr58ed0Vc6RSxsHGCYArOq4xM0+2bzcToyGWT doUt6yNYZ1YwI3Z7yYtqOB07cP7nClEPpidb3NnEq7kaspQR+2tyzyf3WvfG7rzv0Q9U6TuofkL pvfYzYk1IvmIYX5/OQ58HKfdprmRZnOvbs3/tyW9M3pJjxxmFbBHrdcdf2lKXH X-Google-Smtp-Source: AGHT+IE2wGBv6w4TzgH/dIqRMjz4ljrVN4/hTLrQ5+0NZaeomnqoztVj/d+T+noqIPl5lxRmm33nkQ== X-Received: by 2002:a5d:5f55:0:b0:429:bc31:5de6 with SMTP id ffacd0b85a97d-429bd671ed0mr446668f8f.12.1761846933645; Thu, 30 Oct 2025 10:55:33 -0700 (PDT) Received: from biju.lan (host86-162-200-138.range86-162.btcentralplus.com. [86.162.200.138]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429952de5f9sm33384041f8f.38.2025.10.30.10.55.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:55:33 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Greg Kroah-Hartman , Jiri Slaby Cc: Biju Das , Wolfram Sang , Lad Prabhakar , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 10/13] serial: sh-sci: Make sci_scbrr_calc() public Date: Thu, 30 Oct 2025 17:55:14 +0000 Message-ID: <20251030175526.607006-11-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> References: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Make the function sci_scbrr_calc() public for code reuse to support RZ/G3E RSCI IP. Signed-off-by: Biju Das --- v1->v2: * No change. --- drivers/tty/serial/sh-sci-common.h | 3 +++ drivers/tty/serial/sh-sci.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/sh-sci-common.h b/drivers/tty/serial/sh-sci= -common.h index f730ff9add60..a3f4a76cdecb 100644 --- a/drivers/tty/serial/sh-sci-common.h +++ b/drivers/tty/serial/sh-sci-common.h @@ -171,6 +171,9 @@ void sci_port_enable(struct sci_port *sci_port); int sci_startup(struct uart_port *port); void sci_shutdown(struct uart_port *port); =20 +int sci_scbrr_calc(struct sci_port *s, unsigned int bps, unsigned int *brr, + unsigned int *srr, unsigned int *cks); + #define min_sr(_port) ffs((_port)->sampling_rate_mask) #define max_sr(_port) fls((_port)->sampling_rate_mask) =20 diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 67eba7feea9f..ca4915c1e2e6 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -2395,9 +2395,8 @@ static int sci_brg_calc(struct sci_port *s, unsigned = int bps, } =20 /* calculate sample rate, BRR, and clock select */ -static int sci_scbrr_calc(struct sci_port *s, unsigned int bps, - unsigned int *brr, unsigned int *srr, - unsigned int *cks) +int sci_scbrr_calc(struct sci_port *s, unsigned int bps, unsigned int *brr, + unsigned int *srr, unsigned int *cks) { unsigned long freq =3D s->clk_rates[SCI_FCK]; unsigned int sr, br, prediv, scrate, c; @@ -2461,6 +2460,7 @@ static int sci_scbrr_calc(struct sci_port *s, unsigne= d int bps, min_err, *brr, *srr + 1, *cks); return min_err; } +EXPORT_SYMBOL_NS_GPL(sci_scbrr_calc, "SH_SCI"); =20 static void sci_reset(struct uart_port *port) { --=20 2.43.0 From nobody Mon Feb 9 13:04:04 2026 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 8A54936CA99 for ; Thu, 30 Oct 2025 17:55:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846940; cv=none; b=gGVj7azeANziyzMIJHnkWMWrrouGJJJq2VSLJmPEfTfYtr2yXkQ/U1TMDxkoho7+ksuu/3ARKQa1E1of3KX23ymtPwotvkHd42nBmNKmns9zRy1CU+ZmMdgperdlNsyp8jzrg7Lvor71zcXz8nTyEBIqNWU7KLdk0dTJtbpRypk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846940; c=relaxed/simple; bh=ZVr695PrkjlsTLaO5UZFDg6DGUr1VgaEBsWlk7XU+bM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uPtjgjwRcvigL6fpN5lUE3UB8bgnISKGSUnc2uRhj/qIcqlRjHWXB7Bi35YC8aq6lyy5dxsVi98/3XVno+jy9I6+fnFRJvNu7gOxjD7ZaunXfMipNdk/G6HCnizdCYnHG2c0MtDs55FH+fBKNCARpfPGGGmOZy+BopWnTn3pynQ= 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=Swqnbqey; arc=none smtp.client-ip=209.85.221.53 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="Swqnbqey" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-421851bca51so1210680f8f.1 for ; Thu, 30 Oct 2025 10:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761846934; x=1762451734; 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=MfbjD1RYHWgoO0jG0DLqriHMmFx1f2scKAXhmIYvONA=; b=Swqnbqey01kzoa1XCsgBJ96Ik0fRiuVDcnRfuMz8alz7WDm54NY3dzBwjkElt0srJI /HLCcmFPd3QN5j4M/BLm1ABFjPqtpAQcMW0LweGKjOTbsQXHgGbxEkcVmJIRN8CEp+LH QELc3ux58kIV0x//taAH9Ycmll+cuMKGkuFQXaIg+QLzIvaj8JRaWF/8yIl8Ez1GWEV3 wO5i566uyZMpYYh4JcYUtxZ/CK8Z5G2tIyBbyaTcV/OV7JsrojxWrsFTngbgtjVspjWZ 1ErfRY/pSOvrcVVPbKlLIhoKK12Apf4ENW9VhxguusPVyrZxfj3+3upqYVY2hxh4rHqM G4eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761846934; x=1762451734; 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=MfbjD1RYHWgoO0jG0DLqriHMmFx1f2scKAXhmIYvONA=; b=qQGtNFrfSxgxg8Nso6ALyZ7knHfdQcBniVGjyhWFnB5x9zlfJDbkDvLE45VUbVRPjv G9O8O5Gog7FE2ewyQXxuddyS4NJuCojRiNj+GqSD8gUWkPjqrs53B3SLY3D2N6hU1el1 i2Lu7Sv5oWCCedZJcNphkXDkoYbDFlp/mB1vszDbHsj7O0LghP5jWL2GOhsqXNSfyqHn BqZ9avPPrpkaBKWGCxlfdLZswsMJ7xhpyfZh4oFjA+XpwRuu4Vhhh5Ve27tlhLNAJZgz i47sYdI1YYdyK2AJ2Yccq3bqoVt7Yed22jn+gS0pGeBPMJql78/w6UvBn0zoCvLB0Pwn P/Fw== X-Forwarded-Encrypted: i=1; AJvYcCWkNnT5ssNYJmuPdeOEj2eeKjZmm/okjPk59bU1flysbX4OmRDLeD2tG7BoWgXTV7387No32iLko61Q4tw=@vger.kernel.org X-Gm-Message-State: AOJu0YzbVbDF6WzLIb6EdpoELKAQjoXTuHEodweeoc8YbpBtPJPJ1sXw og0BC62DVZN/wF4+yViDl/0x2nQV59S3+B3HZorA+Qj2U+YGf4MO1JKL X-Gm-Gg: ASbGncvcyMe8tRE1H1z1XzvSYoyeUwjs6ug7ZnBnLWXv1qvP9+85TTfYG85I3q13xeF luKJeNmbJcSOnlRrzq+2ZPJ8wYKQOV8X8ZGa6QdguYBrTcI6SuygndaCNZTsxybZx3pmP3mRwu/ isa/APtScoErlSBbuZENlCwGNqP6pNae0pbZVsty/0lxgFohsdh9GfiODqkX4rPweVjYildldQy wTe2MAyxGgBoZksALmV++O+Rn8ERR6kIc7nPi8Unhwd/czpqlchaw92VXi8xCw6yTTtAe8y0OS/ fpnx+dwt0lijMCD3GmkGnc6/UhXmEm6w4M21TBfq4SV65OK9KbrGdTFHof7zvpilYeGAQ37wZ6a DZkwaFHmhcjnmTu5j429oUDlv6SXTcE+PBwl2Rvs7D8QJV74YTKZxHlSMJnxMqBhNyfx+xrkFbJ EU63/Mg1fd1BcNgFkVhV2FSTSB3JxEmPzJdG9sJSgoPyBt50s8okLV6AR+Cci3eTkcSS7ohGsZw JoMC+nARQ== X-Google-Smtp-Source: AGHT+IE3z5lAmhGoh5d4Yy4K8o1VX+Hl6Sh/SAktovTtRK5y2To4h3DqtSkPbGR9LE39NISIviPJxA== X-Received: by 2002:a05:6000:2207:b0:429:7693:884f with SMTP id ffacd0b85a97d-429bd6725bbmr488929f8f.5.1761846934316; Thu, 30 Oct 2025 10:55:34 -0700 (PDT) Received: from biju.lan (host86-162-200-138.range86-162.btcentralplus.com. [86.162.200.138]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429952de5f9sm33384041f8f.38.2025.10.30.10.55.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:55:34 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Greg Kroah-Hartman , Jiri Slaby Cc: Biju Das , Wolfram Sang , Lad Prabhakar , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 11/13] serial: sh-sci: Add finish_console_write() callback Date: Thu, 30 Oct 2025 17:55:15 +0000 Message-ID: <20251030175526.607006-12-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> References: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Add finish_console_write() callback as RZ/G3E RSCI IP needs special handling compared to other SoCs. Signed-off-by: Biju Das --- v1->v2: * No change. --- drivers/tty/serial/sh-sci-common.h | 1 + drivers/tty/serial/sh-sci.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/sh-sci-common.h b/drivers/tty/serial/sh-sci= -common.h index a3f4a76cdecb..2e97aad390d9 100644 --- a/drivers/tty/serial/sh-sci-common.h +++ b/drivers/tty/serial/sh-sci-common.h @@ -95,6 +95,7 @@ struct sci_port_ops { void (*shutdown_complete)(struct uart_port *port); =20 void (*prepare_console_write)(struct uart_port *port, u32 ctrl); + void (*finish_console_write)(struct uart_port *port, u32 ctrl); void (*console_save)(struct uart_port *port); void (*console_restore)(struct uart_port *port); size_t (*suspend_regs_size)(void); diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index ca4915c1e2e6..fac83dace27c 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -3259,7 +3259,10 @@ static void serial_console_write(struct console *co,= const char *s, cpu_relax(); =20 /* restore the SCSCR */ - sci_port->ops->write_reg(port, regs->control, ctrl); + if (sci_port->ops->finish_console_write) + sci_port->ops->finish_console_write(port, ctrl); + else + sci_port->ops->write_reg(port, regs->control, ctrl); =20 if (locked) uart_port_unlock_irqrestore(port, flags); --=20 2.43.0 From nobody Mon Feb 9 13:04:04 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 9315036E341 for ; Thu, 30 Oct 2025 17:55:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846942; cv=none; b=n//MYx97s1pWkJk/xIX1fQQGDPDNvHUvJiOsK/0Wk07J/GEpEmfhx6Gr2QgiD8w4WfH6/zakHRwCz1kCwYDQbs/PGY9yXIaiPQRsfZ3vxqpa0nNNeGnx/3rsDdbdvKt6rCTMTidf6rSEW2k0BPkbNCrwyqIgyiZx33WeuNpDBr8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846942; c=relaxed/simple; bh=HxHvhoN6WLI2e6cUh87N9UQ5gXQc56q7zIhiyZRxEVM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r2rHBcmFvWu5L7tzvUCEN6N405YiGkFVOH5oV99qGeEHZmAi8Y/gDNR/ThpqdhwH4ZwLzKU+vO13o+qKDqhYtVXEM4u1vuFnH0k3hQhwP3YfWkDGX7GGGvzln5lXGVsy1CS9QUlNq6l0wZB+CE8wiKLm5NH+Sl5UsJdtrmz0pqc= 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=NKYvUPc0; arc=none smtp.client-ip=209.85.128.53 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="NKYvUPc0" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-471b80b994bso17391475e9.3 for ; Thu, 30 Oct 2025 10:55:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761846935; x=1762451735; 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=12vawuhA5hn/B4rj402RgiwkldKOu83rfuQdTW3rcow=; b=NKYvUPc0t93nzIhnntvoezK32VWki6+Rd1fsnbWWYeLms0fy24awZlos3K8RHU2X8E CNS+cqWXrAyr+xMuygdwnB81lNFGdwnhZUUDjaXU9t6YCSwYNKOINPtPbsgKr4PnT40i Y9EK7z110dmbgELzGsHJcr3/4qYaD8lvCjWYKVFF4MtlCZ+yHJ9pyccClRk8d5cuj71y hxomKBLiT2CIB+4bJpKWtpYTlkPBEr7ZhLYDtSb2GDaLXLaWDPaVc/Kt4V4u5fjXCvpR zXrPVt1nuAxLoYKhtnaDxi6CUo81EkVy6E9H8wKiA1ORaO4qLm4Us8wLlnm58FLSyPLq JApw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761846935; x=1762451735; 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=12vawuhA5hn/B4rj402RgiwkldKOu83rfuQdTW3rcow=; b=iSYqxB/0nCgw11s12Dz/nJigJ2vaCW2CE6ldWA3Av0gF1B/81W7wblj60+c0UAdgbd 5pIKgYITgHZkRDW6lgbYIz+3hcPzoZVcj/fabuMBiYrAqjbtiqy/8vgMRPPvGrfINIEc rhBMZdMXexS4Dv6HJP+I6CQvnnaqq6sDzrKASqjcBgUlKNR37vlqkSVjLgsqEccgA2Bz hrjzAyKTPqcp9VqI1cxCdXryHzeXecSl49Djpuxdr83ZPpGPTnnQK3Bgdt4LqobW9cpX /fCx9EAn6rJN5a7ywBDz6XvwmXQvYG3Knuja1gA2wMmkw3dG8XY5aNQYL0SgG5HSH9dR gxVA== X-Forwarded-Encrypted: i=1; AJvYcCUzHUs5ofUQE0diSBpNIazO4QvqPk6yBBu51RehDWQhq0fRv8gluAeRIe5vzMHh0+r+INeB0DRc456vWKs=@vger.kernel.org X-Gm-Message-State: AOJu0YzTF0EI2uaFwDDP5dXiTGuTHEkva6NnfKQqKj8H/uWlcbXvPL6p xlq4+nUqCGoGKUdbXWRsrlii//YJhMqgG9AMGTUZ3eGOcssiOaoQhFLE X-Gm-Gg: ASbGncvO8EWghcKsqhj7wKxCYEqlTu0kvrG5dDYSzgjbE0pVOjyxEMrvaxAuwHMcC5B wo7gV9D2aVULX23A3MR23dycSefBAGRU/KEWVHvcu7SP8Lg8WRPmRadnBmglGL7SGV22bCzQ42m 3DyA2VOmwWV1KB2PonVb2gw7zxAqWWDoztVGWqexwZCbZU2uIrbyXo4As+aindU03l6t2vYRnKE YLkhOZSixHKsyagNKoTUWljV5Ll9Lc+mvJXEX/FjC1Zy6oVM0NsIkYPCOr+5ev3cCLjNO+kenvH EPrHqD7yjg0T5W/t9XHtDLamNAFbC2BjEiB3VAHaF6fqYnNi5uPT6yHzTzafLtUcZs2V5Xnu97g +Y817QANWgBTbN4GRpWNMeF0z65J13HTM7FVF5K9hvH++oCRU+wyUfkntjRXf8M9fq/9bAu0jZk T/qKo035lhFMBH7BFr9l2H8KXLrmnB96mQ48SKIxB2THG6RwpPHrC/tHIR6oSv X-Google-Smtp-Source: AGHT+IEyOgy/dUi6fhAGFix3AzR2Ni+7vm6LFcFMhE3t5javD+YFB8bIhGDmyUkpso8pT++ef6rjjA== X-Received: by 2002:a05:6000:2385:b0:426:fd06:6b98 with SMTP id ffacd0b85a97d-429bd6816bdmr500007f8f.14.1761846934790; Thu, 30 Oct 2025 10:55:34 -0700 (PDT) Received: from biju.lan (host86-162-200-138.range86-162.btcentralplus.com. [86.162.200.138]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429952de5f9sm33384041f8f.38.2025.10.30.10.55.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:55:34 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Greg Kroah-Hartman , Jiri Slaby Cc: Biju Das , Wolfram Sang , Lad Prabhakar , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 12/13] serial: sh-sci: Add support for RZ/G3E RSCI SCIF Date: Thu, 30 Oct 2025 17:55:16 +0000 Message-ID: <20251030175526.607006-13-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> References: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Add support for RZ/G3E RSCI SCIF(a.k.a FIFO mode). RSCI IP found on the RZ/G3E SoC is similar to RZ/T2H, but it has a 32-stage FIFO. it has 6 clocks(5 module clocks + 1 external clock) instead of 3 clocks(2 module clocks + 1 external clock) on T2H and has multiple resets. Add support for the hardware flow control. Signed-off-by: Biju Das --- v1->v2: * Updated commit description. * Updated multiline comment to fit into single line. * Updated set_termios() for getting baud_rate() --- drivers/tty/serial/rsci.c | 282 ++++++++++++++++++++++++++++++++++-- drivers/tty/serial/rsci.h | 1 + drivers/tty/serial/sh-sci.c | 9 +- 3 files changed, 281 insertions(+), 11 deletions(-) diff --git a/drivers/tty/serial/rsci.c b/drivers/tty/serial/rsci.c index ade5ee479e99..a3e216c05b76 100644 --- a/drivers/tty/serial/rsci.c +++ b/drivers/tty/serial/rsci.c @@ -11,6 +11,8 @@ #include #include #include + +#include "serial_mctrl_gpio.h" #include "rsci.h" =20 MODULE_IMPORT_NS("SH_SCI"); @@ -59,6 +61,41 @@ MODULE_IMPORT_NS("SH_SCI"); #define CCR1_CTSPEN BIT(1) /* CTS External Pin Enable */ #define CCR1_CTSE BIT(0) /* CTS Enable */ =20 +/* CCR2 (Common Control Register 2) */ +#define CCR2_INIT 0xFF000004 +#define CCR2_CKS_TCLK (0) /* TCLK clock */ +#define CCR2_CKS_TCLK_DIV4 BIT(20) /* TCLK/4 clock */ +#define CCR2_CKS_TCLK_DIV16 BIT(21) /* TCLK16 clock */ +#define CCR2_CKS_TCLK_DIV64 (BIT(21) | BIT(20)) /* TCLK/64 clock */ +#define CCR2_BRME BIT(16) /* Bitrate Modulation Enable */ +#define CCR2_ABCSE BIT(6) /* Asynchronous Mode Extended Base Clock Selec= t */ +#define CCR2_ABCS BIT(5) /* Asynchronous Mode Base Clock Select */ +#define CCR2_BGDM BIT(4) /* Baud Rate Generator Double-Speed Mode Select= */ + +/* CCR3 (Common Control Register 3) */ +#define CCR3_INIT 0x1203 +#define CCR3_BLK BIT(29) /* Block Transfer Mode */ +#define CCR3_GM BIT(28) /* GSM Mode */ +#define CCR3_CKE1 BIT(25) /* Clock Enable 1 */ +#define CCR3_CKE0 BIT(24) /* Clock Enable 0 */ +#define CCR3_DEN BIT(21) /* Driver Enabled */ +#define CCR3_FM BIT(20) /* FIFO Mode Select */ +#define CCR3_MP BIT(19) /* Multi-Processor Mode */ +#define CCR3_MOD_ASYNC 0 /* Asynchronous mode (Multi-processor mode) */ +#define CCR3_MOD_IRDA BIT(16) /* Smart card interface mode */ +#define CCR3_MOD_CLK_SYNC BIT(17) /* Clock synchronous mode */ +#define CCR3_MOD_SPI (BIT(17) | BIT(16)) /* Simple SPI mode */ +#define CCR3_MOD_I2C BIT(18) /* Simple I2C mode */ +#define CCR3_RXDESEL BIT(15) /* Asynchronous Start Bit Edge Detection Se= lect */ +#define CCR3_STP BIT(14) /* Stop bit Length */ +#define CCR3_SINV BIT(13) /* Transmitted/Received Data Invert */ +#define CCR3_LSBF BIT(12) /* LSB First select */ +#define CCR3_CHR1 BIT(9) /* Character Length */ +#define CCR3_CHR0 BIT(8) /* Character Length */ +#define CCR3_BPEN BIT(7) /* Synchronizer Bypass Enable */ +#define CCR3_CPOL BIT(1) /* Clock Polarity Select */ +#define CCR3_CPHA BIT(0) /* Clock Phase Select */ + /* FCR (FIFO Control Register) */ #define FCR_RFRST BIT(23) /* Receive FIFO Data Register Reset */ #define FCR_TFRST BIT(15) /* Transmit FIFO Data Register Reset */ @@ -142,21 +179,160 @@ static void rsci_start_rx(struct uart_port *port) rsci_serial_out(port, CCR0, ctrl); } =20 +static void rsci_enable_ms(struct uart_port *port) +{ + mctrl_gpio_enable_ms(to_sci_port(port)->gpios); +} + +static void rsci_init_pins(struct uart_port *port, unsigned int cflag) +{ + struct sci_port *s =3D to_sci_port(port); + + /* Use port-specific handler if provided */ + if (s->cfg->ops && s->cfg->ops->init_pins) { + s->cfg->ops->init_pins(port, cflag); + return; + } + + if (!s->has_rtscts) + return; + + if (s->autorts) + rsci_serial_out(port, CCR1, rsci_serial_in(port, CCR1) | + CCR1_CTSE | CCR1_CTSPEN); +} + +static int rsci_scif_set_rtrg(struct uart_port *port, int rx_trig) +{ + unsigned int bits; + + if (rx_trig >=3D port->fifosize) + rx_trig =3D port->fifosize - 1; + else if (rx_trig < 1) + rx_trig =3D 1; + + bits =3D rx_trig << 16; + rsci_serial_out(port, FCR, (rsci_serial_in(port, FCR) & ~FCR_RTRG4_0) | b= its); + + return rx_trig; +} + static void rsci_set_termios(struct uart_port *port, struct ktermios *term= ios, const struct ktermios *old) { + unsigned int ccr2_val =3D CCR2_INIT, ccr3_val =3D CCR3_INIT; + unsigned int ccr0_val =3D 0, ccr1_val =3D 0, ccr4_val =3D 0; + unsigned int brr1 =3D 255, cks1 =3D 0, srr1 =3D 15; struct sci_port *s =3D to_sci_port(port); + unsigned int brr =3D 255, cks =3D 0; + int min_err =3D INT_MAX, err; + unsigned long max_freq =3D 0; + unsigned int baud, i; unsigned long flags; + unsigned int ctrl; + int best_clk =3D -1; + + if ((termios->c_cflag & CSIZE) =3D=3D CS7) { + ccr3_val |=3D CCR3_CHR0; + } else { + termios->c_cflag &=3D ~CSIZE; + termios->c_cflag |=3D CS8; + } + + if (termios->c_cflag & PARENB) + ccr1_val |=3D CCR1_PE; + + if (termios->c_cflag & PARODD) + ccr1_val |=3D (CCR1_PE | CCR1_PM); + + if (termios->c_cflag & CSTOPB) + ccr3_val |=3D CCR3_STP; + + /* Enable noise filter function */ + ccr1_val |=3D CCR1_NFEN; + + /* + * earlyprintk comes here early on with port->uartclk set to zero. + * the clock framework is not up and running at this point so here + * we assume that 115200 is the maximum baud rate. please note that + * the baud rate is not programmed during earlyprintk - it is assumed + * that the previous boot loader has enabled required clocks and + * setup the baud rate generator hardware for us already. + */ + if (!port->uartclk) { + max_freq =3D 115200; + } else { + for (i =3D 0; i < SCI_NUM_CLKS; i++) + max_freq =3D max(max_freq, s->clk_rates[i]); + + max_freq /=3D min_sr(s); + } + + baud =3D uart_get_baud_rate(port, termios, old, 0, max_freq); + if (!baud) + goto done; + + /* Divided Functional Clock using standard Bit Rate Register */ + err =3D sci_scbrr_calc(s, baud, &brr1, &srr1, &cks1); + if (abs(err) < abs(min_err)) { + best_clk =3D SCI_FCK; + ccr0_val =3D 0; + min_err =3D err; + brr =3D brr1; + cks =3D cks1; + } + +done: + if (best_clk >=3D 0) + dev_dbg(port->dev, "Using clk %pC for %u%+d bps\n", + s->clks[best_clk], baud, min_err); =20 sci_port_enable(s); uart_port_lock_irqsave(port, &flags); =20 - /* For now, only RX enabling is supported */ - if (termios->c_cflag & CREAD) + uart_update_timeout(port, termios->c_cflag, baud); + + rsci_serial_out(port, CCR0, ccr0_val); + + ccr3_val |=3D CCR3_FM; + rsci_serial_out(port, CCR3, ccr3_val); + + ccr2_val |=3D (cks << 20) | (brr << 8); + rsci_serial_out(port, CCR2, ccr2_val); + + rsci_serial_out(port, CCR1, ccr1_val); + rsci_serial_out(port, CCR4, ccr4_val); + + ctrl =3D rsci_serial_in(port, FCR); + ctrl |=3D (FCR_RFRST | FCR_TFRST); + rsci_serial_out(port, FCR, ctrl); + + if (s->rx_trigger > 1) + rsci_scif_set_rtrg(port, s->rx_trigger); + + port->status &=3D ~UPSTAT_AUTOCTS; + s->autorts =3D false; + + if ((port->flags & UPF_HARD_FLOW) && (termios->c_cflag & CRTSCTS)) { + port->status |=3D UPSTAT_AUTOCTS; + s->autorts =3D true; + } + + rsci_init_pins(port, termios->c_cflag); + rsci_serial_out(port, CFCLR, CFCLR_CLRFLAG); + rsci_serial_out(port, FFCLR, FFCLR_DRC); + + ccr0_val |=3D CCR0_RE; + rsci_serial_out(port, CCR0, ccr0_val); + + if ((termios->c_cflag & CREAD) !=3D 0) rsci_start_rx(port); =20 uart_port_unlock_irqrestore(port, flags); sci_port_disable(s); + + if (UART_ENABLE_MS(port, termios->c_cflag)) + rsci_enable_ms(port); } =20 static int rsci_txfill(struct uart_port *port) @@ -181,13 +357,34 @@ static unsigned int rsci_tx_empty(struct uart_port *p= ort) =20 static void rsci_set_mctrl(struct uart_port *port, unsigned int mctrl) { - /* Not supported yet */ + if (mctrl & TIOCM_LOOP) { + /* Standard loopback mode */ + rsci_serial_out(port, CCR1, rsci_serial_in(port, CCR1) | CCR1_SPLP); + } } =20 static unsigned int rsci_get_mctrl(struct uart_port *port) { - /* Not supported yet */ - return 0; + struct sci_port *s =3D to_sci_port(port); + struct mctrl_gpios *gpios =3D s->gpios; + unsigned int mctrl =3D 0; + + mctrl_gpio_get(gpios, &mctrl); + + /* + * CTS/RTS is handled in hardware when supported, while nothing + * else is wired up. + */ + if (!mctrl_gpio_to_gpiod(gpios, UART_GPIO_CTS)) + mctrl |=3D TIOCM_CTS; + + if (!mctrl_gpio_to_gpiod(gpios, UART_GPIO_DSR)) + mctrl |=3D TIOCM_DSR; + + if (!mctrl_gpio_to_gpiod(gpios, UART_GPIO_DCD)) + mctrl |=3D TIOCM_CAR; + + return mctrl; } =20 static void rsci_start_tx(struct uart_port *port) @@ -312,7 +509,8 @@ static void rsci_receive_chars(struct uart_port *port) continue; } =20 - /* Store data and status. + /* + * Store data and status. * Non FIFO mode is not supported */ if (rdat & RDR_FFER) { @@ -346,6 +544,28 @@ static void rsci_receive_chars(struct uart_port *port) } } =20 +static void rsci_break_ctl(struct uart_port *port, int break_state) +{ + unsigned short ccr0_val, ccr1_val; + unsigned long flags; + + uart_port_lock_irqsave(port, &flags); + ccr1_val =3D rsci_serial_in(port, CCR1); + ccr0_val =3D rsci_serial_in(port, CCR0); + + if (break_state =3D=3D -1) { + ccr1_val =3D (ccr1_val | CCR1_SPB2IO) & ~CCR1_SPB2DT; + ccr0_val &=3D ~CCR0_TE; + } else { + ccr1_val =3D (ccr1_val | CCR1_SPB2DT) & ~CCR1_SPB2IO; + ccr0_val |=3D CCR0_TE; + } + + rsci_serial_out(port, CCR1, ccr1_val); + rsci_serial_out(port, CCR0, ccr0_val); + uart_port_unlock_irqrestore(port, flags); +} + static void rsci_poll_put_char(struct uart_port *port, unsigned char c) { u32 status; @@ -367,14 +587,30 @@ static void rsci_poll_put_char(struct uart_port *port= , unsigned char c) static void rsci_prepare_console_write(struct uart_port *port, u32 ctrl) { struct sci_port *s =3D to_sci_port(port); - u32 ctrl_temp =3D - s->params->param_bits->rxtx_enable | CCR0_TIE | - s->hscif_tot; + u32 ctrl_temp =3D s->params->param_bits->rxtx_enable; + + if (s->type =3D=3D SCI_PORT_RSCI) + ctrl_temp |=3D CCR0_TIE | s->hscif_tot; + rsci_serial_out(port, CCR0, ctrl_temp); } =20 +static void rsci_finish_console_write(struct uart_port *port, u32 ctrl) +{ + rsci_serial_out(port, CCR0, ctrl & ~CCR0_TE); + cpu_relax(); + rsci_serial_out(port, CCR0, ctrl); +} + static const char *rsci_type(struct uart_port *port) { + struct sci_port *s =3D to_sci_port(port); + + switch (s->type) { + case RSCI_PORT_SCIF: + return "scif"; + } + return "rsci"; } =20 @@ -414,6 +650,17 @@ static const struct sci_port_params rsci_port_params = =3D { .common_regs =3D &rsci_common_regs, }; =20 +static const struct sci_port_params rsci_rzg3e_scif_port_params =3D { + .fifosize =3D 32, + .overrun_reg =3D CSR, + .overrun_mask =3D CSR_ORER, + .sampling_rate_mask =3D SCI_SR(32), + .error_mask =3D RSCI_DEFAULT_ERROR_MASK, + .error_clear =3D RSCI_ERROR_CLEAR, + .param_bits =3D &rsci_port_param_bits, + .common_regs =3D &rsci_common_regs, +}; + static const struct uart_ops rsci_uart_ops =3D { .tx_empty =3D rsci_tx_empty, .set_mctrl =3D rsci_set_mctrl, @@ -421,6 +668,8 @@ static const struct uart_ops rsci_uart_ops =3D { .start_tx =3D rsci_start_tx, .stop_tx =3D rsci_stop_tx, .stop_rx =3D rsci_stop_rx, + .enable_ms =3D rsci_enable_ms, + .break_ctl =3D rsci_break_ctl, .startup =3D sci_startup, .shutdown =3D sci_shutdown, .set_termios =3D rsci_set_termios, @@ -440,6 +689,7 @@ static const struct sci_port_ops rsci_port_ops =3D { .receive_chars =3D rsci_receive_chars, .poll_put_char =3D rsci_poll_put_char, .prepare_console_write =3D rsci_prepare_console_write, + .finish_console_write =3D rsci_finish_console_write, .suspend_regs_size =3D rsci_suspend_regs_size, .shutdown_complete =3D rsci_shutdown_complete, }; @@ -451,6 +701,13 @@ struct sci_of_data of_sci_rsci_data =3D { .params =3D &rsci_port_params, }; =20 +struct sci_of_data of_rsci_scif_data =3D { + .type =3D RSCI_PORT_SCIF, + .ops =3D &rsci_port_ops, + .uart_ops =3D &rsci_uart_ops, + .params =3D &rsci_rzg3e_scif_port_params, +}; + #ifdef CONFIG_SERIAL_SH_SCI_EARLYCON =20 static int __init rsci_early_console_setup(struct earlycon_device *device, @@ -459,6 +716,13 @@ static int __init rsci_early_console_setup(struct earl= ycon_device *device, return scix_early_console_setup(device, &of_sci_rsci_data); } =20 +static int __init rsci_rzg3e_scif_early_console_setup(struct earlycon_devi= ce *device, + const char *opt) +{ + return scix_early_console_setup(device, &of_rsci_scif_data); +} + +OF_EARLYCON_DECLARE(rsci, "renesas,r9a09g047-rscif", rsci_rzg3e_scif_early= _console_setup); OF_EARLYCON_DECLARE(rsci, "renesas,r9a09g077-rsci", rsci_early_console_set= up); =20 #endif /* CONFIG_SERIAL_SH_SCI_EARLYCON */ diff --git a/drivers/tty/serial/rsci.h b/drivers/tty/serial/rsci.h index 2af3f28b465a..ba255f58c088 100644 --- a/drivers/tty/serial/rsci.h +++ b/drivers/tty/serial/rsci.h @@ -6,5 +6,6 @@ #include "sh-sci-common.h" =20 extern struct sci_of_data of_sci_rsci_data; +extern struct sci_of_data of_rsci_scif_data; =20 #endif /* __RSCI_H__ */ diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index fac83dace27c..85b89c1ebf15 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -3397,7 +3397,7 @@ static void sci_remove(struct platform_device *dev) if (s->port.fifosize > 1) device_remove_file(&dev->dev, &dev_attr_rx_fifo_trigger); if (type =3D=3D PORT_SCIFA || type =3D=3D PORT_SCIFB || type =3D=3D PORT_= HSCIF || - type =3D=3D SCI_PORT_RSCI) + type =3D=3D SCI_PORT_RSCI || type =3D=3D RSCI_PORT_SCIF) device_remove_file(&dev->dev, &dev_attr_rx_fifo_timeout); } =20 @@ -3492,6 +3492,10 @@ static const struct of_device_id of_sci_match[] __ma= ybe_unused =3D { .data =3D &of_sci_scif_rzv2h, }, #ifdef CONFIG_SERIAL_RSCI + { + .compatible =3D "renesas,r9a09g047-rscif", + .data =3D &of_rsci_scif_data, + }, { .compatible =3D "renesas,r9a09g077-rsci", .data =3D &of_sci_rsci_data, @@ -3759,7 +3763,8 @@ static int sci_probe(struct platform_device *dev) return ret; } if (sp->type =3D=3D PORT_SCIFA || sp->type =3D=3D PORT_SCIFB || - sp->type =3D=3D PORT_HSCIF || sp->type =3D=3D SCI_PORT_RSCI) { + sp->type =3D=3D PORT_HSCIF || sp->type =3D=3D SCI_PORT_RSCI || + sp->type =3D=3D RSCI_PORT_SCIF) { ret =3D device_create_file(&dev->dev, &dev_attr_rx_fifo_timeout); if (ret) { if (sp->port.fifosize > 1) { --=20 2.43.0 From nobody Mon Feb 9 13:04:04 2026 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 C38F436E345 for ; Thu, 30 Oct 2025 17:55:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846941; cv=none; b=PH0DvkzI4HqVgQ7iqQHapKTHEPV8uSR2weVYwyrYn/ZHrt+PQtcpT4SkeHzL5nuXC24HGT7lgR+C7vDian2UvJBthXuUQdfTSYZkdqa/g9UOh0/AQa/U/+4SdmbZrlpFrgizfzMXcnUZhodFITZHBhQ4TTtzZn1VzGBTDWmFLBw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846941; c=relaxed/simple; bh=l69I5xmyhHro4KhUO/PVpo4RcLcYevtDC9A8q7K0wyM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tRVTSNm1aEG24sDtFj7x/fwk1o+n3eykQKY6VyLRZUoKXcorvPRG/PFo2aeX9qZowl1mJ6+uGOEUjwm88lJDN3f8OKr8MyjYp+F3yDWZp47V4wLD3UhqqjcJ/dOQh9Wl4hRnfrlIx77ahQcimQbrmd84/CwaSK/ZX+f0qP78zSo= 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=M5+BnbTK; arc=none smtp.client-ip=209.85.128.43 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="M5+BnbTK" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-47117f92e32so12173905e9.1 for ; Thu, 30 Oct 2025 10:55:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761846936; x=1762451736; 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=Edvdlqy9JPFDf6Wc3Jobmq+A9++TT7Am/KBqXa8adZg=; b=M5+BnbTKRPxR/DiZagiMEuXXjTRe3HqJ3hCTCxgM11nRxIo4osvlw5DnhtA5AdPGQS 60pzUrmdwez1+Xx8GfG++gOx1OflgfNKCj0ecqjCbyuK2LCXhmiU/SQmpL3jFwBu6bdn gP3X33zuqFHFU6JOnb3TIw/V4cffGcAq/sJGknwEYAmgwYvxL3m3CwJE+FBjDLGa8lY0 wlyY5X1JxEJ5BnP179K4jY4CEfbkUzMPHqOdiflqiNQRGM5IEQh/d8EPN4QYpHOQNveI 0c+ppbUtSfL949A8nHwbonQV4UAD8Db+GrbixLLIAZTLGPZLYiJGNob4U3BLN0N4jMoz kROQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761846936; x=1762451736; 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=Edvdlqy9JPFDf6Wc3Jobmq+A9++TT7Am/KBqXa8adZg=; b=BPeYkYllrFHSZVoDlhyNmH+HnoRM9/HyKRgUQ+NxSO7xO3eGa3Zcq0jfioiFQBDR+M JXmTKmWjEibOIRvbhVGmrO9hZi9dbzVJpqRTEfDxgRNPpn4hZEcvNm2K//J69t2wwvJB Uc1PIl1UCnFRhDxYKE6fSyCsED8zRGZK2A+xiDT01h/bauRBsHrK5iqBj73wNPYlt3q8 N/u/UKIpEQVEOmOmnLvUkUcfca68reOGzvPPb4jq+o0RICRuRagIY88+lDI6PNCwx/36 ZCrCr2bkljoYrbjXvturSwrmkEiAO7pjqVrAP0rU7xT8JgmNgtdK+9yGCOp+ZzFbGERe soZw== X-Forwarded-Encrypted: i=1; AJvYcCWyFY4Zowspj27XDMy4bKfVKge9Upm5XEW9zu86IJzhTqE9jCaGUsUK7cdHgH0B+YQs2vxF3QMyfrJwFmo=@vger.kernel.org X-Gm-Message-State: AOJu0Yxt/85L2VQJPQILelcM/6FcAwCfvxCiDyCgDUOj8y5qTVg6Rs1/ 6ZllV49WIiAudAhoys4CFRGKa0DRWWpOSMNbXwG7+Pk7X8CIrho6d10N X-Gm-Gg: ASbGnctwot1v1RtW/+T/rFQBcEblaM7tL90X6AVqYQ4xzPbpX38g0LlHOYecl8c7j4m PqxHEfL3rct3ix/ITkDNpSPIOT1KMJg2HcIJEM36JGtipEL2IgOfzC1IMrohYBAVF0+3FCHSnCN fjIWg0KMF5hJlxC0JK8mKmmiGnFTuLrZx4kPNy3QzsEv7DWLAJ8rGHnl+PyBc3xtBDeF02O8pb+ WZAW0G4LkAMj2P7v91K8lHiIrY5tm9rJUuornngJOoK7LRuxDY+cst7FIyKqfTiLpAvF8brvnWQ CnJgyGeOG4FYC8D0+g/D+/hLQBGSpCASWWiFPorxzfmIR15WnaQ+TGaNQB9a+L9meJrCyNfD5+j OrUS+/Jxii2bfgOgsbJXH/0fRCLum4+FkTkGjLrn4rRDSBIJ63QN+duM0zFG8LnuQEVzpHnH8nf qdfsGdVNbIWoVauAE91D+XS2USZQhVEtT4k3U3kazhOboUiwfETXZmxZjNlN9/ X-Google-Smtp-Source: AGHT+IHZ4v4xyt6n2fCbsMqLzZeV3M66YmvJIYue7LBx5q08PgWSkNP33rl4YSupEamRgrRJ3iz7yg== X-Received: by 2002:a05:600c:3511:b0:476:d494:41d2 with SMTP id 5b1f17b1804b1-4773089021cmr6614515e9.29.1761846935276; Thu, 30 Oct 2025 10:55:35 -0700 (PDT) Received: from biju.lan (host86-162-200-138.range86-162.btcentralplus.com. [86.162.200.138]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429952de5f9sm33384041f8f.38.2025.10.30.10.55.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:55:35 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Cc: Biju Das , Wolfram Sang , Lad Prabhakar , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 13/13] serial: sh-sci: Add support for RZ/G3E RSCI SCI Greg Kroah-Hartman , Jiri Slaby Date: Thu, 30 Oct 2025 17:55:17 +0000 Message-ID: <20251030175526.607006-14-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> References: <20251030175526.607006-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Add support for RZ/G3E RSCI SCI(a.k.a non FIFO mode). Signed-off-by: Biju Das --- v1->v2: * No change. --- drivers/tty/serial/rsci.c | 138 +++++++++++++++++++++++++----------- drivers/tty/serial/rsci.h | 1 + drivers/tty/serial/sh-sci.c | 4 ++ 3 files changed, 103 insertions(+), 40 deletions(-) diff --git a/drivers/tty/serial/rsci.c b/drivers/tty/serial/rsci.c index a3e216c05b76..43a381e5eace 100644 --- a/drivers/tty/serial/rsci.c +++ b/drivers/tty/serial/rsci.c @@ -161,8 +161,11 @@ static void rsci_serial_out(struct uart_port *p, int o= ffset, int value) =20 static void rsci_clear_DRxC(struct uart_port *port) { + struct sci_port *s =3D to_sci_port(port); + rsci_serial_out(port, CFCLR, CFCLR_RDRFC); - rsci_serial_out(port, FFCLR, FFCLR_DRC); + if (s->type !=3D RSCI_PORT_SCI) + rsci_serial_out(port, FFCLR, FFCLR_DRC); } =20 static void rsci_clear_SCxSR(struct uart_port *port, unsigned int mask) @@ -229,7 +232,6 @@ static void rsci_set_termios(struct uart_port *port, st= ruct ktermios *termios, unsigned long max_freq =3D 0; unsigned int baud, i; unsigned long flags; - unsigned int ctrl; int best_clk =3D -1; =20 if ((termios->c_cflag & CSIZE) =3D=3D CS7) { @@ -294,7 +296,11 @@ static void rsci_set_termios(struct uart_port *port, s= truct ktermios *termios, =20 rsci_serial_out(port, CCR0, ccr0_val); =20 - ccr3_val |=3D CCR3_FM; + if (s->type =3D=3D RSCI_PORT_SCI) + ccr3_val |=3D CCR3_RXDESEL; + else + ccr3_val |=3D CCR3_FM; + rsci_serial_out(port, CCR3, ccr3_val); =20 ccr2_val |=3D (cks << 20) | (brr << 8); @@ -303,12 +309,16 @@ static void rsci_set_termios(struct uart_port *port, = struct ktermios *termios, rsci_serial_out(port, CCR1, ccr1_val); rsci_serial_out(port, CCR4, ccr4_val); =20 - ctrl =3D rsci_serial_in(port, FCR); - ctrl |=3D (FCR_RFRST | FCR_TFRST); - rsci_serial_out(port, FCR, ctrl); + if (s->type !=3D RSCI_PORT_SCI) { + unsigned int ctrl; =20 - if (s->rx_trigger > 1) - rsci_scif_set_rtrg(port, s->rx_trigger); + ctrl =3D rsci_serial_in(port, FCR); + ctrl |=3D (FCR_RFRST | FCR_TFRST); + rsci_serial_out(port, FCR, ctrl); + + if (s->rx_trigger > 1) + rsci_scif_set_rtrg(port, s->rx_trigger); + } =20 port->status &=3D ~UPSTAT_AUTOCTS; s->autorts =3D false; @@ -320,7 +330,8 @@ static void rsci_set_termios(struct uart_port *port, st= ruct ktermios *termios, =20 rsci_init_pins(port, termios->c_cflag); rsci_serial_out(port, CFCLR, CFCLR_CLRFLAG); - rsci_serial_out(port, FFCLR, FFCLR_DRC); + if (s->type !=3D RSCI_PORT_SCI) + rsci_serial_out(port, FFCLR, FFCLR_DRC); =20 ccr0_val |=3D CCR0_RE; rsci_serial_out(port, CCR0, ccr0_val); @@ -337,12 +348,23 @@ static void rsci_set_termios(struct uart_port *port, = struct ktermios *termios, =20 static int rsci_txfill(struct uart_port *port) { - return rsci_serial_in(port, FTSR); + struct sci_port *s =3D to_sci_port(port); + + if (s->type =3D=3D RSCI_PORT_SCI) + return !(rsci_serial_in(port, CSR) & CSR_TDRE); + else + return rsci_serial_in(port, FTSR); } =20 static int rsci_rxfill(struct uart_port *port) { - u32 val =3D rsci_serial_in(port, FRSR); + struct sci_port *s =3D to_sci_port(port); + u32 val; + + if (s->type =3D=3D RSCI_PORT_SCI) + return (rsci_serial_in(port, CSR) & CSR_RDRF) !=3D 0; + + val =3D rsci_serial_in(port, FRSR); =20 return FIELD_GET(FRSR_R5_0, val); } @@ -357,7 +379,9 @@ static unsigned int rsci_tx_empty(struct uart_port *por= t) =20 static void rsci_set_mctrl(struct uart_port *port, unsigned int mctrl) { - if (mctrl & TIOCM_LOOP) { + struct sci_port *s =3D to_sci_port(port); + + if ((mctrl & TIOCM_LOOP) && s->type !=3D RSCI_PORT_SCI) { /* Standard loopback mode */ rsci_serial_out(port, CCR1, rsci_serial_in(port, CCR1) | CCR1_SPLP); } @@ -478,12 +502,13 @@ static void rsci_transmit_chars(struct uart_port *por= t) static void rsci_receive_chars(struct uart_port *port) { struct tty_port *tport =3D &port->state->port; + struct sci_port *s =3D to_sci_port(port); u32 rdat, status, frsr_status =3D 0; int i, count, copied =3D 0; unsigned char flag; =20 status =3D rsci_serial_in(port, CSR); - frsr_status =3D rsci_serial_in(port, FRSR); + frsr_status =3D (s->type =3D=3D RSCI_PORT_SCI) ? 0 : rsci_serial_in(port,= FRSR); =20 if (!(status & CSR_RDRF) && !(frsr_status & FRSR_DR)) return; @@ -496,34 +521,40 @@ static void rsci_receive_chars(struct uart_port *port) if (count =3D=3D 0) break; =20 - for (i =3D 0; i < count; i++) { - char c; - - rdat =3D rsci_serial_in(port, RDR); - /* 9-bits data is not supported yet */ - c =3D rdat & RDR_RDAT_MSK; - - if (uart_handle_sysrq_char(port, c)) { - count--; - i--; - continue; - } - - /* - * Store data and status. - * Non FIFO mode is not supported - */ - if (rdat & RDR_FFER) { - flag =3D TTY_FRAME; - port->icount.frame++; - } else if (rdat & RDR_FPER) { - flag =3D TTY_PARITY; - port->icount.parity++; - } else { - flag =3D TTY_NORMAL; + if (s->type =3D=3D RSCI_PORT_SCI) { + char c =3D rsci_serial_in(port, RDR) & RDR_RDAT_MSK; + + if (uart_handle_sysrq_char(port, c)) + count =3D 0; + else + tty_insert_flip_char(tport, c, TTY_NORMAL); + } else { + for (i =3D 0; i < count; i++) { + char c; + + rdat =3D rsci_serial_in(port, RDR); + /* 9-bits data is not supported yet */ + c =3D rdat & RDR_RDAT_MSK; + + if (uart_handle_sysrq_char(port, c)) { + count--; + i--; + continue; + } + + /* Store data and status */ + if (rdat & RDR_FFER) { + flag =3D TTY_FRAME; + port->icount.frame++; + } else if (rdat & RDR_FPER) { + flag =3D TTY_PARITY; + port->icount.parity++; + } else { + flag =3D TTY_NORMAL; + } + + tty_insert_flip_char(tport, c, flag); } - - tty_insert_flip_char(tport, c, flag); } =20 rsci_serial_in(port, CSR); /* dummy read */ @@ -607,6 +638,8 @@ static const char *rsci_type(struct uart_port *port) struct sci_port *s =3D to_sci_port(port); =20 switch (s->type) { + case RSCI_PORT_SCI: + return "sci"; case RSCI_PORT_SCIF: return "scif"; } @@ -650,6 +683,17 @@ static const struct sci_port_params rsci_port_params = =3D { .common_regs =3D &rsci_common_regs, }; =20 +static const struct sci_port_params rsci_rzg3e_sci_port_params =3D { + .fifosize =3D 1, + .overrun_reg =3D CSR, + .overrun_mask =3D CSR_ORER, + .sampling_rate_mask =3D SCI_SR(32), + .error_mask =3D RSCI_DEFAULT_ERROR_MASK, + .error_clear =3D RSCI_ERROR_CLEAR, + .param_bits =3D &rsci_port_param_bits, + .common_regs =3D &rsci_common_regs, +}; + static const struct sci_port_params rsci_rzg3e_scif_port_params =3D { .fifosize =3D 32, .overrun_reg =3D CSR, @@ -701,6 +745,13 @@ struct sci_of_data of_sci_rsci_data =3D { .params =3D &rsci_port_params, }; =20 +struct sci_of_data of_rsci_sci_data =3D { + .type =3D RSCI_PORT_SCI, + .ops =3D &rsci_port_ops, + .uart_ops =3D &rsci_uart_ops, + .params =3D &rsci_rzg3e_sci_port_params, +}; + struct sci_of_data of_rsci_scif_data =3D { .type =3D RSCI_PORT_SCIF, .ops =3D &rsci_port_ops, @@ -716,12 +767,19 @@ static int __init rsci_early_console_setup(struct ear= lycon_device *device, return scix_early_console_setup(device, &of_sci_rsci_data); } =20 +static int __init rsci_rzg3e_sci_early_console_setup(struct earlycon_devic= e *device, + const char *opt) +{ + return scix_early_console_setup(device, &of_rsci_sci_data); +} + static int __init rsci_rzg3e_scif_early_console_setup(struct earlycon_devi= ce *device, const char *opt) { return scix_early_console_setup(device, &of_rsci_scif_data); } =20 +OF_EARLYCON_DECLARE(rsci, "renesas,r9a09g047-rsci", rsci_rzg3e_sci_early_c= onsole_setup); OF_EARLYCON_DECLARE(rsci, "renesas,r9a09g047-rscif", rsci_rzg3e_scif_early= _console_setup); OF_EARLYCON_DECLARE(rsci, "renesas,r9a09g077-rsci", rsci_early_console_set= up); =20 diff --git a/drivers/tty/serial/rsci.h b/drivers/tty/serial/rsci.h index ba255f58c088..df7a7edad7d4 100644 --- a/drivers/tty/serial/rsci.h +++ b/drivers/tty/serial/rsci.h @@ -6,6 +6,7 @@ #include "sh-sci-common.h" =20 extern struct sci_of_data of_sci_rsci_data; +extern struct sci_of_data of_rsci_sci_data; extern struct sci_of_data of_rsci_scif_data; =20 #endif /* __RSCI_H__ */ diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 85b89c1ebf15..b7d9ea4091d2 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -3492,6 +3492,10 @@ static const struct of_device_id of_sci_match[] __ma= ybe_unused =3D { .data =3D &of_sci_scif_rzv2h, }, #ifdef CONFIG_SERIAL_RSCI + { + .compatible =3D "renesas,r9a09g047-rsci", + .data =3D &of_rsci_sci_data, + }, { .compatible =3D "renesas,r9a09g047-rscif", .data =3D &of_rsci_scif_data, --=20 2.43.0