Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp432597imm; Fri, 31 Aug 2018 04:28:42 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZn0bpTrXJXe9SQDQorhiS7bxzlC3pVnMPQLNz0tFL21dkIBb200spUFxf3sf2xpLgvPOD0 X-Received: by 2002:a63:5845:: with SMTP id i5-v6mr13906639pgm.272.1535714922299; Fri, 31 Aug 2018 04:28:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535714922; cv=none; d=google.com; s=arc-20160816; b=L3KKboaJB0KXFm+/c+VBLsXYscv9qgesrdX4tXtyLeEfSg+OiFLso3LFzCH6/7vccL CPwk8mGK0gSPxtAf3fZxDIskrzMVQi8MBhrpeEwsiaOPzCxQVFE/jF266ohegSLkB9P0 V9j+U5UJK6ZgSA36wwGMSjWhXV/pePrzXeVIobxB0i44AC5Zbt7ZOa140GCToMn/WclV Ggf6H1GoDTXtSG5ZY9WyTJm2UalUv7CVJa4aCSJaZtjU9jYZZ0L1tDbYkZe06nuq/g7Q oKKPcLvuTbU2LeDafN5hCdaAbvV6A4yiinSRDc9YsLJhSlYXBzPuIBu9TFdqA1W5XVTn C59w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=jmMTqa8Gp2T3ae4kpUn+pKJEaE71CcJ6I0H+T5eK+qg=; b=LCmDszcHeZYFeUhTUWQ/YwCs9wJFR+aSIcu4V6ovSw74T3a+/m655YbFQN3IvSNPre 0rKke4kkKyJZ2E8Aj08j+f/ED4n+7hWZKrBBmrDIBr5+BVZwR1m/J+F9zw92VfpO7/lb H1rh0f+YEzhqH2L3kGT0dhnGsdvkMYJk8bGGjg2PtF1CcgFt7dExLP6dVRaRoBRpUt2i p/paYh+4QVOBJD3wmSLkNITiwjF8+e+v/SVOsfg8Dc1IvV5UIvxIyIdEdQDFcpDJBN4S 86Mr1o0QbZ0RFNvPcKrd95jFK/OBlWaY+i0uWIYHMfD53SHfXPgBFouzUjo8+tmXQMZA SbeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s71-v6si9794437pfa.367.2018.08.31.04.28.27; Fri, 31 Aug 2018 04:28:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728132AbeHaPds (ORCPT + 99 others); Fri, 31 Aug 2018 11:33:48 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:32420 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726990AbeHaPds (ORCPT ); Fri, 31 Aug 2018 11:33:48 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 31 Aug 2018 20:26:41 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id A752D84E9B; Fri, 31 Aug 2018 20:26:41 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.53,311,1531753200"; d="scan'208";a="291187229" Received: from unknown (HELO vbox.ree.adwin.renesas.com) ([10.226.37.67]) by relmlii2.idc.renesas.com with ESMTP; 31 Aug 2018 20:26:38 +0900 From: Phil Edworthy To: Geert Uytterhoeven Cc: Michael Turquette , Stephen Boyd , linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Phil Edworthy Subject: [PATCH] clk: renesas: r9a06g032: Fix UART34567 clock rate Date: Fri, 31 Aug 2018 12:26:36 +0100 Message-Id: <1535714796-2211-1-git-send-email-phil.edworthy@renesas.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The clock for UARTs 0 through 2 is UART012, the clock for UARTs 3 through 7 is UART34567. For UART012, we stop the clock driver from changing the clock rate. This is because the Synopsys UART driver simply sets the reference clock to 16x the baud rate, but doesn't check if the actual rate is within the required tolerance. The RZ/N1 clock divider can't provide this (we have to rely on the UART's internal divider to set the correct clock rate), so you end up with a clock rate that is way off what you wanted. In addition, since the clock is shared between multiple UARTs, you don't want the driver trying to change the clock rate as it may affect the other UARTs (which may not have been configured yet, so you don't know what baud rate they will use). Normally, the clock rate is set early on before Linux to some very high rate that supports all of the clock rates you want. This change stops the UART34567 clock rate from changing for the same reasons. Signed-off-by: Phil Edworthy --- drivers/clk/renesas/r9a06g032-clocks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/renesas/r9a06g032-clocks.c b/drivers/clk/renesas/r9a06g032-clocks.c index a0b6ecd..6d2b568 100644 --- a/drivers/clk/renesas/r9a06g032-clocks.c +++ b/drivers/clk/renesas/r9a06g032-clocks.c @@ -539,7 +539,8 @@ r9a06g032_div_round_rate(struct clk_hw *hw, * several uarts attached to this divider, and changing this impacts * everyone. */ - if (clk->index == R9A06G032_DIV_UART) { + if (clk->index == R9A06G032_DIV_UART || + clk->index == R9A06G032_DIV_P2_PG) { pr_devel("%s div uart hack!\n", __func__); return clk_get_rate(hw->clk); } -- 2.7.4