From patchwork Tue Jun 28 10:31:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guodong Xu X-Patchwork-Id: 9202577 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 7264860757 for ; Tue, 28 Jun 2016 10:33:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62DB4285CA for ; Tue, 28 Jun 2016 10:33:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5710C28600; Tue, 28 Jun 2016 10:33:46 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D935D285CA for ; Tue, 28 Jun 2016 10:33:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bHqJk-0005gh-Cv; Tue, 28 Jun 2016 10:32:32 +0000 Received: from mail-pf0-x233.google.com ([2607:f8b0:400e:c00::233]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bHqJX-0005b4-An for linux-arm-kernel@lists.infradead.org; Tue, 28 Jun 2016 10:32:20 +0000 Received: by mail-pf0-x233.google.com with SMTP id h14so5634820pfe.1 for ; Tue, 28 Jun 2016 03:31:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=svoVkYTlK/84c2mNqVgdqLq/mrJG8eZrLUry9JTIIhE=; b=ZsEw0tNp1HeWLYWNj7fmQ87BthcXsg0FIGUbcGG70VwPlaR3cR39PwqaK7m2xSgmRS 0jP4VWJsD7410I4W6A8mDRiAm0fQR41zTj4cF3TH+StYctKkxibuuVIYRrBxBWt8nXOG 2yHvG3ug9mlX+4F8K5aRLsGnJbleQ7IiK+QKw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=svoVkYTlK/84c2mNqVgdqLq/mrJG8eZrLUry9JTIIhE=; b=kSzEr+ymtaHZi+JnIAc3AQ7UkunJCRwDztOi2mOnx51fnWW1jYSlq1S7/ta6LmoWgG P/v6eqQEW4/7jhs/SdCaGLC2Ij+X/vlsks6px8cz/HhJgacZJayqm+FLOk6QU7xTA9qc whvscUxpriJoSgcjygtc7Z5Vx4+5KzmZZAPhwU5mtRPnl3K5IEKjiKim4XIEkrKo3BWx +YJrUaRN5AuRvYu0Bf8SOKzUFkuzvrCBUhBLiWDzDoqVnrBB57dt+TgVk63IYhEr7Ofi jfYiCWXA1PDG/rgRbEQvuUHy/8ZqrvGo1lO1Aerxy46AG5Khbu9znr/lYxegKmsOJgy6 mJ9A== X-Gm-Message-State: ALyK8tJcz41weIwZmyMNPfuf4wwQRfsNgE0XJgy37D4vH+iDlDLtDi9yHGmk199NQEPReNAs X-Received: by 10.98.208.197 with SMTP id p188mr506632pfg.152.1467109918226; Tue, 28 Jun 2016 03:31:58 -0700 (PDT) Received: from localhost.localdomain ([45.56.152.9]) by smtp.gmail.com with ESMTPSA id d8sm5801433pfg.72.2016.06.28.03.31.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Jun 2016 03:31:57 -0700 (PDT) From: Guodong Xu To: mturquette@baylibre.com, sboyd@codeaurora.org, jorge.ramirez-ortiz@linaro.org, xinliang.liu@linaro.org, guodong.xu@linaro.org, john.stultz@linaro.org Subject: [PATCH 2/2] clk: hi6220: initialize UART1 clock to 150MHz Date: Tue, 28 Jun 2016 18:31:42 +0800 Message-Id: <1467109902-17625-2-git-send-email-guodong.xu@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467109902-17625-1-git-send-email-guodong.xu@linaro.org> References: <1467109902-17625-1-git-send-email-guodong.xu@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160628_033219_567566_AC491F33 X-CRM114-Status: GOOD ( 13.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jorge Ramirez-Ortiz Early at boot, during the sys_clk initialization, make sure UART1 uses the higher frequency clock. This enables support for higher baud rates (up to 3Mbps) required to support faster bluetooth transfers. Signed-off-by: Jorge Ramirez-Ortiz Signed-off-by: Guodong Xu --- drivers/clk/hisilicon/clk-hi6220.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/clk/hisilicon/clk-hi6220.c b/drivers/clk/hisilicon/clk-hi6220.c index a36ffcb..55bd9bb 100644 --- a/drivers/clk/hisilicon/clk-hi6220.c +++ b/drivers/clk/hisilicon/clk-hi6220.c @@ -11,6 +11,7 @@ */ #include +#include #include #include #include @@ -70,10 +71,10 @@ static struct hisi_gate_clock hi6220_separated_gate_clks_ao[] __initdata = { { HI6220_UART0_PCLK, "uart0_pclk", "clk_tcxo", CLK_SET_RATE_PARENT|CLK_IGNORE_UNUSED, 0x630, 24, 0, }, }; +static struct hisi_clock_data *clk_data_ao; + static void __init hi6220_clk_ao_init(struct device_node *np) { - struct hisi_clock_data *clk_data_ao; - clk_data_ao = hisi_clk_init(np, HI6220_AO_NR_CLKS); if (!clk_data_ao) return; @@ -192,6 +193,13 @@ static void __init hi6220_clk_sys_init(struct device_node *np) hi6220_clk_register_divider(hi6220_div_clks_sys, ARRAY_SIZE(hi6220_div_clks_sys), clk_data); + + if (!clk_data_ao) + return; + + /* enable high speed clock on UART1 mux */ + clk_set_parent(clk_data->clk_data.clks[HI6220_UART1_SRC], + clk_data_ao->clk_data.clks[HI6220_150M]); } CLK_OF_DECLARE(hi6220_clk_sys, "hisilicon,hi6220-sysctrl", hi6220_clk_sys_init);