From patchwork Tue Jun 5 06:26:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 137696 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp574055lji; Mon, 4 Jun 2018 23:27:08 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLpXdTkVjLivxoEbxCQokdC2pfNJLADx/jkFyZeTtZEf6od2/Ni7zPH4x3YSCtKwin6YsWU X-Received: by 2002:a17:902:722:: with SMTP id 31-v6mr25666919pli.3.1528180028620; Mon, 04 Jun 2018 23:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528180028; cv=none; d=google.com; s=arc-20160816; b=1BB5pnCg2MIZclWYUQx1953/h8wgIEBPkbWhHueI0eGYdwZ5TBJKX2FZfMrQ2ZsXHf uf3A8bf3qv7y1KFBCn7GpSxUqQTaZRjc8Si9zdVU9xpkgzxONjmksq2Ar0AZV3CywCWg gX8eZgFc8Qz1G3Aa8/UjlVBjrbBAvVbK2MKGU/ss+sd2ZBhOowMKCKI3Ie8nX0TvhQbw +D63FiOxEGkUcR25ngMkniR+5Tc2EHijOSXm8JIwcI6ENfM8QLwO1uX3i+eggr96qzKr 8gPKu9HrQYBaPDL1Tulaf6Qwbbo1NciJbk2G+5Miz1niNtMcie4OxvNgt2TJpJ7052Jm s/iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=rgbOrog4kJvu7soQjaX76eN0pbty82bHniX4vWTYLNc=; b=W0r9/IcbT2/BsWRmkhDMpMbigsGsDtHD0NrTsHOLa15xKzNedqMnXljZhN50WfSBLa zA6WvgVGaNuWiLLPvO91sw9JHO7W7u42ELRQ1cqdf3kcHN48ohcNhq8257A9G3n2zc6G rXEnOx2QvpL6OqRRJ9/4buvqb3DMKErYThXpERAiAD1AqQZlquCqbLBoYT/4jDhV/7KE jt549XNdKHkWU2qXmpful47CrJZJzfXF6hJlbsOfa7locwSwi+s1vY1cM/cF5sSkaTOy idBV0amk4P4UBoZaFx8+SVQWwXk0tsJ4jD5FQkpcy2pfSHTUIb7yqHGDdLouxn2kzwug TBag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=y9qZWFAV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m67-v6si7627776pgm.517.2018.06.04.23.27.08; Mon, 04 Jun 2018 23:27:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=y9qZWFAV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751575AbeFEG1E (ORCPT + 30 others); Tue, 5 Jun 2018 02:27:04 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:37769 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751509AbeFEG1A (ORCPT ); Tue, 5 Jun 2018 02:27:00 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w556Qeba002932; Tue, 5 Jun 2018 01:26:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1528180000; bh=rgbOrog4kJvu7soQjaX76eN0pbty82bHniX4vWTYLNc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=y9qZWFAVGyGrndDjtbbXUSbkt7Kbs26dqKNiVgXDbg6xabT6m36xABA2HUtFaBgvz An/NDSeeVPL+iUkzW9c4COdhC52TiGRdXd/xEMIhNJ+5y78REykwxeNA2czkz6rQVo q9ZVVm1+FQBeyaQSTd4hhV1StYAleNBeIAXGdX8w= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w556Qe6g029106; Tue, 5 Jun 2018 01:26:40 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Tue, 5 Jun 2018 01:26:40 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Tue, 5 Jun 2018 01:26:40 -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 w556QeN6027373; Tue, 5 Jun 2018 01:26:40 -0500 From: Nishanth Menon To: Rob Herring , Santosh Shilimkar , Tero Kristo , Nishanth Menon CC: , , Subject: [RFC PATCH 1/3] Documentation: dt: keystone: ti-sci: Add optional host-id parameter Date: Tue, 5 Jun 2018 01:26:38 -0500 Message-ID: <20180605062640.3356-2-nm@ti.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180605062640.3356-1-nm@ti.com> References: <20180605062640.3356-1-nm@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Documentation/devicetree/bindings/arm/keystone/ti,sci.txt | 4 ++++ 1 file changed, 4 insertions(+) -- 2.15.1 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 Jun 5 06:26:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 137697 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp574447lji; Mon, 4 Jun 2018 23:27:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKPWxluNA8+ehc9y/yd9gmoUCpQl9rxSGXTZ3lxhfwcUTpW6gj8/K8tYaGSXchZ1DrMrbDV X-Received: by 2002:a17:902:8bc6:: with SMTP id r6-v6mr25365855plo.257.1528180054654; Mon, 04 Jun 2018 23:27:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528180054; cv=none; d=google.com; s=arc-20160816; b=ITCuG5ToQb6xbbbpOT/5N7Bj6moEiflPy7Tk8/r4nrNYDYIRQsURgxPzLs5McTaZ6s rBoyIqSy2Q47wRmbGCPw9X4Xwuy7fkh49CoHIBwsNf8YDU2CVOYi3GFCgeWCge07CqYX 3M8503zf5LkoKVaQKFe/6z9Uq9/fZyfEoWXzvX5Wgese9WST2qL4gQ9lckRW1Yv5iM74 92cyD4FvSV1CQj9VskURtTfRoZlib5YmAlbYP5NYFd2iX8D4amcTGhO/EP8uhRfDJysu LoMvkJ5+Vsqrwtc/LdS3RLRz0T6FDh/HGylzeZIT8bJ5yWb+/5lo4ZuGzkKWFjXmW5ge W+lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=nuhgxDwjzT6r6cAVm3FeQccB5wfjbiWBZ7tfXt7CvRw=; b=AyH0w5eHlwlVhrVO/5P+wf5hML6bQrTZystC+xleq6htB0r0SkC8jxnW0P7uLENDt3 xaf5aBHPCr5gqPZuzOoPdyz8NrsisSNzCDfGjg2u4To+PCI9mPcJxlh+7BCnYKy8N78k xZ0N+npRJgaW1mVXGsBcAM2XI4MxOknQJ+w8w5SApwk6k1g1y2Z1MiK2IQAYRex9k/ML nHOvE5u1hNdrHI7Z9nwQdtBxdzM+/fsJhPVtRM1MzWdE7SvSxOc2F/ZNUyKh2EqWkEM0 Z/ea0dhf3PJpyMJovjKmtxxsPhGVfoRHsQX10RS7F3VwjQPNu9w1VrY3fQ/96NB+lHN7 vrrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=IcwXZT+W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11-v6si38302461pgc.669.2018.06.04.23.27.34; Mon, 04 Jun 2018 23:27:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=IcwXZT+W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751625AbeFEG1c (ORCPT + 30 others); Tue, 5 Jun 2018 02:27:32 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:37767 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751449AbeFEG05 (ORCPT ); Tue, 5 Jun 2018 02:26:57 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w556QeK5002934; Tue, 5 Jun 2018 01:26:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1528180000; bh=nuhgxDwjzT6r6cAVm3FeQccB5wfjbiWBZ7tfXt7CvRw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=IcwXZT+WxkTgBlCBKyCNA/4Se/ZbB3dgH93oA7KGy/a8keAY9JWhJQHl2UYKm4UIp 8Tn6EGtJdQqL/KLT0CUsTle3kWKT2KQo1mIpCuxbhVvYEBUHNLj4vQLXR8WfFoWFH/ 3kViPZLDtgUzMorpEo2VusjuhyRI+eTRcr2Hlwos= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w556Qewx029107; Tue, 5 Jun 2018 01:26:40 -0500 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Tue, 5 Jun 2018 01:26:40 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Tue, 5 Jun 2018 01:26:40 -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 w556QenZ002091; Tue, 5 Jun 2018 01:26:40 -0500 From: Nishanth Menon To: Rob Herring , Santosh Shilimkar , Tero Kristo , Nishanth Menon CC: , , Subject: [RFC PATCH 2/3] firmware: ti_sci: Provide host-id as an optional dt parameter Date: Tue, 5 Jun 2018 01:26:39 -0500 Message-ID: <20180605062640.3356-3-nm@ti.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180605062640.3356-1-nm@ti.com> References: <20180605062640.3356-1-nm@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/firmware/ti_sci.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) -- 2.15.1 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);