From patchwork Tue Aug 28 00:59:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 10577729 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5C17E1390 for ; Tue, 28 Aug 2018 01:01:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D73F29971 for ; Tue, 28 Aug 2018 01:01:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4BBB329BA7; Tue, 28 Aug 2018 01:01:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BCA1029971 for ; Tue, 28 Aug 2018 01:01:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fuVAAmU7N2kRcXxL1TsxDxZTu1iS0sm+Wbq1xGTc8lQ=; b=dfs9Mt+xUAwccJ 4P3kQcR56Ftmi8lN1c8HWii7Gy5ewfi1GzV+CsOrroHHLLSrN+zvHjiIle3gjIl/mp4NY/xXLP0tw AiAXTxzNbnlI8UUJhnQwe7NCnfP/4k/WyaFUi7pZ6fc94yHCnH8Z067uYCkZdFDuLquV0P0TgVo9i NEmtEq6wz+aWlL4golzgbQFlTl1xfuwpFx/Musddye0GCUzyHRr+M+NzTDLa5TN4uw9t7whYK+u9v b4U2+5AF9eM1IRs/3Z7TKlQc9ofdv6oT/7y5cHSgmISXfIhxzcLffZlBH6L3ZWVdw65dPgP9phplc jkylOtWtocmOGdtGc43w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuSNT-0002Lv-Rg; Tue, 28 Aug 2018 01:01:03 +0000 Received: from fllv0016.ext.ti.com ([198.47.19.142]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuSM6-0000Xj-9Y for linux-arm-kernel@lists.infradead.org; Tue, 28 Aug 2018 00:59:41 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id w7S0xPXe120472; Mon, 27 Aug 2018 19:59:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1535417965; bh=Yp7WIQrJLFdNs40X2jn2BcUKm1E+XJaynnfUxSwhq5s=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=k2fABPy1T36PMp+itFSDHrzyVUGkdLOPWMav/GCNZ6LkbMUtW6GAOPKWvblqobiCb p8nfLnVQn6m3OcTWGKp3M69moEGoaLZ6watBntZsLoqLCEbviMTtAlb1t+BlhyPWgp g1o2BJJvyyv5lvMoptq8Mp2CEBICldYgQvVwHBV4= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w7S0xPo7008041; Mon, 27 Aug 2018 19:59:25 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 27 Aug 2018 19:59:25 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Mon, 27 Aug 2018 19:59:25 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w7S0xPIA024517; Mon, 27 Aug 2018 19:59:25 -0500 From: Nishanth Menon To: Santosh Shilimkar , Tero Kristo Subject: [PATCH V3 1/2] Documentation: dt: keystone: ti-sci: Add optional host-id parameter Date: Mon, 27 Aug 2018 19:59:23 -0500 Message-ID: <20180828005924.13092-2-nm@ti.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180828005924.13092-1-nm@ti.com> References: <20180828005924.13092-1-nm@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180827_175938_441122_2EA76888 X-CRM114-Status: GOOD ( 12.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nishanth Menon , devicetree@vger.kernel.org, Rob Herring , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Nishanth Menon --- 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>; From patchwork Tue Aug 28 00:59:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 10577727 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 61E54139B for ; Tue, 28 Aug 2018 01:00:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52B8D296A7 for ; Tue, 28 Aug 2018 01:00:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50DCC29718; Tue, 28 Aug 2018 01:00:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C70242984D for ; Tue, 28 Aug 2018 01:00:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=H7ai10a4bmXmOd7kUxHdoeb+B+UGCc3sA3TpSuJ0VFw=; b=G5fzFnV5CFfvzn rgyHI8py4Wl5t72YLD3Ti939mcHmePgFbOdW5D2vFkb1WcjxpCqUyPH4xOQyqdRVyMvJvEdlgrDoC mFBfY77xsGy4gDa6FTIg4QschKXVtjTI/9tEH9LuoTZaKew0jjHUC+R3JuZO8ZcNBf6u9oXK3RJg8 QHpwLs+AIQ0iENrx6Z0XQVX1t8q2L9SNXjqNmjTKWbtbp9rY0H/pKR7ragpsNkdK0kaS9tirWnmQN 7Za/Zl4UhlN3O/I9pavAXjgsawfK9/wzJ5e/42rld7aNr3HwlaTjXBSZeHf3DUhrFgcfXNG4IDRwV NoGMF92CvXUlzegdLkYA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuSMm-0001KE-E8; Tue, 28 Aug 2018 01:00:20 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuSM5-0000Xh-I0 for linux-arm-kernel@lists.infradead.org; Tue, 28 Aug 2018 00:59:39 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id w7S0xPc7057529; Mon, 27 Aug 2018 19:59:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1535417965; bh=IO25pPSBv6KXr/MYJLedbO7tk4i60dfuh04AY61KCNQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=VXwb1qIJ204glIdtpCG5d+HtoQqa9Ds8E9YfNqcFKEOrrtyLPYFUe9zNIUKMKlUyr hDXrdetKcDdYCDchql6SWxeNXOiY4639bmabWGC7vdXswygcVNrVphUJBlNh3G3YUu J5DUhWhIt3+ICK6AagA1QJbJMfsVB8lwVRsRFBMY= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w7S0xP0e006143; Mon, 27 Aug 2018 19:59:25 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 27 Aug 2018 19:59:25 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Mon, 27 Aug 2018 19:59:25 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w7S0xPMi012834; Mon, 27 Aug 2018 19:59:25 -0500 From: Nishanth Menon To: Santosh Shilimkar , Tero Kristo Subject: [PATCH V3 2/2] firmware: ti_sci: Provide host-id as an optional dt parameter Date: Mon, 27 Aug 2018 19:59:24 -0500 Message-ID: <20180828005924.13092-3-nm@ti.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180828005924.13092-1-nm@ti.com> References: <20180828005924.13092-1-nm@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180827_175937_710314_55E8D1A0 X-CRM114-Status: GOOD ( 20.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nishanth Menon , devicetree@vger.kernel.org, Rob Herring , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);