linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] firmware: arm_scmi: add SCMI v2.0 fastchannels and reset protocol support
@ 2019-08-06 17:02 Sudeep Holla
  2019-08-06 17:02 ` [PATCH v2 1/5] firmware: arm_scmi: Add discovery of SCMI v2.0 performance fastchannels Sudeep Holla
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Sudeep Holla @ 2019-08-06 17:02 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Sudeep Holla, Peng Fan, linux-kernel, Bo Zhang, Jim Quinlan,
	Volodymyr Babchuk, Gaku Inami, aidapala, pajay, Etienne Carriere,
	Souvik Chakravarty, wesleys, Felix Burton, Saeed Nowshadi

SCMI v2.0[1] released recently adds support for:

1. Performance protocol fast channels
2. Reset Management Protocol
among several other features.

This series adds support for the above 2.

The code is based on the cleanup[2] and Rx/async/delayed response series[3]
and is available @[4]

--
Regards,
Sudeep

v1[5]->v2:
	- Changed the macro SCMI_PERF_FC_RING_DB to use do {} while(0)
	- 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

[1] http://infocenter.arm.com/help/topic/com.arm.doc.den0056b/DEN0056B_System_Control_and_Management_Interface_v2_0.pdf
[2] https://lore.kernel.org/lkml/20190726134531.8928-1-sudeep.holla@arm.com
[3] https://lore.kernel.org/lkml/20190726135138.9858-1-sudeep.holla@arm.com/
[4] git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git scmi_updates
[5] https://lore.kernel.org/lkml/20190726135954.11078-1-sudeep.holla@arm.com/

Sudeep Holla (5):
  firmware: arm_scmi: Add discovery of SCMI v2.0 performance fastchannels
  firmware: arm_scmi: Make use SCMI v2.0 fastchannel for performance protocol
  dt-bindings: arm: Extend SCMI to support new reset protocol
  firmware: arm_scmi: Add RESET protocol in SCMI v2.0
  reset: Add support for resets provided by SCMI

 .../devicetree/bindings/arm/arm,scmi.txt      |  17 ++
 MAINTAINERS                                   |   1 +
 drivers/firmware/arm_scmi/Makefile            |   2 +-
 drivers/firmware/arm_scmi/perf.c              | 257 +++++++++++++++++-
 drivers/firmware/arm_scmi/reset.c             | 231 ++++++++++++++++
 drivers/reset/Kconfig                         |  11 +
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-scmi.c                    | 126 +++++++++
 include/linux/scmi_protocol.h                 |  26 ++
 9 files changed, 663 insertions(+), 9 deletions(-)
 create mode 100644 drivers/firmware/arm_scmi/reset.c
 create mode 100644 drivers/reset/reset-scmi.c

--
2.17.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v2 1/5] firmware: arm_scmi: Add discovery of SCMI v2.0 performance fastchannels
  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 ` Sudeep Holla
  2019-08-07  9:23   ` Peng Fan
  2019-08-06 17:02 ` [PATCH v2 2/5] firmware: arm_scmi: Make use SCMI v2.0 fastchannel for performance protocol Sudeep Holla
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 17+ messages in thread
From: Sudeep Holla @ 2019-08-06 17:02 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Sudeep Holla, Peng Fan, linux-kernel, Bo Zhang, Jim Quinlan,
	Volodymyr Babchuk, Gaku Inami, aidapala, pajay, Etienne Carriere,
	Souvik Chakravarty, wesleys, Felix Burton, Saeed Nowshadi,
	Ionela Voinescu, Chris Redpath, Quentin Perret

SCMI v2.0 adds support for "FastChannel", a lightweight unidirectional
channel that is dedicated to a single SCMI message type for controlling
a specific platform resource. They do not use a message header as they
are specialized for a single message.

Only PERFORMANCE_LIMITS_{SET,GET} and PERFORMANCE_LEVEL_{SET,GET}
commands are supported over fastchannels. As they are optional, they
need to be discovered by PERFORMANCE_DESCRIBE_FASTCHANNEL command.
Further {LIMIT,LEVEL}_SET commands can have optional doorbell support.

Add support for discovery of these fastchannels.

Cc: Ionela Voinescu <Ionela.Voinescu@arm.com>
Cc: Chris Redpath <Chris.Redpath@arm.com>
Cc: Quentin Perret <Quentin.Perret@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/firmware/arm_scmi/perf.c | 153 ++++++++++++++++++++++++++++++-
 1 file changed, 149 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
index 3c8ae7cc35de..6cce3e82e81e 100644
--- a/drivers/firmware/arm_scmi/perf.c
+++ b/drivers/firmware/arm_scmi/perf.c
@@ -5,7 +5,9 @@
  * Copyright (C) 2018 ARM Ltd.
  */
 
+#include <linux/bits.h>
 #include <linux/of.h>
+#include <linux/io.h>
 #include <linux/platform_device.h>
 #include <linux/pm_opp.h>
 #include <linux/sort.h>
@@ -21,6 +23,7 @@ enum scmi_performance_protocol_cmd {
 	PERF_LEVEL_GET = 0x8,
 	PERF_NOTIFY_LIMITS = 0x9,
 	PERF_NOTIFY_LEVEL = 0xa,
+	PERF_DESCRIBE_FASTCHANNEL = 0xb,
 };
 
 struct scmi_opp {
@@ -44,6 +47,7 @@ struct scmi_msg_resp_perf_domain_attributes {
 #define SUPPORTS_SET_PERF_LVL(x)	((x) & BIT(30))
 #define SUPPORTS_PERF_LIMIT_NOTIFY(x)	((x) & BIT(29))
 #define SUPPORTS_PERF_LEVEL_NOTIFY(x)	((x) & BIT(28))
+#define SUPPORTS_PERF_FASTCHANNELS(x)	((x) & BIT(27))
 	__le32 rate_limit_us;
 	__le32 sustained_freq_khz;
 	__le32 sustained_perf_level;
@@ -87,17 +91,56 @@ struct scmi_msg_resp_perf_describe_levels {
 	} opp[0];
 };
 
+struct scmi_perf_get_fc_info {
+	__le32 domain;
+	__le32 message_id;
+};
+
+struct scmi_msg_resp_perf_desc_fc {
+	__le32 attr;
+#define SUPPORTS_DOORBELL(x)		((x) & BIT(0))
+#define DOORBELL_REG_WIDTH(x)		FIELD_GET(GENMASK(2, 1), (x))
+	__le32 rate_limit;
+	__le32 chan_addr_low;
+	__le32 chan_addr_high;
+	__le32 chan_size;
+	__le32 db_addr_low;
+	__le32 db_addr_high;
+	__le32 db_set_lmask;
+	__le32 db_set_hmask;
+	__le32 db_preserve_lmask;
+	__le32 db_preserve_hmask;
+};
+
+struct scmi_fc_db_info {
+	int width;
+	u64 set;
+	u64 mask;
+	void __iomem *addr;
+};
+
+struct scmi_fc_info {
+	void __iomem *level_set_addr;
+	void __iomem *limit_set_addr;
+	void __iomem *level_get_addr;
+	void __iomem *limit_get_addr;
+	struct scmi_fc_db_info *level_set_db;
+	struct scmi_fc_db_info *limit_set_db;
+};
+
 struct perf_dom_info {
 	bool set_limits;
 	bool set_perf;
 	bool perf_limit_notify;
 	bool perf_level_notify;
+	bool perf_fastchannels;
 	u32 opp_count;
 	u32 sustained_freq_khz;
 	u32 sustained_perf_level;
 	u32 mult_factor;
 	char name[SCMI_MAX_STR_SIZE];
 	struct scmi_opp opp[MAX_OPPS];
+	struct scmi_fc_info *fc_info;
 };
 
 struct scmi_perf_info {
@@ -162,6 +205,7 @@ scmi_perf_domain_attributes_get(const struct scmi_handle *handle, u32 domain,
 		dom_info->set_perf = SUPPORTS_SET_PERF_LVL(flags);
 		dom_info->perf_limit_notify = SUPPORTS_PERF_LIMIT_NOTIFY(flags);
 		dom_info->perf_level_notify = SUPPORTS_PERF_LEVEL_NOTIFY(flags);
+		dom_info->perf_fastchannels = SUPPORTS_PERF_FASTCHANNELS(flags);
 		dom_info->sustained_freq_khz =
 					le32_to_cpu(attr->sustained_freq_khz);
 		dom_info->sustained_perf_level =
@@ -250,7 +294,7 @@ scmi_perf_describe_levels_get(const struct scmi_handle *handle, u32 domain,
 }
 
 static int scmi_perf_limits_set(const struct scmi_handle *handle, u32 domain,
-				u32 max_perf, u32 min_perf)
+				   u32 max_perf, u32 min_perf)
 {
 	int ret;
 	struct scmi_xfer *t;
@@ -273,7 +317,7 @@ static int scmi_perf_limits_set(const struct scmi_handle *handle, u32 domain,
 }
 
 static int scmi_perf_limits_get(const struct scmi_handle *handle, u32 domain,
-				u32 *max_perf, u32 *min_perf)
+				   u32 *max_perf, u32 *min_perf)
 {
 	int ret;
 	struct scmi_xfer *t;
@@ -299,7 +343,7 @@ static int scmi_perf_limits_get(const struct scmi_handle *handle, u32 domain,
 }
 
 static int scmi_perf_level_set(const struct scmi_handle *handle, u32 domain,
-			       u32 level, bool poll)
+				  u32 level, bool poll)
 {
 	int ret;
 	struct scmi_xfer *t;
@@ -322,7 +366,7 @@ static int scmi_perf_level_set(const struct scmi_handle *handle, u32 domain,
 }
 
 static int scmi_perf_level_get(const struct scmi_handle *handle, u32 domain,
-			       u32 *level, bool poll)
+				  u32 *level, bool poll)
 {
 	int ret;
 	struct scmi_xfer *t;
@@ -343,6 +387,104 @@ static int scmi_perf_level_get(const struct scmi_handle *handle, u32 domain,
 	return ret;
 }
 
+static bool scmi_perf_fc_size_is_valid(u32 msg, u32 size)
+{
+	if ((msg == PERF_LEVEL_GET || msg == PERF_LEVEL_SET) && size == 4)
+		return true;
+	if ((msg == PERF_LIMITS_GET || msg == PERF_LIMITS_SET) && size == 8)
+		return true;
+	return false;
+}
+
+static void
+scmi_perf_domain_desc_fc(const struct scmi_handle *handle, u32 domain,
+			 u32 message_id, void __iomem **p_addr,
+			 struct scmi_fc_db_info **p_db)
+{
+	int ret;
+	u32 flags;
+	u64 phys_addr;
+	u8 size;
+	void __iomem *addr;
+	struct scmi_xfer *t;
+	struct scmi_fc_db_info *db;
+	struct scmi_perf_get_fc_info *info;
+	struct scmi_msg_resp_perf_desc_fc *resp;
+
+	if (!p_addr)
+		return;
+
+	ret = scmi_xfer_get_init(handle, PERF_DESCRIBE_FASTCHANNEL,
+				 SCMI_PROTOCOL_PERF,
+				 sizeof(*info), sizeof(*resp), &t);
+	if (ret)
+		return;
+
+	info = t->tx.buf;
+	info->domain = cpu_to_le32(domain);
+	info->message_id = cpu_to_le32(message_id);
+
+	ret = scmi_do_xfer(handle, t);
+	if (ret)
+		goto err_xfer;
+
+	resp = t->rx.buf;
+	flags = le32_to_cpu(resp->attr);
+	size = le32_to_cpu(resp->chan_size);
+	if (!scmi_perf_fc_size_is_valid(message_id, size))
+		goto err_xfer;
+
+	phys_addr = le32_to_cpu(resp->chan_addr_low);
+	phys_addr |= (u64)le32_to_cpu(resp->chan_addr_high) << 32;
+	addr = devm_ioremap(handle->dev, phys_addr, size);
+	if (!addr)
+		goto err_xfer;
+	*p_addr = addr;
+
+	if (p_db && SUPPORTS_DOORBELL(flags)) {
+		db = devm_kzalloc(handle->dev, sizeof(*db), GFP_KERNEL);
+		if (!db)
+			goto err_xfer;
+
+		size = 1 << DOORBELL_REG_WIDTH(flags);
+		phys_addr = le32_to_cpu(resp->db_addr_low);
+		phys_addr |= (u64)le32_to_cpu(resp->db_addr_high) << 32;
+		addr = devm_ioremap(handle->dev, phys_addr, size);
+		if (!addr)
+			goto err_xfer;
+
+		db->addr = addr;
+		db->width = size;
+		db->set = le32_to_cpu(resp->db_set_lmask);
+		db->set |= (u64)le32_to_cpu(resp->db_set_hmask) << 32;
+		db->mask = le32_to_cpu(resp->db_preserve_lmask);
+		db->mask |= (u64)le32_to_cpu(resp->db_preserve_hmask) << 32;
+		*p_db = db;
+	}
+err_xfer:
+	scmi_xfer_put(handle, t);
+}
+
+static void scmi_perf_domain_init_fc(const struct scmi_handle *handle,
+				     u32 domain, struct scmi_fc_info **p_fc)
+{
+	struct scmi_fc_info *fc;
+
+	fc = devm_kzalloc(handle->dev, sizeof(*fc), GFP_KERNEL);
+	if (!fc)
+		return;
+
+	scmi_perf_domain_desc_fc(handle, domain, PERF_LEVEL_SET,
+				 &fc->level_set_addr, &fc->level_set_db);
+	scmi_perf_domain_desc_fc(handle, domain, PERF_LEVEL_GET,
+				 &fc->level_get_addr, NULL);
+	scmi_perf_domain_desc_fc(handle, domain, PERF_LIMITS_SET,
+				 &fc->limit_set_addr, &fc->limit_set_db);
+	scmi_perf_domain_desc_fc(handle, domain, PERF_LIMITS_GET,
+				 &fc->limit_get_addr, NULL);
+	*p_fc = fc;
+}
+
 /* Device specific ops */
 static int scmi_dev_domain_id(struct device *dev)
 {
@@ -494,6 +636,9 @@ static int scmi_perf_protocol_init(struct scmi_handle *handle)
 
 		scmi_perf_domain_attributes_get(handle, domain, dom);
 		scmi_perf_describe_levels_get(handle, domain, dom);
+
+		if (dom->perf_fastchannels)
+			scmi_perf_domain_init_fc(handle, domain, &dom->fc_info);
 	}
 
 	handle->perf_ops = &perf_ops;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 2/5] firmware: arm_scmi: Make use SCMI v2.0 fastchannel for performance protocol
  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-06 17:02 ` 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
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 17+ messages in thread
From: Sudeep Holla @ 2019-08-06 17:02 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Sudeep Holla, Peng Fan, linux-kernel, Bo Zhang, Jim Quinlan,
	Volodymyr Babchuk, Gaku Inami, aidapala, pajay, Etienne Carriere,
	Souvik Chakravarty, wesleys, Felix Burton, Saeed Nowshadi,
	Ionela Voinescu, Chris Redpath, Quentin Perret

SCMI v2.0 adds support for "FastChannel" which do not use a message
header as they are specialized for a single message.

Only PERFORMANCE_LIMITS_{SET,GET} and PERFORMANCE_LEVEL_{SET,GET}
commands are supported over fastchannels. As they are optional, they
need to be discovered by PERFORMANCE_DESCRIBE_FASTCHANNEL command.
Further {LIMIT,LEVEL}_SET commands can have optional doorbell support.

Add support for making use of these fastchannels.

Cc: Ionela Voinescu <Ionela.Voinescu@arm.com>
Cc: Chris Redpath <Chris.Redpath@arm.com>
Cc: Quentin Perret <Quentin.Perret@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/firmware/arm_scmi/perf.c | 104 +++++++++++++++++++++++++++++--
 1 file changed, 100 insertions(+), 4 deletions(-)

v1->v2:
	- Changed the macro SCMI_PERF_FC_RING_DB to use do {} while(0)

diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
index 6cce3e82e81e..fb7f6cab2c11 100644
--- a/drivers/firmware/arm_scmi/perf.c
+++ b/drivers/firmware/arm_scmi/perf.c
@@ -8,6 +8,7 @@
 #include <linux/bits.h>
 #include <linux/of.h>
 #include <linux/io.h>
+#include <linux/io-64-nonatomic-hi-lo.h>
 #include <linux/platform_device.h>
 #include <linux/pm_opp.h>
 #include <linux/sort.h>
@@ -293,7 +294,42 @@ scmi_perf_describe_levels_get(const struct scmi_handle *handle, u32 domain,
 	return ret;
 }
 
-static int scmi_perf_limits_set(const struct scmi_handle *handle, u32 domain,
+#define SCMI_PERF_FC_RING_DB(doorbell, w)		\
+do {							\
+	u##w val = 0;					\
+	struct scmi_fc_db_info *db = doorbell;		\
+							\
+	if (db->mask)					\
+		val = ioread##w(db->addr) & db->mask;	\
+	iowrite##w((u##w)db->set | val, db->addr);	\
+} while(0)
+
+static void scmi_perf_fc_ring_db(struct scmi_fc_db_info *db)
+{
+	if (!db || !db->addr)
+		return;
+
+	if (db->width == 1)
+		SCMI_PERF_FC_RING_DB(db, 8);
+	else if (db->width == 2)
+		SCMI_PERF_FC_RING_DB(db, 16);
+	else if (db->width == 4)
+		SCMI_PERF_FC_RING_DB(db, 32);
+	else /* db->width == 8 */
+#ifdef CONFIG_64BIT
+		SCMI_PERF_FC_RING_DB(db, 64);
+#else
+	{
+		u64 val = 0;
+
+		if (db->mask)
+			val = ioread64_hi_lo(db->addr) & db->mask;
+		iowrite64_hi_lo(db->set, db->addr);
+	}
+#endif
+}
+
+static int scmi_perf_mb_limits_set(const struct scmi_handle *handle, u32 domain,
 				   u32 max_perf, u32 min_perf)
 {
 	int ret;
@@ -316,7 +352,23 @@ static int scmi_perf_limits_set(const struct scmi_handle *handle, u32 domain,
 	return ret;
 }
 
-static int scmi_perf_limits_get(const struct scmi_handle *handle, u32 domain,
+static int scmi_perf_limits_set(const struct scmi_handle *handle, u32 domain,
+				u32 max_perf, u32 min_perf)
+{
+	struct scmi_perf_info *pi = handle->perf_priv;
+	struct perf_dom_info *dom = pi->dom_info + domain;
+
+	if (dom->fc_info && dom->fc_info->limit_set_addr) {
+		iowrite32(max_perf, dom->fc_info->limit_set_addr);
+		iowrite32(min_perf, dom->fc_info->limit_set_addr + 4);
+		scmi_perf_fc_ring_db(dom->fc_info->limit_set_db);
+		return 0;
+	}
+
+	return scmi_perf_mb_limits_set(handle, domain, max_perf, min_perf);
+}
+
+static int scmi_perf_mb_limits_get(const struct scmi_handle *handle, u32 domain,
 				   u32 *max_perf, u32 *min_perf)
 {
 	int ret;
@@ -342,7 +394,22 @@ static int scmi_perf_limits_get(const struct scmi_handle *handle, u32 domain,
 	return ret;
 }
 
-static int scmi_perf_level_set(const struct scmi_handle *handle, u32 domain,
+static int scmi_perf_limits_get(const struct scmi_handle *handle, u32 domain,
+				u32 *max_perf, u32 *min_perf)
+{
+	struct scmi_perf_info *pi = handle->perf_priv;
+	struct perf_dom_info *dom = pi->dom_info + domain;
+
+	if (dom->fc_info && dom->fc_info->limit_get_addr) {
+		*max_perf = ioread32(dom->fc_info->limit_get_addr);
+		*min_perf = ioread32(dom->fc_info->limit_get_addr + 4);
+		return 0;
+	}
+
+	return scmi_perf_mb_limits_get(handle, domain, max_perf, min_perf);
+}
+
+static int scmi_perf_mb_level_set(const struct scmi_handle *handle, u32 domain,
 				  u32 level, bool poll)
 {
 	int ret;
@@ -365,7 +432,22 @@ static int scmi_perf_level_set(const struct scmi_handle *handle, u32 domain,
 	return ret;
 }
 
-static int scmi_perf_level_get(const struct scmi_handle *handle, u32 domain,
+static int scmi_perf_level_set(const struct scmi_handle *handle, u32 domain,
+			       u32 level, bool poll)
+{
+	struct scmi_perf_info *pi = handle->perf_priv;
+	struct perf_dom_info *dom = pi->dom_info + domain;
+
+	if (dom->fc_info && dom->fc_info->level_set_addr) {
+		iowrite32(level, dom->fc_info->level_set_addr);
+		scmi_perf_fc_ring_db(dom->fc_info->level_set_db);
+		return 0;
+	}
+
+	return scmi_perf_mb_level_set(handle, domain, level, poll);
+}
+
+static int scmi_perf_mb_level_get(const struct scmi_handle *handle, u32 domain,
 				  u32 *level, bool poll)
 {
 	int ret;
@@ -387,6 +469,20 @@ static int scmi_perf_level_get(const struct scmi_handle *handle, u32 domain,
 	return ret;
 }
 
+static int scmi_perf_level_get(const struct scmi_handle *handle, u32 domain,
+			       u32 *level, bool poll)
+{
+	struct scmi_perf_info *pi = handle->perf_priv;
+	struct perf_dom_info *dom = pi->dom_info + domain;
+
+	if (dom->fc_info && dom->fc_info->level_get_addr) {
+		*level = ioread32(dom->fc_info->level_get_addr);
+		return 0;
+	}
+
+	return scmi_perf_mb_level_get(handle, domain, level, poll);
+}
+
 static bool scmi_perf_fc_size_is_valid(u32 msg, u32 size)
 {
 	if ((msg == PERF_LEVEL_GET || msg == PERF_LEVEL_SET) && size == 4)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 3/5] dt-bindings: arm: Extend SCMI to support new reset protocol
  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-06 17:02 ` [PATCH v2 2/5] firmware: arm_scmi: Make use SCMI v2.0 fastchannel for performance protocol Sudeep Holla
@ 2019-08-06 17:02 ` Sudeep Holla
  2019-08-07  8:26   ` Philipp Zabel
  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-06 17:02 ` [PATCH v2 5/5] reset: Add support for resets provided by SCMI Sudeep Holla
  4 siblings, 2 replies; 17+ messages in thread
From: Sudeep Holla @ 2019-08-06 17:02 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Sudeep Holla, Peng Fan, linux-kernel, Bo Zhang, Jim Quinlan,
	Volodymyr Babchuk, Gaku Inami, aidapala, pajay, Etienne Carriere,
	Souvik Chakravarty, wesleys, Felix Burton, Saeed Nowshadi,
	Philipp Zabel, Rob Herring, Mark Rutland, devicetree

SCMIv2.0 adds a new Reset Management Protocol to manage various reset
states a given device or domain can enter. Extend the existing SCMI
bindings to add reset protocol support by re-using the reset bindings
for bothe reset providers and consumers.

Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree@vger.kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 .../devicetree/bindings/arm/arm,scmi.txt        | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt b/Documentation/devicetree/bindings/arm/arm,scmi.txt
index 317a2fc3667a..083dbf96ee00 100644
--- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
+++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
@@ -73,6 +73,16 @@ SCMI provides an API to access the various sensors on the SoC.
 			 as used by the firmware. Refer to  platform details
 			 for your implementation for the IDs to use.
 
+Reset signal bindings for the reset domains based on SCMI Message Protocol
+------------------------------------------------------------
+
+This binding for the SCMI reset domain providers uses the generic reset
+signal binding[5].
+
+Required properties:
+ - #reset-cells : Should be 1. Contains the reset domain ID value used
+		  by SCMI commands.
+
 SRAM and Shared Memory for SCMI
 -------------------------------
 
@@ -93,6 +103,7 @@ Each sub-node represents the reserved area for SCMI.
 [2] Documentation/devicetree/bindings/power/power_domain.txt
 [3] Documentation/devicetree/bindings/thermal/thermal.txt
 [4] Documentation/devicetree/bindings/sram/sram.txt
+[5] Documentation/devicetree/bindings/reset/reset.txt
 
 Example:
 
@@ -152,6 +163,11 @@ firmware {
 			reg = <0x15>;
 			#thermal-sensor-cells = <1>;
 		};
+
+		scmi_reset: protocol@16 {
+			reg = <0x16>;
+			#reset-cells = <1>;
+		};
 	};
 };
 
@@ -166,6 +182,7 @@ hdlcd@7ff60000 {
 	reg = <0 0x7ff60000 0 0x1000>;
 	clocks = <&scmi_clk 4>;
 	power-domains = <&scmi_devpd 1>;
+	resets = <&scmi_reset 10>;
 };
 
 thermal-zones {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 4/5] firmware: arm_scmi: Add RESET protocol in SCMI v2.0
  2019-08-06 17:02 [PATCH v2 0/5] firmware: arm_scmi: add SCMI v2.0 fastchannels and reset protocol support Sudeep Holla
                   ` (2 preceding siblings ...)
  2019-08-06 17:02 ` [PATCH v2 3/5] dt-bindings: arm: Extend SCMI to support new reset protocol Sudeep Holla
@ 2019-08-06 17:02 ` Sudeep Holla
  2019-08-07  8:17   ` Philipp Zabel
  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
  4 siblings, 2 replies; 17+ messages in thread
From: Sudeep Holla @ 2019-08-06 17:02 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Sudeep Holla, Peng Fan, linux-kernel, Bo Zhang, Jim Quinlan,
	Volodymyr Babchuk, Gaku Inami, aidapala, pajay, Etienne Carriere,
	Souvik Chakravarty, wesleys, Felix Burton, Saeed Nowshadi,
	Philipp Zabel

SCMIv2.0 adds a new Reset Management Protocol to manage various reset
states a given device or domain can enter. Device(s) that can be
collectively reset through a common reset signal constitute a reset
domain for the firmware.

A reset domain can be reset autonomously or explicitly through assertion
and de-assertion of the signal. When autonomous reset is chosen, the
firmware is responsible for taking the necessary steps to reset the
domain and to subsequently bring it out of reset. When explicit reset is
chosen, the caller has to specifically assert and then de-assert the
reset signal by issuing two separate RESET commands.

Add the basic SCMI reset infrastructure that can be used by Linux
reset controller driver.

Cc: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/firmware/arm_scmi/Makefile |   2 +-
 drivers/firmware/arm_scmi/reset.c  | 231 +++++++++++++++++++++++++++++
 include/linux/scmi_protocol.h      |  26 ++++
 3 files changed, 258 insertions(+), 1 deletion(-)
 create mode 100644 drivers/firmware/arm_scmi/reset.c

diff --git a/drivers/firmware/arm_scmi/Makefile b/drivers/firmware/arm_scmi/Makefile
index c47d28d556b6..5f298f00a82e 100644
--- a/drivers/firmware/arm_scmi/Makefile
+++ b/drivers/firmware/arm_scmi/Makefile
@@ -2,5 +2,5 @@
 obj-y	= scmi-bus.o scmi-driver.o scmi-protocols.o
 scmi-bus-y = bus.o
 scmi-driver-y = driver.o
-scmi-protocols-y = base.o clock.o perf.o power.o sensors.o
+scmi-protocols-y = base.o clock.o perf.o power.o reset.o sensors.o
 obj-$(CONFIG_ARM_SCMI_POWER_DOMAIN) += scmi_pm_domain.o
diff --git a/drivers/firmware/arm_scmi/reset.c b/drivers/firmware/arm_scmi/reset.c
new file mode 100644
index 000000000000..11cb8b5ccf34
--- /dev/null
+++ b/drivers/firmware/arm_scmi/reset.c
@@ -0,0 +1,231 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * System Control and Management Interface (SCMI) Reset Protocol
+ *
+ * Copyright (C) 2019 ARM Ltd.
+ */
+
+#include "common.h"
+
+enum scmi_reset_protocol_cmd {
+	RESET_DOMAIN_ATTRIBUTES = 0x3,
+	RESET = 0x4,
+	RESET_NOTIFY = 0x5,
+};
+
+enum scmi_reset_protocol_notify {
+	RESET_ISSUED = 0x0,
+};
+
+#define NUM_RESET_DOMAIN_MASK	0xffff
+#define RESET_NOTIFY_ENABLE	BIT(0)
+
+struct scmi_msg_resp_reset_domain_attributes {
+	__le32 attributes;
+#define SUPPORTS_ASYNC_RESET(x)		((x) & BIT(31))
+#define SUPPORTS_NOTIFY_RESET(x)	((x) & BIT(30))
+	__le32 latency;
+	    u8 name[SCMI_MAX_STR_SIZE];
+};
+
+struct scmi_msg_reset_domain_reset {
+	__le32 domain_id;
+	__le32 flags;
+#define AUTONOMOUS_RESET	BIT(0)
+#define EXPLICIT_RESET_ASSERT	BIT(1)
+#define ASYNCHRONOUS_RESET	BIT(2)
+	__le32 reset_state;
+#define ARCH_RESET_TYPE		BIT(31)
+#define COLD_RESET_STATE	BIT(0)
+#define ARCH_COLD_RESET		(ARCH_RESET_TYPE | COLD_RESET_STATE)
+};
+
+struct reset_dom_info {
+	bool async_reset;
+	bool reset_notify;
+	u32 latency_us;
+	char name[SCMI_MAX_STR_SIZE];
+};
+
+struct scmi_reset_info {
+	int num_domains;
+	struct reset_dom_info *dom_info;
+};
+
+static int scmi_reset_attributes_get(const struct scmi_handle *handle,
+				     struct scmi_reset_info *pi)
+{
+	int ret;
+	struct scmi_xfer *t;
+	u32 *attr;
+
+	ret = scmi_xfer_get_init(handle, PROTOCOL_ATTRIBUTES,
+				 SCMI_PROTOCOL_RESET, 0, sizeof(*attr), &t);
+	if (ret)
+		return ret;
+
+	attr = t->rx.buf;
+
+	ret = scmi_do_xfer(handle, t);
+	if (!ret)
+		pi->num_domains = le32_to_cpu(*attr) & NUM_RESET_DOMAIN_MASK;
+
+	scmi_xfer_put(handle, t);
+	return ret;
+}
+
+static int
+scmi_reset_domain_attributes_get(const struct scmi_handle *handle, u32 domain,
+				 struct reset_dom_info *dom_info)
+{
+	int ret;
+	struct scmi_xfer *t;
+	struct scmi_msg_resp_reset_domain_attributes *attr;
+
+	ret = scmi_xfer_get_init(handle, RESET_DOMAIN_ATTRIBUTES,
+				 SCMI_PROTOCOL_RESET, sizeof(domain),
+				 sizeof(*attr), &t);
+	if (ret)
+		return ret;
+
+	*(__le32 *)t->tx.buf = cpu_to_le32(domain);
+	attr = t->rx.buf;
+
+	ret = scmi_do_xfer(handle, t);
+	if (!ret) {
+		u32 attributes = le32_to_cpu(attr->attributes);
+
+		dom_info->async_reset = SUPPORTS_ASYNC_RESET(attributes);
+		dom_info->reset_notify = SUPPORTS_NOTIFY_RESET(attributes);
+		dom_info->latency_us = le32_to_cpu(attr->latency);
+		if (dom_info->latency_us == U32_MAX)
+			dom_info->latency_us = 0;
+		strlcpy(dom_info->name, attr->name, SCMI_MAX_STR_SIZE);
+	}
+
+	scmi_xfer_put(handle, t);
+	return ret;
+}
+
+static int scmi_reset_num_domains_get(const struct scmi_handle *handle)
+{
+	struct scmi_reset_info *pi = handle->reset_priv;
+
+	return pi->num_domains;
+}
+
+static char *scmi_reset_name_get(const struct scmi_handle *handle, u32 domain)
+{
+	struct scmi_reset_info *pi = handle->reset_priv;
+	struct reset_dom_info *dom = pi->dom_info + domain;
+
+	return dom->name;
+}
+
+static int scmi_reset_latency_get(const struct scmi_handle *handle, u32 domain)
+{
+	struct scmi_reset_info *pi = handle->reset_priv;
+	struct reset_dom_info *dom = pi->dom_info + domain;
+
+	return dom->latency_us;
+}
+
+static int scmi_domain_reset(const struct scmi_handle *handle, u32 domain,
+			     u32 flags, u32 state)
+{
+	int ret;
+	struct scmi_xfer *t;
+	struct scmi_msg_reset_domain_reset *dom;
+	struct scmi_reset_info *pi = handle->reset_priv;
+	struct reset_dom_info *rdom = pi->dom_info + domain;
+
+	if (rdom->async_reset)
+		flags |= ASYNCHRONOUS_RESET;
+
+	ret = scmi_xfer_get_init(handle, RESET, SCMI_PROTOCOL_RESET,
+				 sizeof(*dom), 0, &t);
+	if (ret)
+		return ret;
+
+	dom = t->tx.buf;
+	dom->domain_id = cpu_to_le32(domain);
+	dom->flags = cpu_to_le32(flags);
+	dom->domain_id = cpu_to_le32(state);
+
+	if (rdom->async_reset)
+		ret = scmi_do_xfer_with_response(handle, t);
+	else
+		ret = scmi_do_xfer(handle, t);
+
+	scmi_xfer_put(handle, t);
+	return ret;
+}
+
+static int scmi_reset_domain_reset(const struct scmi_handle *handle, u32 domain)
+{
+	return scmi_domain_reset(handle, domain, AUTONOMOUS_RESET,
+				 ARCH_COLD_RESET);
+}
+
+static int
+scmi_reset_domain_assert(const struct scmi_handle *handle, u32 domain)
+{
+	return scmi_domain_reset(handle, domain, EXPLICIT_RESET_ASSERT,
+				 ARCH_COLD_RESET);
+}
+
+static int
+scmi_reset_domain_deassert(const struct scmi_handle *handle, u32 domain)
+{
+	return scmi_domain_reset(handle, domain, 0, ARCH_COLD_RESET);
+}
+
+static struct scmi_reset_ops reset_ops = {
+	.num_domains_get = scmi_reset_num_domains_get,
+	.name_get = scmi_reset_name_get,
+	.latency_get = scmi_reset_latency_get,
+	.reset = scmi_reset_domain_reset,
+	.assert = scmi_reset_domain_assert,
+	.deassert = scmi_reset_domain_deassert,
+};
+
+static int scmi_reset_protocol_init(struct scmi_handle *handle)
+{
+	int domain;
+	u32 version;
+	struct scmi_reset_info *pinfo;
+
+	scmi_version_get(handle, SCMI_PROTOCOL_RESET, &version);
+
+	dev_dbg(handle->dev, "Reset Version %d.%d\n",
+		PROTOCOL_REV_MAJOR(version), PROTOCOL_REV_MINOR(version));
+
+	pinfo = devm_kzalloc(handle->dev, sizeof(*pinfo), GFP_KERNEL);
+	if (!pinfo)
+		return -ENOMEM;
+
+	scmi_reset_attributes_get(handle, pinfo);
+
+	pinfo->dom_info = devm_kcalloc(handle->dev, pinfo->num_domains,
+				       sizeof(*pinfo->dom_info), GFP_KERNEL);
+	if (!pinfo->dom_info)
+		return -ENOMEM;
+
+	for (domain = 0; domain < pinfo->num_domains; domain++) {
+		struct reset_dom_info *dom = pinfo->dom_info + domain;
+
+		scmi_reset_domain_attributes_get(handle, domain, dom);
+	}
+
+	handle->reset_ops = &reset_ops;
+	handle->reset_priv = pinfo;
+
+	return 0;
+}
+
+static int __init scmi_reset_init(void)
+{
+	return scmi_protocol_register(SCMI_PROTOCOL_RESET,
+				      &scmi_reset_protocol_init);
+}
+subsys_initcall(scmi_reset_init);
diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
index f0f2b53a1dac..881fea47c83d 100644
--- a/include/linux/scmi_protocol.h
+++ b/include/linux/scmi_protocol.h
@@ -187,6 +187,26 @@ struct scmi_sensor_ops {
 			   u64 *value);
 };
 
+/**
+ * struct scmi_reset_ops - represents the various operations provided
+ *	by SCMI Reset Protocol
+ *
+ * @num_domains_get: get the count of reset domains provided by SCMI
+ * @name_get: gets the name of a reset domain
+ * @latency_get: gets the reset latency for the specified reset domain
+ * @reset: resets the specified reset domain
+ * @assert: explicitly assert reset signal of the specified reset domain
+ * @deassert: explicitly deassert reset signal of the specified reset domain
+ */
+struct scmi_reset_ops {
+	int (*num_domains_get)(const struct scmi_handle *handle);
+	char *(*name_get)(const struct scmi_handle *handle, u32 domain);
+	int (*latency_get)(const struct scmi_handle *handle, u32 domain);
+	int (*reset)(const struct scmi_handle *handle, u32 domain);
+	int (*assert)(const struct scmi_handle *handle, u32 domain);
+	int (*deassert)(const struct scmi_handle *handle, u32 domain);
+};
+
 /**
  * struct scmi_handle - Handle returned to ARM SCMI clients for usage.
  *
@@ -196,6 +216,7 @@ struct scmi_sensor_ops {
  * @perf_ops: pointer to set of performance protocol operations
  * @clk_ops: pointer to set of clock protocol operations
  * @sensor_ops: pointer to set of sensor protocol operations
+ * @reset_ops: pointer to set of reset protocol operations
  * @perf_priv: pointer to private data structure specific to performance
  *	protocol(for internal use only)
  * @clk_priv: pointer to private data structure specific to clock
@@ -204,6 +225,8 @@ struct scmi_sensor_ops {
  *	protocol(for internal use only)
  * @sensor_priv: pointer to private data structure specific to sensors
  *	protocol(for internal use only)
+ * @reset_priv: pointer to private data structure specific to reset
+ *	protocol(for internal use only)
  */
 struct scmi_handle {
 	struct device *dev;
@@ -212,11 +235,13 @@ struct scmi_handle {
 	struct scmi_clk_ops *clk_ops;
 	struct scmi_power_ops *power_ops;
 	struct scmi_sensor_ops *sensor_ops;
+	struct scmi_reset_ops *reset_ops;
 	/* for protocol internal use */
 	void *perf_priv;
 	void *clk_priv;
 	void *power_priv;
 	void *sensor_priv;
+	void *reset_priv;
 };
 
 enum scmi_std_protocol {
@@ -226,6 +251,7 @@ enum scmi_std_protocol {
 	SCMI_PROTOCOL_PERF = 0x13,
 	SCMI_PROTOCOL_CLOCK = 0x14,
 	SCMI_PROTOCOL_SENSOR = 0x15,
+	SCMI_PROTOCOL_RESET = 0x16,
 };
 
 struct scmi_device {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 5/5] reset: Add support for resets provided by SCMI
  2019-08-06 17:02 [PATCH v2 0/5] firmware: arm_scmi: add SCMI v2.0 fastchannels and reset protocol support Sudeep Holla
                   ` (3 preceding siblings ...)
  2019-08-06 17:02 ` [PATCH v2 4/5] firmware: arm_scmi: Add RESET protocol in SCMI v2.0 Sudeep Holla
@ 2019-08-06 17:02 ` Sudeep Holla
  2019-08-07  8:04   ` Philipp Zabel
  4 siblings, 1 reply; 17+ messages in thread
From: Sudeep Holla @ 2019-08-06 17:02 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Sudeep Holla, Peng Fan, linux-kernel, Bo Zhang, Jim Quinlan,
	Volodymyr Babchuk, Gaku Inami, aidapala, pajay, Etienne Carriere,
	Souvik Chakravarty, wesleys, Felix Burton, Saeed Nowshadi,
	Philipp Zabel

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>
+#include <linux/of.h>
+#include <linux/platform_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
+ */
+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)
+
+/**
+ * scmi_reset_assert() - assert device reset
+ * @rcdev: reset controller entity
+ * @id: ID of the reset to be asserted
+ *
+ * This function implements the reset driver op to assert a device's reset
+ * using the ARM SCMI protocol.
+ *
+ * Return: 0 for successful request, else a corresponding error value
+ */
+static int
+scmi_reset_assert(struct reset_controller_dev *rcdev, unsigned long id)
+{
+	const struct scmi_handle *handle = to_scmi_handle(rcdev);
+
+	return handle->reset_ops->assert(handle, id);
+}
+
+/**
+ * scmi_reset_deassert() - deassert device reset
+ * @rcdev: reset controller entity
+ * @id: ID of the reset to be deasserted
+ *
+ * This function implements the reset driver op to deassert a device's reset
+ * using the ARM SCMI protocol.
+ *
+ * Return: 0 for successful request, else a corresponding error value
+ */
+static int
+scmi_reset_deassert(struct reset_controller_dev *rcdev, unsigned long id)
+{
+	const struct scmi_handle *handle = to_scmi_handle(rcdev);
+
+	return handle->reset_ops->deassert(handle, id);
+}
+
+/**
+ * scmi_reset_reset() - reset the device
+ * @rcdev: reset controller entity
+ * @id: ID of the reset signal to be reset(assert + deassert)
+ *
+ * This function implements the reset driver op to trigger a device's
+ * reset signal using the ARM SCMI protocol.
+ *
+ * Return: 0 for successful request, else a corresponding error value
+ */
+static int
+scmi_reset_reset(struct reset_controller_dev *rcdev, unsigned long id)
+{
+	const struct scmi_handle *handle = to_scmi_handle(rcdev);
+
+	return handle->reset_ops->reset(handle, id);
+}
+
+static const struct reset_control_ops scmi_reset_ops = {
+	.assert		= scmi_reset_assert,
+	.deassert	= scmi_reset_deassert,
+	.reset		= scmi_reset_reset,
+};
+
+static int scmi_reset_probe(struct scmi_device *sdev)
+{
+	struct scmi_reset_data *data;
+	struct device *dev = &sdev->dev;
+	struct device_node *np = dev->of_node;
+	const struct scmi_handle *handle = sdev->handle;
+
+	if (!handle || !handle->reset_ops)
+		return -ENODEV;
+
+	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
+
+	data->rcdev.ops = &scmi_reset_ops;
+	data->rcdev.owner = THIS_MODULE;
+	data->rcdev.of_node = np;
+	data->rcdev.nr_resets = handle->reset_ops->num_domains_get(handle);
+
+	return devm_reset_controller_register(dev, &data->rcdev);
+}
+
+static const struct scmi_device_id scmi_id_table[] = {
+	{ SCMI_PROTOCOL_RESET },
+	{ },
+};
+MODULE_DEVICE_TABLE(scmi, scmi_id_table);
+
+static struct scmi_driver scmi_reset_driver = {
+	.name = "scmi-reset",
+	.probe = scmi_reset_probe,
+	.id_table = scmi_id_table,
+};
+module_scmi_driver(scmi_reset_driver);
+
+MODULE_AUTHOR("Sudeep Holla <sudeep.holla@arm.com>");
+MODULE_DESCRIPTION("ARM SCMI reset controller driver");
+MODULE_LICENSE("GPL v2");
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 5/5] reset: Add support for resets provided by SCMI
  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
  2019-08-07 10:31     ` Sudeep Holla
  0 siblings, 1 reply; 17+ messages in thread
From: Philipp Zabel @ 2019-08-07  8:04 UTC (permalink / raw)
  To: Sudeep Holla, linux-arm-kernel
  Cc: Peng Fan, linux-kernel, Bo Zhang, Jim Quinlan, Volodymyr Babchuk,
	Gaku Inami, aidapala, pajay, Etienne Carriere,
	Souvik Chakravarty, wesleys, Felix Burton, Saeed Nowshadi

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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 4/5] firmware: arm_scmi: Add RESET protocol in SCMI v2.0
  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
  1 sibling, 1 reply; 17+ messages in thread
From: Philipp Zabel @ 2019-08-07  8:17 UTC (permalink / raw)
  To: Sudeep Holla, linux-arm-kernel
  Cc: Peng Fan, linux-kernel, Bo Zhang, Jim Quinlan, Volodymyr Babchuk,
	Gaku Inami, aidapala, pajay, Etienne Carriere,
	Souvik Chakravarty, wesleys, Felix Burton, Saeed Nowshadi

On Tue, 2019-08-06 at 18:02 +0100, Sudeep Holla wrote:
> SCMIv2.0 adds a new Reset Management Protocol to manage various reset
> states a given device or domain can enter. Device(s) that can be
> collectively reset through a common reset signal constitute a reset
> domain for the firmware.
> 
> A reset domain can be reset autonomously or explicitly through assertion
> and de-assertion of the signal. When autonomous reset is chosen, the
> firmware is responsible for taking the necessary steps to reset the
> domain and to subsequently bring it out of reset. When explicit reset is
> chosen, the caller has to specifically assert and then de-assert the
> reset signal by issuing two separate RESET commands.
> 
> Add the basic SCMI reset infrastructure that can be used by Linux
> reset controller driver.
> 
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/firmware/arm_scmi/Makefile |   2 +-
>  drivers/firmware/arm_scmi/reset.c  | 231 +++++++++++++++++++++++++++++
>  include/linux/scmi_protocol.h      |  26 ++++
>  3 files changed, 258 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/firmware/arm_scmi/reset.c
> 
> diff --git a/drivers/firmware/arm_scmi/Makefile b/drivers/firmware/arm_scmi/Makefile
> index c47d28d556b6..5f298f00a82e 100644
> --- a/drivers/firmware/arm_scmi/Makefile
> +++ b/drivers/firmware/arm_scmi/Makefile
> @@ -2,5 +2,5 @@
>  obj-y	= scmi-bus.o scmi-driver.o scmi-protocols.o
>  scmi-bus-y = bus.o
>  scmi-driver-y = driver.o
> -scmi-protocols-y = base.o clock.o perf.o power.o sensors.o
> +scmi-protocols-y = base.o clock.o perf.o power.o reset.o sensors.o
>  obj-$(CONFIG_ARM_SCMI_POWER_DOMAIN) += scmi_pm_domain.o
> diff --git a/drivers/firmware/arm_scmi/reset.c b/drivers/firmware/arm_scmi/reset.c
> new file mode 100644
> index 000000000000..11cb8b5ccf34
> --- /dev/null
> +++ b/drivers/firmware/arm_scmi/reset.c
> @@ -0,0 +1,231 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * System Control and Management Interface (SCMI) Reset Protocol
> + *
> + * Copyright (C) 2019 ARM Ltd.
> + */
> +
> +#include "common.h"
> +
> +enum scmi_reset_protocol_cmd {
> +	RESET_DOMAIN_ATTRIBUTES = 0x3,
> +	RESET = 0x4,
> +	RESET_NOTIFY = 0x5,
> +};
> +
> +enum scmi_reset_protocol_notify {
> +	RESET_ISSUED = 0x0,
> +};
> +
> +#define NUM_RESET_DOMAIN_MASK	0xffff
> +#define RESET_NOTIFY_ENABLE	BIT(0)
> +
> +struct scmi_msg_resp_reset_domain_attributes {
> +	__le32 attributes;
> +#define SUPPORTS_ASYNC_RESET(x)		((x) & BIT(31))
> +#define SUPPORTS_NOTIFY_RESET(x)	((x) & BIT(30))
> +	__le32 latency;
> +	    u8 name[SCMI_MAX_STR_SIZE];
> +};
> +
> +struct scmi_msg_reset_domain_reset {
> +	__le32 domain_id;
> +	__le32 flags;
> +#define AUTONOMOUS_RESET	BIT(0)
> +#define EXPLICIT_RESET_ASSERT	BIT(1)
> +#define ASYNCHRONOUS_RESET	BIT(2)
> +	__le32 reset_state;
> +#define ARCH_RESET_TYPE		BIT(31)
> +#define COLD_RESET_STATE	BIT(0)
> +#define ARCH_COLD_RESET		(ARCH_RESET_TYPE | COLD_RESET_STATE)
> +};
> +
> +struct reset_dom_info {
> +	bool async_reset;
> +	bool reset_notify;
> +	u32 latency_us;
> +	char name[SCMI_MAX_STR_SIZE];
> +};
> +
> +struct scmi_reset_info {
> +	int num_domains;
> +	struct reset_dom_info *dom_info;
> +};
> +
> +static int scmi_reset_attributes_get(const struct scmi_handle *handle,
> +				     struct scmi_reset_info *pi)
> +{
> +	int ret;
> +	struct scmi_xfer *t;
> +	u32 *attr;
> +
> +	ret = scmi_xfer_get_init(handle, PROTOCOL_ATTRIBUTES,
> +				 SCMI_PROTOCOL_RESET, 0, sizeof(*attr), &t);
> +	if (ret)
> +		return ret;
> +
> +	attr = t->rx.buf;
> +
> +	ret = scmi_do_xfer(handle, t);
> +	if (!ret)
> +		pi->num_domains = le32_to_cpu(*attr) & NUM_RESET_DOMAIN_MASK;
> +
> +	scmi_xfer_put(handle, t);
> +	return ret;
> +}
> +
> +static int
> +scmi_reset_domain_attributes_get(const struct scmi_handle *handle, u32 domain,
> +				 struct reset_dom_info *dom_info)
> +{
> +	int ret;
> +	struct scmi_xfer *t;
> +	struct scmi_msg_resp_reset_domain_attributes *attr;
> +
> +	ret = scmi_xfer_get_init(handle, RESET_DOMAIN_ATTRIBUTES,
> +				 SCMI_PROTOCOL_RESET, sizeof(domain),
> +				 sizeof(*attr), &t);
> +	if (ret)
> +		return ret;
> +
> +	*(__le32 *)t->tx.buf = cpu_to_le32(domain);

Should this use
	put_unaligned_le32(domain, t->tx.buf);
? Either way,

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 3/5] dt-bindings: arm: Extend SCMI to support new reset protocol
  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
  1 sibling, 1 reply; 17+ messages in thread
From: Philipp Zabel @ 2019-08-07  8:26 UTC (permalink / raw)
  To: Sudeep Holla, linux-arm-kernel
  Cc: Peng Fan, linux-kernel, Bo Zhang, Jim Quinlan, Volodymyr Babchuk,
	Gaku Inami, aidapala, pajay, Etienne Carriere,
	Souvik Chakravarty, wesleys, Felix Burton, Saeed Nowshadi,
	Rob Herring, Mark Rutland, devicetree

On Tue, 2019-08-06 at 18:02 +0100, Sudeep Holla wrote:
> SCMIv2.0 adds a new Reset Management Protocol to manage various reset
> states a given device or domain can enter. Extend the existing SCMI
> bindings to add reset protocol support by re-using the reset bindings
> for bothe reset providers and consumers.
          ^
typo

> 
> Cc: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH v2 1/5] firmware: arm_scmi: Add discovery of SCMI v2.0 performance fastchannels
  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
  0 siblings, 1 reply; 17+ messages in thread
From: Peng Fan @ 2019-08-07  9:23 UTC (permalink / raw)
  To: Sudeep Holla, linux-arm-kernel
  Cc: linux-kernel, Bo Zhang, Jim Quinlan, Volodymyr Babchuk,
	Gaku Inami, aidapala, pajay, Etienne Carriere,
	Souvik Chakravarty, wesleys, Felix Burton, Saeed Nowshadi,
	Ionela Voinescu, Chris Redpath, Quentin Perret

> Subject: [PATCH v2 1/5] firmware: arm_scmi: Add discovery of SCMI v2.0
> performance fastchannels
> 
> SCMI v2.0 adds support for "FastChannel", a lightweight unidirectional
> channel that is dedicated to a single SCMI message type for controlling a
> specific platform resource. They do not use a message header as they are
> specialized for a single message.
> 
> Only PERFORMANCE_LIMITS_{SET,GET} and
> PERFORMANCE_LEVEL_{SET,GET} commands are supported over
> fastchannels. As they are optional, they need to be discovered by
> PERFORMANCE_DESCRIBE_FASTCHANNEL command.
> Further {LIMIT,LEVEL}_SET commands can have optional doorbell support.
> 
> Add support for discovery of these fastchannels.
> 
> Cc: Ionela Voinescu <Ionela.Voinescu@arm.com>
> Cc: Chris Redpath <Chris.Redpath@arm.com>
> Cc: Quentin Perret <Quentin.Perret@arm.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/firmware/arm_scmi/perf.c | 153
> ++++++++++++++++++++++++++++++-
>  1 file changed, 149 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/perf.c
> b/drivers/firmware/arm_scmi/perf.c
> index 3c8ae7cc35de..6cce3e82e81e 100644
> --- a/drivers/firmware/arm_scmi/perf.c
> +++ b/drivers/firmware/arm_scmi/perf.c
> @@ -5,7 +5,9 @@
>   * Copyright (C) 2018 ARM Ltd.
>   */
> 
> +#include <linux/bits.h>
>  #include <linux/of.h>
> +#include <linux/io.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_opp.h>
>  #include <linux/sort.h>
> @@ -21,6 +23,7 @@ enum scmi_performance_protocol_cmd {
>  	PERF_LEVEL_GET = 0x8,
>  	PERF_NOTIFY_LIMITS = 0x9,
>  	PERF_NOTIFY_LEVEL = 0xa,
> +	PERF_DESCRIBE_FASTCHANNEL = 0xb,
>  };
> 
>  struct scmi_opp {
> @@ -44,6 +47,7 @@ struct scmi_msg_resp_perf_domain_attributes {
>  #define SUPPORTS_SET_PERF_LVL(x)	((x) & BIT(30))
>  #define SUPPORTS_PERF_LIMIT_NOTIFY(x)	((x) & BIT(29))
>  #define SUPPORTS_PERF_LEVEL_NOTIFY(x)	((x) & BIT(28))
> +#define SUPPORTS_PERF_FASTCHANNELS(x)	((x) & BIT(27))
>  	__le32 rate_limit_us;
>  	__le32 sustained_freq_khz;
>  	__le32 sustained_perf_level;
> @@ -87,17 +91,56 @@ struct scmi_msg_resp_perf_describe_levels {
>  	} opp[0];
>  };
> 
> +struct scmi_perf_get_fc_info {
> +	__le32 domain;
> +	__le32 message_id;
> +};
> +
> +struct scmi_msg_resp_perf_desc_fc {
> +	__le32 attr;
> +#define SUPPORTS_DOORBELL(x)		((x) & BIT(0))
> +#define DOORBELL_REG_WIDTH(x)		FIELD_GET(GENMASK(2, 1), (x))
> +	__le32 rate_limit;
> +	__le32 chan_addr_low;
> +	__le32 chan_addr_high;
> +	__le32 chan_size;
> +	__le32 db_addr_low;
> +	__le32 db_addr_high;
> +	__le32 db_set_lmask;
> +	__le32 db_set_hmask;
> +	__le32 db_preserve_lmask;
> +	__le32 db_preserve_hmask;
> +};
> +
> +struct scmi_fc_db_info {
> +	int width;
> +	u64 set;
> +	u64 mask;
> +	void __iomem *addr;
> +};
> +
> +struct scmi_fc_info {
> +	void __iomem *level_set_addr;
> +	void __iomem *limit_set_addr;
> +	void __iomem *level_get_addr;
> +	void __iomem *limit_get_addr;
> +	struct scmi_fc_db_info *level_set_db;
> +	struct scmi_fc_db_info *limit_set_db;
> +};
> +
>  struct perf_dom_info {
>  	bool set_limits;
>  	bool set_perf;
>  	bool perf_limit_notify;
>  	bool perf_level_notify;
> +	bool perf_fastchannels;
>  	u32 opp_count;
>  	u32 sustained_freq_khz;
>  	u32 sustained_perf_level;
>  	u32 mult_factor;
>  	char name[SCMI_MAX_STR_SIZE];
>  	struct scmi_opp opp[MAX_OPPS];
> +	struct scmi_fc_info *fc_info;
>  };
> 
>  struct scmi_perf_info {
> @@ -162,6 +205,7 @@ scmi_perf_domain_attributes_get(const struct
> scmi_handle *handle, u32 domain,
>  		dom_info->set_perf = SUPPORTS_SET_PERF_LVL(flags);
>  		dom_info->perf_limit_notify =
> SUPPORTS_PERF_LIMIT_NOTIFY(flags);
>  		dom_info->perf_level_notify =
> SUPPORTS_PERF_LEVEL_NOTIFY(flags);
> +		dom_info->perf_fastchannels =
> SUPPORTS_PERF_FASTCHANNELS(flags);
>  		dom_info->sustained_freq_khz =
>  					le32_to_cpu(attr->sustained_freq_khz);
>  		dom_info->sustained_perf_level =
> @@ -250,7 +294,7 @@ scmi_perf_describe_levels_get(const struct
> scmi_handle *handle, u32 domain,  }
> 
>  static int scmi_perf_limits_set(const struct scmi_handle *handle, u32
> domain,
> -				u32 max_perf, u32 min_perf)
> +				   u32 max_perf, u32 min_perf)
>  {
>  	int ret;
>  	struct scmi_xfer *t;
> @@ -273,7 +317,7 @@ static int scmi_perf_limits_set(const struct
> scmi_handle *handle, u32 domain,  }
> 
>  static int scmi_perf_limits_get(const struct scmi_handle *handle, u32
> domain,
> -				u32 *max_perf, u32 *min_perf)
> +				   u32 *max_perf, u32 *min_perf)
>  {
>  	int ret;
>  	struct scmi_xfer *t;
> @@ -299,7 +343,7 @@ static int scmi_perf_limits_get(const struct
> scmi_handle *handle, u32 domain,  }
> 
>  static int scmi_perf_level_set(const struct scmi_handle *handle, u32
> domain,
> -			       u32 level, bool poll)
> +				  u32 level, bool poll)
>  {
>  	int ret;
>  	struct scmi_xfer *t;
> @@ -322,7 +366,7 @@ static int scmi_perf_level_set(const struct
> scmi_handle *handle, u32 domain,  }
> 
>  static int scmi_perf_level_get(const struct scmi_handle *handle, u32
> domain,
> -			       u32 *level, bool poll)
> +				  u32 *level, bool poll)
>  {
>  	int ret;
>  	struct scmi_xfer *t;
> @@ -343,6 +387,104 @@ static int scmi_perf_level_get(const struct
> scmi_handle *handle, u32 domain,
>  	return ret;
>  }
> 
> +static bool scmi_perf_fc_size_is_valid(u32 msg, u32 size) {
> +	if ((msg == PERF_LEVEL_GET || msg == PERF_LEVEL_SET) && size == 4)
> +		return true;
> +	if ((msg == PERF_LIMITS_GET || msg == PERF_LIMITS_SET) && size == 8)
> +		return true;
> +	return false;
> +}
> +
> +static void
> +scmi_perf_domain_desc_fc(const struct scmi_handle *handle, u32 domain,
> +			 u32 message_id, void __iomem **p_addr,
> +			 struct scmi_fc_db_info **p_db)
> +{
> +	int ret;
> +	u32 flags;
> +	u64 phys_addr;
> +	u8 size;
> +	void __iomem *addr;
> +	struct scmi_xfer *t;
> +	struct scmi_fc_db_info *db;
> +	struct scmi_perf_get_fc_info *info;
> +	struct scmi_msg_resp_perf_desc_fc *resp;
> +
> +	if (!p_addr)
> +		return;
> +
> +	ret = scmi_xfer_get_init(handle, PERF_DESCRIBE_FASTCHANNEL,
> +				 SCMI_PROTOCOL_PERF,
> +				 sizeof(*info), sizeof(*resp), &t);
> +	if (ret)
> +		return;
> +
> +	info = t->tx.buf;
> +	info->domain = cpu_to_le32(domain);
> +	info->message_id = cpu_to_le32(message_id);
> +
> +	ret = scmi_do_xfer(handle, t);
> +	if (ret)
> +		goto err_xfer;
> +
> +	resp = t->rx.buf;
> +	flags = le32_to_cpu(resp->attr);
> +	size = le32_to_cpu(resp->chan_size);
> +	if (!scmi_perf_fc_size_is_valid(message_id, size))
> +		goto err_xfer;
> +
> +	phys_addr = le32_to_cpu(resp->chan_addr_low);
> +	phys_addr |= (u64)le32_to_cpu(resp->chan_addr_high) << 32;
> +	addr = devm_ioremap(handle->dev, phys_addr, size);
> +	if (!addr)
> +		goto err_xfer;
> +	*p_addr = addr;
> +
> +	if (p_db && SUPPORTS_DOORBELL(flags)) {
> +		db = devm_kzalloc(handle->dev, sizeof(*db), GFP_KERNEL);
> +		if (!db)
> +			goto err_xfer;
> +
> +		size = 1 << DOORBELL_REG_WIDTH(flags);
> +		phys_addr = le32_to_cpu(resp->db_addr_low);
> +		phys_addr |= (u64)le32_to_cpu(resp->db_addr_high) << 32;
> +		addr = devm_ioremap(handle->dev, phys_addr, size);
> +		if (!addr)
> +			goto err_xfer;
> +
> +		db->addr = addr;
> +		db->width = size;
> +		db->set = le32_to_cpu(resp->db_set_lmask);
> +		db->set |= (u64)le32_to_cpu(resp->db_set_hmask) << 32;
> +		db->mask = le32_to_cpu(resp->db_preserve_lmask);
> +		db->mask |= (u64)le32_to_cpu(resp->db_preserve_hmask) << 32;
> +		*p_db = db;
> +	}
> +err_xfer:
> +	scmi_xfer_put(handle, t);
> +}
> +
> +static void scmi_perf_domain_init_fc(const struct scmi_handle *handle,
> +				     u32 domain, struct scmi_fc_info **p_fc) {
> +	struct scmi_fc_info *fc;
> +
> +	fc = devm_kzalloc(handle->dev, sizeof(*fc), GFP_KERNEL);
> +	if (!fc)
> +		return;
> +
> +	scmi_perf_domain_desc_fc(handle, domain, PERF_LEVEL_SET,
> +				 &fc->level_set_addr, &fc->level_set_db);
> +	scmi_perf_domain_desc_fc(handle, domain, PERF_LEVEL_GET,
> +				 &fc->level_get_addr, NULL);
> +	scmi_perf_domain_desc_fc(handle, domain, PERF_LIMITS_SET,
> +				 &fc->limit_set_addr, &fc->limit_set_db);
> +	scmi_perf_domain_desc_fc(handle, domain, PERF_LIMITS_GET,
> +				 &fc->limit_get_addr, NULL);
> +	*p_fc = fc;
> +}
> +
>  /* Device specific ops */
>  static int scmi_dev_domain_id(struct device *dev)  { @@ -494,6 +636,9
> @@ static int scmi_perf_protocol_init(struct scmi_handle *handle)
> 
>  		scmi_perf_domain_attributes_get(handle, domain, dom);
>  		scmi_perf_describe_levels_get(handle, domain, dom);
> +
> +		if (dom->perf_fastchannels)
> +			scmi_perf_domain_init_fc(handle, domain, &dom->fc_info);
>  	}
> 
>  	handle->perf_ops = &perf_ops;

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> --
> 2.17.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH v2 2/5] firmware: arm_scmi: Make use SCMI v2.0 fastchannel for performance protocol
  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
  0 siblings, 0 replies; 17+ messages in thread
From: Peng Fan @ 2019-08-07 10:01 UTC (permalink / raw)
  To: Sudeep Holla, linux-arm-kernel
  Cc: linux-kernel, Bo Zhang, Jim Quinlan, Volodymyr Babchuk,
	Gaku Inami, aidapala, pajay, Etienne Carriere,
	Souvik Chakravarty, wesleys, Felix Burton, Saeed Nowshadi,
	Ionela Voinescu, Chris Redpath, Quentin Perret, dl-linux-imx

> Subject: [PATCH v2 2/5] firmware: arm_scmi: Make use SCMI v2.0
> fastchannel for performance protocol
> 
> SCMI v2.0 adds support for "FastChannel" which do not use a message
> header as they are specialized for a single message.
> 
> Only PERFORMANCE_LIMITS_{SET,GET} and
> PERFORMANCE_LEVEL_{SET,GET} commands are supported over
> fastchannels. As they are optional, they need to be discovered by
> PERFORMANCE_DESCRIBE_FASTCHANNEL command.
> Further {LIMIT,LEVEL}_SET commands can have optional doorbell support.
> 
> Add support for making use of these fastchannels.
> 
> Cc: Ionela Voinescu <Ionela.Voinescu@arm.com>
> Cc: Chris Redpath <Chris.Redpath@arm.com>
> Cc: Quentin Perret <Quentin.Perret@arm.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/firmware/arm_scmi/perf.c | 104
> +++++++++++++++++++++++++++++--
>  1 file changed, 100 insertions(+), 4 deletions(-)
> 
> v1->v2:
> 	- Changed the macro SCMI_PERF_FC_RING_DB to use do {} while(0)
> 
> diff --git a/drivers/firmware/arm_scmi/perf.c
> b/drivers/firmware/arm_scmi/perf.c
> index 6cce3e82e81e..fb7f6cab2c11 100644
> --- a/drivers/firmware/arm_scmi/perf.c
> +++ b/drivers/firmware/arm_scmi/perf.c
> @@ -8,6 +8,7 @@
>  #include <linux/bits.h>
>  #include <linux/of.h>
>  #include <linux/io.h>
> +#include <linux/io-64-nonatomic-hi-lo.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_opp.h>
>  #include <linux/sort.h>
> @@ -293,7 +294,42 @@ scmi_perf_describe_levels_get(const struct
> scmi_handle *handle, u32 domain,
>  	return ret;
>  }
> 
> -static int scmi_perf_limits_set(const struct scmi_handle *handle, u32
> domain,
> +#define SCMI_PERF_FC_RING_DB(doorbell, w)		\
> +do {							\
> +	u##w val = 0;					\
> +	struct scmi_fc_db_info *db = doorbell;		\
> +							\
> +	if (db->mask)					\
> +		val = ioread##w(db->addr) & db->mask;	\
> +	iowrite##w((u##w)db->set | val, db->addr);	\
> +} while(0)
> +
> +static void scmi_perf_fc_ring_db(struct scmi_fc_db_info *db) {
> +	if (!db || !db->addr)
> +		return;
> +
> +	if (db->width == 1)
> +		SCMI_PERF_FC_RING_DB(db, 8);
> +	else if (db->width == 2)
> +		SCMI_PERF_FC_RING_DB(db, 16);
> +	else if (db->width == 4)
> +		SCMI_PERF_FC_RING_DB(db, 32);
> +	else /* db->width == 8 */
> +#ifdef CONFIG_64BIT
> +		SCMI_PERF_FC_RING_DB(db, 64);
> +#else
> +	{
> +		u64 val = 0;
> +
> +		if (db->mask)
> +			val = ioread64_hi_lo(db->addr) & db->mask;
> +		iowrite64_hi_lo(db->set, db->addr);
> +	}
> +#endif
> +}
> +
> +static int scmi_perf_mb_limits_set(const struct scmi_handle *handle,
> +u32 domain,
>  				   u32 max_perf, u32 min_perf)
>  {
>  	int ret;
> @@ -316,7 +352,23 @@ static int scmi_perf_limits_set(const struct
> scmi_handle *handle, u32 domain,
>  	return ret;
>  }
> 
> -static int scmi_perf_limits_get(const struct scmi_handle *handle, u32
> domain,
> +static int scmi_perf_limits_set(const struct scmi_handle *handle, u32
> domain,
> +				u32 max_perf, u32 min_perf)
> +{
> +	struct scmi_perf_info *pi = handle->perf_priv;
> +	struct perf_dom_info *dom = pi->dom_info + domain;
> +
> +	if (dom->fc_info && dom->fc_info->limit_set_addr) {
> +		iowrite32(max_perf, dom->fc_info->limit_set_addr);
> +		iowrite32(min_perf, dom->fc_info->limit_set_addr + 4);
> +		scmi_perf_fc_ring_db(dom->fc_info->limit_set_db);
> +		return 0;
> +	}
> +
> +	return scmi_perf_mb_limits_set(handle, domain, max_perf, min_perf); }
> +
> +static int scmi_perf_mb_limits_get(const struct scmi_handle *handle,
> +u32 domain,
>  				   u32 *max_perf, u32 *min_perf)
>  {
>  	int ret;
> @@ -342,7 +394,22 @@ static int scmi_perf_limits_get(const struct
> scmi_handle *handle, u32 domain,
>  	return ret;
>  }
> 
> -static int scmi_perf_level_set(const struct scmi_handle *handle, u32 domain,
> +static int scmi_perf_limits_get(const struct scmi_handle *handle, u32
> domain,
> +				u32 *max_perf, u32 *min_perf)
> +{
> +	struct scmi_perf_info *pi = handle->perf_priv;
> +	struct perf_dom_info *dom = pi->dom_info + domain;
> +
> +	if (dom->fc_info && dom->fc_info->limit_get_addr) {
> +		*max_perf = ioread32(dom->fc_info->limit_get_addr);
> +		*min_perf = ioread32(dom->fc_info->limit_get_addr + 4);
> +		return 0;
> +	}
> +
> +	return scmi_perf_mb_limits_get(handle, domain, max_perf, min_perf); }
> +
> +static int scmi_perf_mb_level_set(const struct scmi_handle *handle, u32
> +domain,
>  				  u32 level, bool poll)
>  {
>  	int ret;
> @@ -365,7 +432,22 @@ static int scmi_perf_level_set(const struct
> scmi_handle *handle, u32 domain,
>  	return ret;
>  }
> 
> -static int scmi_perf_level_get(const struct scmi_handle *handle, u32 domain,
> +static int scmi_perf_level_set(const struct scmi_handle *handle, u32
> domain,
> +			       u32 level, bool poll)
> +{
> +	struct scmi_perf_info *pi = handle->perf_priv;
> +	struct perf_dom_info *dom = pi->dom_info + domain;
> +
> +	if (dom->fc_info && dom->fc_info->level_set_addr) {
> +		iowrite32(level, dom->fc_info->level_set_addr);
> +		scmi_perf_fc_ring_db(dom->fc_info->level_set_db);
> +		return 0;
> +	}
> +
> +	return scmi_perf_mb_level_set(handle, domain, level, poll); }
> +
> +static int scmi_perf_mb_level_get(const struct scmi_handle *handle, u32
> +domain,
>  				  u32 *level, bool poll)
>  {
>  	int ret;
> @@ -387,6 +469,20 @@ static int scmi_perf_level_get(const struct
> scmi_handle *handle, u32 domain,
>  	return ret;
>  }
> 
> +static int scmi_perf_level_get(const struct scmi_handle *handle, u32
> domain,
> +			       u32 *level, bool poll)
> +{
> +	struct scmi_perf_info *pi = handle->perf_priv;
> +	struct perf_dom_info *dom = pi->dom_info + domain;
> +
> +	if (dom->fc_info && dom->fc_info->level_get_addr) {
> +		*level = ioread32(dom->fc_info->level_get_addr);
> +		return 0;
> +	}
> +
> +	return scmi_perf_mb_level_get(handle, domain, level, poll); }
> +
>  static bool scmi_perf_fc_size_is_valid(u32 msg, u32 size)  {
>  	if ((msg == PERF_LEVEL_GET || msg == PERF_LEVEL_SET) && size == 4)

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> --
> 2.17.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH v2 4/5] firmware: arm_scmi: Add RESET protocol in SCMI v2.0
  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:07   ` Peng Fan
  1 sibling, 0 replies; 17+ messages in thread
From: Peng Fan @ 2019-08-07 10:07 UTC (permalink / raw)
  To: Sudeep Holla, linux-arm-kernel
  Cc: linux-kernel, Bo Zhang, Jim Quinlan, Volodymyr Babchuk,
	Gaku Inami, aidapala, pajay, Etienne Carriere,
	Souvik Chakravarty, wesleys, Felix Burton, Saeed Nowshadi,
	Philipp Zabel

> Subject: [PATCH v2 4/5] firmware: arm_scmi: Add RESET protocol in SCMI
> v2.0
> 
> SCMIv2.0 adds a new Reset Management Protocol to manage various reset
> states a given device or domain can enter. Device(s) that can be collectively
> reset through a common reset signal constitute a reset domain for the
> firmware.
> 
> A reset domain can be reset autonomously or explicitly through assertion and
> de-assertion of the signal. When autonomous reset is chosen, the firmware is
> responsible for taking the necessary steps to reset the domain and to
> subsequently bring it out of reset. When explicit reset is chosen, the caller has
> to specifically assert and then de-assert the reset signal by issuing two
> separate RESET commands.
> 
> Add the basic SCMI reset infrastructure that can be used by Linux reset
> controller driver.
> 
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/firmware/arm_scmi/Makefile |   2 +-
>  drivers/firmware/arm_scmi/reset.c  | 231
> +++++++++++++++++++++++++++++
>  include/linux/scmi_protocol.h      |  26 ++++
>  3 files changed, 258 insertions(+), 1 deletion(-)  create mode 100644
> drivers/firmware/arm_scmi/reset.c
> 
> diff --git a/drivers/firmware/arm_scmi/Makefile
> b/drivers/firmware/arm_scmi/Makefile
> index c47d28d556b6..5f298f00a82e 100644
> --- a/drivers/firmware/arm_scmi/Makefile
> +++ b/drivers/firmware/arm_scmi/Makefile
> @@ -2,5 +2,5 @@
>  obj-y	= scmi-bus.o scmi-driver.o scmi-protocols.o
>  scmi-bus-y = bus.o
>  scmi-driver-y = driver.o
> -scmi-protocols-y = base.o clock.o perf.o power.o sensors.o
> +scmi-protocols-y = base.o clock.o perf.o power.o reset.o sensors.o
>  obj-$(CONFIG_ARM_SCMI_POWER_DOMAIN) += scmi_pm_domain.o diff
> --git a/drivers/firmware/arm_scmi/reset.c
> b/drivers/firmware/arm_scmi/reset.c
> new file mode 100644
> index 000000000000..11cb8b5ccf34
> --- /dev/null
> +++ b/drivers/firmware/arm_scmi/reset.c
> @@ -0,0 +1,231 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * System Control and Management Interface (SCMI) Reset Protocol
> + *
> + * Copyright (C) 2019 ARM Ltd.
> + */
> +
> +#include "common.h"
> +
> +enum scmi_reset_protocol_cmd {
> +	RESET_DOMAIN_ATTRIBUTES = 0x3,
> +	RESET = 0x4,
> +	RESET_NOTIFY = 0x5,
> +};
> +
> +enum scmi_reset_protocol_notify {
> +	RESET_ISSUED = 0x0,
> +};
> +
> +#define NUM_RESET_DOMAIN_MASK	0xffff
> +#define RESET_NOTIFY_ENABLE	BIT(0)
> +
> +struct scmi_msg_resp_reset_domain_attributes {
> +	__le32 attributes;
> +#define SUPPORTS_ASYNC_RESET(x)		((x) & BIT(31))
> +#define SUPPORTS_NOTIFY_RESET(x)	((x) & BIT(30))
> +	__le32 latency;
> +	    u8 name[SCMI_MAX_STR_SIZE];
> +};
> +
> +struct scmi_msg_reset_domain_reset {
> +	__le32 domain_id;
> +	__le32 flags;
> +#define AUTONOMOUS_RESET	BIT(0)
> +#define EXPLICIT_RESET_ASSERT	BIT(1)
> +#define ASYNCHRONOUS_RESET	BIT(2)
> +	__le32 reset_state;
> +#define ARCH_RESET_TYPE		BIT(31)
> +#define COLD_RESET_STATE	BIT(0)
> +#define ARCH_COLD_RESET		(ARCH_RESET_TYPE |
> COLD_RESET_STATE)
> +};
> +
> +struct reset_dom_info {
> +	bool async_reset;
> +	bool reset_notify;
> +	u32 latency_us;
> +	char name[SCMI_MAX_STR_SIZE];
> +};
> +
> +struct scmi_reset_info {
> +	int num_domains;
> +	struct reset_dom_info *dom_info;
> +};
> +
> +static int scmi_reset_attributes_get(const struct scmi_handle *handle,
> +				     struct scmi_reset_info *pi)
> +{
> +	int ret;
> +	struct scmi_xfer *t;
> +	u32 *attr;
> +
> +	ret = scmi_xfer_get_init(handle, PROTOCOL_ATTRIBUTES,
> +				 SCMI_PROTOCOL_RESET, 0, sizeof(*attr), &t);
> +	if (ret)
> +		return ret;
> +
> +	attr = t->rx.buf;
> +
> +	ret = scmi_do_xfer(handle, t);
> +	if (!ret)
> +		pi->num_domains = le32_to_cpu(*attr) &
> NUM_RESET_DOMAIN_MASK;
> +
> +	scmi_xfer_put(handle, t);
> +	return ret;
> +}
> +
> +static int
> +scmi_reset_domain_attributes_get(const struct scmi_handle *handle, u32
> domain,
> +				 struct reset_dom_info *dom_info)
> +{
> +	int ret;
> +	struct scmi_xfer *t;
> +	struct scmi_msg_resp_reset_domain_attributes *attr;
> +
> +	ret = scmi_xfer_get_init(handle, RESET_DOMAIN_ATTRIBUTES,
> +				 SCMI_PROTOCOL_RESET, sizeof(domain),
> +				 sizeof(*attr), &t);
> +	if (ret)
> +		return ret;
> +
> +	*(__le32 *)t->tx.buf = cpu_to_le32(domain);
> +	attr = t->rx.buf;
> +
> +	ret = scmi_do_xfer(handle, t);
> +	if (!ret) {
> +		u32 attributes = le32_to_cpu(attr->attributes);
> +
> +		dom_info->async_reset = SUPPORTS_ASYNC_RESET(attributes);
> +		dom_info->reset_notify = SUPPORTS_NOTIFY_RESET(attributes);
> +		dom_info->latency_us = le32_to_cpu(attr->latency);
> +		if (dom_info->latency_us == U32_MAX)
> +			dom_info->latency_us = 0;
> +		strlcpy(dom_info->name, attr->name, SCMI_MAX_STR_SIZE);
> +	}
> +
> +	scmi_xfer_put(handle, t);
> +	return ret;
> +}
> +
> +static int scmi_reset_num_domains_get(const struct scmi_handle *handle)
> +{
> +	struct scmi_reset_info *pi = handle->reset_priv;
> +
> +	return pi->num_domains;
> +}
> +
> +static char *scmi_reset_name_get(const struct scmi_handle *handle, u32
> +domain) {
> +	struct scmi_reset_info *pi = handle->reset_priv;
> +	struct reset_dom_info *dom = pi->dom_info + domain;
> +
> +	return dom->name;
> +}
> +
> +static int scmi_reset_latency_get(const struct scmi_handle *handle, u32
> +domain) {
> +	struct scmi_reset_info *pi = handle->reset_priv;
> +	struct reset_dom_info *dom = pi->dom_info + domain;
> +
> +	return dom->latency_us;
> +}
> +
> +static int scmi_domain_reset(const struct scmi_handle *handle, u32 domain,
> +			     u32 flags, u32 state)
> +{
> +	int ret;
> +	struct scmi_xfer *t;
> +	struct scmi_msg_reset_domain_reset *dom;
> +	struct scmi_reset_info *pi = handle->reset_priv;
> +	struct reset_dom_info *rdom = pi->dom_info + domain;
> +
> +	if (rdom->async_reset)
> +		flags |= ASYNCHRONOUS_RESET;
> +
> +	ret = scmi_xfer_get_init(handle, RESET, SCMI_PROTOCOL_RESET,
> +				 sizeof(*dom), 0, &t);
> +	if (ret)
> +		return ret;
> +
> +	dom = t->tx.buf;
> +	dom->domain_id = cpu_to_le32(domain);
> +	dom->flags = cpu_to_le32(flags);
> +	dom->domain_id = cpu_to_le32(state);
> +
> +	if (rdom->async_reset)
> +		ret = scmi_do_xfer_with_response(handle, t);
> +	else
> +		ret = scmi_do_xfer(handle, t);
> +
> +	scmi_xfer_put(handle, t);
> +	return ret;
> +}
> +
> +static int scmi_reset_domain_reset(const struct scmi_handle *handle,
> +u32 domain) {
> +	return scmi_domain_reset(handle, domain, AUTONOMOUS_RESET,
> +				 ARCH_COLD_RESET);
> +}
> +
> +static int
> +scmi_reset_domain_assert(const struct scmi_handle *handle, u32 domain)
> +{
> +	return scmi_domain_reset(handle, domain, EXPLICIT_RESET_ASSERT,
> +				 ARCH_COLD_RESET);
> +}
> +
> +static int
> +scmi_reset_domain_deassert(const struct scmi_handle *handle, u32
> +domain) {
> +	return scmi_domain_reset(handle, domain, 0, ARCH_COLD_RESET); }
> +
> +static struct scmi_reset_ops reset_ops = {
> +	.num_domains_get = scmi_reset_num_domains_get,
> +	.name_get = scmi_reset_name_get,
> +	.latency_get = scmi_reset_latency_get,
> +	.reset = scmi_reset_domain_reset,
> +	.assert = scmi_reset_domain_assert,
> +	.deassert = scmi_reset_domain_deassert, };
> +
> +static int scmi_reset_protocol_init(struct scmi_handle *handle) {
> +	int domain;
> +	u32 version;
> +	struct scmi_reset_info *pinfo;
> +
> +	scmi_version_get(handle, SCMI_PROTOCOL_RESET, &version);
> +
> +	dev_dbg(handle->dev, "Reset Version %d.%d\n",
> +		PROTOCOL_REV_MAJOR(version),
> PROTOCOL_REV_MINOR(version));
> +
> +	pinfo = devm_kzalloc(handle->dev, sizeof(*pinfo), GFP_KERNEL);
> +	if (!pinfo)
> +		return -ENOMEM;
> +
> +	scmi_reset_attributes_get(handle, pinfo);
> +
> +	pinfo->dom_info = devm_kcalloc(handle->dev, pinfo->num_domains,
> +				       sizeof(*pinfo->dom_info), GFP_KERNEL);
> +	if (!pinfo->dom_info)
> +		return -ENOMEM;
> +
> +	for (domain = 0; domain < pinfo->num_domains; domain++) {
> +		struct reset_dom_info *dom = pinfo->dom_info + domain;
> +
> +		scmi_reset_domain_attributes_get(handle, domain, dom);
> +	}
> +
> +	handle->reset_ops = &reset_ops;
> +	handle->reset_priv = pinfo;
> +
> +	return 0;
> +}
> +
> +static int __init scmi_reset_init(void) {
> +	return scmi_protocol_register(SCMI_PROTOCOL_RESET,
> +				      &scmi_reset_protocol_init);
> +}
> +subsys_initcall(scmi_reset_init);
> diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
> index f0f2b53a1dac..881fea47c83d 100644
> --- a/include/linux/scmi_protocol.h
> +++ b/include/linux/scmi_protocol.h
> @@ -187,6 +187,26 @@ struct scmi_sensor_ops {
>  			   u64 *value);
>  };
> 
> +/**
> + * struct scmi_reset_ops - represents the various operations provided
> + *	by SCMI Reset Protocol
> + *
> + * @num_domains_get: get the count of reset domains provided by SCMI
> + * @name_get: gets the name of a reset domain
> + * @latency_get: gets the reset latency for the specified reset domain
> + * @reset: resets the specified reset domain
> + * @assert: explicitly assert reset signal of the specified reset
> +domain
> + * @deassert: explicitly deassert reset signal of the specified reset
> +domain  */ struct scmi_reset_ops {
> +	int (*num_domains_get)(const struct scmi_handle *handle);
> +	char *(*name_get)(const struct scmi_handle *handle, u32 domain);
> +	int (*latency_get)(const struct scmi_handle *handle, u32 domain);
> +	int (*reset)(const struct scmi_handle *handle, u32 domain);
> +	int (*assert)(const struct scmi_handle *handle, u32 domain);
> +	int (*deassert)(const struct scmi_handle *handle, u32 domain); };
> +
>  /**
>   * struct scmi_handle - Handle returned to ARM SCMI clients for usage.
>   *
> @@ -196,6 +216,7 @@ struct scmi_sensor_ops {
>   * @perf_ops: pointer to set of performance protocol operations
>   * @clk_ops: pointer to set of clock protocol operations
>   * @sensor_ops: pointer to set of sensor protocol operations
> + * @reset_ops: pointer to set of reset protocol operations
>   * @perf_priv: pointer to private data structure specific to performance
>   *	protocol(for internal use only)
>   * @clk_priv: pointer to private data structure specific to clock @@ -204,6
> +225,8 @@ struct scmi_sensor_ops {
>   *	protocol(for internal use only)
>   * @sensor_priv: pointer to private data structure specific to sensors
>   *	protocol(for internal use only)
> + * @reset_priv: pointer to private data structure specific to reset
> + *	protocol(for internal use only)
>   */
>  struct scmi_handle {
>  	struct device *dev;
> @@ -212,11 +235,13 @@ struct scmi_handle {
>  	struct scmi_clk_ops *clk_ops;
>  	struct scmi_power_ops *power_ops;
>  	struct scmi_sensor_ops *sensor_ops;
> +	struct scmi_reset_ops *reset_ops;
>  	/* for protocol internal use */
>  	void *perf_priv;
>  	void *clk_priv;
>  	void *power_priv;
>  	void *sensor_priv;
> +	void *reset_priv;
>  };
> 
>  enum scmi_std_protocol {
> @@ -226,6 +251,7 @@ enum scmi_std_protocol {
>  	SCMI_PROTOCOL_PERF = 0x13,
>  	SCMI_PROTOCOL_CLOCK = 0x14,
>  	SCMI_PROTOCOL_SENSOR = 0x15,
> +	SCMI_PROTOCOL_RESET = 0x16,
>  };

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> 
>  struct scmi_device {
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 3/5] dt-bindings: arm: Extend SCMI to support new reset protocol
  2019-08-07  8:26   ` Philipp Zabel
@ 2019-08-07 10:18     ` Sudeep Holla
  0 siblings, 0 replies; 17+ messages in thread
From: Sudeep Holla @ 2019-08-07 10:18 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: linux-arm-kernel, Peng Fan, linux-kernel, Bo Zhang, Jim Quinlan,
	Volodymyr Babchuk, Gaku Inami, aidapala, pajay, Etienne Carriere,
	Souvik Chakravarty, wesleys, Felix Burton, Saeed Nowshadi,
	Rob Herring, Mark Rutland, devicetree

On Wed, Aug 07, 2019 at 10:26:50AM +0200, Philipp Zabel wrote:
> On Tue, 2019-08-06 at 18:02 +0100, Sudeep Holla wrote:
> > SCMIv2.0 adds a new Reset Management Protocol to manage various reset
> > states a given device or domain can enter. Extend the existing SCMI
> > bindings to add reset protocol support by re-using the reset bindings
> > for bothe reset providers and consumers.
>           ^
> typo
>

Thanks, fixed now.

--
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 1/5] firmware: arm_scmi: Add discovery of SCMI v2.0 performance fastchannels
  2019-08-07  9:23   ` Peng Fan
@ 2019-08-07 10:28     ` Sudeep Holla
  0 siblings, 0 replies; 17+ messages in thread
From: Sudeep Holla @ 2019-08-07 10:28 UTC (permalink / raw)
  To: Peng Fan
  Cc: linux-arm-kernel, linux-kernel, Bo Zhang, Jim Quinlan,
	Volodymyr Babchuk, Gaku Inami, aidapala, pajay, Etienne Carriere,
	Souvik Chakravarty, wesleys, Felix Burton, Saeed Nowshadi,
	Ionela Voinescu, Chris Redpath, Quentin Perret

On Wed, Aug 07, 2019 at 09:23:41AM +0000, Peng Fan wrote:
> > Subject: [PATCH v2 1/5] firmware: arm_scmi: Add discovery of SCMI v2.0
> > performance fastchannels
> >
> > SCMI v2.0 adds support for "FastChannel", a lightweight unidirectional
> > channel that is dedicated to a single SCMI message type for controlling a
> > specific platform resource. They do not use a message header as they are
> > specialized for a single message.
> >
> > Only PERFORMANCE_LIMITS_{SET,GET} and
> > PERFORMANCE_LEVEL_{SET,GET} commands are supported over
> > fastchannels. As they are optional, they need to be discovered by
> > PERFORMANCE_DESCRIBE_FASTCHANNEL command.
> > Further {LIMIT,LEVEL}_SET commands can have optional doorbell support.
> >
> > Add support for discovery of these fastchannels.
> >
> > Cc: Ionela Voinescu <Ionela.Voinescu@arm.com>
> > Cc: Chris Redpath <Chris.Redpath@arm.com>
> > Cc: Quentin Perret <Quentin.Perret@arm.com>
> > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> > ---
> >  drivers/firmware/arm_scmi/perf.c | 153
> > ++++++++++++++++++++++++++++++-
> >  1 file changed, 149 insertions(+), 4 deletions(-)
> >

[...]

>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
>

Thanks for the review.

--
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 5/5] reset: Add support for resets provided by SCMI
  2019-08-07  8:04   ` Philipp Zabel
@ 2019-08-07 10:31     ` Sudeep Holla
  0 siblings, 0 replies; 17+ messages in thread
From: Sudeep Holla @ 2019-08-07 10:31 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: linux-arm-kernel, Peng Fan, linux-kernel, Bo Zhang, Jim Quinlan,
	Volodymyr Babchuk, Gaku Inami, aidapala, pajay, Etienne Carriere,
	Souvik Chakravarty, wesleys, Felix Burton, Saeed Nowshadi

On Wed, Aug 07, 2019 at 10:04:26AM +0200, Philipp Zabel wrote:
> 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.
>

All the above 3 are now fixed.

> > + */
> > +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>
>

Thanks

--
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 4/5] firmware: arm_scmi: Add RESET protocol in SCMI v2.0
  2019-08-07  8:17   ` Philipp Zabel
@ 2019-08-07 10:35     ` Sudeep Holla
  0 siblings, 0 replies; 17+ messages in thread
From: Sudeep Holla @ 2019-08-07 10:35 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: linux-arm-kernel, Peng Fan, linux-kernel, Bo Zhang, Jim Quinlan,
	Volodymyr Babchuk, Gaku Inami, aidapala, pajay, Etienne Carriere,
	Souvik Chakravarty, wesleys, Felix Burton, Saeed Nowshadi

On Wed, Aug 07, 2019 at 10:17:50AM +0200, Philipp Zabel wrote:
> On Tue, 2019-08-06 at 18:02 +0100, Sudeep Holla wrote:
> > SCMIv2.0 adds a new Reset Management Protocol to manage various reset
> > states a given device or domain can enter. Device(s) that can be
> > collectively reset through a common reset signal constitute a reset
> > domain for the firmware.
> > 
> > A reset domain can be reset autonomously or explicitly through assertion
> > and de-assertion of the signal. When autonomous reset is chosen, the
> > firmware is responsible for taking the necessary steps to reset the
> > domain and to subsequently bring it out of reset. When explicit reset is
> > chosen, the caller has to specifically assert and then de-assert the
> > reset signal by issuing two separate RESET commands.
> > 
> > Add the basic SCMI reset infrastructure that can be used by Linux
> > reset controller driver.
> > 
> > Cc: Philipp Zabel <p.zabel@pengutronix.de>
> > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> > ---
> >  drivers/firmware/arm_scmi/Makefile |   2 +-
> >  drivers/firmware/arm_scmi/reset.c  | 231 +++++++++++++++++++++++++++++
> >  include/linux/scmi_protocol.h      |  26 ++++
> >  3 files changed, 258 insertions(+), 1 deletion(-)
> >  create mode 100644 drivers/firmware/arm_scmi/reset.c
> > 
> > diff --git a/drivers/firmware/arm_scmi/Makefile b/drivers/firmware/arm_scmi/Makefile
> > index c47d28d556b6..5f298f00a82e 100644
> > --- a/drivers/firmware/arm_scmi/Makefile
> > +++ b/drivers/firmware/arm_scmi/Makefile
> > @@ -2,5 +2,5 @@
> >  obj-y	= scmi-bus.o scmi-driver.o scmi-protocols.o
> >  scmi-bus-y = bus.o
> >  scmi-driver-y = driver.o
> > -scmi-protocols-y = base.o clock.o perf.o power.o sensors.o
> > +scmi-protocols-y = base.o clock.o perf.o power.o reset.o sensors.o
> >  obj-$(CONFIG_ARM_SCMI_POWER_DOMAIN) += scmi_pm_domain.o
> > diff --git a/drivers/firmware/arm_scmi/reset.c b/drivers/firmware/arm_scmi/reset.c
> > new file mode 100644
> > index 000000000000..11cb8b5ccf34
> > --- /dev/null
> > +++ b/drivers/firmware/arm_scmi/reset.c
> > @@ -0,0 +1,231 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * System Control and Management Interface (SCMI) Reset Protocol
> > + *
> > + * Copyright (C) 2019 ARM Ltd.
> > + */
> > +
> > +#include "common.h"
> > +
> > +enum scmi_reset_protocol_cmd {
> > +	RESET_DOMAIN_ATTRIBUTES = 0x3,
> > +	RESET = 0x4,
> > +	RESET_NOTIFY = 0x5,
> > +};
> > +
> > +enum scmi_reset_protocol_notify {
> > +	RESET_ISSUED = 0x0,
> > +};
> > +
> > +#define NUM_RESET_DOMAIN_MASK	0xffff
> > +#define RESET_NOTIFY_ENABLE	BIT(0)
> > +
> > +struct scmi_msg_resp_reset_domain_attributes {
> > +	__le32 attributes;
> > +#define SUPPORTS_ASYNC_RESET(x)		((x) & BIT(31))
> > +#define SUPPORTS_NOTIFY_RESET(x)	((x) & BIT(30))
> > +	__le32 latency;
> > +	    u8 name[SCMI_MAX_STR_SIZE];
> > +};
> > +
> > +struct scmi_msg_reset_domain_reset {
> > +	__le32 domain_id;
> > +	__le32 flags;
> > +#define AUTONOMOUS_RESET	BIT(0)
> > +#define EXPLICIT_RESET_ASSERT	BIT(1)
> > +#define ASYNCHRONOUS_RESET	BIT(2)
> > +	__le32 reset_state;
> > +#define ARCH_RESET_TYPE		BIT(31)
> > +#define COLD_RESET_STATE	BIT(0)
> > +#define ARCH_COLD_RESET		(ARCH_RESET_TYPE | COLD_RESET_STATE)
> > +};
> > +
> > +struct reset_dom_info {
> > +	bool async_reset;
> > +	bool reset_notify;
> > +	u32 latency_us;
> > +	char name[SCMI_MAX_STR_SIZE];
> > +};
> > +
> > +struct scmi_reset_info {
> > +	int num_domains;
> > +	struct reset_dom_info *dom_info;
> > +};
> > +
> > +static int scmi_reset_attributes_get(const struct scmi_handle *handle,
> > +				     struct scmi_reset_info *pi)
> > +{
> > +	int ret;
> > +	struct scmi_xfer *t;
> > +	u32 *attr;
> > +
> > +	ret = scmi_xfer_get_init(handle, PROTOCOL_ATTRIBUTES,
> > +				 SCMI_PROTOCOL_RESET, 0, sizeof(*attr), &t);
> > +	if (ret)
> > +		return ret;
> > +
> > +	attr = t->rx.buf;
> > +
> > +	ret = scmi_do_xfer(handle, t);
> > +	if (!ret)
> > +		pi->num_domains = le32_to_cpu(*attr) & NUM_RESET_DOMAIN_MASK;
> > +
> > +	scmi_xfer_put(handle, t);
> > +	return ret;
> > +}
> > +
> > +static int
> > +scmi_reset_domain_attributes_get(const struct scmi_handle *handle, u32 domain,
> > +				 struct reset_dom_info *dom_info)
> > +{
> > +	int ret;
> > +	struct scmi_xfer *t;
> > +	struct scmi_msg_resp_reset_domain_attributes *attr;
> > +
> > +	ret = scmi_xfer_get_init(handle, RESET_DOMAIN_ATTRIBUTES,
> > +				 SCMI_PROTOCOL_RESET, sizeof(domain),
> > +				 sizeof(*attr), &t);
> > +	if (ret)
> > +		return ret;
> > +
> > +	*(__le32 *)t->tx.buf = cpu_to_le32(domain);
> 
> Should this use
> 	put_unaligned_le32(domain, t->tx.buf);
> ? Either way,
> 

Ah, new function to me. I will take a look, may need more place to fix.

> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
>

Thanks,
Sudeep

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 3/5] dt-bindings: arm: Extend SCMI to support new reset protocol
  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 17:41   ` Sudeep Holla
  1 sibling, 0 replies; 17+ messages in thread
From: Sudeep Holla @ 2019-08-07 17:41 UTC (permalink / raw)
  To: linux-arm-kernel, Rob Herring
  Cc: Peng Fan, linux-kernel, Bo Zhang, Jim Quinlan, Volodymyr Babchuk,
	Gaku Inami, aidapala, pajay, Etienne Carriere,
	Souvik Chakravarty, wesleys, Felix Burton, Saeed Nowshadi,
	Philipp Zabel, Rob Herring, Mark Rutland, devicetree

Hi Rob,

On Tue, Aug 06, 2019 at 06:02:06PM +0100, Sudeep Holla wrote:
> SCMIv2.0 adds a new Reset Management Protocol to manage various reset
> states a given device or domain can enter. Extend the existing SCMI
> bindings to add reset protocol support by re-using the reset bindings
> for bothe reset providers and consumers.
>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Rob Herring <robh+dt@kernel.org>

Sorry for the nag, can you review the binding so that I can plan
to get this merged for v5.4

--
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-08-07 17:41 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2019-08-07 10:31     ` Sudeep Holla

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).