From nobody Mon Feb 9 08:15:24 2026 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 827582EA151 for ; Thu, 30 Oct 2025 17:58:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847098; cv=none; b=qnxaooPekneVbLe+AUScVcdN6RQHwsQ5FUeRauaz+n40N3zwq1h7/IUy7nPqhsiwadBXNHrJAuHqZmh7kBcbuQgAbBKAonIWeby99P7MSuzMAkbeSOb53upsgz3fFaRWCJwl2hgL/Jyctp5VPZGrBSFoFhccsPWEOkdHT6WIxts= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847098; c=relaxed/simple; bh=3z2mhzRxyfQNv1R0hi7ZTnOWImB9S2k6FugjQXRhwUY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ia1fB4gFdMzMNJlJFwWuvwFfgG1RsfZJZhet8/qOSOcpL/Hoq6Y/x3CnHKvGCOvoPfMEY59pPbRKSGLfksRVsaU2rJnEjWBifkzKlA9lswGt1seDrZylSoW9BdjO1oqIbZmhJf9zU4hIneuh8S9whFNoWnW2d5udLjzjoiutAaY= 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=CIinMekw; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CIinMekw" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4711b95226dso17769905e9.0 for ; Thu, 30 Oct 2025 10:58:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761847095; x=1762451895; 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=CIinMekwGQ3fN31rSkF4qOfK52HPYRwt8CU5EA//fipNZ25F0qTS/ogihBvQHpi2Xg ogC6qWoYf8qJQPG4bWrJpF3LQ4l9V8gy02CKSP+uKPefN3Q/kj574XDlk9mAXMT09Cf1 VhTDXeDMjZfbkiBoLvZmxua+UsxJzasre4Sm0CFTF8Sgjg+269lpIMT5kaqhLco9PcaF I6I+7ds6M5xQ+3JsIF4znCkEdYaBlRw/gAGFxWTu7GEgMp1fIURhSTqewERiKDtozjuN VpsYmasRGwzAlZYeUxEdVqGiuZtf2JNmZn4oeW4M+J7E4O6nogZKbTdf+8CxFxlRlsHq EsVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761847095; x=1762451895; 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=JE3Lfm6rWYwotg9MQfaoXiO2PfZa2jZhy/UQBnJZkd4gWMRpgCpc1DxCufsHGKQXL6 5x17Sx6LnUxKB+/6O5lVZHI5Td8WsWZsNUZUwolNGQocPBM03ciYFyBcsWqUBqJs5KI8 jiSpSnInj68NpOvoFl7CL1beb0aU8hxav0AKNtcBeTLuNkvoq0/P8Q6t9lv7FeMbo9Bn ffmNXHo7lCmKVp4pTXSTDDRVqZ92M+/ZP5KahosLPXXTyvHKQhIyd1ipoRGjkQHj1c78 HMsz8WKwbKnKyR+kBrvP87/Kt8mkBk8yfh48Ut8CCzB4rdFYojPGkB0jQIchJkGCnYh7 ZihA== X-Forwarded-Encrypted: i=1; AJvYcCVwrR6Ve0LaoC4EahqrL6DEm+bpdhG+te5yc+gCVfnmw0q56WftzFEPiNfXp9IhXQbuusVf+iqYrDCOjLA=@vger.kernel.org X-Gm-Message-State: AOJu0YzgAFZrUTuTmBwGPSablOkoGb3amvR0w64t2pT8/CaZnnlkU18a XbXHoQ8W7QDFsyuDbVWvptJ+paig7rcV/NBUbS32ImRWDrZy1kbxv6LO X-Gm-Gg: ASbGnctIobbeHiiiOuYInvN537akPstjV/xRgk2qlBwOMoyiTG96vhMNzkrvljrZiww PPif6kfL7Hm+w6Xt2Fwve12z61BpQxLFBlHGGvA/e+uTK2M+dJrUrxvP+7FSTO3l6rwdvNzlxpi FHHy8YGTQSgBiP3lJBEp6VW9lzfTLqXNLmpwKxWYm8fXvIVD7k2XQbGBFWursETCRatU88nVVNe VEH4nrbGLc2+C+9Y2xtL84HyyvTOK2pjNJOmtjWkpF8hJBUI1e2w9ZfUkXR88rCpsh8B+YnRZyA /pM6ENXf6XzbfDLg+KjAKCAKH4oJLWDA+2FuOTiaumkDvwBW6GZuksBdLePoNdmFq/j7DKF0TLH SA8DVe+psq1Civhw1YviNwbQCH+xbAWku+g2xsYAxMmrsBLJTihUzrxHOrDdWzhMh/wWg0fBoX+ Up0mrMcY726xPV16i/XVSCFjc+Bl3y5I6PdhYGiyNApXgwt9NjP6U5QYb+EdkVDoptNo6LZ3Q= X-Google-Smtp-Source: AGHT+IE1FuZnnp5NmXH6wKHeFVq3jsmIh/MUmdAqP8BqCay4i4c5dgPUHmDX609AIkhZuUJDO3bVbw== X-Received: by 2002:a05:600c:820b:b0:471:c72:c807 with SMTP id 5b1f17b1804b1-4773087af79mr5773565e9.22.1761847094521; Thu, 30 Oct 2025 10:58:14 -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 5b1f17b1804b1-4772f53aad6sm15098055e9.13.2025.10.30.10.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:58:14 -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:57:49 +0000 Message-ID: <20251030175811.607137-2-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175811.607137-1-biju.das.jz@bp.renesas.com> References: <20251030175811.607137-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 Acked-by: Conor Dooley --- 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 08:15:24 2026 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 2076036CDED for ; Thu, 30 Oct 2025 17:58:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847100; cv=none; b=rb5UmQq7Pl4QQJwR7c0CrTpVGgWi68iuBnnnK+MteRIXk7kyhpzYljeOQxzx/JB4Q6T5vSD9N+Mbmo3XPCnf7l6dBKv+B8g5FogLrXOvbTeJFT/8YElJq3WTlZz+ZRa9DIipeOfxW7MzfzvmwMYJikdCTFmtB0Hd3jEB+rbdsDo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847100; c=relaxed/simple; bh=CGCGb9V5eBipiJiyKGzWDh8EBRU+yWeR3nCYNAfd3C0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bNcTyVfgrTGzS5noXtIDBIaoK5XhgLN51v7n/ij+bJAtJjX+5ftd3Sqd5TlcdgnQLfChzCtJKTcP8HXZ3wD0/cg5Skb2JrCjZ25Gz99vpz5bOVFp+1zjUyCuYOHjuvEcF/nBONGKB8jzKlROyM9UjuqXD78a6wLWGrkTEB0kLn0= 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=ArECC7TG; arc=none smtp.client-ip=209.85.221.42 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="ArECC7TG" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-421851bcb25so811796f8f.2 for ; Thu, 30 Oct 2025 10:58:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761847095; x=1762451895; 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=ArECC7TGGBErcGy2ngQS1TzpbESTXq2fI3lVCiD5EH0M9EB/iN+S9fqe1F0SDTvx+w JRDDibRt/I7TRNIG3jtHBBmgSMiBK1mC/xhSJhxy2LlVku908NFTbL0LYwp6wPTMe4NV xu4F9pLpC8XQmBG1yAtYQUow9hb12asJEJv7gWWpy+/pS5kwLPQACE2IsHeApihQDl5Q dB+JB7bA1zwxJr0j413pCoNUuAClLBR+TyDbYxitg1DPIFZ1IkrSLoQmCRWXgXmt+0wj k6o+3onn/EQvL4TBGCEo7mvV604KjI/OFQBx9H6nQ8N/VBKS/eKHUk3GCmRJD5DCEL3D hOww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761847095; x=1762451895; 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=GSa9vnaID4X1ESAtvc8vWYJwtiOd3XETzxN/i+9F54ngvm2uPlbPNxobD4BgOxcgj4 Wj86zsgdFV9Xd8hmVm03wrYYEwNmrWcBup43ZO/0EfFbGgCCtzgvfFpZaLM3Nf5KB128 GI7Ib+G7dZXoi9Vxsu8DPviDcbNwfz3t1bbS/tZkss0dckfBEQBtf4L8grGAu7ObtWfW UN18sHiH/kjBchN++xCdUe0v1K5kEp7uddIyBAyQaFC/sWLcw0agwTs5bFBWcgqX58vZ D2epUeU0GSl3ODzPRNbebo5BEmsQAP+HtwKeWsjMI2jYA4FgOOD0RIm6nn5yPzHyc/nU WkEw== X-Forwarded-Encrypted: i=1; AJvYcCXGuDUbd/7HH6whiQLJPTYVVni8J57lTOy9Xm3ts9f5F/bez4a38m4YN/2sSBJyNKr5eAh2037eU7OgjoY=@vger.kernel.org X-Gm-Message-State: AOJu0YwnWxBT0aIXFUECe1+3Eh/JfiBlKR2SNEcyeSKv7cqUCArU/07z EcqHGH+aVaiFpKMxkKaC/ZVB05g+r+DhJemEXgCv6FtOTWWlOTlYY8gM X-Gm-Gg: ASbGncvn3LcFo9MUhdY+ZUHyXplR6uHJmER4WYm7m2PcT0/rBUmhSK8f1ladhoMIHAZ YhDQiGcn7RU40x4gyWSF9aD5bM95U8BxDO0TvE+VTZJMnFYJPGbFgGflHaVpW5k93osv0rFBZ11 LmJJUzekKVHZM6a9UCX3NnAxxDr1tr9N9GICIAp23HrsJhBUAzW41MgCW/0a2Bd3RjPY9McpHh/ vfm7myPRnNTHfmcsOxYCV/V4oKGQ2DFFZc+vLQMXpPND0ZSsJMbKw4XWlHbhc9LGJKTLSRMDc+4 rJZGYvTo1YsDL3lx2jSSMmNQCx5b0gDOGmUH3gofjQyC1wCKd5qz4kJEE31vkqd7ZPDMPiHNO5Y jtFB0uJU/mloinOgUlMkc8LWoS4OtB/WQjRMQhTXS5o5+IzmN+cDTZNweFB45Rin6Oo9UsSRgUb fNuniwszSQJeEnuQ40NYxM0RWSg55I7MWPIWmBK7vJHDxmffLRHy3RQ/idvRBw X-Google-Smtp-Source: AGHT+IF+7U/wNQ0NpxIF99gi4U8nhseKBZ5Da8Q6VFYrm3gmjFcz96pkmQpTdIaTfQVb/63+drU5Mg== X-Received: by 2002:a05:6000:1863:b0:427:4b0:b3e5 with SMTP id ffacd0b85a97d-429bd6ada25mr459355f8f.47.1761847095143; Thu, 30 Oct 2025 10:58:15 -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 5b1f17b1804b1-4772f53aad6sm15098055e9.13.2025.10.30.10.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:58:14 -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:57:50 +0000 Message-ID: <20251030175811.607137-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175811.607137-1-biju.das.jz@bp.renesas.com> References: <20251030175811.607137-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 08:15:24 2026 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 8E5AF374AC5 for ; Thu, 30 Oct 2025 17:58:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847099; cv=none; b=u8JJAgLY3ApfsJVIxzEiVJoPE7BeYtOWj8l9x9g7G1bUhK1H/v4dpzpZqY8DlNtvzxlOIUDclGs292zXuVzYbrBAHLSon0rmGJ8sZgvzvzqNXftQ3BBHpCJv7ZlPShuvkX3blZI2pldQNZ9+54bbL0vWftABsvp+4Y0Q6BJ+hrk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847099; c=relaxed/simple; bh=6rJaHYLudOTTm3QmqB48Nxc1YcoHdZeo58CPf1gncKQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PNYQjVWz6FET74fqGKQDc4lupfNYjbjqGNqRKASUzr+dwD4Bhy1szuFV4wMxFAywA6LSrkxzME22Thq6zQSihGDSqbQIlcBe+CeKoteyUZpEiMeGTFZ5Rt7mv1U5+3eoN5AUVRdbYkvpCBivOV8f4iuQ1/+6VY17vKgfcK5ZFYs= 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=gN+tFXfU; arc=none smtp.client-ip=209.85.128.45 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="gN+tFXfU" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-475dc0ed8aeso9496515e9.2 for ; Thu, 30 Oct 2025 10:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761847096; x=1762451896; 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=gN+tFXfUhYd7AN3Egbhc+T7/pjjMN64BsyJlhBek2r3vzGltI3kPlI/rTbHDhObt/v KDuecshf8fz1/LKL+bgt6zTWG5uYBx98KpeqkELuXlTesVM8gspjIp8iuR4yzPH3BOhM Q7afw2djT/6wdIrjocj4Z0+aWgSpvOKEa6U/7oxh4957jYlIPv8JbOmV/AKNdC2BUxcE Uuk9TWfGk0msU8pD3UiTi54FxLCDgbIIPj9IvBuFUJioXNebhjbJ6y+/XMKLl96gyZe2 y1NGgvNSCGB7rX09KdcbStfOVHdjViDBfcEqPggOCuTSn++ROLMrRusk6cyPkInqQhZU TuRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761847096; x=1762451896; 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=QR7QCzTyBk/5u41uzX+cFcZKoU+pLUmz1uXQvs2v2x/F2Zue5c+Uaw44GTmNX3+cNF MxzFrV72asjmY0PT/ciMvVY4XzvtIgqDOA0y3qpw0ZwiDV3wjwk3LgRbyZ4b7OQgHcOP 6hLVOnIIz5eefPfRohyKXpfzftHs4dh6ZSyJECjfTZXtCKLmdVqIo3gBOELyhtYnUUhz QFodfIj67exkhdO69k1kAVC6sb6oC61WZIjfUHGUs6I0fzsYKHEEKaHc7fy9CJsDkmBI B2xjOGw+HLGaYdMRbaQ1LXs6UOaT7rd7+X9rcbw4vIJOBFBikVt7Ual4MHKENSRc/b41 4T+Q== X-Forwarded-Encrypted: i=1; AJvYcCUgHjUbsEHIAPvqCRUSyughRN61k+ooOQpdRKlOMeB5JRHImUXOUEDMh6H5Rfao3EvJro7ew9t4iJh5z8c=@vger.kernel.org X-Gm-Message-State: AOJu0YwhJuNVvP5YJRQB2fZ7J36UioOxExa0QoqakyWWsRkfPSyzo+X7 K/28Jv1HLm5RIncJ12t9DNSGhvm8oRTBbGBJtukK4qNKNB/CZIorRXk5 X-Gm-Gg: ASbGnctBlw8a7/mBYFnB8lK/W5Ipp3vqkqqe7btQF3caRRhJ9CyW8oJ3BrzWL1qK2Mq eNV5sb1TD5szidhYt5rvVent3I/YkzrN4EjmpLM1ewmYL41attE9R6qb/qpIudzjWvBzaeNG9aH nZTGEq1OratyrCYEtgfwJ8QbBQEr7rF28UeLm2FpgrAvFrZeSATzt76YFSUowAJDiBKuRO9GXCC /lLG0zjQg/oJMrXwvOi06KHdqX2iyZawgWIH9wTOlOHBv0Z6f6Exnig2r2MxtaphISDwzVLOac0 9Y1b9cL6PU3ILXi6573apr9xltk7CedZzVJZNSk/U9VPUbXY6t9MEP4JgRzgYDJoVV7p8+LWWKq 0MJh9ya88MVvjJ+5sAlyU1bZo4HEBc6hdjheI5aITMsLQ+OZG6XVJDEUJyCCL7PSNOmlh0htR6I RKSfIhoRIjwbTgfXds+dR1qrDDA/Kg3yP0F4aA8sK7+Lg/qohcTblmRm2uSomml6hs1t1LTVw= X-Google-Smtp-Source: AGHT+IESJKAO8ONCerKPM8W5gyvkInHRoiE3CjlNsdnbfCKBMGmr+c3jFDp/+N+TA8ao+fo305pRQQ== X-Received: by 2002:a05:6000:2f88:b0:426:d51c:4d71 with SMTP id ffacd0b85a97d-429bd675f4fmr449957f8f.8.1761847095655; Thu, 30 Oct 2025 10:58:15 -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 5b1f17b1804b1-4772f53aad6sm15098055e9.13.2025.10.30.10.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:58:15 -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:57:51 +0000 Message-ID: <20251030175811.607137-4-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175811.607137-1-biju.das.jz@bp.renesas.com> References: <20251030175811.607137-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 08:15:24 2026 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 64266374AD2 for ; Thu, 30 Oct 2025 17:58:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847100; cv=none; b=q5DaW+tIcBxQ89Z5aO8HabqzSV357SDepBgUrP8WVr1YifGC3gtJ7ZZxs4V0eBgG7Xh7cjOtltDjR0/Rylg+gmef7kT4Q+zpKPyMFbgt5PPODEUtTjYQbeb5vnPf18b9lL1gdXb3TAHqWekmzTbNpMAsXAu6EnW6nhSUPtndEQM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847100; c=relaxed/simple; bh=KXgzGd6gNo09gi0VZSrUZARuDuGxlTCFI7gHi/TqNjw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IO3KuQfftyE+0apUk1wjrOs9FNhw+tF3wB+Wf+5beOftOEHMvqaAGxKPziGfvIz1bg13KBC1VEjP5T89GoYtS2CJfvZngea/6jWNU6Q25cx9GXX5Ie2PScNSNnlQNmVQssRDo9TKKYFvpUuyxUXOfbsZu9KMjtUS3VoQdQ4rHRQ= 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=JNewtzJo; arc=none smtp.client-ip=209.85.128.51 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="JNewtzJo" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-475dc0ed8aeso9496635e9.2 for ; Thu, 30 Oct 2025 10:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761847096; x=1762451896; 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=JNewtzJotfw5LiLe2JGXAzYyGpsH7UwUG91pj2aKigmiysVtMavQWQpawJwo3XGX0L tMnLVe0GSNO0WDB+RqVpPANzTp1xQbYk5B+Prr3SqU9hhZ5GyV+jczXyeO7NF8sA7Tj1 tAk30mJMsnUxaIy/m7EsDHiWP7feEjCBUCooJ8VjPrZnrAJ0xapsuqHEL4L8RPP2OLGW hpKVnUPIk1VuGAuOD1b4Lei/4PqbD4ZP7kp+qdLymtXmnlz4Ox4gzExymDJkAqk0xrXe /l1kG2Mq+5OBQJkG3CKBzQgsZA9eN0unEO20Lc6P2q2cB4cf41RMxEJo9zPYgR69mnct J0Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761847096; x=1762451896; 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=MyrzN9c2AYtMwnNNzJT99rUXWTyhG7ClxcxXew/SQVaerKnHpkF/M+YO76E1OwWGOr ZpD8KCjOI83Td/LZhBfMki7tTUWfasuSm5vlP6bz8CPJ/tdXrKdTdhOX7dtkRPOmTR6b zULvdryTekYpwkTAsBP+v+0YM3slYlCVQvjQ0z+HjMZnbz/dvxYzqBNHXO8+unN78NzJ x3axGKpC5iqvBe53PPGEkP3jSvQThA+B0mOu58Yzy8THSP4PGOFCISMpQ2zLl6FlekFE iB9Hz48hlLNwHuK4VrQ7HzpCR/sC0S42kNXOu428OTA7zpqgYBOGKBc5SnJntb+HaQBb 7XcQ== X-Forwarded-Encrypted: i=1; AJvYcCVlEN2Mr+3bHnhoVDaBNEf5YfK46K8qn7VmRRb6SgPJw6Uz6IsyFMev0xPIMdT8mueGsxQG1+OKGE3TM2A=@vger.kernel.org X-Gm-Message-State: AOJu0YyXlaJ7SUdW8DFhPfZxcvFLDuTiROnoLWvtdLrg5s67t8kzWqts C2lDPnx43CJ6omUmNKG8T+A2n3YT/JCLhXYU5Y37XojGQR4u192Vct1J X-Gm-Gg: ASbGncsaPpwxl0IlMG4Px+/14tMPd2e5LvanIdAKpF7FrjlBo3WYCu9TpiVY0EWCCWJ 5NxvrHRY2nOaqZAdsV/7/hoklfWcq1gErvTYuoWXyrZPjEFC+xaU2V3226uQawvRouz3Pbqjy0S UjFEnSCrzOPwth3by36TU1velBfKCQMbWhl5k0tHd1atO3/ZhV+3rXzIBhd7eQUe8BzLfPBzMsK ECuOkH1Gysa6leKajY+QO/XTEb41UdSZp2CkGUj+pBNw44v1gHx2BjxCBPrtnSNReoFiUIEmTq2 XnVpFX1S8iIlzkonNGhJRO+BvXiUd31tUirOt3HXGT57J1/MO2RpGOd5JZdsvHB8Mt4asJKSPYd pojzcO+mCuBiipIFJkzTyODMg1x/kSdBn74/3mY1CInM8fBPw3ofIATl417rnGgq1QW/A7WhxSO OX8s9f9numBdqdechFxrAw9N87F39R6Yc7xbMIImY0kLAxPS3SbJc7iv2uvacjG3pdWDGxddY= X-Google-Smtp-Source: AGHT+IEauFP+H4BtsTHNnwX2RMa6g7oaZopNNZdiBz+4pgcKwzPpZyX4Q4A5C/MiMwcUg284xoHAQA== X-Received: by 2002:a05:600c:468e:b0:475:dd59:d8d8 with SMTP id 5b1f17b1804b1-47730793c2amr7516675e9.8.1761847096132; Thu, 30 Oct 2025 10:58:16 -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 5b1f17b1804b1-4772f53aad6sm15098055e9.13.2025.10.30.10.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:58:15 -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:57:52 +0000 Message-ID: <20251030175811.607137-5-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175811.607137-1-biju.das.jz@bp.renesas.com> References: <20251030175811.607137-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 08:15:24 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 6FA0D374AB3 for ; Thu, 30 Oct 2025 17:58:18 +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=1761847100; cv=none; b=c75oU749ET9n/nXtsm+CLss1j206O0946UB6hruIQwdbT4fby/DUu+Nb1DBh2sExCwyLiomo2QCoBnkkQFmgg/5Tw3srzX9hMiyktjMWI9G2WJXxQN/HnJbDUONnFIrbgXCPiLlE+le9zj9h1Y2UB0xOLf6OEiWNKnbMjFa5c2w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847100; c=relaxed/simple; bh=9jcJ345rfMMIxdlmZfAg0y+exXpCpE0R+jvegxv2zm4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sdt8k1sJjDla9+51yn/JhHaYhaP7znt4pze6f5g0cwecADRzA+kz/gwi56ckFmpJZ4F2+li1Lp95arW/qh1Gn/Dcu0T3Znbf0mdL5Y3EcV7f/gMWMjynwgJnzVRv+6LqTc+96rw2KX0TMboLH8eXylWw+iQKLyMB7H9EWTx8Hn8= 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=g2/7CgLG; 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="g2/7CgLG" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-47721293fd3so8610495e9.1 for ; Thu, 30 Oct 2025 10:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761847097; x=1762451897; 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=g2/7CgLGNM06zuV3it5VB7AXNnSh/EFwuTl55MbCt9TwFejVsFq0yfSD0jmSKpi9pe cm2JLb+QJtOCRR5M18Bva9NoODFirJbmNYh8tMNP3WnQzAq8NlnBWM5FaRqObSiuBq4y VyBoUir3jd5pGWYhmGSso1bWxq7m4yhFF8RJeY/1yfcLIIh8a/UHOMiL8JKUExb2Z3h3 JFfz28PD0MH3XYs6RI4fJ2aCZU/gSM3Xf7p6kkYfLxXTwgcAgVVU2RZ5agdCR4wQn/Gd qui/5F0a5Qpq77OMC0Hs7K2RN75atwWzfLJrLYWt1inZ9zWvw3xNpGK6yyLZfDPeejDp cWrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761847097; x=1762451897; 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=pXUfLlAjBycwOr5oze9BdlpoNj7+6ONsFxO6wWxLhIwH09TSbDvZfA/X9F/UhpS9cq 4a4VfnYoWLVVtXvsl7ekX3AmiNrDTBP76OlmqeFeBlKp3tSep9ClqEd+4Ea65tz2/+Xj e9KE1+89XgCfj4b9ZFcBxL72mLRRmHsIbcwdatlVioNYA5Qeg9mhfKyjoSaKZpfiEUjA SjqNLZqbWJjs0goANj1Fz9oPxLu9YdPJ2Oo72F1mve/qv0b3yECMo2BfNYg8Od3RBk17 02NnNx1+ZY+AggDaTECGEGvB02S2XqdTCbxlYfpWN6SjXXMeIedHFn5ByOJyRj9ZXLD0 whXw== X-Forwarded-Encrypted: i=1; AJvYcCWpBQdQzU06stUXDsasOGKnwDWPbmzFr6BhIKH6jWbmSSOHS8GHj0U5oMvjCg+I5pIWb0aN06iyZB/TQPY=@vger.kernel.org X-Gm-Message-State: AOJu0YyiYoFFjQWOA7LbEK0yT4XFFfaAB3R+BZJi6vKFRtbiDTAuz9vK aG2LV+Ca4HW+Vb5s+3eJAr+YsN5diaBZRSThrXN3zurn8ZRb6JIXUBeS X-Gm-Gg: ASbGnctIfkyBhGs7msSTBfT1X3qz0z+uuUUm8KuRDAbNNT0GdMMSIe2JLzx+t1kjI+b w9223l5VTuchU8ehePYlYyGtNiUHU+MTh+zXuLN6ChIo9z4qcR3S6J8tqSoXfd97eU7CMRYjrar m8GDFtJpkqBKeoZ/rMyiOpdwFWkNarlQ27WEq3MtdN0pkIg06N0dTkm8HfBiMfkhsWd9uC1aipO QSR7asqn7a4PvppHI69doPD6QkhaxQBXHVTeaPigq3mhZ3rXM24bBV8v4YXZmblRAhFrXgC8JdX kCmuQDczwxKqK2hup9tnwGh/GGDl6LZU2f/TSmOc+GITQua8bECxtWLGERYQ946KcZ5CA8p1jDj nrGnW7MYXUwZLrQq8u5CknUo3oHA0S3ACoi/aRcDkPVvfJSEq9vCriEj+CE4BK2QVKBbt0KI8ee jXWNTTaUV8JaRADSaVNtZSQEZPBwDCLeacwWId7S8SFMjp2O1GPFXEwTqzFu/E2U+17oy6cQw= X-Google-Smtp-Source: AGHT+IHaW/aKuio2uca4DVlK5hpIYnror7GRbjbf3WKhe549DWwP6AesragGrVL8J6g2M1dW2nuRjA== X-Received: by 2002:a7b:ce96:0:b0:471:611:c1e2 with SMTP id 5b1f17b1804b1-4772622261fmr32312035e9.3.1761847096589; Thu, 30 Oct 2025 10:58:16 -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 5b1f17b1804b1-4772f53aad6sm15098055e9.13.2025.10.30.10.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:58:16 -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:57:53 +0000 Message-ID: <20251030175811.607137-6-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175811.607137-1-biju.das.jz@bp.renesas.com> References: <20251030175811.607137-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 08:15:24 2026 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.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 37D6B375729 for ; Thu, 30 Oct 2025 17:58:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847101; cv=none; b=JNziIBxru9xS61GpKh7UFhOPVeYFNj69XYvnbnCvN/ojeDbeN18FkmyfDPxrnUfPXBVluRKSnHlJhoohpN4xD4gI9dVKJYaoZRAYmMVTF1M8buNKAdMoNFOz5rBYfJfEWJoifKVV/TV2YXvA8+pwenHAQnuijtMvh/GUDDQYfOA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847101; c=relaxed/simple; bh=h/WB+hR/anHyT+SzoBQFwmDv8A8kpm7m3RVwaDTL2qk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LL5taQMjiAWDluCvhXR0l7X/7pVg98wSpmRYVKfiT3UdAyXE9z+GPUVqfnItvIDteREDBuwqeWy297LhnmJb641eU48+QDp41YYjSVGxUu+uKttuYp50s23ix/tNpfcltWTw2n406Ipx5ada8hu/D3TnAfiDvPPa+AzzAMxrq28= 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=Ue6HlFbQ; arc=none smtp.client-ip=209.85.128.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="Ue6HlFbQ" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-475dd559b0bso18065165e9.1 for ; Thu, 30 Oct 2025 10:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761847097; x=1762451897; 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=Ue6HlFbQ8SrByoyiJdjZKBFdoL7coCuUelTMxyniu0aIjWwOG4v0R/dmqD7/usgFn4 gKbjDEzzV1gaZdt13CGa4B10ug49ctS9rqbqE6eKGm8XfON4puoWxRX/RkmV0bqFTFU4 lgrQNLqDUy8xsrlSFwia5d3kbiiH3AaSgRD97ov/ingswzvXA9Ey8F/7vV57X+FSUZqb e1dDanbEsFBfOor0bV3g2B8eCjHr+xuATVIV0E7vfS7r2Tgho0IvFBNwbMaObtrWJjLX eSBueea+2IUSjhMVbmsk8bi7yXki8tHkkXhwN07U5JHu+AJbwWKdLgFMNDtaKuXROpps S2yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761847097; x=1762451897; 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=sAe+O42y0j5F/RnnzIAeyvtoxBJenMJKoWeAgGKDN0u6DbBz0cXlZcRNyfZFKPBwg2 Dt/SyqQgaHzGLEpBZtwj6Jpr8LGsAum2hvoNNexFocWA7Lz8ln2Y8UXMNRruy7rYi9FS z632ItCDZZ1BEmzn9G37eX8GiOpyLyrrQlDp6wfbkist05C0NmgZ+WeJKe51v7bB7YG0 NUWbU/Mofxpj3eFVmB10oN2xT/A3iTTAWY/OFaU7imx6b7l6XlBVAECmb3kChXQssiSO PzXxhmBgViaJdpfaJ75Wo1jpquyoZO1uL7hongcdbx+5gc8T5pRCJprrVZtV4VqeWFIK cLhQ== X-Forwarded-Encrypted: i=1; AJvYcCUDofgF6jIwo5RcDua5nHq+PUsKrBuwB4xH97ZkCZLBCzoetAPVyR8dNQcgD930X39i5HBd0kAZ0WM+Vfk=@vger.kernel.org X-Gm-Message-State: AOJu0YziSJIJY/9r2vqxm+mzjGT9zrLcIRWGL0Ovl0dEPvK1xHjtyFDe Ldu3H6vPPPjQ1eiWhtompqY35eR3QVfUlRK/rl9V52hJukqoBB38Hs0Y X-Gm-Gg: ASbGnctQf2SRF4AMaRKhv5rFlqd0Mqwq6nbHp25fd2pZdLI8yef77cICkqEAEmdFgvE Qbw2xocLlpDOxgubM4APSjJ0sTnwjvlmDnpZ/pnrNh2/R9TiA3QCDG3Xju9k2wBZolDre6iivyq uIdW5zrOX2xHgDqPgFTLtPmtd4lGbj1xwdLHhL4Ns1O2rbc0TGBo07QCVnJMSV61Srpw40VrdIU JIiIQfiW3C3CP8H9l1byWTNmMQwXewlPhWi3+B2Q77k24NCblfNsXdl+XlD2Dhj+BVgK54pc4YG ew1/y0NjjyNQQoXdfkl7W6S+OvJu6RgZXNdjKk21pzIIYfEq9cVZe14NADn0VogXKLaltLENdTR bsKCBrSPlNuGRNeAhGioutx/DnBrAo9Me0I5lfBOEf+INjCVY3+OaRssMmKakAY+fCrrsASoiGN kVRWrotRrj0wOLxKr/a7V0O/o6XyOD5QAjU6ocE/BUhRLS1CRSSIAaDhqVs1QqxxwNL6byFqE= X-Google-Smtp-Source: AGHT+IGYhfx2hhEnVp811r6o3+mVesMzRX0VxLwwsFF+Aubi9Ud9nfeO5K494LycQhg4yojLHmy/Ng== X-Received: by 2002:a05:600c:3590:b0:471:115e:624b with SMTP id 5b1f17b1804b1-477308595f6mr6032205e9.17.1761847097374; Thu, 30 Oct 2025 10:58:17 -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 5b1f17b1804b1-4772f53aad6sm15098055e9.13.2025.10.30.10.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:58:16 -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:57:54 +0000 Message-ID: <20251030175811.607137-7-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175811.607137-1-biju.das.jz@bp.renesas.com> References: <20251030175811.607137-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 08:15:24 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 0CD2A37573C for ; Thu, 30 Oct 2025 17:58:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847103; cv=none; b=ZzZrUc4TAwhA4nL1tQqqDpNaDexAg6dK0Of83f0Opf6FpRUW0xhkgKp5is39KR2/XM4x7QE4Fy+h0/uRFzzz9scG2/3z3gxPUlI2xWdX3UmV3hqeZy25CdnQLxsGKut+WyltAXKp6WRCOPCbUoCf3nAYJ7KoOqxQ9kSsyCY2cxA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847103; c=relaxed/simple; bh=hRGcrf757tBUlPVJghD36FxXRGKWF+Ddzd5vihoN5uc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bjxOpjFlCK1NMinQOwDgswHP5Y2OH8XxuQZQBIicYGGWwUzPCzhR6xmw/s3u7RaB5+OXwF0cXyh4XAiVtaboAMwo440iJuB5dvW9VgZflwW80pFP5Wyltuz07sRNBxEkKGg9aoVl28+CP15C10qLXpnCDu5Rw3UaYTUl4JtXEcI= 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=YXPMvkaw; arc=none smtp.client-ip=209.85.128.49 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="YXPMvkaw" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-47728f914a4so6467655e9.1 for ; Thu, 30 Oct 2025 10:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761847098; x=1762451898; 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=YXPMvkawHvTCa7O2TOGqIkRSO1AsAnYS4wF4Dua4XUXv2vIpXzO6uc8jbEa5gb9bry KhOjFGa4yRfI4Pw/V50I0GAObednKhdFwdvbqHIlHE0I0qvWfyovVf2P7wBQowI08Wd+ dZpL2msLWPRY3bGpM+U2DuONWxQbLjw/ucVzbQn7b4gUBggJ+oTe1rcYk898qTQHU5vB yY5eXqw5B6ZbgckwVn21oR6mk4y5ZtHxrqNPO1+KzTfMxATL2yVqO2sI45Xa4B5tycyS bFknHEf1kI6vu8pKzr1zsxf7tcnzmwXlu1OaUvyq2PYCzc8Oa0k/GRCjZ3II9pHihdl7 rYJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761847098; x=1762451898; 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=jKV61olYNki66cbfJOK4t1Bfg+/9N1WR8kDzOzsWYqHuaWJi/sg8fhKSLMDwLgrhyc Vh07OLHpoN76ud2uc6OlckP2vuY/lVsoXfiDn7bREAGNDpYFbfFvDNv3rhkzZF7912yj X89lidr443awFS1Fi29zOKf2sl3Pe5/3hiuz2XKCAQ3739n0VUYuam2MTw5T0+1MzLlT F24I90Y/fbZ1uFoJecSO4yNUbyzjA2jncLSrt5t0S9zpOfPXuQaROPsDkRsFs5wCV5Br 5ykuj6AmOsioKHyIdWKAbWmto9UCP3EYbOQN5BeBlqkkz7PdhmYCa0SwxUsnvQnvtrIq UzNA== X-Forwarded-Encrypted: i=1; AJvYcCWnaNC05RDsJFF1beR114/h8rWJ0sby3a6LbeZr+4epT0ra49QwRHBDXKrfzuBl2XPy7xh2aQk5sd/v2mY=@vger.kernel.org X-Gm-Message-State: AOJu0YwWNBigiuiQK4pcLPJCYnqyGZ/9wP7dz0Hp4/yyq82VGNClY6FP MouWoWPRodxpUlvP4NaBsWljKvBEFnOOxqQozg35LqPg/FfAEMqqpqV2 X-Gm-Gg: ASbGnctqv7BpPo258yk1VILkU2r1mOIiCkVLyyeGxkQ6YHSXdFueQe3n/EYR1q/88O7 lpC3T9NVCld6nQ9GhjDgBikb2A8fnXkMMO7n9sq7QUs6xmk43O1OO2s5NYZY6cBn4zXPJeGF+z6 5DcKfY+qGlXIeOVrB8ZfOuPlbSY/R218hsd9beBFRXmhTzMgdyF8a/oAanG5my+JZ6h86nnPFjm Pxt/4NeldZUvwqutL2gRc0/VP58vfmDbn/58CtL/87xFWy7nSru7P0l/NVJV37D0V1rp6MBFUEG H9meKgKdCyaxAgj/7950bQXBFBn8WJhTY65WW19xhZ8zMwI8vuY3i7VG4eXASesOF0orM4A/t+X iv0XYUR74hQytyFhCRGwbD5YC0RZxCgpCaf8Txzg/E28PNhOPFkrZC9O5/bRqWMWHKMQEswSeF0 DSku39lFNie1tMbSvJ7CHzGciJ9XqOM0y8+r/SD29Fefttjte5I68A2V99t2oYFnEw/MtJIKk= X-Google-Smtp-Source: AGHT+IFxF/iIFAzHknsywdTtIa6UpsxTE/jVAyMQAFSxtFD6VyWI1a9ctJ+afJ70siiRJJLy10m6Fg== X-Received: by 2002:a05:600c:5295:b0:46d:3a07:73cd with SMTP id 5b1f17b1804b1-4773087258fmr5929595e9.23.1761847097921; Thu, 30 Oct 2025 10:58:17 -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 5b1f17b1804b1-4772f53aad6sm15098055e9.13.2025.10.30.10.58.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:58:17 -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:57:55 +0000 Message-ID: <20251030175811.607137-8-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175811.607137-1-biju.das.jz@bp.renesas.com> References: <20251030175811.607137-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 08:15:24 2026 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 54233375742 for ; Thu, 30 Oct 2025 17:58:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847103; cv=none; b=D4ytN8W0flYUrNRooylJq2nRNGf4DSO3xIpj08CewZnGKI//1BVf9fBS7SS7RyadAT7dATdi8OK7+gTTJ9TxSklaNHUHjVHQoBk2evYQfJFUciAntjsxAHVC1wf4K/1rTLuY4Y58nYRqBW9pGPvkdVQms3/f9ovjar4QrUl5I4s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847103; c=relaxed/simple; bh=vO9lAruIFRWwmcjhkElTrINqAF4ZFqyjtlRL6JeFb7M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P7yTMjQ9RjGdNcFjJW3SNP7AtG1H94G0D1P5mOFa2MVFBEzV5Gl6OgRxARjYfwnUyQburqXbOz2sufJpurz42WdbJbgHaIBpagvpxiUg5AJi8gXOvCNF+og0Ii6mG0eyt4mj16FHlWPpHhAYAZ4bwrBV0STGDQYATO0m+iReC7M= 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=G+3fxuz1; arc=none smtp.client-ip=209.85.128.51 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="G+3fxuz1" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-471b80b994bso17423575e9.3 for ; Thu, 30 Oct 2025 10:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761847098; x=1762451898; 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=G+3fxuz1w6dLvNdBnSclQjsuzXUS/OCeDEFOcc66qghMNxL7Iy/2o143MmZRVvXZz1 1spVp0vONa50xG30/qk5WeBwq9kGdXvP7Mx5klSK5nboaWcbytszB0J9hXp8Uo2KuHIm +2fS4Q/Cy7wLHIpblWV5dkIYSZtBPnqR6nIuQtLg9Nex2QVICZ3D5Yv8kRY0oTr9i7g2 n/L5QbLcPuZqZ/Kz9vaIHMpMskZF4oKZVHNObkHIKd1WEC8dBcZQTGA8HeaULMYIZpPJ XWjCxt/f7GW3U3sc+qO9Hpeqyd0NGZ1q1+U/2vZ3S/5DeAt38in3bx/HZHJQUQOH7doI DUjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761847098; x=1762451898; 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=h0SKH0kQuURmSVa02YRl/JAuGfwjwfOpq+qoz6rAru/ld2mDFQ08aWAcNvPB39a20v bGPBBiZz4dJ4jsz2Tv/nFQPv1kWswItIGS13R7YFqDkXcZQhGK7NHmuukuhDLK8k20RT Yy+zdGsoyFkTI7fg5TDclFyxa149NGzWSaNZBDLIejdYvmt7GA9UixMvMmDMwbVGnflJ BSzQShmlIJ0LdpG8Qgk9CTYv6CKp6U+hbjgSf7JY+URMh57v3uyXBd2vKpvOB3yLA0Ud 5n+WPJ7JbiQouvmPaPMV6o+pvQv6ZdvsnGILl6hefILyiUjMcxCyIy9HcTaFlYk8W1Ex bYpA== X-Forwarded-Encrypted: i=1; AJvYcCU41xAQxfw7lAF/V0zEqMYX15G5FQEQ2t/ijYCJ36iME58pOGS86Ey3jm06z4WF7FQKWLlT65Czn/idF0w=@vger.kernel.org X-Gm-Message-State: AOJu0YwBBHwYuyIBmimTU9oQ1Z1T83gf8opBg7ivBuhqRnFH6LL3cpOf zws1qWZRAC/LF/0oZpjbICoNJIJ0zBgF7FdGjMbfGcP/Iyvs5Y8eNbtv X-Gm-Gg: ASbGncuYnM7NqjoYePu+KqICs94msBQyD2zYK+EE3mnpx+uidDKb2844twIj+KJkqjG O6eKl8AJjic5kR0E5zP10tol4CVoE2yKPE61L9JcVvubqOqU/O4ARLkNzdM2YoQzQgsyi5KEghu Kh8zvN0CT6KCtWClnS2oqGLLAxjEG3LBmqp1p3Og1Fl9Omo80fZa+jqqFTqo2Je7a/hnBRMb/xc CK9cehJDwsBXrJWWzjszrvWxlUaW/IqObLjR73sJxRUWxb+n4OuBvdY7wCqB4wlPv4HKsv3oWWg fi8h/GdirZmqqGoVN0OgvadCjAx9XN4iTa06gl/Pg+MnYspt4gOoLLpqZ8kDpFTProo1v8XkU5C 9FSuGDx0DdNzKkSDQWXRfcAaDJNm4BnKEXlcyebSXfFbiv5mXI+al27KDLrwkEFxcWVxu6kd2Cz y7plKwq9cnefNhiWZR5ComceXmU5Eu6fpqJHxvOjmUAm33AM1HaeTovKo8qPkrWFdu/X+YBBY= X-Google-Smtp-Source: AGHT+IHSLeHPyg7IKsaNF1Z5dRMW0XOJfQJfZIjvZOv3DXHqMuCpNkr1OVMVg0G9x3tsIeUBwjGQJA== X-Received: by 2002:a05:600c:1e11:b0:475:faaa:8620 with SMTP id 5b1f17b1804b1-47730871febmr4732345e9.20.1761847098425; Thu, 30 Oct 2025 10:58:18 -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 5b1f17b1804b1-4772f53aad6sm15098055e9.13.2025.10.30.10.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:58:18 -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:57:56 +0000 Message-ID: <20251030175811.607137-9-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175811.607137-1-biju.das.jz@bp.renesas.com> References: <20251030175811.607137-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 08:15:24 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 0D4FB375757 for ; Thu, 30 Oct 2025 17:58:20 +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=1761847104; cv=none; b=qNrFK++J8fpe4X8DKJdNPV0UbxpT15jV9f18BomTmBu9Uof3coLQSXsrtFTJgQy0gDQm74GtRltBs3jPoy+H6JfTWGUnkm3qAeqarSevzNqZkr51zqVYM8fVWQHNv0b62Ec1tD89mYZADMigFvgEYF73WF7xuOHCagj30s+Dqu4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847104; c=relaxed/simple; bh=HUpnC1htM18fOjkA4XpHL5QRou+4yn4bYa0B4lXoOyg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l2eGFPjhwL3GW9YpnTtXluDDR/urPwrwF0CbC5qzoxz9y7k3fU9+d6DF7w1k82CdYlFMUdo5ZNE72i2v3b5rWhSYLPDLelICpHKyWE21OTSEZkK70ARDFM5qEcTLQ5OZso+nIrHXaNAjwB5JJaCYb6B7/qM48SgRvuFtF2b3+sk= 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=EUggTbiB; 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="EUggTbiB" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-47710acf715so7587995e9.1 for ; Thu, 30 Oct 2025 10:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761847099; x=1762451899; 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=EUggTbiBhseDw5AelPETgH/Zu5KInJAirZUTl+wFeQi4mXedPnPlZqgFWeX4IKhF/i cPcMaoU5Z5L+8zDJ9rXAhxgiWzASxOmyN2BQ1c/zhBQH8lLr8aucVnFuFP7mt6YANHaT 0PyIwCH7t1R0/xt8Rfj3twrM6UQUUhCLCwxm1w+qKaQRaMnMPmMpv8NGRkyKekveOYts 67/pSkxTCJGIXNcDZKMQ4xOeB/NPVNVhbtHheN5YcsX6EAp18lygQiyLbKPyqk+RKb3o IsYfMKb/Yfy/g+HAKD7b9H2w5vdfIPmkin0Rw1S2WZ4bZgrkjEdMZe0G7c33h9Tx0H76 SiiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761847099; x=1762451899; 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=hKncUW4nsyUS5vGxJxhQv5jNtOEYNfiZB0gH8vpMSDyipBkq7qdP/J2SO8/wKYWA6x CgL4VHrOwgex75lVfG4LAVxuzvWPI970Pwy9kwHD8Zw+KIb2hAe2KTRyoEGikFsaapj8 mrj9TxiS6Us+8ppvvHEaqrCrKF3qz0YH3sj5El9cjPt9gsJ2aTGtfpW1v5Nf+7Z7lmph l6va7XI67r3II1TsGwiawJsVlSemuhg2iAi1Jo6VLj4BreAGS2T0m5RyGmHtivt86loN DYnwzlTJ5LjWRA+Jfp3ITyH1BjeCqr7ZYvJgH5nLEQobLSLXhx077zcL8MH1IxHpodW0 hUQA== X-Forwarded-Encrypted: i=1; AJvYcCW3KqIqLTC6ib3UPUeH9rnoOMhl0pP1M+0YLOGU2fM+wjrLwfdGc6rLRsTWtp0TuQALkh0ZXTbCmwBN9DU=@vger.kernel.org X-Gm-Message-State: AOJu0Yxh/JK2I3T7zK8skFVSyEIGcAykWaJfvEHg1e+XEVzY/LJWMnXC ZtLhnwfCwgCbzPJOe1TVwjjeeCtcnjg9eZPS8+BmQEa2YBSJTkRvh5AK X-Gm-Gg: ASbGnctnY6TJvpB9GmW2McenVsTr1uKw6byBC3dRnijqELjgoLE8GcZt9PrVkZM/FQB GOIhvMB8CtiKdLRme5hrvLU57maISIwsw8O0231kbtY5TdodgasVaoLm7OV6ZgSfWCowS4AxqP3 D+uOLHMukPn0LW/j2GikPGOmRvQ1gsImWyVKZhsw4sshCqg3TmkOgf8IYPMcox9v/+FGtj/Mynn l9KubNaaLA1xixnZYkQV9ElLoQP8GdxeAP/SxpS35rBmNXwkCAXktiAnYGpbYWTeQJmR8W0yYTN 5P7roTc6AsOaMfwn+CXtZ7GDXThRxtDvop4RnDVbEISkkKH0ITsDS3rUkj53mimhGIG4hjpbcpz G/uDX8c8TZmx3fAJxY5j+EnyTrJIVv/O0HwfsNhl3l4I7ZS/s3NjdsBO5VbJiAw/1kB4omr7gMd hJhGCPcnmp7JnLvVLJt69rwvhY6YuteOQ4dTTYsz9BhbUnVLj3vhcSbKEWMUzyTzlyb7YRgUk= X-Google-Smtp-Source: AGHT+IHCnSAFWePFf3QW3AZNoiI/h3gcT0ofd78nlVqllQKhXKQhlnqG5HXZO9bGFC2m/6UHt0HCZA== X-Received: by 2002:a05:600c:4ed0:b0:471:1415:b545 with SMTP id 5b1f17b1804b1-477307b8f57mr6623855e9.7.1761847098870; Thu, 30 Oct 2025 10:58:18 -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 5b1f17b1804b1-4772f53aad6sm15098055e9.13.2025.10.30.10.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:58:18 -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:57:57 +0000 Message-ID: <20251030175811.607137-10-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175811.607137-1-biju.das.jz@bp.renesas.com> References: <20251030175811.607137-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 08:15:24 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 363CC37DBC1 for ; Thu, 30 Oct 2025 17:58:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847103; cv=none; b=qRghcTJxZKywitNLrW59jnSqKVtGqQEr6n4YDzjOy8CAddEN9LjSYHtkss1DhjomxPY8EXjWDX9qPH8walh4wJ4sjYZ1lnefI6TiO7PziiQu022fDVrVzP8o72OY+TC2o1XmgyBhWBiz/xtr6H4GUA9Vq7AX2uenlRCWzI4F1A4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847103; c=relaxed/simple; bh=FUUpdN5VqPaa0AglNAM37NGlXaHlU8F1s0H5S0bhfxo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RYspIev4BPZHOMbZ4mOwUkn2kp3761c+eHzQ+4fNWO8MgIZJF9PJDgIIawVkFVcpKr9O3mS6cddlEhc3ZuWPLTdZWii7CR0bPYz61BgFCerpvc5PKOLrznrBV9RHtj+JvpLUbydQ+g+mlVq9Wjv31rBJzCwyPZ5yEBqgw9fpbAA= 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=KHk3RpWK; arc=none smtp.client-ip=209.85.128.49 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="KHk3RpWK" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-471b80b994bso17423745e9.3 for ; Thu, 30 Oct 2025 10:58:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761847099; x=1762451899; 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=KHk3RpWK07Tx5yE+KFd36Erln8/MJ5GLnQUmV/VepNXLQltC6ou5pNnkrpjSqeSg9l rFsNAhnluyEz9/5Mhzrs9tC5s2FvRvVjcB6litomKpG5Iiivebtq3al07fOri/hs2Vvq 9CUPgEqk71JIw/mqABJ8Gp1qPKannJk3QgHh1Qn6UKB56I1dfVzA4c34RO62bjk5u3Hp xl17l6lq/bygbBGxYMeAjlRTRVJ9WZIlhPRxW5RdXmQQXBetmPHqJ5+QOzTDS6f9CEvi gXK6750S1CPJgy6JJD67zBUFTcuz4vhhuIzih9DaElLeww9TLWXyN7Zq8MHJnS9PDBtQ /L2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761847099; x=1762451899; 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=wvN4/lltoYVbbsOqV3sKAarjAwwhTPq8sxVyEJlsYJ6zmh7IrDyX8wNTjeLyKZpi0G TGbxknih2XNWJZDNeQnaNMZQ1PfT2lC6DcdBwxVQs9+LnlxwUE18gCjRqOE9jvPTnMRR yDw4+T07mgdB3GPdCXWopwNDDEmqVMD6bzKq2EBwEVvKUA9w339MfR6oWz0krz10/46X AcjWNo+KPQfVxeV79ubTzYyYNMuYctFjvEbyn55ZKnHunKTZHGlrwxh/L7VxbzUQtvfy 1xR6fy8wqFZSg3e1bFq9/YrTlseb/B/KwhrVX774yzxcN3PhxpJHPMaM5JfsMat/HPK6 m4JA== X-Forwarded-Encrypted: i=1; AJvYcCXZJC+QAK06nJXNNnsXXZOCI17dgV9MBOSpOn3xyDjcapLb1q9kVcZScI1o1l3WKRGhxaDezV2C0zmrHRY=@vger.kernel.org X-Gm-Message-State: AOJu0YxvnJNy4MhH9nlNSiXY2xE7C3v/Ib5cvgfo5NzLzh9wqaum15hL F0woIcUcbucmIHiyHwaw39HDesWQPSZIjEFLVqChKFIAoxWLku0CNvzh X-Gm-Gg: ASbGncswtZF0SnF3UrgAhd7iGmnjA3BxgV8Qjvd/pXWaB0YKd21lHSCVRf6tg/cKgP5 n44aX/7KlfZMT3JODGLVMjTP6axfBMQ0JMZJU1wkU0geyGfrXInhZzWvlK1fY9aZOYFd6SdUssx Qb2E0/yy4PGnTKhhGmmSibMzkF2TQ8z2ZgnRWFanQZpiFLPpKLXtFst8TiYeCDy2g1Dhb59RbaI dbcAPwDMvgz2/9TZJhbqYmy6Sf3yi0MdNoTIiadOJzC22yeh6og1jyYGr91mWPsYwy0+b3na9lA OydSMaQn8QXBh3SpeoHDtolZtOJV23otKuNbua8IgkI4pDRI4bBqEMopP8JDOkHpV2jriDPq0b+ HCQNgKySPi8jrvBgtoo+1dd7YwSVDO4hcrpy/iXnYSL/eLJQMcUSDIWttFj8RNiussbUz1TuZ/c 48vtvgsssp9yrxh3B/dAXVUvREmg3BnS0qwxT0oItQa3CN6fRZlTNd34LMMPye5ZeTVVu31TA= X-Google-Smtp-Source: AGHT+IEM7c5w5v0aGKFjPUDUh4EvuTkOKmjFdioWbv9NSqY6m/OatijGxXMTlQm1Adm4IZf0xwqM/w== X-Received: by 2002:a05:600c:1c93:b0:477:58:7cf4 with SMTP id 5b1f17b1804b1-47730794401mr6582545e9.4.1761847099337; Thu, 30 Oct 2025 10:58:19 -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 5b1f17b1804b1-4772f53aad6sm15098055e9.13.2025.10.30.10.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:58:19 -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:57:58 +0000 Message-ID: <20251030175811.607137-11-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175811.607137-1-biju.das.jz@bp.renesas.com> References: <20251030175811.607137-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 08:15:24 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 ECFF137DBCE for ; Thu, 30 Oct 2025 17:58:21 +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=1761847104; cv=none; b=uYHQimv71KGP9tzKBv31Y4xIfErF9GXbfeKVqlCbuM163dwKt4tahy8LvGXHVJHVIDOQg8/AQLMJnuytUkx1VnkaJ4yUV58V7zMoxSfB+Rz8CzxwDru5h1XFk0gtzt9KMLTjVkfc2pcZKcBJcjh/RwTX+QBvPj7BtCrsHfIxixk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847104; c=relaxed/simple; bh=ZVr695PrkjlsTLaO5UZFDg6DGUr1VgaEBsWlk7XU+bM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LYWXfYwVM5pYfc0ONXc+m8dFEg7V1Ug154OW2wD9pPiWZpn619dT0X8kDBBq8qA8S6Nk+sEYYJ2dDxehofkKKYeAiWM6uOpvzAafl/GEFFl51sm+/y3orh+eAsK6Uj1TGHyjRkI60M8dnaOOyf5rS8fDIl58Swn4mpsGaRMjbA0= 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=azfsx1pU; 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="azfsx1pU" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-3ee64bc6b90so1123145f8f.0 for ; Thu, 30 Oct 2025 10:58:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761847100; x=1762451900; 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=azfsx1pUgFkTpN+3DH7falTpbwTn0N/KvJ6g8CC7E/3doS+qKR7yNqPpyogWr1QVE2 iMsNPVBxARX1g3x63S0iX1GS2pusGQtkWWAQhcvjjkWjXM2i77OBe0wQqz9yHUYhzNkd Tc94/bq4+WT//uyIb1+tRf/r70lSOPWYnnmEJb1VSZA4DTbsdZBckHYAUTeeBpx5bV9U Y/7moIRtxksVby79yTngd8EHSQrMfGGBxVEwQoC3QveM4wpeP53UvEbQ+uKC4R0POPxj T7h3mF4LGFfH8Y4YduINwE4kDIuAC0bdqoCxSzDal+02OW0sE7OG+yMNZwEdFfXzu+8h VePg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761847100; x=1762451900; 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=Y7XDQm3rIAiuiialXJ/toDEUiqk1LNPzROBnsZTuk7Jcst3Ll+qudmfPoLNQX4ZnBW twkm2WoAP+9k6Shf5ffc9r2ozh4XC16MtbL1q6F0d3NEV+M9R7raHEaBjTowX++cBkYq a2DQ9z3vG/+IWzb2sZLgUAfwQLlySEj7DzcWNLvCxRdKwqmCyHyynWLgiuaesgi4cshj 7EnUU2kwAAEI7Ik+qe4lxPHiQBB+8NHCvDt0ygTR6dOtl7MQh6mahre1mkunEyoadhx5 FjoIL7OV2kh3t166a5hoEFoFHKNjHvV7oWnbbZPx80vj4IiPPCsu09Z2cHpLaFGaDqDr kTXQ== X-Forwarded-Encrypted: i=1; AJvYcCWMQC0YFhN/vH7L5GPNJC4NPAD+cUguvcK+2yiEceQmvP/zcX+gaftKN3G2842b2Qp6AwQxTGWYV6U5xTY=@vger.kernel.org X-Gm-Message-State: AOJu0YzRRlTRgYtsPsj3TbYq26upUn+S219NWShGRZogEgHEsqeEf9iv SJyugil3vH/85vX/FZ7voOJvzXek6efF7hDRubtzQG5abXRo92HScQfc X-Gm-Gg: ASbGncu5Xrhy0MN1KWSxskWmNEUbONRy0ypLn5Ejdl/Ssz/L5lkxvuw60HPeZH+anDB ynHNjZvyRgfFNS7BoluWT7YI+3RieLWe4an1wPrTxaMC3WtP5v48x7W49F6YEIXil9RbOzi41vP Gfd2HBcVSl1oo6K+AUgQTbAXgsVfJXMVX+op+8GeqJHgwwu2a/0yWgz92W/F41UzVZwFEh22dbn ffXXzznUCYJ6pk/0KkiKW2wP9mPsiITEY9bnR1lLLMah5Zl5vvGbzblNBrpAeVZuOVKw5sWTB6E uIyH9fwhLA3VHnAzlVv0xOdDhee+KwCny4Q/vngAqSYA96MrCMbyFd1MKQfKN8Io+3/xUDf8idj SLh6RLn1dx1tltVR+NG4hS07gXnveiyrt//zMqCl4q70OOHMmwbsVTsCyGLpFV/esX1F0rLSNe4 lKVo8XuvFtCzi9rIvkEzmmDAnzqWvhCbBlNS/ilJmSKf2RbTZwE5CuJH+Ksi1OlbqPf7gA77g= X-Google-Smtp-Source: AGHT+IHuRhTGUiR2NIlai1bZW5SqOJBWIIwWKnWsf40J77cS2AzqDsRE/KFfqvOf5LEZ0cNzAruVbA== X-Received: by 2002:a05:6000:1ac8:b0:3ea:bccc:2a2c with SMTP id ffacd0b85a97d-429bd6726a2mr523089f8f.11.1761847099845; Thu, 30 Oct 2025 10:58:19 -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 5b1f17b1804b1-4772f53aad6sm15098055e9.13.2025.10.30.10.58.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:58:19 -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:57:59 +0000 Message-ID: <20251030175811.607137-12-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175811.607137-1-biju.das.jz@bp.renesas.com> References: <20251030175811.607137-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 08:15:24 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 C5D3E374AB1 for ; Thu, 30 Oct 2025 17:58:22 +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=1761847106; cv=none; b=Jlo6o6KT5EnYG8NEa7k7S8zdg0nZKcHdqXCzBIMoquOfcNk0+3Sekz0cf5hfY0m1hZHxjCMlosyzUYwm3r83FeRImTCcGNs5gVbF2SAQQ7tKF//fz6AR/vZRJGDo+pjcCUck+8QRwuMpWtvZsaoc9zRlkzTqfXt8o98nwgvJ1LQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847106; c=relaxed/simple; bh=HxHvhoN6WLI2e6cUh87N9UQ5gXQc56q7zIhiyZRxEVM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P0I4xAnjqLa3tzLnpRQMLrosWBTw7+b6IgPbwUIKunlGTQusHSH8gq3zcfXh+JPBnv5siPlQMsEVR7hy2ZbZ47aLnIDY2FH8J6mu6BjfvciWuM2O27h9tZxLaWC459pG/Tn3fnaXJOTIY1ausp+N1VF4esdLpLYATRMfYstew4o= 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=U+bEFrXy; 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="U+bEFrXy" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-471191ac79dso15210955e9.3 for ; Thu, 30 Oct 2025 10:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761847100; x=1762451900; 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=U+bEFrXy3v6WW+QjI64U2va/kjLoS0OGi3R7k8blDuxhwuco8BVnXLI2OWhwawz0+E m3rGLXCrbATZpKFr3sISRq8WKPDWs3n0T2ZlEM+gVdzoHfNMrpoqPrFJOGVu2w/DWwh+ xORFb+iCcFJpsqxJyQB5WCWF3J+79NplrINyghDHqLDhvdDnfiqX+Et1kGMWlFFUG7rb mah7Xta5+qHJo5PzgsHWRf+R/OK6L5FQ3jB6ry4x/mZZHF4sa96MYag2eCw4uPSMEDB5 kp6JWtF+iJLOOgB1YW6jUrTuW0y5C1cMLvEnTobanwppvxbQ2p8HnMuHxnS01EHHt9HV vJFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761847100; x=1762451900; 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=dkA2jFAO2Fzfta82fPFQCpLdexMZ6Z6ZbeoV9pD7Tg2YnBjwmMUF2xMOSco/+DzVRZ 4F3IETC80T9KKr8H2wHdWfKbhaCmvN5rYkEqU6OIS7eeJXAtMp40jMnEcSTn3bRvbZcR +BU2dRkJI3bdfXWp+qmy7v58rrh0F9CHRwxf3gPmKhNathIokp49XkcDMIF6Xyxbd9DP 38Z5JgJLK/wbvv7VldPVabZ91LNE1l4q7hHFRKKAnvjqA53XxkqmZeQWQDKG/uGu/0K8 PjipJBMly0sJo4PJIDaLp3N2FUmRZ+eVjykkHeTjqFSeATQrD5YSrNG4Pg9qOPeEKT8m a/6g== X-Forwarded-Encrypted: i=1; AJvYcCUqfuKA8NuSRWBJ9K/u6rHQ754VT4/PlD3T5H38wvP7LjfFYO3FtcJLI397y5k67TOzvmhEXHD+xUrAFSc=@vger.kernel.org X-Gm-Message-State: AOJu0Yy+nDaXDMH1ek/eYUEcoMQyB36KPnkQGX5F/hkEKx1CKG0eGjF7 B7qyGf/S7OAsf+qyi/ZuMZezECJD9GvhNCBNLmX7kQWk0E7LlXGSkPbo X-Gm-Gg: ASbGncudfCvxttz5MvhJX7mu1s4bHDvDR49a5HDrBxcr9hAH6reZVKi/Yx9eYFC7bHo XGfIwEjZNJeZ1V7Vof8mdrz6rTU3tIy7Vb4jZhjbBP0aOfcDpQgdOTR8Yy0HrrRDJ3o8jEhwNQu 9Pmfp4l6fZ1qe297m+ONxY6tgddPCZdnqOnj6IoIXYsgoT89kSZrtq6UjzGdb44V8r+cL4ILLt0 bacEFY5A6iHUtklhUKgGOACv/jt/0vpZamnL8sy60CMCzhXM7BzQ4HlgTiTFUHHjER/idaTXMki mlDmphGPX3DpiqEoH2Hz5HQfqI5mPzXhrtC8LkSMMHotxDloYdUSHov5ZHbYF/aWZNT6Y8zhPn/ 3gHRsKiW8/sGm64gx6W3ySpj2Ag4GkM605RKNfJEfRGQfXJS07FqriaLv81yU2hpCKyIVmzXTY0 TS7y6A2vW23brrynwbIyXt4C6+rsm8PknVV4kakKgiwjFs4z2VI3jGcmu01/avZ7Uivb32sy8= X-Google-Smtp-Source: AGHT+IFejjMV1MXViC7OFDq4Wo7fp6zfnGlAxE/CnK4NP1eTIIt/Hwjp8uRSRgo4dYR8KGjeX07+Zg== X-Received: by 2002:a05:600c:4e05:b0:46e:3550:9390 with SMTP id 5b1f17b1804b1-477308b60camr5418935e9.20.1761847100380; Thu, 30 Oct 2025 10:58:20 -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 5b1f17b1804b1-4772f53aad6sm15098055e9.13.2025.10.30.10.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:58:20 -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:58:00 +0000 Message-ID: <20251030175811.607137-13-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175811.607137-1-biju.das.jz@bp.renesas.com> References: <20251030175811.607137-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 08:15:24 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 16FB137DBF1 for ; Thu, 30 Oct 2025 17:58:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847106; cv=none; b=oisdSnJEg6XPcxYtc0Bxpazy5cGRZ+eU91f8MjN3wAlZaMi8f7TyHI38ZT2PN/aBxaAHox3wnhURlDu3eouoO0d2pJqcEACqOZLXhF7HB9861G49NEMDKl/NQyl+PbnzlcA5sLRxUxaIy9p8v07DRCsuwTe93P7uw1llch1QejA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761847106; c=relaxed/simple; bh=l69I5xmyhHro4KhUO/PVpo4RcLcYevtDC9A8q7K0wyM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IOWXRM/YOr0mBmo2zlOvoGib9wAx2nRz3wEOSDgf0a6q4MBkRI0WekIfT+cZmkGupptZ/TRC/AwADGjh0v7Y+z6vJOIMxMa2mmW9JW2ofR0EPSBrjt8XciEqvWZ6RCMCCOoU+VIRzIvkVYVrIrH7jkgG+l1yIz/81BCFrvuQ1E8= 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=EypW9XRP; arc=none smtp.client-ip=209.85.128.49 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="EypW9XRP" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-46e6a689bd0so13290075e9.1 for ; Thu, 30 Oct 2025 10:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761847101; x=1762451901; 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=EypW9XRPOjXY/BwTMmufm01QyPpSWGmXwGJociTQ25Jl/FZTsXefmtvkwsACw/UEqA DLTcqoHNxeYGj1Y2MtDb4aQM3U/aJ03+UTHP1a+fQrcBeAqOrAT6UNfYv3m2aEc9UwxQ nVDvkSC9OxQmrE3oq3DfgGJLJZ8hG7udOrdqY9qgvD9Dp6PbCssOe340m3fp+kmDNDU8 RzGCyGNhAcLQo0Jk+Hz/9nmdbvbeZqWqeFOknFWr2DyrmhuLkBF6dwGksXMJPLOIw71e iBpK9vHi7waQi9M17Mx5FCEco3yDYa4jvTLppDWF5UOdEyY7C2M38RJA0/E0TZHW2jI6 33uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761847101; x=1762451901; 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=S8A+fmPQkwjHLhgLNj1P71YAYQ0AR4LBNjW+/s859BjXt0Sof8DrYjOt7GMlxbZmNM YVSC9w/MI9rTP4t5VtrEqJtOgOY56LhTfT8vVxm6/ZQJel48KeYERPwHApUq9rfMpzm3 HIorcjmHOsOEQhv26ntqi7tZV4PZY2K3+JdTduLFXe7n5rUvPxxtqAuRqtXG1K+OI1Uh /LrvJ3oKHlhoUvfg1gFoXQ/X04oCWJLXckTLloLttSN6PY5G8+HI+C3LuuNm8GdizOQS KDnvSG+cjP9v8lEm25e6l/C3NDQzo11c6/uJl5sG9PH1MfLA/gJVDVINfCNzyfrMI4W2 c6MA== X-Forwarded-Encrypted: i=1; AJvYcCVx+kQVLSI5OGXAxb6dIZmhlmuNT4dc23l/ct2WpmonGF5J67ajYn0p5aPM75SbYsPZk084MEKEywVAzKk=@vger.kernel.org X-Gm-Message-State: AOJu0YzIUOQ2qDq4lIcDS2FGHzrBYrEdhFE9O2XQjgxGdE92NdEaikax 9L6MQ1qYzmICInuxEqjCbPPZQms+lxqL20jYJzIlq/0y5VWj3Q+GFST/ X-Gm-Gg: ASbGnctQnu2dsQpY64sH3m55CFQkOZjMYokXbsFt+/KSTXtv3XiMR2dLhoxVtcrI38m 1ITMlw5GeVVrUf579ctLBu1CJ++y9ehuoHw9uBgrWXkyMyahrMQJ5PXMJi3Bn8mI95Fm9+G/mJg mPXkdFkHorh3cMrPUQaQwu2dh8aQl0oE5DjlhFbW6zFT/RMY0n2f8PNCDSwkxABKhFLtfvYh2db 7prxO+tuhRKIq3JL+LOydk4qGJL5xpArXfdGOsx09/Lr2FNFFTwfutOkiwnhWr1+JfEXYdalVeP EojJxJQimXwD3t39KAL+z8Wk2pXQ+QSXAb4yYdQdayvYFoXuAMv9VlO0QFXGeW5Rwb3VUkSe+re KTNj6FV934EW1GtqWfqj6K4Eb+Pgui3F8GyVIXTkuD2ppX343lXylIEot3quFz03njxwNsYRKxX sMwZfXKy13MAr6V3lqc5dwgq/rzOnTnLHnz9QTNMuYwTGVzyunoorbdEZ/MENjJiBcgj2LLs4= X-Google-Smtp-Source: AGHT+IFqbrKQ5/jJ201fuWsP+20Nw8T/bQElSs8vE0JryTvXYNgKbYIgvVDd+hZC3bnGBXBweaE/kA== X-Received: by 2002:a05:600c:3548:b0:477:171f:65f with SMTP id 5b1f17b1804b1-477308aa6a1mr5784485e9.38.1761847100893; Thu, 30 Oct 2025 10:58:20 -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 5b1f17b1804b1-4772f53aad6sm15098055e9.13.2025.10.30.10.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 10:58:20 -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 13/13] serial: sh-sci: Add support for RZ/G3E RSCI SCI Date: Thu, 30 Oct 2025 17:58:01 +0000 Message-ID: <20251030175811.607137-14-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251030175811.607137-1-biju.das.jz@bp.renesas.com> References: <20251030175811.607137-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