Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp623052pxj; Thu, 3 Jun 2021 15:22:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVOfLvvYoXIkvEttdEQKdIUnOBQzsTqND5qhTJtt0EoxHDWWRLgNFSAkOv9xFsjWOxQw60 X-Received: by 2002:a05:6402:42c1:: with SMTP id i1mr1565083edc.62.1622758928028; Thu, 03 Jun 2021 15:22:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622758928; cv=none; d=google.com; s=arc-20160816; b=a6v2X9+NHjW5QK3bV7IbORk70PhipDdcBe7xHiRwKPP5QW05w5dDK7O+fgr6uhc/ta g1hJZWrqmidBxg961eYD2TXWdXTGJkqdcJC/oiYc6+yU7sGQPPVcKOIZDI4lkBTpTDwY /1CubpJWFENda+Z5fBrFWHRnHBEFyU6byeJA7Fv14oSEipo8nrPzR5ECbnC65nCT6XPX ogMIneRZYfYGkCTDqfqeRHfhaH5WBLHicnHmjZmx0UmVRB+JqlzVAyXahqODDNoTu12D uieyLExUJdnkDBOMVn3YFGlryNM3ZT0lXT6XFBE3CINkAbhIAftZIo5aELGAKts4BJmh S2Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=kqwHc+E0lnZe8+h86y4tDdLC/vc4E/QwQaydFmy9rlM=; b=ull+Xo7mVg1PFtGnsyXO4E8hUPVHZZ1u0ew7b30tQNGyWL8KNMCxqv1ZKCUs/Yd7cY w33rKS9p9KDSR+oCJ0/iD7RMh7FEL7yWChraTyapRaWDxoEWpZb28TqGkC0T4t6elVnX Q6x6niYUSP+sQXllPtoKyz96lVhDCqz7p1YIKIO2RGrIrKgaZIKCdxp6jNl9GfNYAQ2o BZwQnG0Dx2rHd1vtlY5iV1aXWat03fJjO6XjwIKW7pUxW7RgdWr1K6Ts98phkJUuBgK6 on6Q+fa9cTVgrPJO6QIAPSJF1ZlMXCDea9B3fXSbs6FxSEQW2KSc3afjlOFSEIAQnc1w 9wbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e22si2867558ejs.654.2021.06.03.15.21.44; Thu, 03 Jun 2021 15:22:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231337AbhFCWUh (ORCPT + 99 others); Thu, 3 Jun 2021 18:20:37 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:9907 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230265AbhFCWUg (ORCPT ); Thu, 3 Jun 2021 18:20:36 -0400 X-IronPort-AV: E=Sophos;i="5.83,246,1616425200"; d="scan'208";a="83182177" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 04 Jun 2021 07:18:50 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 0DDA3410B534; Fri, 4 Jun 2021 07:18:46 +0900 (JST) From: Lad Prabhakar To: Geert Uytterhoeven , Magnus Damm , Rob Herring , Michael Turquette , Stephen Boyd , Catalin Marinas , Will Deacon , Greg Kroah-Hartman , Jiri Slaby , Philipp Zabel , linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org Cc: Prabhakar , Biju Das , Lad Prabhakar Subject: [PATCH v2 10/12] serial: sh-sci: Add support for RZ/G2L SoC Date: Thu, 3 Jun 2021 23:17:56 +0100 Message-Id: <20210603221758.10305-11-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210603221758.10305-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20210603221758.10305-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Biju Das Add serial support for RZ/G2L SoC with earlycon and extended mode register support. Signed-off-by: Biju Das Signed-off-by: Lad Prabhakar --- drivers/tty/serial/sh-sci.c | 12 +++++++++++- drivers/tty/serial/sh-sci.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index ef37fdf37612..798ccd88251f 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -289,7 +289,7 @@ static const struct sci_port_params sci_port_params[SCIx_NR_REGTYPES] = { }, /* - * The "SCIFA" that is in RZ/T and RZ/A2. + * The "SCIFA" that is in RZ/A2, RZ/G2L and RZ/T. * It looks like a normal SCIF with FIFO data, but with a * compressed address space. Also, the break out of interrupts * are different: ERI/BRI, RXI, TXI, TEI, DRI. @@ -306,6 +306,7 @@ static const struct sci_port_params sci_port_params[SCIx_NR_REGTYPES] = { [SCFDR] = { 0x0E, 16 }, [SCSPTR] = { 0x10, 16 }, [SCLSR] = { 0x12, 16 }, + [SEMR] = { 0x14, 8 }, }, .fifosize = 16, .overrun_reg = SCLSR, @@ -2514,6 +2515,9 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, if (termios->c_cflag & PARENB) bits++; + if (sci_getreg(port, SEMR)->size) + serial_port_out(port, SEMR, 0); + if (best_clk >= 0) { if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) switch (srr + 1) { @@ -3170,6 +3174,10 @@ static const struct of_device_id of_sci_match[] = { .compatible = "renesas,scif-r7s9210", .data = SCI_OF_DATA(PORT_SCIF, SCIx_RZ_SCIFA_REGTYPE), }, + { + .compatible = "renesas,scif-r9a07g044", + .data = SCI_OF_DATA(PORT_SCIF, SCIx_RZ_SCIFA_REGTYPE), + }, /* Family-specific types */ { .compatible = "renesas,rcar-gen1-scif", @@ -3452,6 +3460,7 @@ static int __init rzscifa_early_console_setup(struct earlycon_device *device, port_cfg.regtype = SCIx_RZ_SCIFA_REGTYPE; return early_console_setup(device, PORT_SCIF); } + static int __init scifa_early_console_setup(struct earlycon_device *device, const char *opt) { @@ -3471,6 +3480,7 @@ static int __init hscif_early_console_setup(struct earlycon_device *device, OF_EARLYCON_DECLARE(sci, "renesas,sci", sci_early_console_setup); OF_EARLYCON_DECLARE(scif, "renesas,scif", scif_early_console_setup); OF_EARLYCON_DECLARE(scif, "renesas,scif-r7s9210", rzscifa_early_console_setup); +OF_EARLYCON_DECLARE(scif, "renesas,scif-r9a07g044", rzscifa_early_console_setup); OF_EARLYCON_DECLARE(scifa, "renesas,scifa", scifa_early_console_setup); OF_EARLYCON_DECLARE(scifb, "renesas,scifb", scifb_early_console_setup); OF_EARLYCON_DECLARE(hscif, "renesas,hscif", hscif_early_console_setup); diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h index c0dfe4382898..c0ae78632dda 100644 --- a/drivers/tty/serial/sh-sci.h +++ b/drivers/tty/serial/sh-sci.h @@ -31,6 +31,7 @@ enum { SCCKS, /* BRG Clock Select Register */ HSRTRGR, /* Rx FIFO Data Count Trigger Register */ HSTTRGR, /* Tx FIFO Data Count Trigger Register */ + SEMR, /* Serial extended mode register */ SCIx_NR_REGS, }; -- 2.17.1