From patchwork Mon Jan 4 13:45:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 7948171 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BECE9BEEED for ; Mon, 4 Jan 2016 13:45:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E14FE2034B for ; Mon, 4 Jan 2016 13:45:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CE23E20374 for ; Mon, 4 Jan 2016 13:45:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752209AbcADNp3 (ORCPT ); Mon, 4 Jan 2016 08:45:29 -0500 Received: from xavier.telenet-ops.be ([195.130.132.52]:56017 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753251AbcADNp1 (ORCPT ); Mon, 4 Jan 2016 08:45:27 -0500 Received: from ayla.of.borg ([84.195.106.123]) by xavier.telenet-ops.be with bizsmtp id 1plQ1s00j2fm56U01plQs5; Mon, 04 Jan 2016 14:45:26 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1aG5Rs-0002eN-JC; Mon, 04 Jan 2016 14:45:24 +0100 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1aG5Ru-0007sD-A3; Mon, 04 Jan 2016 14:45:26 +0100 From: Geert Uytterhoeven To: Greg Kroah-Hartman , Jiri Slaby Cc: Simon Horman , Magnus Damm , Yoshinori Sato , linux-serial@vger.kernel.org, linux-sh@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 2/5] serial: sh-sci: Preserve SCIFA/SCIFB bit rate config for serial console Date: Mon, 4 Jan 2016 14:45:19 +0100 Message-Id: <1451915122-30219-3-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1451915122-30219-1-git-send-email-geert+renesas@glider.be> References: <1451915122-30219-1-git-send-email-geert+renesas@glider.be> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP SCIFA and SCIFB have additional bit rate config bits in the Serial Mode Register. Don't touch them when using the port as a serial console, as we rely on the boot loader to have configured the serial port config. Signed-off-by: Geert Uytterhoeven --- I'm not aware of any boot loader setting these bits, but better safe than sorry. --- drivers/tty/serial/sh-sci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index a7c062192e2d3130..e8d6fa77e11208d4 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -2229,7 +2229,8 @@ done: } else { /* Don't touch the bit rate configuration */ scr_val = s->cfg->scscr & (SCSCR_CKE1 | SCSCR_CKE0); - smr_val |= serial_port_in(port, SCSMR) & SCSMR_CKS; + smr_val |= serial_port_in(port, SCSMR) & + (SCSMR_CKEDG | SCSMR_SRC_MASK | SCSMR_CKS); dev_dbg(port->dev, "SCR 0x%x SMR 0x%x\n", scr_val, smr_val); serial_port_out(port, SCSCR, scr_val); serial_port_out(port, SCSMR, smr_val);