From patchwork Mon Jan 28 14:23:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10783763 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 EE36714E1 for ; Mon, 28 Jan 2019 14:23:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D984B2A5D5 for ; Mon, 28 Jan 2019 14:23:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7C1B2A602; Mon, 28 Jan 2019 14:23:56 +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 6589C2A5D5 for ; Mon, 28 Jan 2019 14:23:56 +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: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:In-Reply-To:References: List-Owner; bh=XwW0bLHdykUA/a481WYtb80z4Ea7xzIwJc4eUFpprKk=; b=QxLYnza715in8x 6hUUZaxc6t0wJLeM39cCrqQBVVJWofoWQaX/K6Hyxy7SZj79AH4T+8hsT/xikR/dTUzmZq3/LYQr6 zV8ZfQvmRWE59d/2CkoMD+eOMc/T0gLOlX3dhAv8fQPd602mEgW6JHpizMnh0g2Ldsef2qn+Q1i04 dYdlo6E+SLmmBI57N9nhwRuO8lJivZuMkSd1y5fToNFCgStfuCGaZ7Y0DP/qLFLz2KTMZEztVDDhl OSPbq8XJLHtRb6yvC4CCpa8GwgIWkeYEJogQUqFgr70NBnk/WbZ2AOjavwo0cMHlSAYULhIWHX4Yw TmEayB79Mth4jTvT9BDw==; 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 1go7pI-00055G-33; Mon, 28 Jan 2019 14:23:52 +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-0004tt-E4 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 x0SELTeH011305; Mon, 28 Jan 2019 15:23:30 +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 2q8famd3m4-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 28 Jan 2019 15:23: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 680E538; Mon, 28 Jan 2019 14:23:29 +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 E1EF82D3A; Mon, 28 Jan 2019 14:23:28 +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: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.361.1; Mon, 28 Jan 2019 15:23:27 +0100 From: Benjamin Gaignard To: , , , , , Subject: [RFC v2 0/7] Introduce bus domains controller framework Date: Mon, 28 Jan 2019 15:23:06 +0100 Message-ID: <20190128142313.17036-1-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 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_751185_9814B533 X-CRM114-Status: GOOD ( 10.72 ) 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 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. Framework architecture is inspirated by pinctrl framework: - a default configuration could be applied before bind the driver - configurations could be apllied dynamically by drivers - device node provides the bus domains configurations An example of bus domains controller is STM32 ETZPC hardware block which 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. Up to 94 hardware blocks of the soc could be managed by ETZPC and assigned to one of the three domains. At least two other hardware blocks can take benefits of this: - ARM TZC-400: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0504c/index.html which is able to manage up to 8 regions in address space. - IMX Ressource Domain Controller (RDC): supports four domains and up to eight regions It is an RFC, comments are welcome to help to create this framework, thanks. Benjamin Benjamin Gaignard (7): devicetree: bindings: Document domains controller bindings domainsctrl: Introduce domains controller framework base: Add calls to domains controller devicetree: bindings: domainsctrl: Add STM32 ETZPC bindings bus: domainsctrl: Add driver for STM32 ETZPC controller ARM: dts: stm32: Add domainsctrl node for stm32mp157 SoC ARM: dts: stm32: enable domains controller node on stm32mp157c-ed1 .../bindings/bus/domains/domainsctrl.txt | 55 +++++ .../bindings/bus/domains/st,stm32-etzpc.txt | 14 ++ arch/arm/boot/dts/stm32mp157c-ev1.dts | 2 + arch/arm/boot/dts/stm32mp157c.dtsi | 7 + drivers/base/dd.c | 9 + drivers/bus/Kconfig | 2 + drivers/bus/Makefile | 2 + drivers/bus/domains/Kconfig | 14 ++ drivers/bus/domains/Makefile | 2 + drivers/bus/domains/domainsctrl.c | 234 +++++++++++++++++++++ drivers/bus/domains/stm32-etzpc.c | 140 ++++++++++++ include/dt-bindings/bus/domains/stm32-etzpc.h | 25 +++ include/linux/domainsctrl.h | 70 ++++++ 13 files changed, 576 insertions(+) create mode 100644 Documentation/devicetree/bindings/bus/domains/domainsctrl.txt create mode 100644 Documentation/devicetree/bindings/bus/domains/st,stm32-etzpc.txt 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 drivers/bus/domains/stm32-etzpc.c create mode 100644 include/dt-bindings/bus/domains/stm32-etzpc.h create mode 100644 include/linux/domainsctrl.h