linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] firmware: Add K3 Support for TISCI driver
@ 2018-06-05  6:26 Nishanth Menon
  2018-06-05  6:26 ` [RFC PATCH 1/3] Documentation: dt: keystone: ti-sci: Add optional host-id parameter Nishanth Menon
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Nishanth Menon @ 2018-06-05  6:26 UTC (permalink / raw)
  To: Rob Herring, Santosh Shilimkar, Tero Kristo, Nishanth Menon
  Cc: linux-kernel, devicetree, linux-arm-kernel

Hi,

The following series enables TI System Control Interface(TISCI) support for
the newest addition in TI's SoC portfolio - AM654 SoC.

The series is an RFC based off next-20180604 and will post formally once
v4.18-rc1 is available.

The series (part 4 of 4) is available here:
https://github.com/nmenon/linux-2.6-playground/commits/upstream/next-20180604/k3-4-am6-tisci

Full Boot log is available here: https://pastebin.ubuntu.com/p/vWCzMKtBCW/

The Linux development follows closely the 66AK2G SoC model in aarch64 with a
few additions to handle the flexibility of firmware.

The architecture and dts support depends on part 1 of the series:
https://marc.info/?l=linux-arm-kernel&m=152817866312732&w=2

See AM65x Technical Reference Manual (SPRUID7, April 2018)
for further details: http://www.ti.com/lit/pdf/spruid7

Nishanth Menon (3):
  Documentation: dt: keystone: ti-sci: Add optional host-id parameter
  firmware: ti_sci: Provide host-id as an optional dt parameter
  arm64: dts: ti: k3-am6: Add Device Management Security Controller
    support

 .../devicetree/bindings/arm/keystone/ti,sci.txt    |  4 +++
 arch/arm64/boot/dts/ti/k3-am6.dtsi                 | 32 ++++++++++++++++++++++
 drivers/firmware/ti_sci.c                          | 24 +++++++++++++---
 3 files changed, 56 insertions(+), 4 deletions(-)

-- 
2.15.1

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

* [RFC PATCH 1/3] Documentation: dt: keystone: ti-sci: Add optional host-id parameter
  2018-06-05  6:26 [RFC PATCH 0/3] firmware: Add K3 Support for TISCI driver Nishanth Menon
@ 2018-06-05  6:26 ` Nishanth Menon
  2018-06-12 21:39   ` Rob Herring
  2018-06-05  6:26 ` [RFC PATCH 2/3] firmware: ti_sci: Provide host-id as an optional dt parameter Nishanth Menon
  2018-06-05  6:26 ` [RFC PATCH 3/3] arm64: dts: ti: k3-am6: Add Device Management Security Controller support Nishanth Menon
  2 siblings, 1 reply; 6+ messages in thread
From: Nishanth Menon @ 2018-06-05  6:26 UTC (permalink / raw)
  To: Rob Herring, Santosh Shilimkar, Tero Kristo, Nishanth Menon
  Cc: linux-kernel, devicetree, 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.

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

We call this with a vendor prefix to prevent any possible confusion
with SCSI ID (m68k) kernel option.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 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] 6+ messages in thread

* [RFC PATCH 2/3] firmware: ti_sci: Provide host-id as an optional dt parameter
  2018-06-05  6:26 [RFC PATCH 0/3] firmware: Add K3 Support for TISCI driver Nishanth Menon
  2018-06-05  6:26 ` [RFC PATCH 1/3] Documentation: dt: keystone: ti-sci: Add optional host-id parameter Nishanth Menon
@ 2018-06-05  6:26 ` Nishanth Menon
  2018-06-05  6:26 ` [RFC PATCH 3/3] arm64: dts: ti: k3-am6: Add Device Management Security Controller support Nishanth Menon
  2 siblings, 0 replies; 6+ messages in thread
From: Nishanth Menon @ 2018-06-05  6:26 UTC (permalink / raw)
  To: Rob Herring, Santosh Shilimkar, Tero Kristo, Nishanth Menon
  Cc: linux-kernel, devicetree, 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>
---
 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 b74a533ef35b..6b08ee815b24 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] 6+ messages in thread

* [RFC PATCH 3/3] arm64: dts: ti: k3-am6: Add Device Management Security Controller support
  2018-06-05  6:26 [RFC PATCH 0/3] firmware: Add K3 Support for TISCI driver Nishanth Menon
  2018-06-05  6:26 ` [RFC PATCH 1/3] Documentation: dt: keystone: ti-sci: Add optional host-id parameter Nishanth Menon
  2018-06-05  6:26 ` [RFC PATCH 2/3] firmware: ti_sci: Provide host-id as an optional dt parameter Nishanth Menon
@ 2018-06-05  6:26 ` Nishanth Menon
  2 siblings, 0 replies; 6+ messages in thread
From: Nishanth Menon @ 2018-06-05  6:26 UTC (permalink / raw)
  To: Rob Herring, Santosh Shilimkar, Tero Kristo, Nishanth Menon
  Cc: linux-kernel, devicetree, linux-arm-kernel

Add TISCI compatible System controller for AM6 SoCs.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am6.dtsi | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am6.dtsi b/arch/arm64/boot/dts/ti/k3-am6.dtsi
index 07e9cc05519c..898422e24b27 100644
--- a/arch/arm64/boot/dts/ti/k3-am6.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am6.dtsi
@@ -97,6 +97,38 @@
 			interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
 		};
 
+		dmsc: dmsc {
+			compatible = "ti,k2g-sci";
+			ti,host-id = <12>;
+			#address-cells = <2>;
+			#size-cells = <2>;
+			ranges;
+			/*
+			 * In case of rare platforms that does not use am6 as
+			 * system master, use /delete-property/
+			 */
+			ti,system-reboot-controller;
+			mbox-names = "rx", "tx";
+
+			mboxes= <&secure_proxy 11>,
+				<&secure_proxy 13>;
+
+			k3_pds: power-controller {
+				compatible = "ti,sci-pm-domain";
+				#power-domain-cells = <1>;
+			};
+
+			k3_clks: clocks {
+				compatible = "ti,k2g-sci-clk";
+				#clock-cells = <2>;
+			};
+
+			k3_reset: reset-controller {
+				compatible = "ti,sci-reset";
+				#reset-cells = <2>;
+			};
+		};
+
 		wkup_uart0: serial@42300000 {
 			compatible = "ti,am654-uart", "ti,omap4-uart", "ns16550a";
 			reg = <0x0 0x42300000 0x0 0x100>;
-- 
2.15.1

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

* Re: [RFC PATCH 1/3] Documentation: dt: keystone: ti-sci: Add optional host-id parameter
  2018-06-05  6:26 ` [RFC PATCH 1/3] Documentation: dt: keystone: ti-sci: Add optional host-id parameter Nishanth Menon
@ 2018-06-12 21:39   ` Rob Herring
  2018-06-12 22:09     ` Nishanth Menon
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Herring @ 2018-06-12 21:39 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Santosh Shilimkar, Tero Kristo, linux-kernel, devicetree,
	linux-arm-kernel

On Tue, Jun 05, 2018 at 01:26:38AM -0500, Nishanth Menon wrote:
> Texas Instrument's System Control Interface (TISCI) permits the
> ability for Operating Systems to running in virtual machines to be

...for OSs running in virtual...

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

So the hypervisor will fill in host-id's for each VM instance?

> 
> This is introduced as an optional parameter to maintain consistency
> with legacy device tree blobs.
> 
> We call this with a vendor prefix to prevent any possible confusion
> with SCSI ID (m68k) kernel option.
> 
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---
>  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	[flat|nested] 6+ messages in thread

* Re: [RFC PATCH 1/3] Documentation: dt: keystone: ti-sci: Add optional host-id parameter
  2018-06-12 21:39   ` Rob Herring
@ 2018-06-12 22:09     ` Nishanth Menon
  0 siblings, 0 replies; 6+ messages in thread
From: Nishanth Menon @ 2018-06-12 22:09 UTC (permalink / raw)
  To: Rob Herring
  Cc: Santosh Shilimkar, Tero Kristo, linux-kernel, devicetree,
	linux-arm-kernel

On 21:39-20180612, Rob Herring wrote:
> On Tue, Jun 05, 2018 at 01:26:38AM -0500, Nishanth Menon wrote:
> > Texas Instrument's System Control Interface (TISCI) permits the
> > ability for Operating Systems to running in virtual machines to be
> 
> ...for OSs running in virtual...

Ack. thanks.

> 
> > 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.
> 
> So the hypervisor will fill in host-id's for each VM instance?

Yes OR have it's own device tree blobs representation of it's own host
IDs assigned by system firmware. This provides complete independence of
VMs to communicate with the system controller (once the host-id is
provided) without switching to hyp for arbitration (and yes, verified
ability with jailhouse hypervisor and multiple linux instances operating
simultaneously). This also has the added benefit of:
1. The burden of hypervisor from being involved in PM functionality as each
of the VMs can operate autonomously.
2. In TI SoCs which are heterogeneous, the system firmware plays the role
of system master communicating with multiple firmware(running on various
uCs) and OSes running on bigger cores.

-- 
Regards,
Nishanth Menon

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

end of thread, other threads:[~2018-06-12 22:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-05  6:26 [RFC PATCH 0/3] firmware: Add K3 Support for TISCI driver Nishanth Menon
2018-06-05  6:26 ` [RFC PATCH 1/3] Documentation: dt: keystone: ti-sci: Add optional host-id parameter Nishanth Menon
2018-06-12 21:39   ` Rob Herring
2018-06-12 22:09     ` Nishanth Menon
2018-06-05  6:26 ` [RFC PATCH 2/3] firmware: ti_sci: Provide host-id as an optional dt parameter Nishanth Menon
2018-06-05  6:26 ` [RFC PATCH 3/3] arm64: dts: ti: k3-am6: Add Device Management Security Controller support Nishanth Menon

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