From patchwork Fri Jun 15 14:56:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10466669 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 98F3E600F4 for ; Fri, 15 Jun 2018 14:56:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8858C28DE7 for ; Fri, 15 Jun 2018 14:56:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86E5728DF0; Fri, 15 Jun 2018 14:56:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8BB828DE7 for ; Fri, 15 Jun 2018 14:56:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964824AbeFOO4R (ORCPT ); Fri, 15 Jun 2018 10:56:17 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:46112 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964778AbeFOO4R (ORCPT ); Fri, 15 Jun 2018 10:56:17 -0400 Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CA20B1A9A; Fri, 15 Jun 2018 16:56:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1529074575; bh=N55VZKQTaM6gHNegLc657BZENcO/jNhgiXxKOlHv9+M=; h=From:To:Cc:Subject:Date:From; b=HkXFijBU3Zt4mwoZhmqlVQekQ+KSq2vLOpIEMM6ireCNECckkXtDncrydrMkBkxoi WOV/cuIRU8B7+PufZLBy5lWj3Dtg/QeIyKfVZrlcgoZGUFtWI60QGC3jhWorjb/XH0 h/Qc92fM7bHx/lLkoEQjTeR5jNqV5xATNm+5+e9c= From: Kieran Bingham To: linux-renesas-soc@vger.kernel.org Cc: Kieran Bingham Subject: [PATCH] [HACK] serial: sh-sci: Hard code SCIF clocks Date: Fri, 15 Jun 2018 15:56:09 +0100 Message-Id: <20180615145609.22617-1-kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.17.1 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hard code the clock rates for the SCI_FCK clock to allow development of serial passthrough within virtualisation environments without clock support. Signed-off-by: Kieran Bingham --- drivers/tty/serial/sh-sci.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index b46b146524ce..729326d25056 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -510,8 +510,27 @@ static void sci_port_enable(struct sci_port *sci_port) for (i = 0; i < SCI_NUM_CLKS; i++) { clk_prepare_enable(sci_port->clks[i]); sci_port->clk_rates[i] = clk_get_rate(sci_port->clks[i]); + + pr_err("sci_port->clk_rates[%u] = %lu\n", i , sci_port->clk_rates[i]); } - sci_port->port.uartclk = sci_port->clk_rates[SCI_FCK]; + + /* +[ 62.482432] sh-sci e6e68000.serial: BRG: 9600+0 bps using DL 96 SR 32 +[ 62.491553] sh-sci e6e68000.serial: Using clk scif for 9600+0 bps +[ 62.500304] sci_port->clk_rates[0] = 66560000 +[ 62.507276] sci_port->clk_rates[1] = 0 +[ 62.513596] sci_port->clk_rates[2] = 266240000 +[ 62.520570] sci_port->clk_rates[3] = 14745600 +[ 62.527720] sh-sci e6e68000.serial: BRG: 115200+0 bps using DL 8 SR 32 +[ 62.536802] sh-sci e6e68000.serial: Using clk scif for 115200+0 bps +[ 62.545613] sci_port->clk_rates[0] = 66560000 +[ 62.552463] sci_port->clk_rates[1] = 0 +[ 62.558689] sci_port->clk_rates[2] = 266240000 +[ 62.565594] sci_port->clk_rates[3] = 14745600 + */ + + // Temporary Hardcode + sci_port->port.uartclk = sci_port->clk_rates[SCI_FCK] = 66560000; } static void sci_port_disable(struct sci_port *sci_port)