From: Philipp Zabel <p.zabel@pengutronix.de>
To: Sudeep Holla <sudeep.holla@arm.com>,
linux-arm-kernel@lists.infradead.org
Cc: Peng Fan <peng.fan@nxp.com>,
linux-kernel@vger.kernel.org,
Bo Zhang <bozhang.zhang@broadcom.com>,
Jim Quinlan <james.quinlan@broadcom.com>,
Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
Gaku Inami <gaku.inami.xh@renesas.com>,
aidapala@qti.qualcomm.com, pajay@qti.qualcomm.com,
Etienne Carriere <etienne.carriere@linaro.org>,
Souvik Chakravarty <Souvik.Chakravarty@arm.com>,
wesleys@xilinx.com, Felix Burton <fburton@xilinx.com>,
Saeed Nowshadi <saeed.nowshadi@xilinx.com>
Subject: Re: [PATCH v2 5/5] reset: Add support for resets provided by SCMI
Date: Wed, 07 Aug 2019 10:04:26 +0200 [thread overview]
Message-ID: <1565165066.5048.2.camel@pengutronix.de> (raw)
In-Reply-To: <20190806170208.6787-6-sudeep.holla@arm.com>
On Tue, 2019-08-06 at 18:02 +0100, Sudeep Holla wrote:
> On some ARM based systems, a separate Cortex-M based System Control
> Processor(SCP) provides the overall power, clock, reset and system
> control. System Control and Management Interface(SCMI) Message Protocol
> is defined for the communication between the Application Cores(AP)
> and the SCP.
>
> Adds support for the resets provided using SCMI protocol for performing
> reset management of various devices present on the SoC. Various reset
> functionalities are achieved by the means of different ARM SCMI device
> operations provided by the ARM SCMI framework.
>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
> MAINTAINERS | 1 +
> drivers/reset/Kconfig | 11 ++++
> drivers/reset/Makefile | 1 +
> drivers/reset/reset-scmi.c | 126 +++++++++++++++++++++++++++++++++++++
> 4 files changed, 139 insertions(+)
> create mode 100644 drivers/reset/reset-scmi.c
>
> v1->v2:
> - Renamed RESET_ARM_SCMI to RESET_SCMI and reworded Kconfig text
> - Dropped unused struct device pointer from scmi_reset_data
> - Added to_scmi_handle which helped to remove some repetitive code
> - Fixed some doxygen comments
> - Initialised rcdev.nr_resets
> - Fixed MODULE_DESCRIPTION
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 6426db5198f0..f4af5c59c116 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -15545,6 +15545,7 @@ F: drivers/clk/clk-sc[mp]i.c
> F: drivers/cpufreq/sc[mp]i-cpufreq.c
> F: drivers/firmware/arm_scpi.c
> F: drivers/firmware/arm_scmi/
> +F: drivers/reset/reset-scmi.c
> F: include/linux/sc[mp]i_protocol.h
>
> SYSTEM RESET/SHUTDOWN DRIVERS
> diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
> index 21efb7d39d62..4178ac11ba85 100644
> --- a/drivers/reset/Kconfig
> +++ b/drivers/reset/Kconfig
> @@ -116,6 +116,17 @@ config RESET_QCOM_PDC
> to control reset signals provided by PDC for Modem, Compute,
> Display, GPU, Debug, AOP, Sensors, Audio, SP and APPS.
>
> +config RESET_SCMI
> + tristate "Reset driver controlled via ARM SCMI interface"
> + depends on ARM_SCMI_PROTOCOL || COMPILE_TEST
> + default ARM_SCMI_PROTOCOL
> + help
> + This driver provides support for reset signal/domains that are
> + controlled by firmware that implements the SCMI interface.
> +
> + This driver uses SCMI Message Protocol to interact with the
> + firmware controlling all the reset signals.
> +
> config RESET_SIMPLE
> bool "Simple Reset Controller Driver" if COMPILE_TEST
> default ARCH_STM32 || ARCH_STRATIX10 || ARCH_SUNXI || ARCH_ZX || ARCH_ASPEED || ARCH_BITMAIN
> diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
> index 61456b8f659c..cf60ce526064 100644
> --- a/drivers/reset/Makefile
> +++ b/drivers/reset/Makefile
> @@ -18,6 +18,7 @@ obj-$(CONFIG_RESET_OXNAS) += reset-oxnas.o
> obj-$(CONFIG_RESET_PISTACHIO) += reset-pistachio.o
> obj-$(CONFIG_RESET_QCOM_AOSS) += reset-qcom-aoss.o
> obj-$(CONFIG_RESET_QCOM_PDC) += reset-qcom-pdc.o
> +obj-$(CONFIG_RESET_SCMI) += reset-scmi.o
> obj-$(CONFIG_RESET_SIMPLE) += reset-simple.o
> obj-$(CONFIG_RESET_STM32MP157) += reset-stm32mp1.o
> obj-$(CONFIG_RESET_SOCFPGA) += reset-socfpga.o
> diff --git a/drivers/reset/reset-scmi.c b/drivers/reset/reset-scmi.c
> new file mode 100644
> index 000000000000..5e976a02a6cc
> --- /dev/null
> +++ b/drivers/reset/reset-scmi.c
> @@ -0,0 +1,126 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * ARM System Control and Management Interface (ARM SCMI) reset driver
> + *
> + * Copyright (C) 2019 ARM Ltd.
> + */
> +
> +#include <linux/module.h>
> +#include <linux/mutex.h>
You can drop mutex.h, it is unused.
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
This is not a platform device driver. Better replace this with
#include <linux/device.h>
> +#include <linux/reset-controller.h>
> +#include <linux/scmi_protocol.h>
> +
> +/**
> + * struct scmi_reset_data - reset controller information structure
> + * @rcdev: reset controller entity
> + * @handle: ARM SCMI handle used for communication with system controller
> + * @dev: reset controller device pointer
Drop this line, dev has been removed from struct scmi_reset_data.
> + */
> +struct scmi_reset_data {
> + struct reset_controller_dev rcdev;
> + const struct scmi_handle *handle;
> +};
> +
> +#define to_scmi_reset_data(p) container_of((p), struct scmi_reset_data, rcdev)
> +#define to_scmi_handle(p) (to_scmi_reset_data(p)->handle)
[...]
Apart from these,
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
next prev parent reply other threads:[~2019-08-07 8:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-06 17:02 [PATCH v2 0/5] firmware: arm_scmi: add SCMI v2.0 fastchannels and reset protocol support Sudeep Holla
2019-08-06 17:02 ` [PATCH v2 1/5] firmware: arm_scmi: Add discovery of SCMI v2.0 performance fastchannels Sudeep Holla
2019-08-07 9:23 ` Peng Fan
2019-08-07 10:28 ` Sudeep Holla
2019-08-06 17:02 ` [PATCH v2 2/5] firmware: arm_scmi: Make use SCMI v2.0 fastchannel for performance protocol Sudeep Holla
2019-08-07 10:01 ` Peng Fan
2019-08-06 17:02 ` [PATCH v2 3/5] dt-bindings: arm: Extend SCMI to support new reset protocol Sudeep Holla
2019-08-07 8:26 ` Philipp Zabel
2019-08-07 10:18 ` Sudeep Holla
2019-08-07 17:41 ` Sudeep Holla
2019-08-06 17:02 ` [PATCH v2 4/5] firmware: arm_scmi: Add RESET protocol in SCMI v2.0 Sudeep Holla
2019-08-07 8:17 ` Philipp Zabel
2019-08-07 10:35 ` Sudeep Holla
2019-08-07 10:07 ` Peng Fan
2019-08-06 17:02 ` [PATCH v2 5/5] reset: Add support for resets provided by SCMI Sudeep Holla
2019-08-07 8:04 ` Philipp Zabel [this message]
2019-08-07 10:31 ` Sudeep Holla
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=1565165066.5048.2.camel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=Souvik.Chakravarty@arm.com \
--cc=aidapala@qti.qualcomm.com \
--cc=bozhang.zhang@broadcom.com \
--cc=etienne.carriere@linaro.org \
--cc=fburton@xilinx.com \
--cc=gaku.inami.xh@renesas.com \
--cc=james.quinlan@broadcom.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pajay@qti.qualcomm.com \
--cc=peng.fan@nxp.com \
--cc=saeed.nowshadi@xilinx.com \
--cc=sudeep.holla@arm.com \
--cc=volodymyr_babchuk@epam.com \
--cc=wesleys@xilinx.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).