Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1011486pxj; Sat, 15 May 2021 00:45:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgaXi+eQXN+kt0E71VIV+qplfAP4sxUrGxxulIzQtqA7w8yjfcQBv1RHUWH0wSU6unlLrL X-Received: by 2002:a05:6e02:1d90:: with SMTP id h16mr43932423ila.59.1621064745163; Sat, 15 May 2021 00:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621064745; cv=none; d=google.com; s=arc-20160816; b=mqywpAsDX1INCNFVA58MBKY5Mic0t8q95EY6lez302gwoMPkjyBL0R8qrE4/k1zayX TfZfZ+yeDvcpySDkIO3We9Cl4kP5nGIDcJ/phU9ovbMo4sQkxKUcuyGmeu/Fs5gTac11 W0STKos4GMXqNB11HURfP5fuHXU6ck3ZMfW25oO13dx8BSHlWgCxXddXi2m7/DKYOhA0 49D4DtUQOU1zKIuCdnP2LRO8aC+JopRDVPaeCcn6f2qG5LLlzsBZaYwSikt+8dAEMJ/6 X6Ch7sS/tromG0dubS+sf4J29+bMiNPZPoeXrxUO/hBnuFMjrM2Dzff6uJyGUus8grdQ LbVw== 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=L3wPAG7MgG/Woalv4we11I4rLHxwXHQDzkj24ZwVgao=; b=njnPyxEAd2yvoKkBmqB6TjHdsA24LCVPEaDX4KJ3rooVrtBlf2TbndW8qa/awvPfCL 9WBNdvs9tYLmUtGFVJ1olpGdhUgoWWkWsTDDs6xzQwSWg9oX3KnIdv3MceK6Fk8q0HZA Td7+s6keHVeks+4G9/f6/iYdgT1QhXK6OLJ89j/uQBA6YyT2bQHHEHXdoNEBaPlkk5Fk /dCyX5Jd6nakEL0mUYfks+Q/hvMO5m3PyBt1FXf954FZBTAMkh8VtL4eYM9ZF9zQsLjN N3+5iomrZAA+xBr94LzXVNmMlScIO3fV4p13huUi5RP93OcE9ulnNQ3Lf+xMYCDyQ6X+ 9P3w== 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 n6si10982690ilk.9.2021.05.15.00.45.29; Sat, 15 May 2021 00:45:45 -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 S234058AbhENTZD (ORCPT + 99 others); Fri, 14 May 2021 15:25:03 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:53998 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233970AbhENTZA (ORCPT ); Fri, 14 May 2021 15:25:00 -0400 X-IronPort-AV: E=Sophos;i="5.82,300,1613401200"; d="scan'208";a="81343881" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 15 May 2021 04:23:48 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 8C0CC4010906; Sat, 15 May 2021 04:23:44 +0900 (JST) From: Lad Prabhakar To: Geert Uytterhoeven , Rob Herring , Magnus Damm , Michael Turquette , Stephen Boyd , Greg Kroah-Hartman , Catalin Marinas , Will Deacon , Jiri Slaby , Philipp Zabel , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Biju Das , Lad Prabhakar , Prabhakar Subject: [PATCH 10/16] serial: sh-sci: Add support for RZ/G2L SoC Date: Fri, 14 May 2021 20:22:12 +0100 Message-Id: <20210514192218.13022-11-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210514192218.13022-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20210514192218.13022-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 Reviewed-by: Lad Prabhakar --- drivers/tty/serial/sh-sci.c | 11 +++++++++++ drivers/tty/serial/sh-sci.h | 1 + 2 files changed, 12 insertions(+) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index ef37fdf37612..872a2c3b11c4 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -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, @@ -2527,6 +2528,8 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, case 27: smr_val |= SCSMR_SRC_27; break; } smr_val |= cks; + if (sci_getreg(port, SEMR)->size) + serial_port_out(port, SEMR, 0); serial_port_out(port, SCSCR, scr_val | s->hscif_tot); serial_port_out(port, SCSMR, smr_val); serial_port_out(port, SCBRR, brr); @@ -2561,6 +2564,8 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, scr_val = s->cfg->scscr & (SCSCR_CKE1 | SCSCR_CKE0); smr_val |= serial_port_in(port, SCSMR) & (SCSMR_CKEDG | SCSMR_SRC_MASK | SCSMR_CKS); + if (sci_getreg(port, SEMR)->size) + serial_port_out(port, SEMR, 0); serial_port_out(port, SCSCR, scr_val | s->hscif_tot); serial_port_out(port, SCSMR, smr_val); } @@ -3170,6 +3175,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 +3461,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 +3481,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