From patchwork Mon Mar 18 10:05:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10857349 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 3C981922 for ; Mon, 18 Mar 2019 10:31:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1966C2933D for ; Mon, 18 Mar 2019 10:31:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D2722933F; Mon, 18 Mar 2019 10:31:29 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 A51742933D for ; Mon, 18 Mar 2019 10:31:28 +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=FUl4aX8WAbYnFBIIjuJvy9BcOiHV/9Aqi3soZ/6xozg=; b=WMNG+RNh5Xq9NG /gGXeX0G3TTILt4ezG2/0k2EWlAX97RYb4Ir0u/HWGOqFhnQZ3eWF+1vJgc8gOhCCE0VmsnziCi6t zMKVtMa3yDt0zI7ppVtikIodPtbib8tb/qabYM4MhRVhJvQsnHouIMHPs0dhKXsZ0lVUS+48o/8JV v8q52ojcetztVuccdM+N401HBQTBObzIOU1WTyLlGRxtudnbx6l8cUa69XMsPRGSK0mzn33cigh/q ii3FamM4LM0nuGUlkJjgrKGcaRymOL27tFIvfz9tPt8buzFUG11SdDzg3MmKVkBaI+A7345H1q74K YgWoIP3UvDZfHfH7o+aA==; 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 1h5pY9-0003MZ-PA; Mon, 18 Mar 2019 10:31:21 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5pXp-0002vV-6q for linux-arm-kernel@bombadil.infradead.org; Mon, 18 Mar 2019 10:31:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gLE1OBL3hXHSdIp1g8xW0K6AfvWVmLCR6aOw/Y/Pt2M=; b=hdYgj+WGmn4rjAksbATDYn8uI hX7v/Xo+JNRJDE6GC2tBXKLJ/jZzmyiW4PeDE8nMbHtXehLw9YbOw04WFQGgYzWyyQP5wKA2IzRl6 CCPBtZv/GY4MOe58d1L0LGV6QSpqw0aJcQuapZ/QtPPQQYEWrUFl8lZJ4dggHASnrzhOoOTkYMvFc OpGt6HBbEu2PAABE9Tj9BaBnpYMn7MQJ14OFUVeh67PRxMBOwekslFyTy0q3ILeGosp5L+5rb2xXR VuKISBp1odeW8tG2Jo0iFDVljbKPBF0ClF1wKESoB92CMiMdykeNSWRM2SgEMplhwRwOIeH20vxzI Xflg/ZcBA==; Received: from mx07-00178001.pphosted.com ([62.209.51.94]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5pAH-0008KW-Ue for linux-arm-kernel@lists.infradead.org; Mon, 18 Mar 2019 10:06:43 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2IA11d5025027; Mon, 18 Mar 2019 11:06:26 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2r8qsxb4wy-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 18 Mar 2019 11:06:26 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1F9AB41; Mon, 18 Mar 2019 10:06:25 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D60D62AAA; Mon, 18 Mar 2019 10:06:24 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.435.0; Mon, 18 Mar 2019 11:06:24 +0100 Received: from localhost (10.201.20.122) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.435.0; Mon, 18 Mar 2019 11:06:24 +0100 From: Benjamin Gaignard To: , , , , , Subject: [RESEND PATCH 1/7] devicetree: bindings: Document domains controller bindings Date: Mon, 18 Mar 2019 11:05:59 +0100 Message-ID: <20190318100605.29120-2-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190318100605.29120-1-benjamin.gaignard@st.com> References: <20190318100605.29120-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.20.122] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-18_07:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190318_060642_238789_499B3F64 X-CRM114-Status: GOOD ( 15.54 ) 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: benjamin.gaignard@linaro.org, loic.pallardy@st.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, Benjamin Gaignard 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 Document commons domains controller bindings for controller and client devices. Signed-off-by: Benjamin Gaignard --- .../bindings/bus/domains/domainsctrl.txt | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Documentation/devicetree/bindings/bus/domains/domainsctrl.txt diff --git a/Documentation/devicetree/bindings/bus/domains/domainsctrl.txt b/Documentation/devicetree/bindings/bus/domains/domainsctrl.txt new file mode 100644 index 000000000000..f82e5e11ea64 --- /dev/null +++ b/Documentation/devicetree/bindings/bus/domains/domainsctrl.txt @@ -0,0 +1,55 @@ +Common Domains Controller bindings properties + +Bus domains controllers allow to divided system on chip into multiple domains +that can be used to select by who hardware blocks could be accessed. +A domain could be a cluster of CPUs (or coprocessors), a range of addresses or +a group of hardware blocks. + +This device tree bindings can be used to bind bus domain consumer devices with +their bus domains provided by bus domains controllers. A bus domain provider +can be represented by any node in the device tree and can provide one or more +bus domains. A consumer node can refer to the provider by a phandle and a set +of phandle arguments of length specified by the #domainctrl-cells property in +the bus domain provider node. + +==Bus domain provider== + +Required properties: +- #domainctrl-cells : Number of cells in a bus domain specifier; + Can be any value as specified by device tree binding + documentation of a particular provider. + +==Bus domain consumer== + +Required properties: +- domainsctrl-X : A list of bus domain specifiers, as defined by + bindings of the bus domain controller that is the + bus domain provider. + +Optional properties: +- domainsctrl-names : A list of bus domain name string sorted in the same + order as the domainsctrl-X proprerties. Consumer + drivers will use domainsctrl-names to match bus + domains with bus domains specifiers. + Note that "default" and "unbind" are reserved names + used by the framework. + +Example of usage with: +- a domains controller with a 2 parameters cell +- a domains controller with a 3 parameters cell +- a client device node using the both controllers and 2 configurations + named "default" and "unbind" + +ctrl0: ctrl@0 { + #domainctrl-cells = <2>; +}; + +ctrl1: ctrl@1 { + #domainctrl-cells = <3>; +}; + +foo@0 { + domains-names = "default", "unbind"; + domainctrl-0 = <&ctrl0 1 2>, <&ctrl1 3 4 5>; + domainctrl-1 = <&ctrl0 6 7>, <&ctrl1 8 9 0>; +}; From patchwork Mon Mar 18 10:06:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10857257 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 A4C64139A for ; Mon, 18 Mar 2019 10:08:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8263229328 for ; Mon, 18 Mar 2019 10:08:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 763CA2932C; Mon, 18 Mar 2019 10:08:53 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 A87A929328 for ; Mon, 18 Mar 2019 10:08:52 +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=Op8ZoVx900cbB+3YEIlV8S5XedoZTqF00rlD0VALhhY=; b=ZyFKyFbh5wnw74 5bKsZEIvyodBFG8OTfPXcuUn20+dLalIOwpBpdKtW9SZbq/6lhjUF55NePrpHmJd7oRVS0MlYWtwF yIWH7Zrua3nUvHV6Uuz1Qde9oDCxL8l1qzj2Dr9Iou48p+xQue1murfAA9pH+D+uERU/XYGdoGm6M Zcmyl/MbuQ+kfrcIdG1Y95/lS6ffFYfk26+o9+q3saehURAn/4ye1g4xgSMpmpkjZwku/d+gWu5WY gjxV/lWKW8p5rOZSMqW8f9Gn5SZofnk4s5L6BFVcKCqQURg6QflYWiDNs3GKec4dDGjVe9KB0bDkr d2c/+Dn1WilthGPgAWJQ==; 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 1h5pCM-0005D9-4T; Mon, 18 Mar 2019 10:08:50 +0000 Received: from mx07-00178001.pphosted.com ([62.209.51.94]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5pAJ-0002cE-89 for linux-arm-kernel@lists.infradead.org; Mon, 18 Mar 2019 10:07:13 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2IA1Jht012116; Mon, 18 Mar 2019 11:06:29 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2r8qg4b790-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 18 Mar 2019 11:06:28 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4F79642; Mon, 18 Mar 2019 10:06:26 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 130FD2AB2; Mon, 18 Mar 2019 10:06:25 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by SAFEX1HUBCAS21.st.com (10.75.90.44) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 18 Mar 2019 11:06:25 +0100 Received: from localhost (10.201.20.122) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.435.0; Mon, 18 Mar 2019 11:06:25 +0100 From: Benjamin Gaignard To: , , , , , Subject: [RESEND PATCH 2/7] domainsctrl: Introduce domains controller framework Date: Mon, 18 Mar 2019 11:06:00 +0100 Message-ID: <20190318100605.29120-3-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190318100605.29120-1-benjamin.gaignard@st.com> References: <20190318100605.29120-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.20.122] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-18_07:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190318_030643_971782_F1920EDA X-CRM114-Status: GOOD ( 22.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: benjamin.gaignard@linaro.org, loic.pallardy@st.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, Benjamin Gaignard 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 The goal of this framework is to offer an interface for the hardware blocks controlling bus accesses rights. Bus domains controllers are typically used to control if a hardware block can perform read or write operations on bus. Smarter domains controllers could be able to define accesses rights per hardware blocks to control where they can read or write. Domains controller configurations are provided in device node, parsed by the framework and send to the driver to apply them. Each controller may need different number and type of inputs to configure a domain so device-tree properties size have to be define by using "#domainctrl-cells". Domains configurations properties have to be named "domainsctrl-X" on device node. "domainsctrl-names" keyword can also be used to give a name to a specific configuration. Example of device-tree: ctrl0: domainsctrl@0 { #domainctrl-cells = <2>; }; foo: foo@0 { domainsctrl-names = "default", "setting1"; domainsctrl-0 = <&ctrl0 1 2>; domainsctrl-1 = <&ctrl0 3 4>; }; Configurations could be applied with functions like domainsctrl_set_config_by_index() or domainsctrl_set_config_by_name(). domainsctrl_set_default_config() function will apply the configuration named "default" (if existing) or the configuration with index 0 (i.e. domainsctrl-0). Drivers could register/unregister themselves be calling domainsctrl_register/domainsctrl_unregister functions. When a configuration has to be applied the driver callback, provided in the ops at registration time, set_config is called by the framework. Signed-off-by: Benjamin Gaignard Reviewed-by: Mark Brown --- drivers/bus/Kconfig | 2 + drivers/bus/Makefile | 2 + drivers/bus/domains/Kconfig | 7 ++ drivers/bus/domains/Makefile | 1 + drivers/bus/domains/domainsctrl.c | 234 ++++++++++++++++++++++++++++++++++++++ include/linux/domainsctrl.h | 70 ++++++++++++ 6 files changed, 316 insertions(+) create mode 100644 drivers/bus/domains/Kconfig create mode 100644 drivers/bus/domains/Makefile create mode 100644 drivers/bus/domains/domainsctrl.c create mode 100644 include/linux/domainsctrl.h diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig index 1851112ccc29..a0f7a67c1296 100644 --- a/drivers/bus/Kconfig +++ b/drivers/bus/Kconfig @@ -183,4 +183,6 @@ config DA8XX_MSTPRI source "drivers/bus/fsl-mc/Kconfig" +source "drivers/bus/domains/Kconfig" + endmenu diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile index ca300b1914ce..d7e95edba33d 100644 --- a/drivers/bus/Makefile +++ b/drivers/bus/Makefile @@ -32,3 +32,5 @@ obj-$(CONFIG_UNIPHIER_SYSTEM_BUS) += uniphier-system-bus.o obj-$(CONFIG_VEXPRESS_CONFIG) += vexpress-config.o obj-$(CONFIG_DA8XX_MSTPRI) += da8xx-mstpri.o + +obj-$(CONFIG_DOMAINS_CONTROLLERS) += domains/ diff --git a/drivers/bus/domains/Kconfig b/drivers/bus/domains/Kconfig new file mode 100644 index 000000000000..5ba15f750bee --- /dev/null +++ b/drivers/bus/domains/Kconfig @@ -0,0 +1,7 @@ +menu "Bus Domains Controllers" + +config DOMAINS_CONTROLLERS + bool "Support of bus domains controllers" + depends on OF + +endmenu diff --git a/drivers/bus/domains/Makefile b/drivers/bus/domains/Makefile new file mode 100644 index 000000000000..262338b7cad5 --- /dev/null +++ b/drivers/bus/domains/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_DOMAINS_CONTROLLERS) += domainsctrl.o diff --git a/drivers/bus/domains/domainsctrl.c b/drivers/bus/domains/domainsctrl.c new file mode 100644 index 000000000000..bbadf8165bc8 --- /dev/null +++ b/drivers/bus/domains/domainsctrl.c @@ -0,0 +1,234 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) STMicroelectronics 2018 - All Rights Reserved + * Author: Benjamin Gaignard for STMicroelectronics. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/* Mutex taken to protect domainctrl_list */ +static DEFINE_MUTEX(domainctrl_list_mutex); + +/* Global list of domain control devices (struct domains_ctrl) */ +static LIST_HEAD(domainctrl_list); + +struct domains_ctrl { + struct list_head node; + struct device *dev; + struct domains_ctrl_ops *ops; +}; + +static struct domains_ctrl *get_domainctrl_from_node(struct device_node *np) +{ + struct domains_ctrl *ctrl; + + mutex_lock(&domainctrl_list_mutex); + + list_for_each_entry(ctrl, &domainctrl_list, node) { + if (ctrl->dev->of_node == np) { + mutex_unlock(&domainctrl_list_mutex); + return ctrl; + } + } + + mutex_unlock(&domainctrl_list_mutex); + + return NULL; +} + +/** + * domainsctrl_set_config_by_index + * + * Set a domains controller configuration based on given index. + * + * @dev: device with domain configuration to apply. + * @index: the index of the configuration in device node. + * + * Returns 0 if OK, -EPROBE_DEFER if waiting for domains controller to be + * registered or negative value on other errors. + */ +int domainsctrl_set_config_by_index(struct device *dev, int index) +{ + struct device_node *np = dev->of_node; + char *propname; + int configs, i, err = 0; + + if (!np) + return 0; + + propname = kasprintf(GFP_KERNEL, "domainctrl-%d", index); + configs = of_count_phandle_with_args(np, propname, "#domainctrl-cells"); + if (configs < 0) { + err = -EINVAL; + goto error; + } + + for (i = 0; i < configs; i++) { + struct domains_ctrl *ctrl; + struct of_phandle_args args; + + err = of_parse_phandle_with_args(np, propname, + "#domainctrl-cells", + i, &args); + if (err) + goto error; + + /* Test if the controller is (or will be) available */ + if (!of_device_is_available(args.np)) { + of_node_put(args.np); + continue; + } + + ctrl = get_domainctrl_from_node(args.np); + of_node_put(args.np); + + /* Controller is not yet registered */ + if (!ctrl) { + err = -EPROBE_DEFER; + goto error; + } + + err = ctrl->ops->set_config(ctrl->dev, &args); + if (err) + goto error; + } + +error: + kfree(propname); + return err; +} +EXPORT_SYMBOL_GPL(domainsctrl_set_config_by_index); + +/** + * domainsctrl_set_config_by_name + * + * Set a domains controller configuration based on given name. + * + * @dev: device with domain configuration to apply. + * @name: the name of the configuration in device node. + * + * Returns 0 if OK, -EPROBE_DEFER if waiting for domains controller to be + * registered or negative value on other errors. + */ +int domainsctrl_set_config_by_name(struct device *dev, char *name) +{ + const char *configname; + int count, i; + + count = of_property_count_strings(dev->of_node, "domainctrl-names"); + for (i = 0; i < count; i++) { + int err; + + err = of_property_read_string_index(dev->of_node, + "domainctrl-names", + i, &configname); + if (err) + return err; + + if (strcmp(name, configname)) + continue; + + return domainsctrl_set_config_by_index(dev, i); + } + + return -EINVAL; +} +EXPORT_SYMBOL_GPL(domainsctrl_set_config_by_name); + +/** + * domainsctrl_set_default_config + * + * Set the default configuration for device. + * First try to apply configuration named "default", if it fails + * or doesn't exist, try to apply domainsctrl-0 configuration. + * + * @dev: device with domain configuration to apply. + * + * Returns 0 if OK, -EPROBE_DEFER if waiting for domains controller to be + * registered or negative value on other errors. + */ +int domainsctrl_set_default_config(struct device *dev) +{ + int ret; + + ret = domainsctrl_set_config_by_name(dev, "default"); + if (!ret || (ret == -EPROBE_DEFER)) + return ret; + + return domainsctrl_set_config_by_index(dev, 0); +} +EXPORT_SYMBOL_GPL(domainsctrl_set_default_config); + +/** + * domainsctrl_register + * + * Register a domains controller device. + * + * @dev: device implementing domains controller. + * @ops: domains controller operations. + * + * Returns 0 if OK or negative value on error. + */ +int domainsctrl_register(struct device *dev, + struct domains_ctrl_ops *ops) +{ + struct domains_ctrl *ctrl; + + if (!dev || !ops || !ops->set_config) + return -EINVAL; + + ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); + if (!ctrl) + return -ENOMEM; + + INIT_LIST_HEAD(&ctrl->node); + + ctrl->dev = dev; + ctrl->ops = ops; + + mutex_lock(&domainctrl_list_mutex); + list_add_tail(&ctrl->node, &domainctrl_list); + mutex_unlock(&domainctrl_list_mutex); + + return 0; +} +EXPORT_SYMBOL_GPL(domainsctrl_register); + +/** + * domainsctrl_unregister + * + * Unregister a domains controller device. + * + * @dev: device implementing domains controller. + */ +void domainsctrl_unregister(struct device *dev) +{ + struct domains_ctrl *ctrl; + + ctrl = get_domainctrl_from_node(dev->of_node); + if (!ctrl) + return; + + mutex_lock(&domainctrl_list_mutex); + list_del(&ctrl->node); + mutex_unlock(&domainctrl_list_mutex); + + kfree(ctrl); +} +EXPORT_SYMBOL_GPL(domainsctrl_unregister); + +static int __init domainsctrl_init(void) +{ + pr_info("initialized bus domain controller subsystem\n"); + return 0; +} + +/* Init early since drivers really need to configure domains early */ +core_initcall(domainsctrl_init); diff --git a/include/linux/domainsctrl.h b/include/linux/domainsctrl.h new file mode 100644 index 000000000000..1d1960175342 --- /dev/null +++ b/include/linux/domainsctrl.h @@ -0,0 +1,70 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) STMicroelectronics 2018 - All Rights Reserved + * Author: Benjamin Gaignard for STMicroelectronics. + */ + +#ifndef _DOMAINSCTRL_H_ +#define _DOMAINSCTRL_H_ + +#include +#include + +/** + * struct domains_ctrl_ops + * + * Domains controller operations structure to be filled by drivers. + */ +struct domains_ctrl_ops { + /** + * @set_config: + * + * Driver callback to set a domain configuration on a domain controller. + * Configuration arguments are provided in out_args parameter. + * + * Returns 0 on success, a negative error code on failure. + */ + int (*set_config)(struct device *dev, struct of_phandle_args *out_args); +}; + +#ifdef CONFIG_DOMAINS_CONTROLLERS + +int domainsctrl_set_config_by_index(struct device *dev, int index); +int domainsctrl_set_config_by_name(struct device *dev, char *name); +int domainsctrl_set_default_config(struct device *dev); + +int domainsctrl_register(struct device *dev, struct domains_ctrl_ops *ops); + +void domainsctrl_unregister(struct device *dev); + +#else + +static inline int domainsctrl_set_config_by_index(struct device *dev, int index) +{ + return 0; +} + +static inline int domainsctrl_set_config_by_name(struct device *dev, char *name) +{ + return 0; +} + +static inline int domainsctrl_set_default_config(struct device *dev) +{ + return 0; +} + +static inline int domainsctrl_register(struct device *dev, + struct domains_ctrl_ops *ops) +{ + return 0; +} + +static inline void domainsctrl_unregister(struct device *dev) +{ + /* Empty */ +} + +#endif + +#endif /* _DOMAINSCTRL_H_ */ From patchwork Mon Mar 18 10:06:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10857251 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 893BB139A for ; Mon, 18 Mar 2019 10:08:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6919629328 for ; Mon, 18 Mar 2019 10:08:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C93D2932C; Mon, 18 Mar 2019 10:08:19 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 0B98429328 for ; Mon, 18 Mar 2019 10:08:19 +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=uLjEmr5QBSJ2CvCfbhIU3oGIBI7UAs4BhGGSgWrdi88=; b=B3gImmenZrPbUX rplT1cEptyO4mfJ1nZqzMfzCVRHd2ww75BDouAcXpmWExOa9DRonaj8jH+bMBbG3h/1hOPh4AJJU4 Gz9kCvmbnPo/sXtxcp2urnBTaMv54uagz+osLK159YXQHkEnZ7HoaGZTPWuoyl/nglJPZmGF0v2hB ejb7ruSZZaUCyJ++uWvDDQaWsttxBeIF6zBnfk5MWTpoQBX8Z3Gb5NHQ7kW2RmO4Qn0ijWX8ACTY3 a3ERAMC9zUcGCPgHgYkyg283xnGNu1gMTw89P2Vz9PehI2zCDUWldge3Rlt8n52i9qntUkY1fiC9G 3nFxAa4wc7NKydOn2j0w==; 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 1h5pBk-0004TU-JI; Mon, 18 Mar 2019 10:08:12 +0000 Received: from mx07-00178001.pphosted.com ([62.209.51.94]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5pAI-0002Zd-9g for linux-arm-kernel@lists.infradead.org; Mon, 18 Mar 2019 10:07:07 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2IA1SKj012566; Mon, 18 Mar 2019 11:06:30 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2r8qg4b794-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 18 Mar 2019 11:06:30 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9C0EA31; Mon, 18 Mar 2019 10:06:27 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5462E2AB0; Mon, 18 Mar 2019 10:06:27 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by SAFEX1HUBCAS21.st.com (10.75.90.44) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 18 Mar 2019 11:06:27 +0100 Received: from localhost (10.201.20.122) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.435.0; Mon, 18 Mar 2019 11:06:26 +0100 From: Benjamin Gaignard To: , , , , , Subject: [RESEND PATCH 3/7] base: Add calls to domains controller Date: Mon, 18 Mar 2019 11:06:01 +0100 Message-ID: <20190318100605.29120-4-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190318100605.29120-1-benjamin.gaignard@st.com> References: <20190318100605.29120-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.20.122] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-18_07:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190318_030643_045553_A5C1A324 X-CRM114-Status: GOOD ( 11.00 ) 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: benjamin.gaignard@linaro.org, loic.pallardy@st.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, Benjamin Gaignard 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 To avoid modifying all the drivers call domainsctrl_set_default_config before probe to apply the configuration define in device node (if any). When unbinding the device try to apply configuration named "unbind". Signed-off-by: Benjamin Gaignard Reviewed-by: Mark Brown --- drivers/base/dd.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/base/dd.c b/drivers/base/dd.c index a823f469e53f..d8378cd1a8cd 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -482,6 +483,10 @@ static int really_probe(struct device *dev, struct device_driver *drv) re_probe: dev->driver = drv; + ret = domainsctrl_set_default_config(dev); + if (ret) + goto domainctrl_failed; + /* If using pinctrl, bind pins now before probing */ ret = pinctrl_bind_pins(dev); if (ret) @@ -552,6 +557,8 @@ static int really_probe(struct device *dev, struct device_driver *drv) blocking_notifier_call_chain(&dev->bus->p->bus_notifier, BUS_NOTIFY_DRIVER_NOT_BOUND, dev); pinctrl_bind_failed: + domainsctrl_set_config_by_name(dev, "unbind"); +domainctrl_failed: device_links_no_driver(dev); devres_release_all(dev); driver_sysfs_remove(dev); @@ -1083,6 +1090,8 @@ static void __device_release_driver(struct device *dev, struct device *parent) device_links_driver_cleanup(dev); + domainsctrl_set_config_by_name(dev, "unbind"); + devres_release_all(dev); arch_teardown_dma_ops(dev); dev->driver = NULL; From patchwork Mon Mar 18 10:06:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10857253 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 0324C17E9 for ; Mon, 18 Mar 2019 10:08:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5A3B29328 for ; Mon, 18 Mar 2019 10:08:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9B942932C; Mon, 18 Mar 2019 10:08:29 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 647E529328 for ; Mon, 18 Mar 2019 10:08:29 +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=Vcg8d2JLnK8lq6pSrNP8ZZS6dH7uiu+cP2UMOITkXeE=; b=ct3TIdv+uz5Mph gfz92Hqy0nJps3g9abtw2WyDWSQrtWoIY2U89Ui0vIDEgu87dXDJnqaKTqIlYqAo7EHzwKzawTM5X +j6ZrY+UlDivIqcxeqSqG94G36c1EFrXyhj/v9cWy1zW0nzHv1KdQNqCmRzyZ2dUfRN5ybiuRDCts OnbLcJSR2hVstYgLXZNutVF/qPyZxqkH3WIDmS+HQurjlkgeC482ZdfL9lScySCD4kSN4A02qmONK vvR3Dk7WEEAaPrcYTqTt4pJkF2mvSFhbAxCVHi0znuy2YcJ3QBqWZ0Yx6jY1cnQsQVCfZV5MB9aBU zEPHFvPnTxlb0ZVQUlZg==; 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 1h5pBy-0004ig-P0; Mon, 18 Mar 2019 10:08:26 +0000 Received: from mx07-00178001.pphosted.com ([62.209.51.94]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5pAI-0002Zy-Ql for linux-arm-kernel@lists.infradead.org; Mon, 18 Mar 2019 10:07:07 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2IA1Jhu012116; Mon, 18 Mar 2019 11:06:30 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2r8qg4b79b-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 18 Mar 2019 11:06:30 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A6DE638; Mon, 18 Mar 2019 10:06:28 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 875C12AAA; Mon, 18 Mar 2019 10:06:28 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.435.0; Mon, 18 Mar 2019 11:06:28 +0100 Received: from localhost (10.201.20.122) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.435.0; Mon, 18 Mar 2019 11:06:28 +0100 From: Benjamin Gaignard To: , , , , , Subject: [RESEND PATCH 4/7] devicetree: bindings: domainsctrl: Add STM32 ETZPC bindings Date: Mon, 18 Mar 2019 11:06:02 +0100 Message-ID: <20190318100605.29120-5-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190318100605.29120-1-benjamin.gaignard@st.com> References: <20190318100605.29120-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.20.122] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-18_07:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190318_030643_784185_9E165B1D X-CRM114-Status: UNSURE ( 9.47 ) X-CRM114-Notice: Please train this message. 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: benjamin.gaignard@linaro.org, loic.pallardy@st.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, Benjamin Gaignard 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 Describe STM32 Extended TrustZone Protection bindings. Signed-off-by: Benjamin Gaignard --- .../devicetree/bindings/bus/domains/st,stm32-etzpc.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Documentation/devicetree/bindings/bus/domains/st,stm32-etzpc.txt diff --git a/Documentation/devicetree/bindings/bus/domains/st,stm32-etzpc.txt b/Documentation/devicetree/bindings/bus/domains/st,stm32-etzpc.txt new file mode 100644 index 000000000000..8f0a990ab59c --- /dev/null +++ b/Documentation/devicetree/bindings/bus/domains/st,stm32-etzpc.txt @@ -0,0 +1,14 @@ +STMicroelectronics STM32 Extended TrustZone Protection driver + +Required properties: + - compatible : must be "st,stm32-etzpc" + - reg : physical base address of the IP registers and length of memory + mapped region. + - #domainctrl-cells : must be 2 + +Example: + etzpc@5c007000 { + compatible = "st,stm32-etzpc"; + reg = <0x5c007000 0x400>; + #domainctrl-cells = <2>; + }; From patchwork Mon Mar 18 10:06:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10857255 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 D5D4413B5 for ; Mon, 18 Mar 2019 10:08:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B430B29328 for ; Mon, 18 Mar 2019 10:08:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6CCF2932C; Mon, 18 Mar 2019 10:08:49 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 1D86029328 for ; Mon, 18 Mar 2019 10:08:48 +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=yP8ejk0pl8eBd20uEaVrCBQyV5De+OI1I8yaQG+3pm0=; b=EH4g1zPD1ynRtE szGV0Qh4p0nM3+V2qWDu2i1ngUfXa7U5VZe4xLhcwWUVDGPejH8zmoKCmE9+l9yzKIezut1vUP4aP KpuAF3CMBHYXRJJ23PZmONwkg5t5bziWqTSNyL5GSts0sMWJFgZRlTYjougtlcPXM1wa0Crp8maC1 hZ6prjubMXV31KO7VnQeUk9QN562var7svxSCOTmruCPFcpyUpCK7NMQhszLKzns7U40YM4AeCYG5 mwYkWu5zr00JjgakeVvqd6oSP5WTWmk8XtLtB/QULYVLf3FD9+kBuWrtF4jOeMJSZMeoAwrK1iXt4 lsj6Hx+MIeqcqBUMYaRw==; 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 1h5pC9-0004ye-Aj; Mon, 18 Mar 2019 10:08:37 +0000 Received: from mx07-00178001.pphosted.com ([62.209.51.94]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5pAJ-0002cZ-Gl for linux-arm-kernel@lists.infradead.org; Mon, 18 Mar 2019 10:07:12 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2IA1SKk012566; Mon, 18 Mar 2019 11:06:31 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2r8qg4b79c-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 18 Mar 2019 11:06:31 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 14DEF42; Mon, 18 Mar 2019 10:06:30 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9C8392AB4; Mon, 18 Mar 2019 10:06:29 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 18 Mar 2019 11:06:29 +0100 Received: from localhost (10.201.20.122) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.435.0; Mon, 18 Mar 2019 11:06:29 +0100 From: Benjamin Gaignard To: , , , , , Subject: [RESEND PATCH 5/7] bus: domainsctrl: Add driver for STM32 ETZPC controller Date: Mon, 18 Mar 2019 11:06:03 +0100 Message-ID: <20190318100605.29120-6-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190318100605.29120-1-benjamin.gaignard@st.com> References: <20190318100605.29120-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.20.122] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-18_07:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190318_030644_280071_C6BA2F2C X-CRM114-Status: GOOD ( 17.99 ) 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: benjamin.gaignard@linaro.org, loic.pallardy@st.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, Benjamin Gaignard 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 STM32 Extended TrustZone Protection Controller (ETZPC) got 3 domains: - secure: hardware blocks are only accessible by software running on trust zone. - non-secure: hardware blocks are accessible by non-secure software (i.e. linux kernel). - coprocessor: hardware blocks are only accessible by the corpocessor. Each hardware block status is defined by a 2 bits field and all of them are packed into 32 bits registers. ETZPC can manage up to 94 hardware blocks. Signed-off-by: Benjamin Gaignard --- drivers/bus/domains/Kconfig | 7 ++ drivers/bus/domains/Makefile | 1 + drivers/bus/domains/stm32-etzpc.c | 140 ++++++++++++++++++++++++++ include/dt-bindings/bus/domains/stm32-etzpc.h | 25 +++++ 4 files changed, 173 insertions(+) create mode 100644 drivers/bus/domains/stm32-etzpc.c create mode 100644 include/dt-bindings/bus/domains/stm32-etzpc.h diff --git a/drivers/bus/domains/Kconfig b/drivers/bus/domains/Kconfig index 5ba15f750bee..7afd209e8c4f 100644 --- a/drivers/bus/domains/Kconfig +++ b/drivers/bus/domains/Kconfig @@ -4,4 +4,11 @@ config DOMAINS_CONTROLLERS bool "Support of bus domains controllers" depends on OF +config STM32_ETZPC + bool "STM32 ETZPC Domain Controller" + depends on DOMAINS_CONTROLLERS && MACH_STM32MP157 + help + Select y to enable STM32 Extended TrustZone Protection + Controller (ETZPC) + endmenu diff --git a/drivers/bus/domains/Makefile b/drivers/bus/domains/Makefile index 262338b7cad5..8000de6023a5 100644 --- a/drivers/bus/domains/Makefile +++ b/drivers/bus/domains/Makefile @@ -1 +1,2 @@ obj-$(CONFIG_DOMAINS_CONTROLLERS) += domainsctrl.o +obj-$(CONFIG_STM32_ETZPC) += stm32-etzpc.o diff --git a/drivers/bus/domains/stm32-etzpc.c b/drivers/bus/domains/stm32-etzpc.c new file mode 100644 index 000000000000..8a03128a8715 --- /dev/null +++ b/drivers/bus/domains/stm32-etzpc.c @@ -0,0 +1,140 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) STMicroelectronics 2018 - All Rights Reserved + * Author: Benjamin Gaignard for STMicroelectronics. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define ETZPC_DECPROT 0x010 +#define ETZPC_NUM_LOCKS 94 + +struct stm32_etzpc { + struct regmap_field *fields[ETZPC_NUM_LOCKS]; +}; + +static int stm32_etzpc_set_config(struct device *dev, + struct of_phandle_args *out_args) +{ + struct stm32_etzpc *etzpc = dev_get_drvdata(dev); + int index = out_args->args[0]; + unsigned int value = out_args->args[1]; + u32 status; + + if (out_args->args_count != 2) + return -EINVAL; + + if (index >= ETZPC_NUM_LOCKS) + return -EINVAL; + + if (value > STM32_ETZPC_NON_SECURE) + return -EINVAL; + + regmap_field_force_write(etzpc->fields[index], value); + + /* Hardware could denied the new value, read it back to check it */ + regmap_field_read(etzpc->fields[index], &status); + + if (value != status) { + dev_info(dev, "failed to set configuration: index %d, value %d\n", + index, value); + return -EINVAL; + } + + return 0; +} + +static struct domains_ctrl_ops stm32_etzpc_ops = { + .set_config = stm32_etzpc_set_config, +}; + +static const struct regmap_config stm32_etzpc_regmap_cfg = { + .reg_bits = 32, + .val_bits = 32, + .reg_stride = sizeof(u32), + .max_register = 0x3FF, + .fast_io = true, +}; + +static int stm32_etzpc_probe(struct platform_device *pdev) +{ + struct stm32_etzpc *etzpc; + struct resource *res; + void __iomem *mmio; + struct regmap *regmap; + int i; + + etzpc = devm_kzalloc(&pdev->dev, sizeof(*etzpc), GFP_KERNEL); + if (!etzpc) + return -ENOMEM; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + mmio = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(mmio)) + return PTR_ERR(mmio); + + regmap = devm_regmap_init_mmio(&pdev->dev, mmio, + &stm32_etzpc_regmap_cfg); + + for (i = 0; i < ETZPC_NUM_LOCKS; i++) { + struct reg_field field; + + /* + * Each hardware block status is defined by + * a 2 bits field and all of them are packed into + * 32 bits registers. Do some computation to get + * register offset and the shift. + */ + field.reg = ETZPC_DECPROT + (i >> 4) * sizeof(u32); + field.lsb = (i % 0x10) << 1; + field.msb = field.lsb + 1; + + etzpc->fields[i] = devm_regmap_field_alloc(&pdev->dev, + regmap, field); + } + + platform_set_drvdata(pdev, etzpc); + + return domainsctrl_register(&pdev->dev, &stm32_etzpc_ops); +} + +static int stm32_etzpc_remove(struct platform_device *pdev) +{ + domainsctrl_unregister(&pdev->dev); + + return 0; +} + +static const struct of_device_id stm32_etzpc_of_match[] = { + { .compatible = "st,stm32-etzpc" }, + { /* end node */ } +}; +MODULE_DEVICE_TABLE(of, stm32_etzpc_of_match); + +static struct platform_driver stm32_etzpc_driver = { + .probe = stm32_etzpc_probe, + .remove = stm32_etzpc_remove, + .driver = { + .name = "stm32-etzpc", + .of_match_table = stm32_etzpc_of_match, + }, +}; + +static int __init stm32_etzpc_init(void) +{ + return platform_driver_register(&stm32_etzpc_driver); +} +arch_initcall(stm32_etzpc_init); + +MODULE_AUTHOR("Benjamin Gaignard "); +MODULE_DESCRIPTION("STMicroelectronics STM32 Bus Dommains Controller"); diff --git a/include/dt-bindings/bus/domains/stm32-etzpc.h b/include/dt-bindings/bus/domains/stm32-etzpc.h new file mode 100644 index 000000000000..93190fa29a9c --- /dev/null +++ b/include/dt-bindings/bus/domains/stm32-etzpc.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) STMicroelectronics 2018 - All Rights Reserved + * Author: Benjamin Gaignard for STMicroelectronics. + */ + +#ifndef _STM32_ETZPC_H_ +#define _STM32_ETZPC_H_ + +/* ETZPC domains: secure, non-secure or coprocessor*/ +#define STM32_ETZPC_SECURE 1 +#define STM32_ETPCZ_COPRO 2 +#define STM32_ETZPC_NON_SECURE 3 + +/* ETZPC hard blaokcs index */ +#define STM32_ETZPC_USART1 3 +#define STM32_ETZPC_SPI6 4 +#define STM32_ETZPC_I2C4 5 +#define STM32_ETZPC_RNG1 7 +#define STM32_ETZPC_HASH1 8 +#define STM32_ETZPC_CRYP1 9 +#define STM32_ETZPC_I2C6 12 +#define STM32_ETZPC_CEC 38 + +#endif /* _STM32_ETZPC_H_ */ From patchwork Mon Mar 18 10:06:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10857347 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 CF9BE922 for ; Mon, 18 Mar 2019 10:31:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC2152933D for ; Mon, 18 Mar 2019 10:31:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E7DF2933F; Mon, 18 Mar 2019 10:31: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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 543EB2933D for ; Mon, 18 Mar 2019 10:31:15 +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=fEfPG0z0I25aM4MSn66f1bxjnYFzR9L0HN3ucIm5oKE=; b=hZ9Cyg5Kw36tDd Zc8joJqcuwYy/Bz+hgUCorUJ7w3Svnb3A8mv6ZF/w89OoM8gEsFkh5Y+TFH76onvuX7lg4x+NqLaG 3qOU+RVTL4i8SplTrTYcIPWHKuK7B8fwlo0oGYBCbiIHR8tDPsPrQ/1HvkzxNgEIhYElPNW2yCgQ/ rmQ4CTeGKB76LHBYITyX4xPpRjVsFTYfSaV+e/aAruwOGWXjfYowrmCyTGI6ZC6b6nrEx4ry0Ih9M 4bp4OsFUUotvII8l9Uok9rcBMMclX7vn70O1V6mX4i0AW8WcNo/qbO43bVehLeNlB0pSA4gaFU5KR RzF6vRgjyazH0eyr7/Rg==; 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 1h5pY1-0003Bg-HY; Mon, 18 Mar 2019 10:31:13 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5pXn-0002vV-NJ for linux-arm-kernel@bombadil.infradead.org; Mon, 18 Mar 2019 10:30:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=rjnFdUsxLSM6PU/5evbERHqE0unt6UeWNj1M+DnLAy4=; b=QfI5bX8gUSGkD3YnppUzPZwpC blnBMWW9O0XttFyD/YnrND+wbtyR3FVG+VOrF2CyWg4vgdoLvfO8s1e1iE9wKBidXRNB/qDakYhjI aJuln7N+soQiqCgWamkHnXJgZ2K17fY07+mOZMhhtxWYzvldlDzEBHd1H/DkrSz39nwuvFfrTY/Mx 794Z4ftP3DvyHWHT9we9eni+xRsprGn+6dyHNTlCsaZNDYi0ztD9mGWAfGrVn59tm4jG4xnYLeAuZ Ypc0v396AwsnkPDd3O4TH3Kk4/E2t2ZlA9urlN4CMj2cfE6hH+j7OpFadye5CsQS8APb7zGMaYVL7 wXrzbtn1A==; Received: from mx07-00178001.pphosted.com ([62.209.51.94]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5pAH-0008Kp-VB for linux-arm-kernel@lists.infradead.org; Mon, 18 Mar 2019 10:06:43 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2IA10ck025009; Mon, 18 Mar 2019 11:06:32 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2r8qsxb4xk-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 18 Mar 2019 11:06:32 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EE33031; Mon, 18 Mar 2019 10:06:30 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C69942AAA; Mon, 18 Mar 2019 10:06:30 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by SAFEX1HUBCAS21.st.com (10.75.90.44) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 18 Mar 2019 11:06:30 +0100 Received: from localhost (10.201.20.122) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.435.0; Mon, 18 Mar 2019 11:06:30 +0100 From: Benjamin Gaignard To: , , , , , Subject: [RESEND PATCH 6/7] ARM: dts: stm32: Add domainsctrl node for stm32mp157 SoC Date: Mon, 18 Mar 2019 11:06:04 +0100 Message-ID: <20190318100605.29120-7-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190318100605.29120-1-benjamin.gaignard@st.com> References: <20190318100605.29120-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.20.122] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-18_07:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190318_060642_252803_5F565AE0 X-CRM114-Status: GOOD ( 10.17 ) 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: benjamin.gaignard@linaro.org, loic.pallardy@st.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, Benjamin Gaignard 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 Declare ETZPC device as a domains controller node for stm32mp157 SoC Signed-off-by: Benjamin Gaignard --- arch/arm/boot/dts/stm32mp157c.dtsi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/boot/dts/stm32mp157c.dtsi b/arch/arm/boot/dts/stm32mp157c.dtsi index f8bbfff5950b..7b68e18ed2c8 100644 --- a/arch/arm/boot/dts/stm32mp157c.dtsi +++ b/arch/arm/boot/dts/stm32mp157c.dtsi @@ -1199,6 +1199,13 @@ status = "disabled"; }; + etzpc: etzpc@5c007000 { + compatible = "st,stm32-etzpc"; + reg = <0x5c007000 0x400>; + #domainctrl-cells = <2>; + status = "okay"; + }; + i2c6: i2c@5c009000 { compatible = "st,stm32f7-i2c"; reg = <0x5c009000 0x400>; From patchwork Mon Mar 18 10:06:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10857345 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 28734139A for ; Mon, 18 Mar 2019 10:31:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ECD552933D for ; Mon, 18 Mar 2019 10:31:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC7D42933F; Mon, 18 Mar 2019 10:31:03 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 A20F32933D for ; Mon, 18 Mar 2019 10:31:02 +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=qBb0EgwNwRQTPPVVsdvO1567dwXrdqBVBiLpNCqcLpU=; b=Y+7bxpsR9iomyk E+iGqEmkIK6ogA5My8tNfAeJnP2+nA14buDkZfiuUZJ63VURohQh9KSh0xDbkVTaS5yhJPPC7XW8b PsW4puZO7Dmx7jpSmDMd88TP6RcDDgDQhINkOIv8RsH8+SsYWYmrqA9XTbQUrZDpee2fqYrJ9ocgh r7LZEauZbXCQkZ2Qn1GMu2TY5WYmy/EwjLCJ2rZgFCvtLFIPJKS9yolEbBVNcaNPXTog32TJo7nII lNukxMfqVf7xvyFmhI9OpOt566LrkFBxA/Z72w/2K4fN0E7ul9dCwkEaIT8PknYZTHE7En6EU0kwf Zsm6xkjhbz5QK/vi8u2A==; 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 1h5pXo-0002wR-96; Mon, 18 Mar 2019 10:31:00 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5pXm-0002vV-7l for linux-arm-kernel@bombadil.infradead.org; Mon, 18 Mar 2019 10:30:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=pPn7OBAd5IR44Jbjhi5xMpahaqhl2YrMWYxnnHkavm0=; b=k94fSmhPznqh290qt0R975Szh bwSYzkf/zpPoKIQ6w71Rhdnn2scPmauPzdS5vnhlkJ9MTpMhM3/2nAstnkTu7NxGD3Gmxo4Jc9/pW URShapihQ1ZzVKX1oQqMtMbSA/JjjgpndKxh7BqZ2CNEzTGva5iM9aPPeXZ534K9tE8R7ed2sMx/r 8v4KQuQ5lXNElVsIx7UEstQJbHnRpL4Lr8y3ONqoSPw6xL8lofpUwCSqTWVUEnmruYb+kS/Hauvvi yBouQja8HzdmNvHVLFDk2JU2jOf3BbvGwTEulV0jRk/Dp2xHA2O/8Jsb9ol73XXKpUtfCiSPmuyv3 4pNUgBD2w==; Received: from mx07-00178001.pphosted.com ([62.209.51.94]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5pAJ-0008Kq-99 for linux-arm-kernel@lists.infradead.org; Mon, 18 Mar 2019 10:06:44 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2IA1LYG012169; Mon, 18 Mar 2019 11:06:32 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2r8qg4b79p-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 18 Mar 2019 11:06:32 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1F82A34; Mon, 18 Mar 2019 10:06:32 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EDBF92AAA; Mon, 18 Mar 2019 10:06:31 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.435.0; Mon, 18 Mar 2019 11:06:32 +0100 Received: from localhost (10.201.20.122) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.435.0; Mon, 18 Mar 2019 11:06:31 +0100 From: Benjamin Gaignard To: , , , , , Subject: [RESEND PATCH 7/7] ARM: dts: stm32: enable domains controller node on stm32mp157c-ed1 Date: Mon, 18 Mar 2019 11:06:05 +0100 Message-ID: <20190318100605.29120-8-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190318100605.29120-1-benjamin.gaignard@st.com> References: <20190318100605.29120-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.20.122] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-18_07:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190318_060643_774166_37248F0D X-CRM114-Status: GOOD ( 10.44 ) 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: benjamin.gaignard@linaro.org, loic.pallardy@st.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, Benjamin Gaignard 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 Enable ETZPC and set configuration for CEC node Signed-off-by: Benjamin Gaignard --- arch/arm/boot/dts/stm32mp157c-ev1.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/stm32mp157c-ev1.dts b/arch/arm/boot/dts/stm32mp157c-ev1.dts index b6aca40b9b90..a69c171e6b69 100644 --- a/arch/arm/boot/dts/stm32mp157c-ev1.dts +++ b/arch/arm/boot/dts/stm32mp157c-ev1.dts @@ -6,6 +6,7 @@ /dts-v1/; #include "stm32mp157c-ed1.dts" +#include #include / { @@ -32,6 +33,7 @@ &cec { pinctrl-names = "default"; pinctrl-0 = <&cec_pins_a>; + domainctrl-0 = <&etzpc STM32_ETZPC_CEC STM32_ETZPC_NON_SECURE>; status = "okay"; };