linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Loic Poulain <loic.poulain@linaro.org>,
	bjorn.andersson@linaro.org, mturquette@baylibre.com
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	Ilia Lin <ilialin@codeaurora.org>,
	Loic Poulain <loic.poulain@linaro.org>
Subject: Re: [PATCH 1/4] soc: qcom: Separate kryo l2 accessors from PMU driver
Date: Wed, 22 Apr 2020 13:23:43 -0700	[thread overview]
Message-ID: <158758702339.163502.6382911440089423525@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <1585224008-15730-2-git-send-email-loic.poulain@linaro.org>

Quoting Loic Poulain (2020-03-26 05:00:05)
> diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile
> index 9fb35c8..1c76901 100644
> --- a/drivers/soc/qcom/Makefile
> +++ b/drivers/soc/qcom/Makefile
> @@ -25,3 +25,4 @@ obj-$(CONFIG_QCOM_APR) += apr.o
>  obj-$(CONFIG_QCOM_LLCC) += llcc-qcom.o
>  obj-$(CONFIG_QCOM_RPMHPD) += rpmhpd.o
>  obj-$(CONFIG_QCOM_RPMPD) += rpmpd.o
> +obj-$(CONFIG_QCOM_KRYO_L2_ACCESSORS) +=        kryo-l2-accessors.o

Put this after QCOM_LLCC to keep it sorted by Kconfig name?

> diff --git a/drivers/soc/qcom/kryo-l2-accessors.c b/drivers/soc/qcom/kryo-l2-accessors.c
> new file mode 100644
> index 0000000..75fd07a
> --- /dev/null
> +++ b/drivers/soc/qcom/kryo-l2-accessors.c
> @@ -0,0 +1,56 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2018, The Linux Foundation. All rights reserved.
> + */
> +
> +#include <linux/spinlock.h>
> +#include <asm/sysreg.h>
> +#include <soc/qcom/kryo-l2-accessors.h>
> +
> +#define L2CPUSRSELR_EL1         sys_reg(3, 3, 15, 0, 6)
> +#define L2CPUSRDR_EL1           sys_reg(3, 3, 15, 0, 7)
> +
> +static DEFINE_RAW_SPINLOCK(l2_access_lock);
> +
> +/**
> + * kryo_l2_set_indirect_reg() - write value to an L2 register
> + * @reg: Address of L2 register.
> + * @value: Value to be written to register.
> + *
> + * Use architecturally required barriers for ordering between system register
> + * accesses, and system registers with respect to device memory
> + */
> +void kryo_l2_set_indirect_reg(u64 reg, u64 val)
> +{
> +       unsigned long flags;
> +
> +       raw_spin_lock_irqsave(&l2_access_lock, flags);
> +       write_sysreg_s(reg, L2CPUSRSELR_EL1);
> +       isb();

Any include for barrier.h? Or it comes from spinlock.h?

> +       write_sysreg_s(val, L2CPUSRDR_EL1);
> +       isb();
> +       raw_spin_unlock_irqrestore(&l2_access_lock, flags);
> +}
> +EXPORT_SYMBOL(kryo_l2_set_indirect_reg);

  reply	other threads:[~2020-04-22 20:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26 12:00 [PATCH 0/4] msm8996 CPU scaling support Loic Poulain
2020-03-26 12:00 ` [PATCH 1/4] soc: qcom: Separate kryo l2 accessors from PMU driver Loic Poulain
2020-04-22 20:23   ` Stephen Boyd [this message]
2020-03-26 12:00 ` [PATCH 2/4] clk: qcom: Add CPU clock driver for msm8996 Loic Poulain
2020-04-22 20:21   ` Stephen Boyd
2020-03-26 12:00 ` [PATCH 3/4] dt-bindings: clk: qcom: Add bindings for CPU clock " Loic Poulain
2020-04-22  9:08   ` Stephen Boyd
2020-04-22 16:16     ` Loic Poulain
2020-03-26 12:00 ` [PATCH 4/4] arch: arm64: dts: msm8996: Add opp and thermal Loic Poulain
2020-04-21 12:02 ` [PATCH 0/4] msm8996 CPU scaling support Loic Poulain

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=158758702339.163502.6382911440089423525@swboyd.mtv.corp.google.com \
    --to=sboyd@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=ilialin@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    --cc=mturquette@baylibre.com \
    /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).