Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V3 0/2] firmware: ti_sci: Add host-id as an optional parameter
@ 2018-08-28  0:59 Nishanth Menon
  2018-08-28  0:59 ` [PATCH V3 1/2] Documentation: dt: keystone: ti-sci: Add optional host-id parameter Nishanth Menon
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Nishanth Menon @ 2018-08-28  0:59 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Santosh,

This is the rebase to v4.19-rc1 and repost of the patch series [1]
Please find attached series to enable host-id as an optional dt property.

[1] https://patchwork.ozlabs.org/cover/931822/

No Functional changes. Will be great if we can get this in rc cycle,
but, will defer to you.

Nishanth Menon (2):
  Documentation: dt: keystone: ti-sci: Add optional host-id parameter
  firmware: ti_sci: Provide host-id as an optional dt parameter

 .../devicetree/bindings/arm/keystone/ti,sci.txt    |  4 ++++
 drivers/firmware/ti_sci.c                          | 24 ++++++++++++++++++----
 2 files changed, 24 insertions(+), 4 deletions(-)

-- 
2.15.1

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

* [PATCH V3 1/2] Documentation: dt: keystone: ti-sci: Add optional host-id parameter
  2018-08-28  0:59 [PATCH V3 0/2] firmware: ti_sci: Add host-id as an optional parameter Nishanth Menon
@ 2018-08-28  0:59 ` Nishanth Menon
  2018-08-28  0:59 ` [PATCH V3 2/2] firmware: ti_sci: Provide host-id as an optional dt parameter Nishanth Menon
  2018-08-28  1:05 ` [PATCH V3 0/2] firmware: ti_sci: Add host-id as an optional parameter Santosh Shilimkar
  2 siblings, 0 replies; 5+ messages in thread
From: Nishanth Menon @ 2018-08-28  0:59 UTC (permalink / raw)
  To: linux-arm-kernel

Texas Instrument's System Control Interface (TISCI) permits
the ability for OSs running in virtual machines to be able to
independently communicate with the firmware without the need going
through an hypervisor.

The "host-id" in effect is the hardware representation of the
host (example: VMs locked to a core) as identified to the System
Controller. Hypervisors can either fill in appropriate host-ids in dt
used for each VM instance OR may use prebuilt blobs where the host-ids
are pre-populated, as appropriate for the OS running in the VMs.

This is introduced as an optional parameter to maintain consistency
with legacy device tree blobs.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Nishanth Menon <nm@ti.com>
---

Changes Since V2:
 * Rebase to v4.19-rc1

V2: https://patchwork.kernel.org/patch/10527307/
V1: https://patchwork.kernel.org/patch/10475311/
RFC: https://patchwork.kernel.org/patch/10447753/

 Documentation/devicetree/bindings/arm/keystone/ti,sci.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/keystone/ti,sci.txt b/Documentation/devicetree/bindings/arm/keystone/ti,sci.txt
index 31f5f9a104cc..b56a02c10ae6 100644
--- a/Documentation/devicetree/bindings/arm/keystone/ti,sci.txt
+++ b/Documentation/devicetree/bindings/arm/keystone/ti,sci.txt
@@ -45,11 +45,15 @@ Optional Properties:
 	debug_messages - Map the Debug message region
 - reg:  register space corresponding to the debug_messages
 - ti,system-reboot-controller: If system reboot can be triggered by SoC reboot
+- ti,host-id: Integer value corresponding to the host ID assigned by Firmware
+	for identification of host processing entities such as virtual
+	machines
 
 Example (K2G):
 -------------
 	pmmc: pmmc {
 		compatible = "ti,k2g-sci";
+		ti,host-id = <2>;
 		mbox-names = "rx", "tx";
 		mboxes= <&msgmgr &msgmgr_proxy_pmmc_rx>,
 			<&msgmgr &msgmgr_proxy_pmmc_tx>;
-- 
2.15.1

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

* [PATCH V3 2/2] firmware: ti_sci: Provide host-id as an optional dt parameter
  2018-08-28  0:59 [PATCH V3 0/2] firmware: ti_sci: Add host-id as an optional parameter Nishanth Menon
  2018-08-28  0:59 ` [PATCH V3 1/2] Documentation: dt: keystone: ti-sci: Add optional host-id parameter Nishanth Menon
@ 2018-08-28  0:59 ` Nishanth Menon
  2018-08-28  1:05 ` [PATCH V3 0/2] firmware: ti_sci: Add host-id as an optional parameter Santosh Shilimkar
  2 siblings, 0 replies; 5+ messages in thread
From: Nishanth Menon @ 2018-08-28  0:59 UTC (permalink / raw)
  To: linux-arm-kernel

Texas Instrument's System Control Interface (TISCI) permits the
ability for Operating Systems to running in virtual machines to be
able to independently communicate with the firmware without the need
going through an hypervisor.

The "host-id" in effect is the hardware representation of the
host (example: VMs locked to a core) as identified to the System
Controller.

Provide support as an optional parameter implementation and use the
compatible data as default if one is not provided by device tree.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
Changes since V2:
 * None, just rebase to v4.19-rc1

V2: https://patchwork.kernel.org/patch/10527393/
V1: https://patchwork.kernel.org/patch/10475309/
RFC: https://patchwork.kernel.org/patch/10447715/

 drivers/firmware/ti_sci.c | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index 7fa744793bc5..69ed1464175c 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -66,14 +66,14 @@ struct ti_sci_xfers_info {
 
 /**
  * struct ti_sci_desc - Description of SoC integration
- * @host_id:		Host identifier representing the compute entity
+ * @default_host_id:	Host identifier representing the compute entity
  * @max_rx_timeout_ms:	Timeout for communication with SoC (in Milliseconds)
  * @max_msgs: Maximum number of messages that can be pending
  *		  simultaneously in the system
  * @max_msg_size: Maximum size of data per message that can be handled.
  */
 struct ti_sci_desc {
-	u8 host_id;
+	u8 default_host_id;
 	int max_rx_timeout_ms;
 	int max_msgs;
 	int max_msg_size;
@@ -94,6 +94,7 @@ struct ti_sci_desc {
  * @chan_rx:	Receive mailbox channel
  * @minfo:	Message info
  * @node:	list head
+ * @host_id:	Host ID
  * @users:	Number of users of this instance
  */
 struct ti_sci_info {
@@ -110,6 +111,7 @@ struct ti_sci_info {
 	struct mbox_chan *chan_rx;
 	struct ti_sci_xfers_info minfo;
 	struct list_head node;
+	u8 host_id;
 	/* protected by ti_sci_list_mutex */
 	int users;
 
@@ -370,7 +372,7 @@ static struct ti_sci_xfer *ti_sci_get_one_xfer(struct ti_sci_info *info,
 
 	hdr->seq = xfer_id;
 	hdr->type = msg_type;
-	hdr->host = info->desc->host_id;
+	hdr->host = info->host_id;
 	hdr->flags = msg_flags;
 
 	return xfer;
@@ -1793,7 +1795,7 @@ static int tisci_reboot_handler(struct notifier_block *nb, unsigned long mode,
 
 /* Description for K2G */
 static const struct ti_sci_desc ti_sci_pmmc_k2g_desc = {
-	.host_id = 2,
+	.default_host_id = 2,
 	/* Conservative duration */
 	.max_rx_timeout_ms = 1000,
 	/* Limited by MBOX_TX_QUEUE_LEN. K2G can handle upto 128 messages! */
@@ -1819,6 +1821,7 @@ static int ti_sci_probe(struct platform_device *pdev)
 	int ret = -EINVAL;
 	int i;
 	int reboot = 0;
+	u32 h_id;
 
 	of_id = of_match_device(ti_sci_of_match, dev);
 	if (!of_id) {
@@ -1833,6 +1836,19 @@ static int ti_sci_probe(struct platform_device *pdev)
 
 	info->dev = dev;
 	info->desc = desc;
+	ret = of_property_read_u32(dev->of_node, "ti,host-id", &h_id);
+	/* if the property is not present in DT, use a default from desc */
+	if (ret < 0) {
+		info->host_id = info->desc->default_host_id;
+	} else {
+		if (!h_id) {
+			dev_warn(dev, "Host ID 0 is reserved for firmware\n");
+			info->host_id = info->desc->default_host_id;
+		} else {
+			info->host_id = h_id;
+		}
+	}
+
 	reboot = of_property_read_bool(dev->of_node,
 				       "ti,system-reboot-controller");
 	INIT_LIST_HEAD(&info->node);
-- 
2.15.1

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

* [PATCH V3 0/2] firmware: ti_sci: Add host-id as an optional parameter
  2018-08-28  0:59 [PATCH V3 0/2] firmware: ti_sci: Add host-id as an optional parameter Nishanth Menon
  2018-08-28  0:59 ` [PATCH V3 1/2] Documentation: dt: keystone: ti-sci: Add optional host-id parameter Nishanth Menon
  2018-08-28  0:59 ` [PATCH V3 2/2] firmware: ti_sci: Provide host-id as an optional dt parameter Nishanth Menon
@ 2018-08-28  1:05 ` Santosh Shilimkar
  2018-08-28  1:07   ` Nishanth Menon
  2 siblings, 1 reply; 5+ messages in thread
From: Santosh Shilimkar @ 2018-08-28  1:05 UTC (permalink / raw)
  To: linux-arm-kernel

On 8/27/2018 5:59 PM, Nishanth Menon wrote:
> Hi Santosh,
> 
> This is the rebase to v4.19-rc1 and repost of the patch series [1]
> Please find attached series to enable host-id as an optional dt property.
> 
> [1] https://patchwork.ozlabs.org/cover/931822/
> 
> No Functional changes. Will be great if we can get this in rc cycle,
> but, will defer to you.
> 
> Nishanth Menon (2):
>    Documentation: dt: keystone: ti-sci: Add optional host-id parameter
>    firmware: ti_sci: Provide host-id as an optional dt parameter
> 
Yes I had this series bookmarked and was going to merge it now since
rc1 is out. Will get to it in next few days & it should showup
in next. But don't plan to send it for rc since its not a regression"
as such. Thanks for following up Nishant !!

Regards,
Santosh

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

* [PATCH V3 0/2] firmware: ti_sci: Add host-id as an optional parameter
  2018-08-28  1:05 ` [PATCH V3 0/2] firmware: ti_sci: Add host-id as an optional parameter Santosh Shilimkar
@ 2018-08-28  1:07   ` Nishanth Menon
  0 siblings, 0 replies; 5+ messages in thread
From: Nishanth Menon @ 2018-08-28  1:07 UTC (permalink / raw)
  To: linux-arm-kernel

On 01:05-20180828, Santosh Shilimkar wrote:
> On 8/27/2018 5:59 PM, Nishanth Menon wrote:
> > Hi Santosh,
> > 
> > This is the rebase to v4.19-rc1 and repost of the patch series [1]
> > Please find attached series to enable host-id as an optional dt property.
> > 
> > [1] https://patchwork.ozlabs.org/cover/931822/
> > 
> > No Functional changes. Will be great if we can get this in rc cycle,
> > but, will defer to you.
> > 
> > Nishanth Menon (2):
> >    Documentation: dt: keystone: ti-sci: Add optional host-id parameter
> >    firmware: ti_sci: Provide host-id as an optional dt parameter
> > 
> Yes I had this series bookmarked and was going to merge it now since
> rc1 is out. Will get to it in next few days & it should showup
> in next. But don't plan to send it for rc since its not a regression"
> as such. Thanks for following up Nishant !!

Understood. Thanks, Santosh.
-- 
Regards,
Nishanth Menon

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

end of thread, other threads:[~2018-08-28  1:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-28  0:59 [PATCH V3 0/2] firmware: ti_sci: Add host-id as an optional parameter Nishanth Menon
2018-08-28  0:59 ` [PATCH V3 1/2] Documentation: dt: keystone: ti-sci: Add optional host-id parameter Nishanth Menon
2018-08-28  0:59 ` [PATCH V3 2/2] firmware: ti_sci: Provide host-id as an optional dt parameter Nishanth Menon
2018-08-28  1:05 ` [PATCH V3 0/2] firmware: ti_sci: Add host-id as an optional parameter Santosh Shilimkar
2018-08-28  1:07   ` Nishanth Menon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox