devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Jeremy McNicoll <jeremymc@redhat.com>
Cc: linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	devicetree@vger.kernel.org, robh@kernel.org,
	andy.gross@linaro.org, arnd@arndb.de, bjorn.andersson@linaro.org,
	mark.rutland@arm.com, michael.scott@linaro.org
Subject: Re: [PATCH 3/6] msm8994 clocks: global clock support for msm8994 SOC.
Date: Thu, 27 Oct 2016 17:18:00 -0700	[thread overview]
Message-ID: <20161028001800.GK26139@codeaurora.org> (raw)
In-Reply-To: <1477394221-30963-4-git-send-email-jeremymc@redhat.com>

On 10/25, Jeremy McNicoll wrote:
> diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
> index 0146d3c..3b78803 100644
> --- a/drivers/clk/qcom/Kconfig
> +++ b/drivers/clk/qcom/Kconfig
> @@ -132,6 +132,15 @@ config MSM_MMCC_8974
>  	  Say Y if you want to support multimedia devices such as display,
>  	  graphics, video encode/decode, camera, etc.
>  
> +config MSM_GCC_8994
> +	tristate "MSM8994 Global Clock Controller"
> +	select QCOM_GDSC

But we aren't populating GDSCs so this is unnecessary right now.

> +	depends on COMMON_CLK_QCOM
> +	help
> +	  Support for the global clock controller on msm8994 devices.
> +	  Say Y if you want to use peripheral devices such as UART, SPI,
> +	  i2c, USB, SD/eMMC, SATA, PCIe, etc.

Is there a sata controller on 8994? Is there an emmc/sd
controller?

> +
>  config MSM_GCC_8996
>  	tristate "MSM8996 Global Clock Controller"
>  	select QCOM_GDSC
> diff --git a/drivers/clk/qcom/gcc-msm8994.c b/drivers/clk/qcom/gcc-msm8994.c
> new file mode 100644
> index 0000000..39b40d4
> --- /dev/null
> +++ b/drivers/clk/qcom/gcc-msm8994.c
> @@ -0,0 +1,2501 @@
> +/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 and
> + * only version 2 as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/err.h>
> +#include <linux/ctype.h>
> +#include <linux/io.h>
> +#include <linux/clk.h>

Is this include used? Should probably be clk-provider instead.

> +#include <linux/of.h>
> +#include <linux/platform_device.h>
> +#include <linux/module.h>
> +#include <linux/regmap.h>
> +
> +#include <dt-bindings/clock/qcom,gcc-msm8994.h>
> +
> +#include "common.h"
> +#include "clk-regmap.h"
> +#include "clk-pll.h"

Is this include used?

> +#include "clk-alpha-pll.h"
> +#include "clk-rcg.h"
> +#include "clk-branch.h"
> +#include "reset.h"
> +
> +static struct clk_branch gcc_usb30_mock_utmi_clk = {
> +	.halt_reg = 0x03D0,

Lowercase hex everywhere please.

> +
> +
> +static void msm_gcc_8994v2_fixup(void)
> +{
> +	ufs_axi_clk_src.freq_tbl = ftbl_ufs_axi_clk_src_v2;
> +
> +	blsp1_qup1_spi_apps_clk_src.freq_tbl = ftbl_blspqup_spi_apps_clk_src_v2;
> +	blsp1_qup2_spi_apps_clk_src.freq_tbl = ftbl_blspqup_spi_apps_clk_src_v2;
> +	blsp1_qup3_spi_apps_clk_src.freq_tbl = ftbl_blspqup_spi_apps_clk_src_v2;
> +	blsp1_qup4_spi_apps_clk_src.freq_tbl = ftbl_blspqup_spi_apps_clk_src_v2;
> +	blsp1_qup5_spi_apps_clk_src.freq_tbl = ftbl_blspqup_spi_apps_clk_src_v2;
> +	blsp1_qup6_spi_apps_clk_src.freq_tbl = ftbl_blspqup_spi_apps_clk_src_v2;
> +	blsp2_qup1_spi_apps_clk_src.freq_tbl = ftbl_blspqup_spi_apps_clk_src_v2;
> +	blsp2_qup2_spi_apps_clk_src.freq_tbl = ftbl_blspqup_spi_apps_clk_src_v2;
> +	blsp2_qup3_spi_apps_clk_src.freq_tbl = ftbl_blspqup_spi_apps_clk_src_v2;
> +	blsp2_qup4_spi_apps_clk_src.freq_tbl = ftbl_blspqup_spi_apps_clk_src_v2;
> +	blsp2_qup5_spi_apps_clk_src.freq_tbl = ftbl_blspqup_spi_apps_clk_src_v2;
> +	blsp2_qup6_spi_apps_clk_src.freq_tbl = ftbl_blspqup_spi_apps_clk_src_v2;

Please no, just assume v2.

> +}
> +
> +static const struct regmap_config gcc_msm8994_regmap_config = {
> +	.reg_bits	= 32,
> +	.reg_stride	= 4,
> +	.val_bits	= 32,
> +	.max_register	= 0x2000,
> +	.fast_io	= true,
> +};
> +
> +static const struct qcom_cc_desc gcc_msm8994_desc = {
> +	.config = &gcc_msm8994_regmap_config,
> +	.clks = gcc_msm8994_clocks,
> +	.num_clks = ARRAY_SIZE(gcc_msm8994_clocks),
> +	.resets = NULL,
> +	.num_resets = 0,
> +	.gdscs = NULL,
> +	.num_gdscs = 0,

We don't have to be explicit. Does this even work? I thought
common.c expected there to be a reset list? I guess we would have
a reset controller with no resets. Should be possible to grab
some of the resets out of the android driver though.

> +};
> +
> +static const struct of_device_id gcc_msm8994_match_table[] = {
> +	{ .compatible = "qcom,gcc-8994" },
> +	{ .compatible = "qcom,gcc-8994v2" },

Please add msm and drop the v2 one.

> +	{}
> +}
> +
> +MODULE_DEVICE_TABLE(of, gcc_msm8994_match_table);
> +
> +static int gcc_msm8994_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct clk *clk;
> +	const char *compat = NULL;
> +	int compatlen = 0;
> +	bool is_v2 = false;
> +
> +	clk = devm_clk_register(dev, &xo.hw);
> +	if (IS_ERR(clk))
> +		return PTR_ERR(clk);
> +
> +	compat = of_get_property(pdev->dev.of_node, "compatible", &compatlen);
> +	if (!compat || (compatlen <= 0))
> +		return -EINVAL;
> +
> +	is_v2 = !strcmp(compat, "qcom,gcc-8994v2");
> +	if (is_v2)
> +		msm_gcc_8994v2_fixup();

This should simplify greatly.

> +
> +	return qcom_cc_probe(pdev, &gcc_msm8994_desc);
> +}

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2016-10-28  0:18 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25 11:16 [PATCH 0/6] msm8992/msm8994: Google Nexus 5X/6P initial board support Jeremy McNicoll
     [not found] ` <1477394221-30963-1-git-send-email-jeremymc-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-10-25 11:16   ` [PATCH 1/6] arm64: dts: msm8992 SoC and LG Bullhead (Nexus 5X) support Jeremy McNicoll
     [not found]     ` <1477394221-30963-2-git-send-email-jeremymc-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-10-28  0:11       ` Stephen Boyd
2016-11-02 23:59         ` Jeremy McNicoll
2016-11-03 22:38     ` Mark Rutland
2016-10-25 11:16   ` [PATCH 2/6] dt-bindings: qcom: clocks: Add msm8994 clock bindings Jeremy McNicoll
2016-10-28  0:08     ` Stephen Boyd
     [not found]       ` <20161028000811.GI26139-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-11-03  0:01         ` Jeremy McNicoll
2016-10-25 11:16   ` [PATCH 3/6] msm8994 clocks: global clock support for msm8994 SOC Jeremy McNicoll
2016-10-28  0:18     ` Stephen Boyd [this message]
2016-11-04  0:37       ` Jeremy McNicoll
     [not found]     ` <1477394221-30963-4-git-send-email-jeremymc-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-11-03 22:42       ` Mark Rutland
2016-11-03 23:43         ` Jeremy McNicoll
2016-11-04  9:12           ` Bastian Köcher
2016-10-27  0:56   ` [PATCH 0/6] msm8992/msm8994: Google Nexus 5X/6P initial board support Jeremy McNicoll
2016-10-25 11:16 ` [PATCH 4/6] dt-bindings: qcom: Add msm899(2/4) bindings Jeremy McNicoll
     [not found]   ` <1477394221-30963-5-git-send-email-jeremymc-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-10-31  1:43     ` Rob Herring
2016-10-25 11:17 ` [PATCH 5/6] arm64: dts: msm8994 SoC and Huawei Angler (Nexus 6P) support Jeremy McNicoll
2016-10-27  5:33   ` Michael Scott
2016-10-28  0:06   ` Stephen Boyd
2016-10-28  0:54     ` Jeremy McNicoll
2016-11-03 22:32       ` Andy Gross
2016-11-03 22:42         ` Stephen Boyd
     [not found]           ` <9e0555fa-d689-e26e-feba-9daa815eb1c5-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-11-03 22:44             ` Andy Gross
2016-11-04 20:12               ` Stephen Boyd
2016-11-03 23:04           ` Bjorn Andersson
2016-11-04  0:20             ` Jeremy McNicoll
     [not found]               ` <20161104002005.GA15578-IfqqoHeSVXkD/aak0adQqVaTQe2KTcn/@public.gmane.org>
2016-11-04  1:57                 ` Bjorn Andersson
2016-11-04  5:18                   ` Jeremy McNicoll
2016-11-03 22:44   ` Mark Rutland
2016-10-25 11:17 ` [PATCH 6/6] arm64: configs: enable configs for msm899(2/4) basic support Jeremy McNicoll

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161028001800.GK26139@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=andy.gross@linaro.org \
    --cc=arnd@arndb.de \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jeremymc@redhat.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=michael.scott@linaro.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).