Received: by 10.223.185.116 with SMTP id b49csp3629054wrg; Mon, 19 Feb 2018 03:24:28 -0800 (PST) X-Google-Smtp-Source: AH8x2267yPJ+kUtiOk+n6mSS6NjJ3MXcVi+hvPnHlUgLEg5abwVY7AaZ/Jp94OIN2qyIuI/lJXZY X-Received: by 2002:a17:902:f81:: with SMTP id 1-v6mr13524309plz.265.1519039468360; Mon, 19 Feb 2018 03:24:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519039468; cv=none; d=google.com; s=arc-20160816; b=u8xNLSKRubm8aB15FeK3nnuB9OdBydU+IJGqDXG31yYHvH5yBD2Vz2mYGf2Dxu3cCs BmviONNQTjSmcQIJv0yWdUVMldUSzwzpqA9om2VJLjv485DaDcRX2Cv8txOP5RK7I+tb WFSMkR0kxrRTXp0PHzy8gkXZ5KASy3nnwJgOKEtjW/Xkeq3J0yUAE8+e4NcetRwtlJ4t aUgsZeEXs/UTFdgVk3I99rdCNssxXxOSphOg7MUuym+1On0fDz1R1LQ27lZD6VaYPY+G 9AJkQtsSBdD4Nn1rJNrAiLXDP6YCd+BvcFsBDcISOx9HMaaHcgzEdeSJFvGAndXdVlIG nVTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=J+cPRs4MjYqCuoQ2RBiSfYN+ScOaQ/BMT4mpzq+hzIY=; b=B0ytjj2/Z+VBgIFiMyC2q71xfJLJtAcL9Pmu1IjWR08o1SW6gL3K8Atft300ABPOfT ZI2iVw42E9lAeSRW0Lu7BI5YokQWBFl0oOxFf+d+BAI37iUrmE2+vFFQTJeH06rBHrpm eIMkIzYO5WLZkTTBgpHMYMDYXuJFnF90mRcofR6fTZk0NjZ9QiRaDb8JDMfA+U7MXVO9 PkjlwddUWWecCHnyQ5GEOBAIkE/P+QlbYQ3z4vVg16XxF3jxwOa8JyBsua5hHEgFAtDD FQYFmW0EvbR7ROwepT5nMT0tSpqyeZXPxlxLot6sJTnd0iI0GgvTywfbHWeig1nJzU+Y bQTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=eFQDdApO; 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 o19-v6si4742603pll.7.2018.02.19.03.24.14; Mon, 19 Feb 2018 03:24:28 -0800 (PST) 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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=eFQDdApO; 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 S1752735AbeBSLXK (ORCPT + 99 others); Mon, 19 Feb 2018 06:23:10 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:43354 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752645AbeBSLWB (ORCPT ); Mon, 19 Feb 2018 06:22:01 -0500 Received: by mail-wr0-f195.google.com with SMTP id u49so4574462wrc.10 for ; Mon, 19 Feb 2018 03:22:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=J+cPRs4MjYqCuoQ2RBiSfYN+ScOaQ/BMT4mpzq+hzIY=; b=eFQDdApOMZfU7xC2QH9aGRGm8TqbzE6P4ciUS9tw+vka2Er50fNRIp4Rcz/xOVKAdr IuUU7ZksEsH8P3amCai9XXcg38+bYx7dTWs9wevNuLwWI6eI0EoWu4Fa4KOGKCGdBAtI opclAathQBIUTH3MuEsQzIU0z7HL1q411cTPT8bGvLB73p8RG7qwsRTIrvJugSAcWHOL JPfCHPgMY1LNdeo3mtVdNu+i5DQh82WPAeNsdst/73Qo63Yy+1pQkGroosSQiKhyGWEd S7/bxoxmnT4DeditGRSlt2IQzuAuEU+C7ywCf0O0jnRJHuGWk8QNs/2z1pfTXixOfdOz t/LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=J+cPRs4MjYqCuoQ2RBiSfYN+ScOaQ/BMT4mpzq+hzIY=; b=KNYrMQ9LEuGK5CrUKMc1cMg6v69zwlaV/lz/T+6mSzm2cRMbU0fMyfyjskzrpmxSnA 3fy3LIo9KdPD6G3XaysxvaB/RNeBSzD86SuBAohA5EFIJaZdkLiDPkEYiWUnWhE69OXR Ak6ibiMOOdFK2DV35OP4za3I00i29dE7+hbB39oy53RtSqLJ/Y29K4VuXxaIviirwv26 2XPzkyQxQkb6DcuGwtxd6b2p2E9O9M78Xb47zgxcioUiQTdxHDywvRCxkME7VHqGxEpJ zYA7XDYQohmaLgQY3z8UwDMliip6d+rluZDehwCzuiU7Tt31EicHnJYzRd6NsXRvYF2f mOeg== X-Gm-Message-State: APf1xPDTjNJp85E83+G068fqvi1RGNDRugsqKwB2FNvT7Osm5ay6b6Ef vzZ7vkQYEJ3HnSZ4f0eaULqnbw== X-Received: by 10.223.131.230 with SMTP id 93mr12255521wre.59.1519039320006; Mon, 19 Feb 2018 03:22:00 -0800 (PST) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id n20sm8933978wrg.84.2018.02.19.03.21.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Feb 2018 03:21:59 -0800 (PST) From: Jerome Brunet To: Neil Armstrong , Kevin Hilman Cc: Jerome Brunet , Stephen Boyd , Michael Turquette , Carlo Caione , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/11] clk: meson: axg: add hifi pll clock Date: Mon, 19 Feb 2018 12:21:43 +0100 Message-Id: <20180219112146.21746-9-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180219112146.21746-1-jbrunet@baylibre.com> References: <20180219112146.21746-1-jbrunet@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the hifi pll to the axg clock controller. This clock maybe used as an input of the axg audio clock controller. It uses the same settings table as the gp0 pll but has a frac parameter allowing more precision. Signed-off-by: Jerome Brunet --- drivers/clk/meson/axg.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ drivers/clk/meson/axg.h | 2 +- 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/drivers/clk/meson/axg.c b/drivers/clk/meson/axg.c index 892572a2d70f..ed4a645753c4 100644 --- a/drivers/clk/meson/axg.c +++ b/drivers/clk/meson/axg.c @@ -245,6 +245,59 @@ static struct clk_regmap axg_gp0_pll = { }, }; +const struct reg_sequence axg_hifi_init_regs[] = { + { .reg = HHI_HIFI_PLL_CNTL1, .def = 0xc084b000 }, + { .reg = HHI_HIFI_PLL_CNTL2, .def = 0xb75020be }, + { .reg = HHI_HIFI_PLL_CNTL3, .def = 0x0a6a3a88 }, + { .reg = HHI_HIFI_PLL_CNTL4, .def = 0xc000004d }, + { .reg = HHI_HIFI_PLL_CNTL5, .def = 0x00058000 }, + { .reg = HHI_HIFI_PLL_CNTL, .def = 0x40010250 }, +}; + +static struct clk_regmap axg_hifi_pll = { + .data = &(struct meson_clk_pll_data){ + .m = { + .reg_off = HHI_HIFI_PLL_CNTL, + .shift = 0, + .width = 9, + }, + .n = { + .reg_off = HHI_HIFI_PLL_CNTL, + .shift = 9, + .width = 5, + }, + .od = { + .reg_off = HHI_HIFI_PLL_CNTL, + .shift = 16, + .width = 2, + }, + .frac = { + .reg_off = HHI_HIFI_PLL_CNTL5, + .shift = 0, + .width = 13, + }, + .l = { + .reg_off = HHI_HIFI_PLL_CNTL, + .shift = 31, + .width = 1, + }, + .rst = { + .reg_off = HHI_HIFI_PLL_CNTL, + .shift = 29, + .width = 1, + }, + .table = axg_gp0_pll_rate_table, + .init_regs = axg_hifi_init_regs, + .init_count = ARRAY_SIZE(axg_hifi_init_regs), + .flags = CLK_MESON_PLL_ROUND_CLOSEST, + }, + .hw.init = &(struct clk_init_data){ + .name = "hifi_pll", + .ops = &meson_clk_pll_ops, + .parent_names = (const char *[]){ "xtal" }, + .num_parents = 1, + }, +}; static struct clk_fixed_factor axg_fclk_div2 = { .mult = 1, @@ -767,6 +820,7 @@ static struct clk_hw_onecell_data axg_hw_onecell_data = { [CLKID_MPLL1_DIV] = &axg_mpll1_div.hw, [CLKID_MPLL2_DIV] = &axg_mpll2_div.hw, [CLKID_MPLL3_DIV] = &axg_mpll3_div.hw, + [CLKID_HIFI_PLL] = &axg_hifi_pll.hw, [NR_CLKS] = NULL, }, .num = NR_CLKS, @@ -838,6 +892,7 @@ static struct clk_regmap *const axg_clk_regmaps[] = { &axg_fixed_pll, &axg_sys_pll, &axg_gp0_pll, + &axg_hifi_pll, }; static const struct of_device_id clkc_match_table[] = { diff --git a/drivers/clk/meson/axg.h b/drivers/clk/meson/axg.h index 4c1502a8b8c9..4916c7045c48 100644 --- a/drivers/clk/meson/axg.h +++ b/drivers/clk/meson/axg.h @@ -122,7 +122,7 @@ #define CLKID_MPLL2_DIV 67 #define CLKID_MPLL3_DIV 68 -#define NR_CLKS 69 +#define NR_CLKS 70 /* include the CLKIDs that have been made part of the DT binding */ #include -- 2.14.3