From patchwork Mon Jan 28 14:23:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10783761 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 1E60391E for ; Mon, 28 Jan 2019 14:23:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C4582ADFD for ; Mon, 28 Jan 2019 14:23:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0002D2AE7B; Mon, 28 Jan 2019 14:23:46 +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 456412ADFD for ; Mon, 28 Jan 2019 14:23:46 +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=6UIoJqeiRcaM5nxGeeyhteOBcVbuhxVXWKWsr0u+vwI=; b=g3mGcR2pdn1ybj If1zPiYxzQPHB+9WY0N01mp1WTzmj1ofHYKbTreO2wwbXqfkjWakHhB0z4VdKMXxOHukpkXbsRiTf 6wmv+MMFFwOoXf7jMhxGpc3r47bdAwP2x5sYBiOmVxYpJLQjvlLWeYss6cF7d6GmwT/vBig42NR0b aj737YID6/Pb4CkgzCtAjcsO33riuQrzJB4QIMpWkv8cH0RnrcVzM+ABpEFCn7EEae7zyapJCUTBP eLtNQJz/1RpMPcPlf0cVdhjJ7AAE+HfCqJLGfP9mcpw2BvOmqPJlcnO26jILH7k8MDiN90kJyJIHS Z5X0K5jr0Pt6S5Y8ZU7A==; 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 1go7p9-0004wU-37; Mon, 28 Jan 2019 14:23:43 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1go7p4-0004tu-Cz for linux-arm-kernel@lists.infradead.org; Mon, 28 Jan 2019 14:23:40 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0SELTnn011304; Mon, 28 Jan 2019 15:23:31 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2q8famd3m7-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 28 Jan 2019 15:23: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 5BF9841; Mon, 28 Jan 2019 14:23: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 33BAA2D37; Mon, 28 Jan 2019 14:23: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, 28 Jan 2019 15:23: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.361.1; Mon, 28 Jan 2019 15:23:28 +0100 From: Benjamin Gaignard To: , , , , , Subject: [RFC v2 1/7] devicetree: bindings: Document domains controller bindings Date: Mon, 28 Jan 2019 15:23:07 +0100 Message-ID: <20190128142313.17036-2-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190128142313.17036-1-benjamin.gaignard@st.com> References: <20190128142313.17036-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-01-28_08:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190128_062338_723408_730A1960 X-CRM114-Status: GOOD ( 13.19 ) 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, 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 --- version 2: - complete rework of bindings description to try to give a better definition of what bus domains could be. .../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..a3fced91842d --- /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 Jan 28 14:23:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10783777 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 3DBB814E1 for ; Mon, 28 Jan 2019 14:25:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CD492AD77 for ; Mon, 28 Jan 2019 14:25:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AEAB2ADEB; Mon, 28 Jan 2019 14:25:01 +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 C316A2AD77 for ; Mon, 28 Jan 2019 14:24:59 +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=LbVuhyKV4xyhQZDHe8VH6TymDartBqZb7i3VTV/TBQU=; b=oBuN/ziDNyrHSt Zx/LQdEnFrLl9ioHmp7OsXJ435kNB4/lGsNylDHg4ISyciTMn0I+MjZm+tc5doZlxbFAPPLz3i8FB W7O6nbmQ4LPH37jV2qAOsyjw4skjG9bbB0v6dklUi87OGioNXArNgwuj3Aum0kPgI3rR6fZiVVtPI uLp3bLE7hiWsFhIqvcMjfgTwV9COgIwxxOR3tKAitDgC3c1qX7m18TRitbhlC7DOcfjBI+WqzzC09 X0+tAt2sRnzfp79dwziEvtQ8g/zDQzaFSMjTXdb+kayFHawLrd5I1CPAMqi7OwIVJhk0LU8RNT5te L/E+ejGmXwqTAbOuj26g==; 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 1go7qL-0005yn-Il; Mon, 28 Jan 2019 14:24:57 +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 1go7p4-0004tv-Gf for linux-arm-kernel@lists.infradead.org; Mon, 28 Jan 2019 14:23:42 +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 x0SEL2Nj020045; Mon, 28 Jan 2019 15:23: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 2q8e71vveh-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 28 Jan 2019 15:23: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 5CA8831; Mon, 28 Jan 2019 14:23:31 +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 36DFD2D38; Mon, 28 Jan 2019 14:23:31 +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, 28 Jan 2019 15:23: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.361.1; Mon, 28 Jan 2019 15:23:30 +0100 From: Benjamin Gaignard To: , , , , , Subject: [RFC v2 2/7] domainsctrl: Introduce domains controller framework Date: Mon, 28 Jan 2019 15:23:08 +0100 Message-ID: <20190128142313.17036-3-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190128142313.17036-1-benjamin.gaignard@st.com> References: <20190128142313.17036-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-01-28_08:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190128_062338_845159_16764BD8 X-CRM114-Status: GOOD ( 23.32 ) 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, 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 --- 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 Jan 28 14:23:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10783767 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 5B61A184E for ; Mon, 28 Jan 2019 14:24:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A5FF2A5D5 for ; Mon, 28 Jan 2019 14:24:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E7502A5FD; Mon, 28 Jan 2019 14:24:10 +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 E2D362A63F for ; Mon, 28 Jan 2019 14:24:09 +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=eDvZnn60bgzIFVdMmd+sft4OdXHMeeOZCG0cQdbf+NY=; b=XFzDAiibghB2Zh QjxIlFp0/NszEE1Cpk3QljulyWL7Kray93hANnAnAM7v76nDY1uPEOa40hemc+uGt+CsZD5OJ2Iwz 9wWZlD1RQpUbtdsrm9J0XJQY4+EMz2B1TgtdJAggIBPj+y11eNHhuJF19Vlb0fw/KaPcJQuyTEblo B4VXdawF+sIIpZeiwoF2SRN9LKSzNtp2LlpByxaLc2oM94ioLo1TeRcvKlls0GEP5MoRJWzA2nMal /bb6ORW4NDkYAU1fQgaAeJAl6JuaPEpuZgm6blkDh4Whv18WEJx3UTgFtHxzAqimj1XuCKqL5wZlR b/V55ofSskuVZSFsNb1Q==; 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 1go7pW-0005MB-CG; Mon, 28 Jan 2019 14:24:06 +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 1go7p5-0004tx-IV for linux-arm-kernel@lists.infradead.org; Mon, 28 Jan 2019 14:23:41 +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 x0SEL00d025914; Mon, 28 Jan 2019 15:23:33 +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 2q8dw2vy0v-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 28 Jan 2019 15:23:33 +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 7F11E31; Mon, 28 Jan 2019 14:23: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 4CC7F2D38; Mon, 28 Jan 2019 14:23:32 +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.361.1; Mon, 28 Jan 2019 15:23:31 +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.361.1; Mon, 28 Jan 2019 15:23:31 +0100 From: Benjamin Gaignard To: , , , , , Subject: [RFC v2 3/7] base: Add calls to domains controller Date: Mon, 28 Jan 2019 15:23:09 +0100 Message-ID: <20190128142313.17036-4-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190128142313.17036-1-benjamin.gaignard@st.com> References: <20190128142313.17036-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-01-28_08:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190128_062339_910217_DA588F36 X-CRM114-Status: GOOD ( 11.19 ) 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, 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 --- drivers/base/dd.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 8ac10af17c00..2880fe893096 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -478,6 +479,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) @@ -548,6 +553,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); @@ -970,6 +977,8 @@ static void __device_release_driver(struct device *dev, struct device *parent) device_links_driver_cleanup(dev); arch_teardown_dma_ops(dev); + domainsctrl_set_config_by_name(dev, "unbind"); + devres_release_all(dev); dev->driver = NULL; dev_set_drvdata(dev, NULL); From patchwork Mon Jan 28 14:23:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10783775 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 A364991E for ; Mon, 28 Jan 2019 14:25:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E6502AD80 for ; Mon, 28 Jan 2019 14:24:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 124982ADEB; Mon, 28 Jan 2019 14:24: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 B37E52AD80 for ; Mon, 28 Jan 2019 14:24: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=Vcg8d2JLnK8lq6pSrNP8ZZS6dH7uiu+cP2UMOITkXeE=; b=Lvqe2jgYXGtUbN rDRun7jJV+fXdRoCyvPPWlhwSrqR1VJWPQaw1ZX+BB5xYSXBM0+1AopI7YdDR/4RhofOeA1B6Z1LH ieIDx+d5DbtivrPvNHy25MH7ETATAuHdiOjMa+55hRWazzFLuBvxBsuFGCS39ePXjkkdqEn+M0fqn QDU/BZqlThPAmGX106Ol7t4VtVsavIXIJm0/LcKyZOnJmccrXPdrjNwSpm7qeUwdmHxObLz+LeTbY UfcJrmmP0yM3L6GOvlVcrLspoEnXPMBymonsBtCd4i9BScpA4PsNDb2ZIbW/CR0qP1JRHhR/Ahyeq yprRMK7RyONmSHbyz4JQ==; 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 1go7q9-0005kq-Gh; Mon, 28 Jan 2019 14:24:45 +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 1go7p6-0004u0-4M for linux-arm-kernel@lists.infradead.org; Mon, 28 Jan 2019 14:23:42 +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 x0SEL2qc020040; Mon, 28 Jan 2019 15:23:34 +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 2q8e71vveq-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 28 Jan 2019 15:23:34 +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 7BEC838; Mon, 28 Jan 2019 14:23:33 +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 529F82D38; Mon, 28 Jan 2019 14:23:33 +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, 28 Jan 2019 15:23:33 +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.361.1; Mon, 28 Jan 2019 15:23:32 +0100 From: Benjamin Gaignard To: , , , , , Subject: [RFC v2 4/7] devicetree: bindings: domainsctrl: Add STM32 ETZPC bindings Date: Mon, 28 Jan 2019 15:23:10 +0100 Message-ID: <20190128142313.17036-5-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190128142313.17036-1-benjamin.gaignard@st.com> References: <20190128142313.17036-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-01-28_08:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190128_062340_657220_72A87AD6 X-CRM114-Status: GOOD ( 10.16 ) 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, 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 Jan 28 14:23:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10783779 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 D28A814E1 for ; Mon, 28 Jan 2019 14:25:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C06D32AD77 for ; Mon, 28 Jan 2019 14:25:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B43772AE8E; Mon, 28 Jan 2019 14:25: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 28FD92AD77 for ; Mon, 28 Jan 2019 14:25: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=yP8ejk0pl8eBd20uEaVrCBQyV5De+OI1I8yaQG+3pm0=; b=bNDNT95+bJh9xI ds7bRhYimD6/YbcPk1N6bJTvF1aOxQsyGSXiTovDP5ZbevSL0IqUsmJfukeHkYuxrbuyewswCHnss NO5VFE3KcPctttVrpiEQ7y2xpNdTSveFnaa2m9saGwoegPT8YfiAjcwl3OAiBbC6zxmF6LR7fYSWL FjPDS7ICWxepCvwvg35M0f3ZM017cBCMAYCHx1DoZQLrF3Uw8awfNaBvHPtbhvdh8udmngXJulAB1 q0RT/uqAw5fSDoqoglbwa3gEJdyqJFV+b2A/6xqRiDe5v5fB4B0O1hyTYEGXuhcbyKIjNhYI+UEC6 49E6MoNBsIHQ/TEAgyeA==; 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 1go7qf-0006s1-1p; Mon, 28 Jan 2019 14:25:17 +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 1go7p6-0004ug-5z for linux-arm-kernel@lists.infradead.org; Mon, 28 Jan 2019 14:23: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 x0SEL2Nk020045; Mon, 28 Jan 2019 15:23:36 +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 2q8e71vvew-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 28 Jan 2019 15:23:36 +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 94DBB34; Mon, 28 Jan 2019 14:23:34 +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 715BA2D38; Mon, 28 Jan 2019 14:23:34 +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, 28 Jan 2019 15:23:33 +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.361.1; Mon, 28 Jan 2019 15:23:33 +0100 From: Benjamin Gaignard To: , , , , , Subject: [RFC v2 5/7] bus: domainsctrl: Add driver for STM32 ETZPC controller Date: Mon, 28 Jan 2019 15:23:11 +0100 Message-ID: <20190128142313.17036-6-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190128142313.17036-1-benjamin.gaignard@st.com> References: <20190128142313.17036-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-01-28_08:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190128_062340_692629_E9877A07 X-CRM114-Status: GOOD ( 18.27 ) 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, 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 Jan 28 14:23:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10783783 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 3AF3114E1 for ; Mon, 28 Jan 2019 14:25:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 280F92AD77 for ; Mon, 28 Jan 2019 14:25:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C06A2AE74; Mon, 28 Jan 2019 14:25:55 +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 BD60B2AD77 for ; Mon, 28 Jan 2019 14:25:54 +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=FUd3FvlgKZR+4/q247C//yCIgkPpUvwQa7jOOxJeNwU=; b=R8uYW0byiCb8OR PvhG6abKrhCiSXew8c7rf1tO1llS4yLhb862iub5HorqnbjlhRz1H+6iGAs6vzu4kIpU0rRXvvGZe 3C3hI1WKTPW5K7qFMwAqXxFiO4YMPYMlVPLIiqh0E8Xdh5+vTAqzKDMkR64JLSLAxRptEVkRiLD7F nqP/iSvS2Qs32v6ziajA9uO+MdGYL4ggYNmOIe9yWovNrfDr02vq6w+PZMmRw1AzT0FE982jHPOg/ 045J0NSlV/s+MHHnSDgib6rhiu2IhJuXAq2E39I4vQGoNr45OEIWHtiR+inHB2d58+QUSebvn5x30 uT4Uvs/ifeqjCN/AY9gA==; 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 1go7rE-00089p-51; Mon, 28 Jan 2019 14:25:52 +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 1go7p6-0004uf-5t for linux-arm-kernel@lists.infradead.org; Mon, 28 Jan 2019 14:23:42 +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 x0SEL2rA020037; Mon, 28 Jan 2019 15:23:36 +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 2q8e71vvex-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 28 Jan 2019 15:23:36 +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 AA20B3A; Mon, 28 Jan 2019 14:23:35 +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 6426C2D3A; Mon, 28 Jan 2019 14:23:35 +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.361.1; Mon, 28 Jan 2019 15:23:35 +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.361.1; Mon, 28 Jan 2019 15:23:34 +0100 From: Benjamin Gaignard To: , , , , , Subject: [RFC v2 6/7] ARM: dts: stm32: Add domainsctrl node for stm32mp157 SoC Date: Mon, 28 Jan 2019 15:23:12 +0100 Message-ID: <20190128142313.17036-7-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190128142313.17036-1-benjamin.gaignard@st.com> References: <20190128142313.17036-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-01-28_08:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190128_062340_647996_BDA0013E X-CRM114-Status: UNSURE ( 9.97 ) 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, 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 8bf1c17f8cef..d15510a78630 100644 --- a/arch/arm/boot/dts/stm32mp157c.dtsi +++ b/arch/arm/boot/dts/stm32mp157c.dtsi @@ -1106,6 +1106,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 Jan 28 14:23:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10783781 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 D6E6F91E for ; Mon, 28 Jan 2019 14:25:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C54E12AD77 for ; Mon, 28 Jan 2019 14:25:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B68082AE74; Mon, 28 Jan 2019 14:25:39 +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 404802AD77 for ; Mon, 28 Jan 2019 14:25:39 +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=u63iW3WL8oYFBbA+/yFhjHBjKATAKnx/2+KImsAE1iw=; b=mYfQSaeDl1AT/o uPR3aTTKbkHN0OuJUsmvsEWy4CcXm6ryn7IDe/fvRaQ0x01vd/L9fCOnYKR/Edun0l0Wc/37FN/hj 4CJB9XS/27ri8mMeU9hI4CgDTF8hIJIN9tJwOtUX7WswsjtfftCN15KLaEIweCGM+JdTAI1ql4eW7 X+9lkm/1YW8Cl0eb2el0f6j6T1oqg+CaBQ2mrvt1goD3ze5pd9SN/zIJzDurT4Oy9CJsQiFvJ+S6N glcdGXCKfyIMxYNNGH5P/hWgo4KSjF9+cAfYsSX79NTATi723C9naqC++ooBclEj7A2RxVCkw+Jbs tpB4N2yUMji+H+F1vVLg==; 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 1go7qw-0007pw-Mr; Mon, 28 Jan 2019 14:25:34 +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 1go7p8-0004vw-3u for linux-arm-kernel@lists.infradead.org; Mon, 28 Jan 2019 14:23: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 x0SEL0Oj025910; Mon, 28 Jan 2019 15:23:37 +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 2q8dw2vy1c-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 28 Jan 2019 15:23:37 +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 AB60534; Mon, 28 Jan 2019 14:23:36 +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 88ADD2D38; Mon, 28 Jan 2019 14:23:36 +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, 28 Jan 2019 15:23:36 +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.361.1; Mon, 28 Jan 2019 15:23:35 +0100 From: Benjamin Gaignard To: , , , , , Subject: [RFC v2 7/7] ARM: dts: stm32: enable domains controller node on stm32mp157c-ed1 Date: Mon, 28 Jan 2019 15:23:13 +0100 Message-ID: <20190128142313.17036-8-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190128142313.17036-1-benjamin.gaignard@st.com> References: <20190128142313.17036-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-01-28_08:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190128_062342_607058_95CA024F X-CRM114-Status: GOOD ( 10.61 ) 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, 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 063ee8ac5dcb..29142ca3d685 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"; };